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.

show_class.html 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.html" %}
  16. {% block title %}Lodel 2 - Class {{ classname }} {% endblock %}
  17. {% block content %}
  18. <ol class="breadcrumb">
  19. <li><a href="/{{ root_url }}/">Home</a></li>
  20. <li><a href="/{{ root_url }}/list_classes">Types</a></li>
  21. <li class="active">{{ classname }}</li>
  22. </ol>
  23. <h1 class="h1_lodel">Type {{ classname }} </h1>
  24. {% set my_class = leapi.name2class(classname) %}
  25. {% if my_class.child_classes()|length >0 %}
  26. <h2> Childs types</h2>
  27. <ul>
  28. {% for child in my_class.child_classes() %}
  29. {% if child.is_abstract() %}
  30. {% set abst = ' - Abstract class ' %}
  31. {% else %}
  32. {% set abst = ' - ' ~ child.get(None)|length %}
  33. {% endif %}
  34. <li><a href="/{{ root_url }}/show_class?classname={{ child.__name__ }}" >{{ child.__name__ }}</a>{{ abst }}</li>
  35. {% endfor %}
  36. </ul>
  37. {% endif %}
  38. {% if not my_class.is_abstract() %}
  39. <h2>Instances</h2>
  40. {% set uid_f = my_class.uid_fieldname() %}
  41. {% set objects = my_class.get(None) %}
  42. <ul>
  43. {% for obj in objects %}
  44. <li><a href="/{{ root_url }}/show_object?classname={{ classname }}&lodel_id={{ obj.uid() }}" >{{ obj.uid() }} </a> | <a href="/{{ root_url }}/show_object_detailled?classname={{ classname }}&lodel_id={{ obj.uid() }}" >Detailed view </a></li>
  45. {% endfor %}
  46. </ul>
  47. {% endif %}
  48. {% endblock %}