1
0

timesheet_entry_projects.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {% load crispy_forms_tags %}
  2. <form action="{% url 'timesheet' year=current_month.year month=current_month.month %}" method="post">
  3. <div class="row">
  4. <div class="col-sm-12 col-md-4">
  5. <label class="form-label" for="day_of_month">Day of month*</label>
  6. <select id="day_of_month" name="day_of_month" class="form-control form-control-lg {% if form.day_of_month.errors %}is-invalid{% endif %}">
  7. <option value="Blank">---</option>
  8. {% for day in days_of_month %}
  9. {% if selected_day == day.day %}
  10. <option value="{{ day.day }}" selected>{{ day.label }}</option>
  11. {% else %}
  12. <option value="{{ day.day }}">{{ day.label }}</option>
  13. {% endif %}
  14. {% endfor %}
  15. </select>
  16. {% if form.day_of_month.errors %}
  17. {% for error in form.day_of_month.errors %}
  18. <p class="invalid-feedback"><strong>{{ error }}</strong></p>
  19. {% endfor %}
  20. {% endif %}
  21. </div>
  22. <div class="col-sm-12 col-md-4">
  23. {{ form.hours | as_crispy_field }}
  24. </div>
  25. <div class="col-sm-12 col-md-4">
  26. {{ form.minutes | as_crispy_field }}
  27. </div>
  28. <div class="col-sm-12 col-md-6">
  29. {{ form.project | as_crispy_field }}
  30. </div>
  31. <div class="col-sm-12 col-md-6">
  32. <label class="form-label">&nbsp;</label>
  33. <input type="submit" value="Submit" class="form-control form-control-lg btn btn-lg btn-dark">
  34. </div>
  35. {% csrf_token %}
  36. </div>
  37. </form>