Skip to content

Commit

Permalink
fix duplicate id
Browse files Browse the repository at this point in the history
  • Loading branch information
kritzl committed Jul 16, 2024
1 parent bbeb13d commit 253822a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/vinywaji/gui/templates/components/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
</button>
{% endmacro %}

{% macro input label name value="" type="text" step="1" min="" placeholder="" required=False class="" %}
{% macro input label name id=False value="" type="text" step="1" min="" placeholder="" required=False class="" %}
<div class="relative {{ class }}">
<input type="{{ type }}" id="input_{{ name }}"
<input type="{{ type }}" id="input_{% if id %}{{ id }}{% else %}{{ name }}{% endif %}"
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-gray-900 bg-transparent rounded-lg
border-1 border-gray-300 appearance-none dark:text-white dark:border-gray-600
dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"
Expand All @@ -39,7 +39,7 @@
placeholder="{% if placeholder %}{{ placeholder }}{% else %} {% endif %}"
name="{{ name }}"
value="{{ value }}"/>
<label for="input_{{ name }}"
<label for="input_{% if id %}{{ id }}{% else %}{{ name }}{% endif %}"
class="absolute text-sm text-gray-500 dark:text-gray-400 transition-floating duration-300 transform
-translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white dark:bg-gray-900
px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-focus:dark:text-blue-500
Expand Down
2 changes: 1 addition & 1 deletion src/vinywaji/gui/templates/components/forms/pay-up.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
action="{% url 'transaction-list' %}?currency=euro&type=deposit" method="post">
{% csrf_token %}
<div class="grid grid-cols-1 sm:grid-cols-3 justify-stretch gap-2">
{% usemacro input "Deposit Value (€)" "amount" type="number" required=True step="0.1" min="0.1" class="sm:col-span-2" %}
{% usemacro input "Deposit Value (€)" "amount" id="amount_deposit" type="number" required=True step="0.1" min="0.1" class="sm:col-span-2" %}

{% usemacro button "Deposit" icon="deposit" color="lime" darkColor="green" %}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
action="{% url 'transaction-list' %}?currency=euro&type=purchase" method="post">
{% csrf_token %}
<div class="grid grid-cols-2 sm:grid-cols-3 justify-stretch gap-2">
{% usemacro input "Purchase Value (€)" "amount" value="1.5" type="number" required=True step="0.1" %}
{% usemacro input "Purchase Value (€)" "amount" id="amount_purchase" value="1.5" type="number" required=True step="0.1" %}

{% usemacro input "Description" "description" type="text" placeholder="fritz-kola" %}

Expand Down

0 comments on commit 253822a

Please sign in to comment.