No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin_edit.html 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!--
  2. This file is part of Lodel 2 (https://github.com/OpenEdition)
  3. Copyright (C) 2015-2017 Cléo UMS-3287
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Affero General Public License as published
  6. by the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. -->
  15. {% extends "base_backend.html" %}
  16. {% import "admin/editable_component.html" as edit %}
  17. {% set uidfield = target.uid_fieldname()[0] %}
  18. {% set objects = target.get(('%s = %s') % (uidfield, lodel_id)) %}
  19. {% set obj = objects.pop() %}
  20. {% block title %}Edit Object{% endblock %}
  21. {% block body %}
  22. <ol class="breadcrumb">
  23. <li><a href="/{{ root_url }}/admin">Home</a></li>
  24. <li><a href="/{{ root_url }}/admin/classes_admin">Edition</a></li>
  25. <li><a href="/{{ root_url }}/admin/class_admin?classname={{ target.__name__ }}">{{ target.__name__ }}</a></li>
  26. <li class="active">Edit</li>
  27. </ol>
  28. {% if msg is not none %}
  29. {% block msg %} <p style="color:red; font-size:20pt; font-weight:bold">{{ msg }}</p> {% endblock %}
  30. {% endif %}
  31. <h1 class="h1_lodel">Lodel 2 - Edit {{ target.__name__ }} with uid {{ lodel_id }} </h1>
  32. <form class="form-horizontal" action="" method ="post">
  33. <input type="hidden" name="uid" value="{{ lodel_id}}" />
  34. <input type="hidden" name="classname" value={{ target.__name__ }} />
  35. {% for fieldname, fieldvalue in obj.fields().items() %}
  36. <div class="form-group">
  37. <div style="padding-bottom:15px;"> {{edit.input(fieldname, fieldvalue, obj.data(fieldname)) }} </div>
  38. </div>
  39. {% endfor %}
  40. <button type="submit" class="btn btn-primary">Save</button>
  41. <a class="btn btn-default" href="classes_admin">Return</a>
  42. </form>
  43. <div>
  44. </div>
  45. {% endblock %}