Skip to content
This repository
Browse code

factsheet link to plates, admin sorting options, readable stats, brow…

…se styling
  • Loading branch information...
commit 4389bbfea352e87ef2f297feb0d6b23115513213 1 parent c339a67
Philip Bjorge authored
4  django/pnwmoths/settings_global.py
@@ -115,6 +115,7 @@
115 115
     'django.contrib.sites',
116 116
     'django.contrib.messages',
117 117
     'django.contrib.admin',
  118
+    'django.contrib.humanize',
118 119
     'cms',
119 120
     'cms.plugins.text',
120 121
     'cms.plugins.picture',
@@ -134,6 +135,8 @@
134 135
     'south',
135 136
     'reversion',
136 137
     'ajax_select',
  138
+    'paging',
  139
+    'admin_sentry',
137 140
 )
138 141
 
139 142
 CMS_TEMPLATES = (
@@ -142,6 +145,7 @@
142 145
     ('cms/home.html', gettext('home')),
143 146
     ('cms/browse.html', gettext('browse')),
144 147
     ('cms/factsheet.html', gettext('factsheet')),
  148
+    ('cms/plateimages.html', gettext('imageplates')),
145 149
 )
146 150
 CMS_SHOW_END_DATE = True
147 151
 CMS_SHOW_START_DATE = True
15  django/pnwmoths/species/admin.py
@@ -33,7 +33,7 @@ class AuthorAdmin(VersionAdmin, admin.ModelAdmin):
33 33
 
34 34
 class SpeciesAdmin(VersionAdmin, admin.ModelAdmin):
35 35
     filter_horizontal = ("similar",)
36  
-    list_display = ("__unicode__", "noc_id", "factsheet", "common_name")
  36
+    list_display = ("__unicode__", "noc_id", "factsheet", "authority", "common_name")
37 37
     list_editable = ("common_name",)
38 38
     search_fields = ("genus", "species")
39 39
 admin.site.register(Species, SpeciesAdmin)
@@ -48,10 +48,16 @@ def noc_id(self):
48 48
         return self.species.noc_id
49 49
     noc_id.admin_order_field  = 'species__noc_id'
50 50
 
  51
+    def collection(self):
  52
+        return self.record.collection
  53
+    collection.admin_order_field = 'record__collection'
  54
+
51 55
     list_display = (
52 56
         noc_id,
53 57
         "species",
54 58
         "image",
  59
+        collection,
  60
+        "photographer",
55 61
         "weight"
56 62
     )
57 63
     list_editable = ("weight",)
@@ -71,13 +77,14 @@ def noc_id(self):
71 77
     noc_id.admin_order_field  = 'species__noc_id'
72 78
     
73 79
     def thumb(self):
74  
-        t = self.speciesimage_set.all()
  80
+        t = self.speciesimage_set.all()[:1].get()
75 81
         if t:
76  
-            pk = t[0].pk
77  
-            t = get_thumbnail(t[0].image,"70x46")
  82
+            pk = t.pk
  83
+            t = get_thumbnail(t.image,"70x46")
78 84
             return u'<a href="%s" target="_blank"><img src="%s" /></a>' % (urlresolvers.reverse('admin:species_speciesimage_change', args=(pk,)), t.url)
79 85
         else:
80 86
             return u"None"
  87
+    thumb.admin_order_field = 'speciesimage'
81 88
     thumb.short_description = 'Photo'
82 89
     thumb.allow_tags = True 
83 90
 
31  django/pnwmoths/species/forms.py
@@ -327,19 +327,24 @@ def clean(self):
327 327
                     genus = None
328 328
 
329 329
             if genus and species:
330  
-                species_instance, created = Species.objects.get_or_create(
331  
-                    genus=genus,
332  
-                    species=species
333  
-                )
334  
-                cleaned_data["species"] = species_instance
335  
-
336  
-        # If a Species instance doesn't exist for the given data, alert the
337  
-        # user.
338  
-        if not isinstance(cleaned_data.get("species"), Species):
339  
-            # Delete the species entry from cleaned data if it is defined.
340  
-            if cleaned_data.get("species"):
341  
-                del cleaned_data["species"]
342  
-            raise forms.ValidationError("Species isn't defined.")
  330
+                try:
  331
+                    species_instance = Species.objects.get(
  332
+                        genus=genus,
  333
+                        species=species
  334
+                    )
  335
+                    cleaned_data["species"] = species_instance
  336
+                except Exception:
  337
+                    if cleaned_data.get("genus"):
  338
+                        del self.cleaned_data["genus"]
  339
+                    if cleaned_data.get("species"):
  340
+                        del self.cleaned_data["species"]
  341
+                    raise forms.ValidationError("Species does not exist.")
  342
