Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: huddlej/pnwmoths
...
head fork: huddlej/pnwmoths
  • 7 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
View
12 django/pnwmoths/species/models.py
@@ -149,6 +149,16 @@ def __unicode__(self):
def name(self):
return unicode(self)
+ def get_ordered_images(self):
+ """
+ Returns a set of images order alphabetically,
+ ignoring spaces, underscores, and numbers.
+ These characters are added by the django admin and mess up the ordering
+ on factsheets.
+ """
+ qs = list(self.speciesimage_set.all())
+ return sorted(qs, key=lambda s: re.sub(r'[_ -0123456789]', '', s.image.name))
+
def get_first_plate(self):
"""
Returns the first imageplate's PK
@@ -162,8 +172,6 @@ def get_first_image(self):
"""
Return the first image of this species' images if one exists and None
otherwise.
-
- TODO: turn this into a m2m manager method for SpeciesImage
"""
try:
return self.speciesimage_set.all()[:1].get()
View
2  django/pnwmoths/species/templates/zoomify_plate.html
@@ -95,7 +95,7 @@
</div>
<script type="text/javascript">
fixHeight();
- Z.showImage("myContainer", "/{{ z_path }}", "zToolbarVisible=1&zFullPageVisible=0&zNavigatorVisible=0&zKeys=0&zSkinPath=/media/zoomify/Skins/Default");
+ Z.showImage("myContainer", "/{{ z_path }}", "zToolbarVisible=1&zFullPageVisible=0&zNavigatorVisible=1&zKeys=0&zSkinPath=/media/zoomify/Skins/Default");
</script>
{% else %}
<img src="{{ plate.image.url }}" width="100%" />
View
2  django/pnwmoths/templates/cms/factsheet.html
@@ -94,7 +94,7 @@ <h2 style="display: inline" class="fs_title"><em>{{ species.name }}</em> {% if s
<div id="fs_images">
<div class="all-images all-images-no-js">
<div id="images">
- {% for species_image in species.speciesimage_set.all %}
+ {% for species_image in species.get_ordered_images %}
{% if forloop.first %}
<div class="current-image">
{% thumbnail species_image.image species_image.SIZES.medium as im %}
View
4 django/pnwmoths/templates/cms/glossary.html
@@ -11,8 +11,8 @@
<div id="glossary">
<dl>
{% for word in glossary %}
- <dt><a name="{{word.pk}}"></a>{{ word.word }}</dt>
- <dd>{{ word.definition }}</dd>
+ <dt><a name="{{word.pk}}"></a>{{ word.word }} &#151;</dt>
+ <dd>&nbsp;{{ word.definition }}</dd>
{% endfor %}
</dl>
</div>
View
1  django/pnwmoths/templates/cms/home.html
@@ -47,6 +47,7 @@
</div>
<div class="col_6">
{% placeholder "home_content" %}
+ {% placeholder "home_announcement" %}
</div>
<div class="col_6 last">
<div id="stats_map">
View
1  django/pnwmoths/templates/cms/plateimages.html
@@ -28,6 +28,7 @@
{% load_plateimages as plates %}
<div class="col_12 last">
<div id="content">
+ {% placeholder "plate_copyright" %}
<ul id="plate_images">
{% for plate in plates %}
<li id="plate{{plate.pk}}">
View
3  django/pnwmoths/templates/cms/stub.html
@@ -1,4 +1,7 @@
{% extends "cms/base.html" %}
+{% block breadcrumbs %}
+&nbsp;
+{% endblock %}
{% block stylesheets %}
{{ block.super }}
<link rel="stylesheet" href="{{ MEDIA_URL }}css_pages/stub.css" type="text/css" media="screen" />
View
2  django/pnwmoths/urls.py
@@ -5,6 +5,7 @@
patterns,
url
)
+from django.http import HttpResponseRedirect
from django.contrib import admin
from species.views import import_species_records, photographic_plate_zoomify
@@ -23,6 +24,7 @@
(r'^admin/lookups/', include(ajax_select_urls)),
(r'^admin/', include(admin.site.urls)),
url(r'^search/', FancyRedirectSearchView(), name="search"),
+ (r'^identify/lucid_player/help/default.htm$', lambda x: HttpResponseRedirect('/explore-data/about-key/')),
(r'^photographic-plates/(?P<plate_pk>\d+)/$', 'species.views.photographic_plate_zoomify'),
(r'^admin_sentry/', include('admin_sentry.urls')),
url(r'^', include('cms.urls')),
View
7 www/media/css_pages/stub.css
@@ -29,3 +29,10 @@
margin-left: 2em;
text-indent: -2em;
}
+
+dt {
+ float: left;
+}
+dd {
+ margin-left: 2em;
+}

No commit comments for this range

Something went wrong with that request. Please try again.