Skip to content
This repository
  • 7 commits
  • 9 files changed
  • 0 comments
  • 1 contributor
12  django/pnwmoths/species/models.py
@@ -149,6 +149,16 @@ def __unicode__(self):
149 149
     def name(self):
150 150
         return unicode(self)
151 151
 
  152
+    def get_ordered_images(self):
  153
+        """
  154
+        Returns a set of images order alphabetically,
  155
+        ignoring spaces, underscores, and numbers.
  156
+        These characters are added by the django admin and mess up the ordering
  157
+        on factsheets.
  158
+        """
  159
+        qs = list(self.speciesimage_set.all())
  160
+        return sorted(qs, key=lambda s: re.sub(r'[_ -0123456789]', '', s.image.name))
  161
+
152 162
     def get_first_plate(self):
153 163
         """
154 164
         Returns the first imageplate's PK
@@ -162,8 +172,6 @@ def get_first_image(self):
162 172
         """
163 173
         Return the first image of this species' images if one exists and None
164 174
         otherwise.
165  
-
166  
-        TODO: turn this into a m2m manager method for SpeciesImage
167 175
         """
168 176
         try:
169 177
             return self.speciesimage_set.all()[:1].get()
2  django/pnwmoths/species/templates/zoomify_plate.html
@@ -95,7 +95,7 @@
95 95
                     </div>
96 96
                     <script type="text/javascript">
97 97
                         fixHeight();
98  
-                        Z.showImage("myContainer", "/{{ z_path }}", "zToolbarVisible=1&zFullPageVisible=0&zNavigatorVisible=0&zKeys=0&zSkinPath=/media/zoomify/Skins/Default"); 
  98
+                        Z.showImage("myContainer", "/{{ z_path }}", "zToolbarVisible=1&zFullPageVisible=0&zNavigatorVisible=1&zKeys=0&zSkinPath=/media/zoomify/Skins/Default"); 
99 99
                     </script>
100 100
               {% else %}
101 101
                   <img src="{{ plate.image.url }}" width="100%" />
2  django/pnwmoths/templates/cms/factsheet.html
@@ -94,7 +94,7 @@ <h2 style="display: inline" class="fs_title"><em>{{ species.name }}</em> {% if s
94 94
     <div id="fs_images">
95 95
         <div class="all-images all-images-no-js">
96 96
             <div id="images">
97  
-                {% for species_image in species.speciesimage_set.all %}
  97
+                {% for species_image in species.get_ordered_images %}
98 98
                     {% if forloop.first %}
99 99
                         <div class="current-image">
100 100
                         {% thumbnail species_image.image species_image.SIZES.medium as im %}
4  django/pnwmoths/templates/cms/glossary.html
@@ -11,8 +11,8 @@
11 11
     <div id="glossary">
12 12
         <dl>
13 13
         {% for word in glossary %}
14  
-            <dt><a name="{{word.pk}}"></a>{{ word.word }}</dt>
15  
-            <dd>{{ word.definition }}</dd>
  14
+            <dt><a name="{{word.pk}}"></a>{{ word.word }}  &#151;</dt>
  15
+            <dd>&nbsp;{{ word.definition }}</dd>
16 16
         {% endfor %}
17 17
         </dl>
18 18
     </div>
1  django/pnwmoths/templates/cms/home.html
@@ -47,6 +47,7 @@
47 47
     </div>
48 48
         <div class="col_6">
49 49
             {% placeholder "home_content" %}
  50
+            {% placeholder "home_announcement" %}
50 51
         </div>
51 52
         <div class="col_6 last">
52 53
             <div id="stats_map">
1  django/pnwmoths/templates/cms/plateimages.html
@@ -28,6 +28,7 @@
28 28
 {% load_plateimages as plates %}
29 29
 <div class="col_12 last">
30 30
 <div id="content">
  31
+    {% placeholder "plate_copyright" %}
31 32
     <ul id="plate_images">
32 33
     {% for plate in plates %}
33 34
         <li id="plate{{plate.pk}}">
3  django/pnwmoths/templates/cms/stub.html
... ...
@@ -1,4 +1,7 @@
1 1
 {% extends "cms/base.html" %}
  2
+{% block breadcrumbs %}
  3
+&nbsp;
  4
+{% endblock %}
2 5
 {% block stylesheets %}
3 6
 	{{ block.super }}
4 7
 	<link rel="stylesheet" href="{{ MEDIA_URL }}css_pages/stub.css" type="text/css" media="screen" />
2  django/pnwmoths/urls.py
@@ -5,6 +5,7 @@
5 5
     patterns,
6 6
     url
7 7
 )
  8
+from django.http import HttpResponseRedirect
8 9
 from django.contrib import admin
9 10
 
10 11
 from species.views import import_species_records, photographic_plate_zoomify
@@ -23,6 +24,7 @@
23 24
     (r'^admin/lookups/', include(ajax_select_urls)),
24 25
     (r'^admin/', include(admin.site.urls)),
25 26
     url(r'^search/', FancyRedirectSearchView(), name="search"),
  27
+    (r'^identify/lucid_player/help/default.htm$', lambda x: HttpResponseRedirect('/explore-data/about-key/')),
26 28
     (r'^photographic-plates/(?P<plate_pk>\d+)/$', 'species.views.photographic_plate_zoomify'),
27 29
     (r'^admin_sentry/', include('admin_sentry.urls')),
28 30
     url(r'^', include('cms.urls')),
7  www/media/css_pages/stub.css
@@ -29,3 +29,10 @@
29 29
     margin-left: 2em;
30 30
     text-indent: -2em;
31 31
 }
  32
+
  33
+dt {
  34
+    float: left;
  35
+}
  36
+dd {
  37
+    margin-left: 2em;
  38
+}

No commit comments for this range

Something went wrong with that request. Please try again.