# HG changeset patch # User ymh # Date 1310487870 -7200 # Node ID e8a32d48da1b5e05c1e29893765ab42633ad46f5 # Parent 798d8a898237df925a68f6262a3a816084aca314 add search page, cf #19 diff -r 798d8a898237 -r e8a32d48da1b web/hdabo/models.py --- a/web/hdabo/models.py Tue Jul 12 14:46:39 2011 +0200 +++ b/web/hdabo/models.py Tue Jul 12 18:24:30 2011 +0200 @@ -278,6 +278,12 @@ return locals() + @models.permalink + def get_absolute_url(self): + return ('display_datasheet', (), { + 'ds_id': self.hda_id + }) + class TaggedSheet(models.Model): datasheet = models.ForeignKey(Datasheet) diff -r 798d8a898237 -r e8a32d48da1b web/hdabo/static/hdabo/css/style.css --- a/web/hdabo/static/hdabo/css/style.css Tue Jul 12 14:46:39 2011 +0200 +++ b/web/hdabo/static/hdabo/css/style.css Tue Jul 12 18:24:30 2011 +0200 @@ -400,4 +400,20 @@ #login_fields_list, #submitcontent-buttons-login { margin: 10px 0px; +} + +#search_results { + margin-left: 10px; +} + +.result_counter { + color: #C6C6C6; +} + +#search_prev_next { + margin-top: 20px; +} + +#page_number { + text-align: right; } \ No newline at end of file diff -r 798d8a898237 -r e8a32d48da1b web/hdabo/templates/hdabo_base.html --- a/web/hdabo/templates/hdabo_base.html Tue Jul 12 14:46:39 2011 +0200 +++ b/web/hdabo/templates/hdabo_base.html Tue Jul 12 18:24:30 2011 +0200 @@ -58,6 +58,7 @@ {% if user.is_authenticated %} {% endif %} diff -r 798d8a898237 -r e8a32d48da1b web/hdabo/templates/search/search.html --- a/web/hdabo/templates/search/search.html Tue Jul 12 14:46:39 2011 +0200 +++ b/web/hdabo/templates/search/search.html Tue Jul 12 18:24:30 2011 +0200 @@ -1,39 +1,50 @@ {% extends 'hdabo_base.html' %} {% block content %} -

Search

- +

Recherche

+ +
- {{ form.as_table }} + + + +
  - +
- +
+
+
{% if query %} -

Results

- +

Résultats

+
Page {{page.number}}/{{paginator.num_pages}}
+ {% for result in page.object_list %} -

- {{ result.object.title }} -

+ + + + + {% empty %} -

No results found.

+ {% endfor %} +
{{forloop.counter0|add:page.start_index}}. + {{ result.object.title }} +
Pas de résultats.
{% if page.has_previous or page.has_next %} -
- {% if page.has_previous %}{% endif %}« Previous{% if page.has_previous %}{% endif %} +
+ {% if page.has_previous %}{% endif %}« Prec.{% if page.has_previous %}{% endif %} | - {% if page.has_next %}{% endif %}Next »{% if page.has_next %}{% endif %} + {% if page.has_next %}{% endif %}Suiv. »{% if page.has_next %}{% endif %}
{% endif %} - {% else %} - {# Show some example queries to run, maybe query syntax, something else? #} {% endif %} - +
+ {% endblock %} \ No newline at end of file