+            else:
  343
+                if cleaned_data.get("genus"):
  344
+                    del self.cleaned_data["genus"]
  345
+                if cleaned_data.get("species"):
  346
+                    del self.cleaned_data["species"]
  347
+                raise forms.ValidationError("Need a genus and species")
343 348
 
344 349
         if cleaned_data.get("county") is not None:
345 350
             county = cleaned_data.get("county").strip()
18  django/pnwmoths/species/management/commands/remove_wym_inline_styles.py
... ...
@@ -0,0 +1,18 @@
  1
+from django.core.management.base import NoArgsCommand, CommandError
  2
+from cms.plugins.text.models import Text
  3
+from reversion import revision
  4
+import re
  5
+
  6
+class Command(NoArgsCommand):
  7
+
  8
+    @revision.create_on_success
  9
+    def handle_noargs(self, **options):
  10
+        """
  11
+        Removes inline styles from wymeditor text to make it simpler
  12
+        to fix the bug in wym that adds a checkered background to content.
  13
+        """
  14
+        text_objs = Text.objects.all()
  15
+        for obj in text_objs:
  16
+            # Removes inline styles
  17
+            obj.body = re.sub(' style=("|\')(.*?)("|\')', "", obj.body)
  18
+            obj.save()
9  django/pnwmoths/species/templatetags/factsheet_filters.py
... ...
@@ -1,6 +1,6 @@
1 1
 from django import template
2 2
 from pnwmoths.species.models import State, SpeciesRecord
3  
-import json
  3
+import json, re
4 4
 
5 5
 register = template.Library()
6 6
 
@@ -30,6 +30,10 @@ def filters_json(value, arg):
30 30
     """
31 31
         Returns Array with extra values removed based on species
32 32
     """
  33
+    def _human_key(key):
  34
+        parts = re.split('(\d*\.\d+|\d+)', key)
  35
+        return tuple((e.swapcase() if i % 2 == 0 else float(e)) for i, e in enumerate(parts))
  36
+
33 37
     if arg == "county":
34 38
         states = list(State.objects.all().values_list())
35 39
         state_lookup = dict()
@@ -38,4 +42,5 @@ def filters_json(value, arg):
38 42
             state_lookup[s_id] = code
39 43
 
40 44
         return str(sorted([str("%s (%s)" % (item[0], state_lookup.get(item[1], "CANADA"))) for item in set(value.speciesrecord_set.all().values_list('county__name', 'county__state'))])).replace("'", '"')
41  
-    return str(sorted([str(item) for item in set(value.speciesrecord_set.all().values_list(arg, flat=True))])).replace("'", '"')
  45
+    # filter removes None elements, human sort sorts in expected order
  46
+    return str(sorted([str(str(item)[0].capitalize() + str(item)[1:]) for item in set(filter(None, value.speciesrecord_set.all().values_list(arg, flat=True)))], key=_human_key)).replace("'", '"')
8  django/pnwmoths/species/templatetags/stats_filters.py
@@ -2,6 +2,7 @@
2 2
 from django.db.models import F
3 3
 from cms.models.pagemodel import Page
4 4
 from django.db.models.loading import get_model
  5
+from django.contrib.humanize.templatetags.humanize import intcomma
5 6
 register = template.Library()
6 7
 
7 8
 @register.filter
@@ -13,7 +14,10 @@ def species_stat_count(value):
13 14
     """
14 15
     try:
15 16
         if value == 'SpeciesRecord':
16  
-            return get_model('species', value).records.count()
17  
-        return get_model('species', value).objects.count()
  17
+            r_count = get_model('species', value).records.count()
  18
+        else:
  19
+            r_count = get_model('species', value).objects.count()
  20
+        # return formatted count
  21
+        return intcomma(r_count)
18 22
     except (Exception):
19 23
         return ""
2  django/pnwmoths/templates/cms/base.html
@@ -68,7 +68,7 @@ <h1 id="header-text">Pacific Northwest <span id="header-green">Moths</span></h1>
68 68
               </div>
69 69
               <div class="col_4 last">  
70 70
                     <form method="get" action="/search/">
71  
-                        <input type="text" name="search" id="search_box" class="inputBox" />          
  71
+                        <input type="text" name="q" id="search_box" class="inputBox" />          
72 72
                         <input type="submit" value="search" id="search_button" class="submitButton" />
73 73
                     </form>
74 74
               </div>
27  django/pnwmoths/templates/cms/factsheet.html
@@ -71,6 +71,7 @@ <h2 style="display: inline" class="fs_title"><em>{{ species.name }}</em> {% if s
71 71
     </div>
72 72
     <div class="col_4 last">
73 73
         {% if species.noc_id %}<h3 class="fs_subtitle">{{ species.noc_id }}</h3>{% endif %}
  74
+        {% if species.image_plate %}<h3 class="fs_subtitle"><a href="/photographic-plates/{{ species.image_plate.pk }}/" target="_blank">View Photographic Plate</a></h3>{% endif %}
74 75
     </div>
75 76
 </div>
76 77
 <div id="fs_yui-g" class="row">
@@ -163,15 +164,17 @@ <h2 style="display: inline" class="fs_title"><em>{{ species.name }}</em> {% if s
163 164
         <div id="chartpseudotooltip"></div>
164 165
         <div id="factsheet-filters">
165 166
             <h4>Data Filters</h4>
166  
-            <select class="third" id="f-county" multiple="multiple">        
  167
+            <select class="half" id="f-county" multiple="multiple">        
167 168
             </select>
168  
-            <select class="third" id="f-state" multiple="multiple">        
  169
+            <select class="half" id="f-state" multiple="multiple">        
169 170
             </select>
170  
-            <select class="third" id="f-collection" multiple="multiple">        
  171
+            <select class="half" id="f-collection" multiple="multiple">        
171 172
             </select>
172  
-            <select class="third" id="f-year" multiple="multiple"><option value="2012">2012</option><option value="2011">2011</option><option value="2010">2010</option><option value="2009">2009</option><option value="2008">2008</option><option value="2007">2007</option><option value="2006">2006</option><option value="2005">2005</option><option value="2004">2004</option><option value="2003">2003</option><option value="2002">2002</option><option value="2001">2001</option><option value="2000">2000</option><option value="1999">1999</option><option value="1998">1998</option><option value="1997">1997</option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option><option value="1989">1989</option><option value="1988">1988</option><option value="1987">1987</option><option value="1986">1986</option><option value="1985">1985</option><option value="1984">1984</option><option value="1983">1983</option><option value="1982">1982</option><option value="1981">1981</option><option value="1980">1980</option><option value="1979">1979</option><option value="1978">1978</option><option value="1977">1977</option><option value="1976">1976</option><option value="1975">1975</option><option value="1974">1974</option><option value="1973">1973</option><option value="1972">1972</option><option value="1971">1971</option><option value="1970">1970</option><option value="1969">1969</option><option value="1968">1968</option><option value="1967">1967</option><option value="1966">1966</option><option value="1965">1965</option><option value="1964">1964</option><option value="1963">1963</option><option value="1962">1962</option><option value="1961">1961</option><option value="1960">1960</option><option value="1959">1959</option><option value="1958">1958</option><option value="1957">1957</option><option value="1956">1956</option><option value="1955">1955</option><option value="1954">1954</option><option value="1953">1953</option><option value="1952">1952</option><option value="1951">1951</option><option value="1950">1950</option><option value="1949">1949</option><option value="1948">1948</option><option value="1947">1947</option><option value="1946">1946</option><option value="1945">1945</option><option value="1944">1944</option><option value="1943">1943</option><option value="1942">1942</option><option value="1941">1941</option><option value="1940">1940</option><option value="1939">1939</option><option value="1938">1938</option><option value="1937">1937</option><option value="1936">1936</option><option value="1935">1935</option><option value="1934">1934</option><option value="1933">1933</option><option value="1932">1932</option><option value="1931">1931</option><option value="1930">1930</option><option value="1929">1929</option><option value="1928">1928</option><option value="1927">1927</option><option value="1926">1926</option><option value="1925">1925</option><option value="1924">1924</option><option value="1923">1923</option><option value="1922">1922</option><option value="1921">1921</option><option value="1920">1920</option><option value="1919">1919</option><option value="1918">1918</option><option value="1917">1917</option><option value="1916">1916</option><option value="1915">1915</option><option value="1914">1914</option><option value="1913">1913</option><option value="1912">1912</option><option value="1911">1911</option><option value="1910">1910</option><option value="1909">1909</option><option value="1908">1908</option><option value="1907">1907</option><option value="1906">1906</option><option value="1905">1905</option><option value="1904">1904</option><option value="1903">1903</option><option value="1902">1902</option><option value="1901">1901</option><option value="1900">1900</option></select>
173  
-            <select class="third" id="f-month" multiple="multiple"><option value='01'>January</option><option value='02'>February</option><option value='03'>March</option><option value='04'>April</option><option value='05'>May</option><option value='06'>June</option><option value='07'>July</option><option value='08'>August</option><option value='09'>September</option><option value='10'>October</option><option value='11'>November</option><option value='12'>December</option></select>
174  
-            <select class="third" id="f-day" multiple="multiple"><option value='01'>01</option><option value='02'>02</option><option value='03'>03</option><option value='04'>04</option><option value='05'>05</option><option value='06'>06</option><option value='07'>07</option><option value='08'>08</option><option value='09'>09</option><option value='10'>10</option><option value='11'>11</option><option value='12'>12</option><option value='13'>13</option><option value='14'>14</option><option value='15'>15</option><option value='16'>16</option><option value='17'>17</option><option value='18'>18</option><option value='19'>19</option><option value='20'>20</option><option value='21'>21</option><option value='22'>22</option><option value='23'>23</option><option value='24'>24</option><option value='25'>25</option><option value='26'>26</option><option value='27'>27</option><option value='28'>28</option><option value='29'>29</option><option value='30'>30</option><option value='31'>31</option></select>
  173
+            <select class="half" id="f-record_type" multiple="multiple">        
  174
+            </select>
  175
+            <select class="third" id="f-year" multiple="multiple"></select>
  176
+            <select class="third" id="f-month" multiple="multiple"></select>
  177
+            <select class="third" id="f-day" multiple="multiple"></select>
175 178
             <div id="date-filter-1" class="whole" style="padding-top: 50px">
176 179
                     <div id="f-date"></div>
177 180
             </div>
@@ -213,6 +216,18 @@ <h6 style="color: grey; margin-top: 0; margin-left: 30px">Elevation (ft)</h6>
213 216
     <span class="dokuwiki-data" id="collection-data">
214 217
     {{ species|filters_json:"collection__name"|safe }}
215 218
     </span>
  219
+    <span class="dokuwiki-data" id="record_type-data">
  220
+    {{ species|filters_json:"record_type"|safe }}
  221
+    </span>
  222
+    <span class="dokuwiki-data" id="year-data">
  223
+    {{ species|filters_json:"year"|safe }}
  224
+    </span>
  225
+    <span class="dokuwiki-data" id="month-data">
  226
+    {{ species|filters_json:"month"|safe }}
  227
+    </span>
  228
+    <span class="dokuwiki-data" id="day-data">
  229
+    {{ species|filters_json:"day"|safe }}
  230
+    </span>
216 231
     {% endcache %}
217 232
 {% endif %}
218 233
 <!-- data stop -->
8  django/pnwmoths/templates/cms/home.html
... ...
@@ -1,5 +1,5 @@
1 1
 {% extends "cms/base.html" %}
2  
-{% load cache cms_tags menu_tags species_tags browse_filters stats_filters %}
  2
+{% load cache cms_tags menu_tags humanize species_tags browse_filters stats_filters %}
3 3
 
4 4
 {% block scripts %}
5 5
     {{ block.super }}
@@ -31,10 +31,10 @@
31 31
             <div id="googlemap"></div>
32 32
             <ul id="stats_list">
33 33
                 {% cache 0 homepage_stats %}
34  
-                    <li><strong>{{ "Browse"|navnode_species_count }}</strong> Specimen Profiles</li>
  34
+                    <li><strong>{{ "Browse"|navnode_species_count|intcomma }}</strong> Species Profiles</li>
35 35
                     {# SpeciesRecord is a slow query as we join it against images to filter out labels #}
36  
-                    <li><strong>{{ "SpeciesRecord"|species_stat_count }}</strong> Specimen Records</li>
37  
-                    <li><strong>{{ "SpeciesImage"|species_stat_count }}</strong> Specimen Images</li>
  36
+                    <li><strong>{{ "SpeciesRecord"|species_stat_count|intcomma }}</strong> Specimen Records</li>
  37
+                    <li><strong>{{ "SpeciesImage"|species_stat_count|intcomma }}</strong> Specimen Images</li>
38 38
                 {% endcache %}
39 39
             </ul>
40 40
             </div>
15  django/pnwmoths/templates/menu/browse_submenu.html
... ...
@@ -1,6 +1,13 @@
1 1
 {% load menu_tags thumbnail species_tags browse_filters %}
  2
+<div class="browse_items">
2 3
 {% for child in children %}
3 4
 
  5
+{% if forloop.counter0|divisibleby:"2" %}
  6
+{% if child.is_leaf_node %}
  7
+<div class="browse_item_row">
  8
+{% endif %}
  9
+{% endif %}
  10
+
4 11
 {# Added on an ajax request for the tree's horizontal depth lines #}
5 12
 {% if request.is_ajax %}
6 13
     <div class="browse_item_wrapper">
@@ -34,4 +41,12 @@ <h3 {% if child|navnode_is_species_or_genus %}class="browse_genus_species"{% end
34 41
     </div>
35 42
 {% endif %}
36 43
 
  44
+{% if forloop.counter|divisibleby:"2" or forloop.last %}
  45
+{% if child.is_leaf_node %}
  46
+<div style="clear: both; height: 0px"></div>
  47
+</div>
  48
+{% endif %}
  49
+{% endif %}
  50
+
37 51
 {% endfor %}
  52
+</div>
300  www/media/css_bak/styles.css
... ...
@@ -1,300 +0,0 @@
1  
-/* ============================== */
2  
-/* ! Layout for desktop version   */
3  
-/* ============================== */
4  
-
5  
-        /* CMS TOOLBAR HOTFIX */
6  
-        .cms_toolbar_submenu {
7  
-                position: static !important;
8  
-        }
9  
-
10  
-	body {
11  
-		background-color: #E2E2DD;
12  
-	}
13  
-	
14  
-	#title {
15  
-		background-color: #FFFFFF;
16  
-	}
17  
-	
18  
-	#title h1 {
19  
-		padding-left: 10px;
20  
-		margin-bottom: 0px;
21  
-		padding-bottom: 10px;
22  
-	}
23  
-	
24  
-	#mainnav {
25  
-		background-color: #0083D6;
26  
-		-webkit-border-bottom-right-radius: 10px;
27  
-		-webkit-border-bottom-left-radius: 10px;
28  
-		-moz-border-radius-bottomright: 10px;
29  
-		-moz-border-radius-bottomleft: 10px;
30  
-		border-bottom-right-radius: 10px;
31  
-		border-bottom-left-radius: 10px;
32  
-	}
33  
-		
34  
-	#mainnav ul {
35  
-		list-style:none;
36  
-		margin:0;
37  
-		padding:0;
38  
-	}
39  
-		
40  
-	#mainnav ul li {
41  
-		display: inline;
42  
-		width: auto;
43  
-		text-align: center;
44  
-	}
45  
-	
46  
-	#mainnav ul li a.first {
47  
-		background-color: #0083D6;
48  
-        padding-left: 20px;
49  
-		-webkit-border-bottom-left-radius: 10px;
50  
-		-moz-border-radius-bottomleft: 10px;
51  
-		border-bottom-left-radius: 10px;
52  
-	}
53  
-	
54  
-	#mainnav ul li a {
55  
-		font-size: 16px;
56  
-		display:inline-block;
57  
-		padding: 10px 10px 10px 10px;
58  
-		text-shadow: 1px 0px 1px #003F87;
59  
-		color: #FFFFFF;
60  
-	}
61  
-	
62  
-	#mainnav ul li a:hover {
63  
-		background-color: #003F87;
64  
-		color: #FFFFFF;
65  
-	}
66  
-	
67  
-	#mainnav select { display: none; }
68  
-	
69  
-	/* BODY */
70  
-    #body {
71  
-        clear: both;
72  
-    }
73  
-    
74  
-	#body>div {
75  
-		background-color: #FFFFFF;
76  
-	}
77  
-	
78  
-	#body>div.top {
79  
-		margin-top: 15px;
80  
-		background-color: #FFFFFF;
81  
-		-webkit-border-top-right-radius: 10px;
82  
-		-webkit-border-top-left-radius: 10px;
83  
-		-moz-border-radius-topright: 10px;
84  
-		-moz-border-radius-topleft: 10px;
85  
-		border-top-right-radius: 10px;
86  
-		border-top-left-radius: 10px;
87  
-	}
88  
-	
89  
-	#body>div.bottom {
90  
-		padding-top: 20px;
91  
-		margin-bottom: 15px;
92  
-		padding-bottom: 20px;
93  
-		background-color: #FFFFFF;
94  
-		-webkit-border-bottom-right-radius: 10px;
95  
-		-webkit-border-bottom-left-radius: 10px;
96  
-		-moz-border-radius-bottomright: 10px;
97  
-		-moz-border-radius-bottomleft: 10px;
98  
-		border-bottom-right-radius: 10px;
99  
-		border-bottom-left-radius: 10px;
100  
-	}
101  
-	
102  
-	/* Body Content */
103  
-	.lightButton {
104  
-		-moz-box-shadow:inset 0px 1px 0px 0px #cae3fc;
105  
-		-webkit-box-shadow:inset 0px 1px 0px 0px #cae3fc;
106  
-		box-shadow:inset 0px 1px 0px 0px #cae3fc;
107  
-		background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #4197ee) );
108  
-		background:-moz-linear-gradient( center top, #79bbff 5%, #4197ee 100% );
109  
-		filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#4197ee');
110  
-		background-color:#79bbff;
111  
-		-moz-border-radius:6px;
112  
-		-webkit-border-radius:6px;
113  
-		border-radius:6px;
114  
-		border:1px solid #469df5;
115  
-		display:inline-block;
116  
-		color:#ffffff;
117  
-		font-family:arial;
118  
-		font-size:16px;
119  
-		font-weight:bold;
120  
-		padding:6px 24px;
121  
-		text-decoration:none;
122  
-		text-shadow:1px 1px 0px #287ace;
123  
-		width: 85%;
124  
-	}.lightButton:hover {
125  
-		background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4197ee), color-stop(1, #79bbff) );
126  
-		background:-moz-linear-gradient( center top, #4197ee 5%, #79bbff 100% );
127  
-		filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4197ee', endColorstr='#79bbff');
128  
-		background-color:#4197ee;
129  
-	}.lightButton:active {
130  
-		position:relative;
131  
-		top:1px;
132  
-	}.lightButton h4 {
133  
-		color: white;
134  
-	}.lightButton span {
135  
-		width: 50px;
136  
-	}
137  
-	
138  
-	.darkButton {
139  
-		-moz-box-shadow:inset 0px 1px 0px 0px #97c4fe;
140  
-		-webkit-box-shadow:inset 0px 1px 0px 0px #97c4fe;
141  
-		box-shadow:inset 0px 1px 0px 0px #97c4fe;
142  
-		background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #3d94f6), color-stop(1, #1e62d0) );
143  
-		background:-moz-linear-gradient( center top, #3d94f6 5%, #1e62d0 100% );
144  
-		filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#3d94f6', endColorstr='#1e62d0');
145  
-		background-color:#3d94f6;
146  
-		-moz-border-radius:6px;
147  
-		-webkit-border-radius:6px;
148  
-		border-radius:6px;
149  
-		border:1px solid #337fed;
150  
-		display:inline-block;
151  
-		color:#ffffff;
152  
-		font-family:arial;
153  
-		font-size:16px;
154  
-		font-weight:bold;
155  
-		padding:6px 24px;
156  
-		text-decoration:none;
157  
-		text-shadow:1px 1px 0px #1570cd;
158  
-		width: 85%;
159  
-	}.darkButton:hover {
160  
-		background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #1e62d0), color-stop(1, #3d94f6) );
161  
-		background:-moz-linear-gradient( center top, #1e62d0 5%, #3d94f6 100% );
162  
-		filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e62d0', endColorstr='#3d94f6');
163  
-		background-color:#1e62d0;
164  
-	}.darkButton:active {
165  
-		position:relative;
166  
-		top:1px;
167  
-	}.darkButton h4 {
168  
-		color: white;
169  
-	}
170  
-	
171  
-	.leftButton {
172  
-		padding: 0 0px 0 20px;
173  
-	}.rightButton {
174  
-		padding: 0 20px 0 0px;
175  
-	}
176  
-	
177  
-	#featuredmoth>div {
178  
-		padding-left: 20px;
179  
-	}
180  
-	#fullmap>div {
181  
-		padding-right: 20px;
182  
-	}
183  
-
184  
-    #stats_list li {
185  
-        display: inline-block;
186  
-        margin-right: 10px;
187  
-    }
188  
-	
189  
-	/* FOOTER */
190  
-	#footnavhead {
191  
-		background-color: #FFFFFF;
192  
-		-webkit-border-top-right-radius: 10px;
193  
-		-webkit-border-top-left-radius: 10px;
194  
-		-moz-border-radius-topright: 10px;
195  
-		-moz-border-radius-topleft: 10px;
196  
-		border-top-right-radius: 10px;
197  
-		border-top-left-radius: 10px;
198  
-	}
199  
-	
200  
-	#footnavhead div h5 {   
201  
-        background-color: #0083D6;
202  
-        width: 115%;     
203  
-		font-size: 16px;
204  
-		padding: 5px 0 5px 10px;
205  
-        border-left: 1px dotted #003F87;
206  
-        border-bottom: 1px dotted #003F87;
207  
-		color: #FFFFFF;
208  
-		text-shadow: 1px 1px 1px #003F87;
209  
-	}
210  
-
211  
-	#footnavhead div.first h5 {
212  
-		border-left: none;
213  
-	}
214  
-
215  
-    #footnavhead div ul {
216  
-        margin-left: 10px;
217  
-        margin-top: 10px;
218  
-    }
219  
-	
220  
-
221  
-	#footnavhead div>ul {
222  
-        background-color: #FFFFFF;
223  
-		list-style-type: none;
224  
-        width: 100%;
225  
-	}
226  
-
227  
-	#credits {
228  
-		margin:0 auto;
229  
-		border-top: 1px dotted #003F87;
230  
-		background-image: linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
231  
-		background-image: -o-linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
232  
-		background-image: -moz-linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
233  
-		background-image: -webkit-linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
234  
-		background-image: -ms-linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
235  
-
236  
-		background-image: -webkit-gradient(
237  
-			linear,
238  
-			left bottom,
239  
-			left top,
240  
-			color-stop(0.24, #E2E2DD),
241  
-			color-stop(0.36, #FFFFFF)
242  
-		);
243  
-	}
244  
-	
245  
-	#credits ul {
246  
-		text-align: center;
247  
-		margin: 20px 0 60px 0;
248  
-	}
249  
-	#credits ul li {
250  
-		display: inline;
251  
-		zoom: 1;
252  
-		margin: 0 10px 0 10px;
253  
-	}
254  
-
255  
-/* ============================= */
256  
-/* ! Layout for mobile version   */
257  
-/* ============================= */
258  
-
259  
-@media handheld, only screen and (max-width: 767px) {
260  
-	#mainnav ul     { display: none; }
261  
-	#mainnav select { display: inline-block; margin-top: 10px; margin-bottom: 10px; padding:5px; }
262  
-    #footnavhead div h5 {
263  
-        margin-left: -20px;
264  
-    }	
265  
-    .leftButton {
266  
-		padding: 0 0 10px 0;
267  
-	}.rightButton {
268  
-		padding: 10px 0 0 0;
269  
-	}
270  
-	#featuredmoth div {
271  
-		padding-left: 0px;
272  
-	}
273  
-	#fullmap div {
274  
-		padding-right: 0px;
275  
-	}
276  
-	#title form {
277  
-		clear: both;
278  
-		float: left;
279  
-	}
280  
-	#header div:first-child {
281  
-		background-color: #FFFFFF;
282  
-	}
283  
-}
284  
-
285  
-
286  
-
287  
-
288  
-
289  
-/* ========================================== */
290  
-/* ! Provide higher res assets for iPhone 4   */
291  
-/* ========================================== */
292  
-
293  
-@media only screen and (-webkit-min-device-pixel-ratio: 2) { 
294  
-
295  
-/*	.logo {
296  
-		background: url(logo2x.jpg) no-repeat;
297  
-		background-size: 212px 303px;
298  
-	}*/
299  
-
300  
-}
28  www/media/fs_map/script.js
@@ -434,6 +434,7 @@ PNWMOTHS.Filters = function () {
434 434
                 var finishInit = function() {
435 435
                     jQuery("#f-" + name).multiselect({
436 436
                             noneSelectedText: noneSelectedText,
  437
+                            classes: name + "-ms",
437 438
                             selectedText: selectedText,
438 439
                             selectedList: 10,
439 440
                             minWidth: "auto"
@@ -477,8 +478,9 @@ PNWMOTHS.Filters = function () {
477 478
                     
478 479
                     return select;
479 480
                 },
480  
-                reset: function() {
481  
-                    jQuery("#f-" + name).multiselect("uncheckAll");
  481
+                reset: function(filter_delete) {
  482
+                    if (jQuery("#f-" + name).multiselect("getChecked").length)
  483
+                        jQuery("#f-" + name).multiselect("uncheckAll");
482 484
                }
483 485
             };            
484 486
         },
@@ -509,11 +511,13 @@ PNWMOTHS.Filters = function () {
509 511
                     return jQuery("#f-" + name);
510 512
                 },
511 513
                 ajaxPopulate: false,
512  
-                reset: function() {
  514
+                reset: function(filter_delete) {
513 515
                     var m = jQuery("#f-" + name);
514 516
                     var b = m.dateRangeSlider("bounds");
515 517
                     m.dateRangeSlider("values", b.min, b.max); 
516  
-                    delete PNWMOTHS.Filters.filters[name];
  518
+                    if (filter_delete) {
  519
+                        delete PNWMOTHS.Filters.filters[name];
  520
+                    }
517 521
                 }
518 522
             };            
519 523
         },
@@ -543,11 +547,13 @@ PNWMOTHS.Filters = function () {
543 547
                     return jQuery("#f-" + name);
544 548
                 },
545 549
                 ajaxPopulate: false,
546  
-                reset: function() {
  550
+                reset: function(filter_delete) {
547 551
                     var m = jQuery("#f-" + name);
548 552
                     var b = m.editRangeSlider("bounds");
549 553
                     m.editRangeSlider("values", b.min, b.max); 
550  
-                    delete PNWMOTHS.Filters.filters[name];
  554
+                    if (filter_delete) {
  555
+                        delete PNWMOTHS.Filters.filters[name];
  556
+                    }
551 557
                 }
552 558
             };            
553 559
         }
@@ -599,10 +605,11 @@ jQuery(document).ready(function () {
599 605
 			{"name": "county", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Counties", "selectedText": "Filtering on # counties", "ajax": true},
600 606
 			{"name": "state", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "States", "selectedText": "Filtering on # states", "ajax": true},
601 607
 			{"name": "collection", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Collections", "selectedText": "Filtering on # collections", "ajax": true},
  608
+			{"name": "record_type", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Voucher Types", "selectedText": "Filtering on # types", "ajax": true},
602 609
 			{"name": "date", "type": PNWMOTHS.Filters.DateRangeFilter, "bounds": {min:new Date(1900,0,1), max:new Date()}},
603  
-			{"name": "year", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Years", "selectedText": "Filtering on # years", "ajax": false},
604  
-			{"name": "month", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Months", "selectedText": "Filtering on # months", "ajax": false},
605  
-			{"name": "day", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Days", "selectedText": "Filtering on # days", "ajax": false},
  610
+			{"name": "year", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Years", "selectedText": "Filtering on # years", "ajax": true},
  611
+			{"name": "month", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Months", "selectedText": "Filtering on # months", "ajax": true},
  612
+			{"name": "day", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Days", "selectedText": "Filtering on # days", "ajax": true},
606 613
 			{"name": "elevation", "type": PNWMOTHS.Filters.EditRangeFilter, "bounds": {min: 0, max: 10000}}
607 614
 		];
608 615
 
@@ -622,8 +629,9 @@ jQuery(document).ready(function () {
622 629
 
623 630
                 jQuery("#f-reset").click(function() {
624 631
                     jQuery.each(init_filters, function(index, f) {
625  
-                        f.reset();
  632
+                        f.reset(false);
626 633
                     });
  634
+                    PNWMOTHS.Filters.filters = []; 
627 635
                     jQuery(document).trigger("requestData");
628 636
                 });
629 637
 
13  www/media/fs_map/style.css
@@ -82,17 +82,28 @@ div.collections table td {
82 82
 	margin-left: auto;
83 83
 	margin-right: auto;
84 84
 }
  85
+#factsheet-filters .half {
  86
+    width: 30%;
  87
+    display: inline;
  88
+}
85 89
 #factsheet-filters .third {
86 90
     width: 20%;
87 91
     display: inline;
88 92
 }
89 93
 
  94
+.ui-multiselect.county-ms, .ui-multiselect.state-ms, .ui-multiselect.collection-ms, .ui-multiselect.record_type-ms {
  95
+  width: 49% !important;
  96
+}
  97
+.ui-multiselect.year-ms, .ui-multiselect.month-ms, .ui-multiselect.day-ms {
  98
+  width: 33% !important;
  99
+}
  100
+
90 101
 
91 102
 /* multiselect styles */
92 103
 .ui-multiselect:hover {
93 104
 	font-weight: bold !important;
94 105
 }
95  
-.ui-multiselect { padding:2px 0 2px 4px; text-align:left; width: 33% !important; }
  106
+.ui-multiselect { padding:2px 0 2px 4px; text-align:left; }
96 107
 .ui-multiselect span.ui-icon { float:right }
97 108
 .ui-multiselect-single .ui-multiselect-checkboxes input { position:absolute !important; top: auto !important; left:-9999px; }
98 109
 .ui-multiselect-single .ui-multiselect-checkboxes label { padding:5px !important }
6  www/media/js_pages/browse.js
@@ -40,7 +40,7 @@
40 40
                 var url = jQuery(this).parent().find('h3 a').attr('href');
41 41
                 jQuery(this).html('&nbsp;');
42 42
                 jQuery(this).addClass('loading_toggle');
43  
-                jQuery(this).parent().siblings('.ajax').load(url + ' .browse_item_wrapper', function() {
  43
+                jQuery(this).parent().siblings('.ajax').load(url + ' .browse_items', function() {
44 44
                     jQuery(this).parent().find('.toggle_item').removeClass('loading_toggle').html("-");
45 45
                     jQuery(this).append('<div style="height: 0px; clear: both;">&nbsp;</div>');
46 46
                     jQuery(this).find('.browse_item:not(.species)').implement_browse();
@@ -108,13 +108,13 @@ jQuery(document).ready(function() {
108 108
     );
109 109
 
110 110
     //Make species div clickable using first link in the container
111  
-    jQuery(".ajax").delegate(".species" ,"click", function(){
  111
+    jQuery("#content").delegate(".species" ,"click", function(){
112 112
         window.location=jQuery(this).find("h3 a").attr("href");
113 113
         return false;
114 114
     });
115 115
 
116 116
     // Set species div's hover effect
117  
-    jQuery(".ajax").delegate(".species", "hover", function() {
  117
+    jQuery("#content").delegate(".species", "hover", function() {
118 118
         jQuery(this).toggleClass('browse_item_hover');
119 119
     });
120 120
 });

0 notes on commit 4389bbf

Please sign in to comment.
Something went wrong with that request. Please try again.