Browse Source

Allows a pretty display for em_simple

prieto 7 years ago
parent
commit
548df7c36c

+ 1
- 1
lodel/plugins/webui/interface/controllers/listing.py View File

@@ -24,7 +24,7 @@ def list_classes(request):
24 24
 # @param request : the request (get or post)
25 25
 # @note the response is given in a html page called in get_response_function
26 26
 def collections(request):
27
-    return get_response('listing/collections.html', my_classes=dyncode)
27
+    return get_response('listing/collections.html', my_classes=dyncode, get_authors=get_authors)
28 28
 
29 29
 ##@brief Controller's function to list all types (classes) of the editorial model
30 30
 # @param request : the request (get or post)

+ 1
- 0
lodel/plugins/webui/interface/urls.py View File

@@ -19,6 +19,7 @@ urls = (
19 19
     (r'^/list_classes?$', list_classes),
20 20
     (r'^/collections', collections),
21 21
     (r'^/collections?$', collections),
22
+    (r'^/issue?$', issue),
22 23
     (r'^/show_object?$', show_object),
23 24
     (r'^/show_object_detailled?$', show_object_detailled),
24 25
     (r'^/show_class?$', show_class),

+ 5
- 4
lodel/plugins/webui/templates/listing/collections.html View File

@@ -1,7 +1,8 @@
1 1
 {% extends "base.html" %}
2 2
 {% block title %}Lodel 2 - Collections {% endblock %}
3
-{% block content %} 
3
+{% block content %}
4 4
 {% set collections = my_classes.Collection.get(None) %}
5
+{% set issues = my_classes.Issue.get(None) %}
5 6
 
6 7
 <ol class="breadcrumb">
7 8
   <li><a href="/{{ root_url }}/">Home</a></li>
@@ -11,11 +12,10 @@
11 12
     <ul>
12 13
         {% for collection in collections %}
13 14
         <h2>{{ collection.data('title') }}</h2>
14
-        {% set filter = ("%s = %s") % ('collection', collection.uid()) %}
15
-        {% set issues = my_classes.Issue.get((filter)) %}
16 15
         <ul>
17 16
         {% if issues is not none: %}
18 17
             {% for issue in issues %}
18
+              {% if issue.data('collection') == collection.uid(): %}
19 19
                 <li>
20 20
                     <h3><a href="/{{ root_url }}/issue?lodel_id={{ issue.uid() }}"> {{ issue.data('title') }}</a></h3>
21 21
                     <h3>{{ issue.data('subtitle') }}</h3>
@@ -23,9 +23,10 @@
23 23
                     {% set authors = my_classes.Person.get(("%s in (%s)") % ("lodel_id", author_ids|join(','))) %}
24 24
                     <p>Authors : {% for author in authors %} {{ author.data('firstname')}} {{ author.data('lastname')}} ; {% endfor %} </p>
25 25
                 </li>
26
+              {% endif %}
26 27
             {% endfor %}
27 28
         {% endif %}
28 29
         </ul>
29 30
         {% endfor %}
30 31
      <ul>
31
-{% endblock %} 
32
+{% endblock %}

Loading…
Cancel
Save