# HG changeset patch # User cavaliet # Date 1310051898 -7200 # Node ID 35f37b6210df21162b24d644650b6c72894e8860 # Parent a53a1867cec942476e7ecf3592fcb319ccff4291 correction pour créer les url dans template. diff -r a53a1867cec9 -r 35f37b6210df web/hdabo/templates/generic_sheet.html --- a/web/hdabo/templates/generic_sheet.html Thu Jul 07 16:10:14 2011 +0200 +++ b/web/hdabo/templates/generic_sheet.html Thu Jul 07 17:18:18 2011 +0200 @@ -56,14 +56,16 @@ {% block content %} {{block.super}} -

Fiche(s) {% if valid %}validées{% else %}non validées{% endif %} - pour l'organisation {{ orga_name }} : {{nb_sheets}} fiche(s)

+

+ {% if tag %} Fiche(s) concernées par le tag {{ tag.label }} + {% else %} Fiche(s) {% if valid %}validées{% else %}non validées{% endif %} pour l'organisation {{ orga_name }} + {% endif %} : {{nb_sheets}} fiche(s)

-

<<   - <   +

<<   + <   {{displayed_index}}/{{nb_sheets}}   - >   - >>

+ >   + >>

@@ -71,10 +73,10 @@
-

<<   - <   +

<<   + <   {{displayed_index}}/{{nb_sheets}}   - >   - >>

+ >   + >>

{% endblock %} diff -r a53a1867cec9 -r 35f37b6210df web/hdabo/views.py --- a/web/hdabo/views.py Thu Jul 07 16:10:14 2011 +0200 +++ b/web/hdabo/views.py Thu Jul 07 17:18:18 2011 +0200 @@ -71,10 +71,10 @@ else : nb_sheets = None # If there is tag parameter, it means that we display all the ds tagged by one particular tag - param_str = None + tag = None if "tag" in request.GET : - param_str = "?tag=" + request.GET["tag"] - datasheets_qs = Datasheet.objects.filter(tags__in=[Tag.objects.get(id=int(request.GET["tag"]))]).order_by("organisation__name","original_creation_date").select_related("format") + tag = Tag.objects.get(id=int(request.GET["tag"])) + datasheets_qs = Datasheet.objects.filter(tags__in=[tag]).order_by("organisation__name","original_creation_date").select_related("format") # If tag is set and if ds_id is None, it means that we have to display the first ds if not ds_id : index = 0 @@ -109,12 +109,6 @@ else : prev_index = next_index = 0 prev_id = next_id = datasheets_qs[0].hda_id - - if param_str : - param_str += "&" - else : - param_str = "?" - param_str += "nb_sheets=" + str(nb_sheets) # We get the ORDERED tags if we display one sheet (case valid = 0 and 1) ordered_tags = TaggedSheet.objects.filter(datasheet=ds).select_related("tag").order_by('order') @@ -130,8 +124,8 @@ 'zero_id':zero_id, 'prev_index':prev_index, 'prev_id':prev_id, 'next_index':next_index, 'next_id':next_id, 'last_index':last_index, 'last_id':last_id, - 'displayed_index':displayed_index, 'valid':ds.validated, - 'param_str':param_str, 'categories':json.dumps(get_categories())}, + 'displayed_index':displayed_index, 'tag':tag, 'valid':ds.validated, + 'categories':json.dumps(get_categories())}, context_instance=RequestContext(request))