mikhailemv

Untitled

Jun 13th, 2023
776
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.55 KB | None | 0 0
  1. {% extends 'users/profile/operations/operations_base.html' %}
  2.  
  3. {% block content %}
  4.   <h1>Добавление повседневной операции</h1>
  5.  
  6.   <form method="post" id="operation-form">
  7.     {% csrf_token %}
  8.     <input type="hidden"
  9.           name="csrfmiddlewaretoken"
  10.           value="0wxqSeawI7lzNDiKTFLAc5o6dbqWP3auVoXhMeONBPPGTBxXcoHh2CQNCYVT8Bmk">
  11.  
  12.     <p>
  13.       <label for="id_key">Key:</label>
  14.       <select name="key" id="id_key">
  15.           {% for key in keys %}
  16.               {% if key == form.key.value %}
  17.                   <option value="{{ key }}" selected>{{ key }}</option>
  18.               {% else %}
  19.                   <option value="{{ key }}">{{ key }}</option>
  20.               {% endif %}
  21.           {% endfor %}
  22.       </select>
  23.     </p>
  24.  
  25.     <p>
  26.       <label for="id_category">Category:</label>
  27.       <select name="category" class="form-select" required="" id="id_category">
  28.         <option value="" selected>---------</option>
  29.         {% for category in categories %}
  30.           {% if category.id == form.category.value %}
  31.             <option value="{{ category.id }}" selected>{{ category.category_name }}</option>
  32.           {% else %}
  33.             <option value="{{ category.id }}">{{ category.category_name }}</option>
  34.           {% endif %}
  35.         {% endfor %}
  36.       </select>
  37.     </p>
  38.  
  39.     <p>
  40.       <label for="id_account">Account:</label>
  41.       <select name="account"
  42.              class="form-select"
  43.              required=""
  44.              id="id_account">
  45.  
  46.         <option value="" selected>---------</option>
  47.         {% for account in accounts %}
  48.           <option value="{{ account.id }}">{{ account.name }}</option>
  49.         {% endfor %}
  50.  
  51.       </select>
  52.     </p>
  53.  
  54.     <p>
  55.       <label for="id_date">Date:</label>
  56.       <input type="date"
  57.             name="date"
  58.             value="{{ form.date_of_birth.value|date:'Y-m-d' }}"
  59.             class="form-control"
  60.             required=""
  61.             id="id_date">
  62.     </p>
  63.  
  64.     <p>
  65.       <label for="id_amount">Amount:</label>
  66.       <input type="number"
  67.             name="amount"
  68.             class="form-control"
  69.             step="0.01"
  70.             min="0"
  71.             required=""
  72.             id="id_amount">
  73.     </p>
  74.  
  75.     <p>
  76.       <label for="id_comment">Comment:</label>
  77.       <textarea name="comment"
  78.                cols="40"
  79.                rows="3"
  80.                class="form-control"
  81.                id="id_comment">
  82.       </textarea>
  83.     </p>
  84.     <button type="submit">Сохранить</button>
  85.   </form>
  86.  
  87. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment