mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-03 17:29:26 +00:00
Default set rate variable to false and amount variable to true.
This commit is contained in:
parent
31ead537c9
commit
c5508fe9be
2 changed files with 71 additions and 28 deletions
|
@ -248,7 +248,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-0 border-b items-center justify-between -mx-4 mb-6 pb-3 border-gray-400 border-opacity-20">
|
||||
|
||||
{% if debug_mode == true %}
|
||||
<div class="py-0 border-b items-center justify-between -mx-4 mb-6 pb-3 border-gray-400 border-opacity-20">
|
||||
<div class="w-full md:w-10/12">
|
||||
<div class="flex flex-wrap -m-3 w-full sm:w-auto px-4 mb-6 sm:mb-0">
|
||||
<div class="w-full md:w-1/3 p-6">
|
||||
|
@ -256,14 +258,18 @@
|
|||
</div>
|
||||
<div class="w-full md:flex-1 p-3">
|
||||
<div class="flex form-check form-check-inline">
|
||||
<div class="flex items-center h-5"> <input class="hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type="checkbox" id="amt_var" name="amt_var" value="av" {% if data.amt_var==true %} checked="checked" {% endif %}> </div>
|
||||
<div class="flex items-center h-5">
|
||||
<input class="hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type="checkbox" id="amt_var" name="amt_var" value="av">
|
||||
</div>
|
||||
<div class="ml-2 text-sm">
|
||||
<label class="form-check-label text-sm font-medium text-gray-800 dark:text-white" for="inlineCheckbox2">Amount Variable</label>
|
||||
<p id="helper-checkbox-text" class="text-xs font-normal text-gray-500 dark:text-gray-300">Allow bids with a different amount to the offer.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-2 form-check form-check-inline">
|
||||
<div class="flex items-center h-5"> <input class="hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type="checkbox" id="rate_var" name="rate_var" value="rv" {% if data.rate_var==true %} checked="checked" {% endif %}> </div>
|
||||
<div class="flex items-center h-5">
|
||||
<input class="hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type="checkbox" id="rate_var" name="rate_var" value="rv">
|
||||
</div>
|
||||
<div class="ml-2 text-sm">
|
||||
<label class="form-check-label text-sm font-medium text-gray-800 dark:text-white" for="inlineCheckbox3">Rate Variable</label>
|
||||
<p id="helper-checkbox-text" class="text-xs font-normal text-gray-500 dark:text-gray-300">Allow bids with a different rate to the offer.</p>
|
||||
|
@ -272,7 +278,38 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="py-0 border-b items-center justify-between -mx-4 mb-6 pb-3 border-gray-400 border-opacity-20">
|
||||
<div class="w-full md:w-10/12">
|
||||
<div class="flex flex-wrap -m-3 w-full sm:w-auto px-4 mb-6 sm:mb-0">
|
||||
<div class="w-full md:w-1/3 p-6">
|
||||
<p class="text-sm text-coolGray-800 dark:text-white font-semibold">Options</p>
|
||||
</div>
|
||||
<div class="w-full md:flex-1 p-3">
|
||||
<div class="flex form-check form-check-inline">
|
||||
<div class="flex items-center h-5">
|
||||
<input class="cursor-not-allowed hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type="checkbox" id="amt_var" name="amt_var" value="av" checked disabled>
|
||||
</div>
|
||||
<div class="ml-2 text-sm">
|
||||
<label class="form-check-label text-sm font-medium text-gray-800 dark:text-white" for="inlineCheckbox2" style="opacity: 0.40;">Amount Variable</label>
|
||||
<p id="helper-checkbox-text" class="text-xs font-normal text-gray-500 dark:text-gray-300" style="opacity: 0.40;">Allow bids with a different amount to the offer.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-2 form-check form-check-inline">
|
||||
<div class="flex items-center h-5">
|
||||
<input class="cursor-not-allowed hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type="checkbox" id="rate_var" name="rate_var" value="rv" disabled>
|
||||
</div>
|
||||
<div class="ml-2 text-sm">
|
||||
<label class="form-check-label text-sm font-medium text-gray-800 dark:text-white" for="inlineCheckbox3" style="opacity: 0.40;">Rate Variable</label>
|
||||
<p id="helper-checkbox-text" class="text-xs font-normal text-gray-500 dark:text-gray-300" style="opacity: 0.40;">Allow bids with a different rate to the offer.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="pricejsonhidden hidden py-3 border-b items-center justify-between -mx-4 mb-6 pb-3 border-gray-400 border-opacity-20">
|
||||
<div class="w-full md:w-10/12">
|
||||
<div class="flex flex-wrap -m-3 w-full sm:w-auto px-4 mb-6 sm:mb-0">
|
||||
|
|
|
@ -160,10 +160,16 @@ def parseOfferFormData(swap_client, form_data, page_data, options={}):
|
|||
(parsed_data["amt_from"] * parsed_data["rate"]) // ci_from.COIN()
|
||||
)
|
||||
|
||||
if swap_client.debug:
|
||||
page_data["amt_var"] = True if have_data_entry(form_data, "amt_var") else False
|
||||
parsed_data["amt_var"] = page_data["amt_var"]
|
||||
page_data["rate_var"] = True if have_data_entry(form_data, "rate_var") else False
|
||||
parsed_data["rate_var"] = page_data["rate_var"]
|
||||
else:
|
||||
page_data["amt_var"] = True
|
||||
page_data["rate_var"] = False
|
||||
parsed_data["amt_var"] = True
|
||||
parsed_data["rate_var"] = False
|
||||
|
||||
page_data["automation_strat_id"] = int(
|
||||
get_data_entry_or(form_data, "automation_strat_id", -1)
|
||||
|
|
Loading…
Reference in a new issue