mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-03 17:29:26 +00:00
Merge pull request #172 from gerlofvanek/page_offers-5
Default set rate variable to false and amount variable to true.
This commit is contained in:
commit
913cdfa984
2 changed files with 71 additions and 28 deletions
|
@ -248,31 +248,68 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
|
||||||
<div class="w-full md:w-10/12">
|
{% if debug_mode == true %}
|
||||||
<div class="flex flex-wrap -m-3 w-full sm:w-auto px-4 mb-6 sm:mb-0">
|
<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-1/3 p-6">
|
<div class="w-full md:w-10/12">
|
||||||
<p class="text-sm text-coolGray-800 dark:text-white font-semibold">Options</p>
|
<div class="flex flex-wrap -m-3 w-full sm:w-auto px-4 mb-6 sm:mb-0">
|
||||||
</div>
|
<div class="w-full md:w-1/3 p-6">
|
||||||
<div class="w-full md:flex-1 p-3">
|
<p class="text-sm text-coolGray-800 dark:text-white font-semibold">Options</p>
|
||||||
<div class="flex form-check form-check-inline">
|
</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" {% if data.amt_var==true %} checked="checked" {% endif %}> </div>
|
<div class="w-full md:flex-1 p-3">
|
||||||
<div class="ml-2 text-sm">
|
<div class="flex form-check form-check-inline">
|
||||||
<label class="form-check-label text-sm font-medium text-gray-800 dark:text-white" for="inlineCheckbox2">Amount Variable</label>
|
<div class="flex items-center h-5">
|
||||||
<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>
|
<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>
|
|
||||||
<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="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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</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">
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</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="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="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="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()
|
(parsed_data["amt_from"] * parsed_data["rate"]) // ci_from.COIN()
|
||||||
)
|
)
|
||||||
|
|
||||||
page_data["amt_var"] = True if have_data_entry(form_data, "amt_var") else False
|
if swap_client.debug:
|
||||||
parsed_data["amt_var"] = page_data["amt_var"]
|
page_data["amt_var"] = True if have_data_entry(form_data, "amt_var") else False
|
||||||
page_data["rate_var"] = True if have_data_entry(form_data, "rate_var") else False
|
parsed_data["amt_var"] = page_data["amt_var"]
|
||||||
parsed_data["rate_var"] = page_data["rate_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(
|
page_data["automation_strat_id"] = int(
|
||||||
get_data_entry_or(form_data, "automation_strat_id", -1)
|
get_data_entry_or(form_data, "automation_strat_id", -1)
|
||||||
|
|
Loading…
Reference in a new issue