Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…se styling
  • Loading branch information...
commit 4389bbfea352e87ef2f297feb0d6b23115513213 1 parent c339a67
@philipbjorge philipbjorge authored
View
4 django/pnwmoths/settings_global.py
@@ -115,6 +115,7 @@
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
+ 'django.contrib.humanize',
'cms',
'cms.plugins.text',
'cms.plugins.picture',
@@ -134,6 +135,8 @@
'south',
'reversion',
'ajax_select',
+ 'paging',
+ 'admin_sentry',
)
CMS_TEMPLATES = (
@@ -142,6 +145,7 @@
('cms/home.html', gettext('home')),
('cms/browse.html', gettext('browse')),
('cms/factsheet.html', gettext('factsheet')),
+ ('cms/plateimages.html', gettext('imageplates')),
)
CMS_SHOW_END_DATE = True
CMS_SHOW_START_DATE = True
View
15 django/pnwmoths/species/admin.py
@@ -33,7 +33,7 @@ class AuthorAdmin(VersionAdmin, admin.ModelAdmin):
class SpeciesAdmin(VersionAdmin, admin.ModelAdmin):
filter_horizontal = ("similar",)
- list_display = ("__unicode__", "noc_id", "factsheet", "common_name")
+ list_display = ("__unicode__", "noc_id", "factsheet", "authority", "common_name")
list_editable = ("common_name",)
search_fields = ("genus", "species")
admin.site.register(Species, SpeciesAdmin)
@@ -48,10 +48,16 @@ def noc_id(self):
return self.species.noc_id
noc_id.admin_order_field = 'species__noc_id'
+ def collection(self):
+ return self.record.collection
+ collection.admin_order_field = 'record__collection'
+
list_display = (
noc_id,
"species",
"image",
+ collection,
+ "photographer",
"weight"
)
list_editable = ("weight",)
@@ -71,13 +77,14 @@ def noc_id(self):
noc_id.admin_order_field = 'species__noc_id'
def thumb(self):
- t = self.speciesimage_set.all()
+ t = self.speciesimage_set.all()[:1].get()
if t:
- pk = t[0].pk
- t = get_thumbnail(t[0].image,"70x46")
+ pk = t.pk
+ t = get_thumbnail(t.image,"70x46")
return u'<a href="%s" target="_blank"><img src="%s" /></a>' % (urlresolvers.reverse('admin:species_speciesimage_change', args=(pk,)), t.url)
else:
return u"None"
+ thumb.admin_order_field = 'speciesimage'
thumb.short_description = 'Photo'
thumb.allow_tags = True
View
31 django/pnwmoths/species/forms.py
@@ -327,19 +327,24 @@ def clean(self):
genus = None
if genus and species:
- species_instance, created = Species.objects.get_or_create(
- genus=genus,
- species=species
- )
- cleaned_data["species"] = species_instance
-
- # If a Species instance doesn't exist for the given data, alert the
- # user.
- if not isinstance(cleaned_data.get("species"), Species):
- # Delete the species entry from cleaned data if it is defined.
- if cleaned_data.get("species"):
- del cleaned_data["species"]
- raise forms.ValidationError("Species isn't defined.")
+ try:
+ species_instance = Species.objects.get(
+ genus=genus,
+ species=species
+ )
+ cleaned_data["species"] = species_instance
+ except Exception:
+ if cleaned_data.get("genus"):
+ del self.cleaned_data["genus"]
+ if cleaned_data.get("species"):
+ del self.cleaned_data["species"]
+ raise forms.ValidationError("Species does not exist.")
+ else:
+ if cleaned_data.get("genus"):
+ del self.cleaned_data["genus"]
+ if cleaned_data.get("species"):
+ del self.cleaned_data["species"]
+ raise forms.ValidationError("Need a genus and species")
if cleaned_data.get("county") is not None:
county = cleaned_data.get("county").strip()
View
18 django/pnwmoths/species/management/commands/remove_wym_inline_styles.py
@@ -0,0 +1,18 @@
+from django.core.management.base import NoArgsCommand, CommandError
+from cms.plugins.text.models import Text
+from reversion import revision
+import re
+
+class Command(NoArgsCommand):
+
+ @revision.create_on_success
+ def handle_noargs(self, **options):
+ """
+ Removes inline styles from wymeditor text to make it simpler
+ to fix the bug in wym that adds a checkered background to content.
+ """
+ text_objs = Text.objects.all()
+ for obj in text_objs:
+ # Removes inline styles
+ obj.body = re.sub(' style=("|\')(.*?)("|\')', "", obj.body)
+ obj.save()
View
9 django/pnwmoths/species/templatetags/factsheet_filters.py
@@ -1,6 +1,6 @@
from django import template
from pnwmoths.species.models import State, SpeciesRecord
-import json
+import json, re
register = template.Library()
@@ -30,6 +30,10 @@ def filters_json(value, arg):
"""
Returns Array with extra values removed based on species
"""
+ def _human_key(key):
+ parts = re.split('(\d*\.\d+|\d+)', key)
+ return tuple((e.swapcase() if i % 2 == 0 else float(e)) for i, e in enumerate(parts))
+
if arg == "county":
states = list(State.objects.all().values_list())
state_lookup = dict()
@@ -38,4 +42,5 @@ def filters_json(value, arg):
state_lookup[s_id] = code
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("'", '"')
- return str(sorted([str(item) for item in set(value.speciesrecord_set.all().values_list(arg, flat=True))])).replace("'", '"')
+ # filter removes None elements, human sort sorts in expected order
+ 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("'", '"')
View
8 django/pnwmoths/species/templatetags/stats_filters.py
@@ -2,6 +2,7 @@
from django.db.models import F
from cms.models.pagemodel import Page
from django.db.models.loading import get_model
+from django.contrib.humanize.templatetags.humanize import intcomma
register = template.Library()
@register.filter
@@ -13,7 +14,10 @@ def species_stat_count(value):
"""
try:
if value == 'SpeciesRecord':
- return get_model('species', value).records.count()
- return get_model('species', value).objects.count()
+ r_count = get_model('species', value).records.count()
+ else:
+ r_count = get_model('species', value).objects.count()
+ # return formatted count
+ return intcomma(r_count)
except (Exception):
return ""
View
2  django/pnwmoths/templates/cms/base.html
@@ -68,7 +68,7 @@ <h1 id="header-text">Pacific Northwest <span id="header-green">Moths</span></h1>
</div>
<div class="col_4 last">
<form method="get" action="/search/">
- <input type="text" name="search" id="search_box" class="inputBox" />
+ <input type="text" name="q" id="search_box" class="inputBox" />
<input type="submit" value="search" id="search_button" class="submitButton" />
</form>
</div>
View
27 django/pnwmoths/templates/cms/factsheet.html
@@ -71,6 +71,7 @@ <h2 style="display: inline" class="fs_title"><em>{{ species.name }}</em> {% if s
</div>
<div class="col_4 last">
{% if species.noc_id %}<h3 class="fs_subtitle">{{ species.noc_id }}</h3>{% endif %}
+ {% if species.image_plate %}<h3 class="fs_subtitle"><a href="/photographic-plates/{{ species.image_plate.pk }}/" target="_blank">View Photographic Plate</a></h3>{% endif %}
</div>
</div>
<div id="fs_yui-g" class="row">
@@ -163,15 +164,17 @@ <h2 style="display: inline" class="fs_title"><em>{{ species.name }}</em> {% if s
<div id="chartpseudotooltip"></div>
<div id="factsheet-filters">
<h4>Data Filters</h4>
- <select class="third" id="f-county" multiple="multiple">
+ <select class="half" id="f-county" multiple="multiple">
</select>
- <select class="third" id="f-state" multiple="multiple">
+ <select class="half" id="f-state" multiple="multiple">
</select>
- <select class="third" id="f-collection" multiple="multiple">
+ <select class="half" id="f-collection" multiple="multiple">
</select>
- <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>
- <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>
- <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>
+ <select class="half" id="f-record_type" multiple="multiple">
+ </select>
+ <select class="third" id="f-year" multiple="multiple"></select>
+ <select class="third" id="f-month" multiple="multiple"></select>
+ <select class="third" id="f-day" multiple="multiple"></select>
<div id="date-filter-1" class="whole" style="padding-top: 50px">
<div id="f-date"></div>
</div>
@@ -213,6 +216,18 @@ <h6 style="color: grey; margin-top: 0; margin-left: 30px">Elevation (ft)</h6>
<span class="dokuwiki-data" id="collection-data">
{{ species|filters_json:"collection__name"|safe }}
</span>
+ <span class="dokuwiki-data" id="record_type-data">
+ {{ species|filters_json:"record_type"|safe }}
+ </span>
+ <span class="dokuwiki-data" id="year-data">
+ {{ species|filters_json:"year"|safe }}
+ </span>
+ <span class="dokuwiki-data" id="month-data">
+ {{ species|filters_json:"month"|safe }}
+ </span>
+ <span class="dokuwiki-data" id="day-data">
+ {{ species|filters_json:"day"|safe }}
+ </span>
{% endcache %}
{% endif %}
<!-- data stop -->
View
8 django/pnwmoths/templates/cms/home.html
@@ -1,5 +1,5 @@
{% extends "cms/base.html" %}
-{% load cache cms_tags menu_tags species_tags browse_filters stats_filters %}
+{% load cache cms_tags menu_tags humanize species_tags browse_filters stats_filters %}
{% block scripts %}
{{ block.super }}
@@ -31,10 +31,10 @@
<div id="googlemap"></div>
<ul id="stats_list">
{% cache 0 homepage_stats %}
- <li><strong>{{ "Browse"|navnode_species_count }}</strong> Specimen Profiles</li>
+ <li><strong>{{ "Browse"|navnode_species_count|intcomma }}</strong> Species Profiles</li>
{# SpeciesRecord is a slow query as we join it against images to filter out labels #}
- <li><strong>{{ "SpeciesRecord"|species_stat_count }}</strong> Specimen Records</li>
- <li><strong>{{ "SpeciesImage"|species_stat_count }}</strong> Specimen Images</li>
+ <li><strong>{{ "SpeciesRecord"|species_stat_count|intcomma }}</strong> Specimen Records</li>
+ <li><strong>{{ "SpeciesImage"|species_stat_count|intcomma }}</strong> Specimen Images</li>
{% endcache %}
</ul>
</div>
View
15 django/pnwmoths/templates/menu/browse_submenu.html
@@ -1,6 +1,13 @@
{% load menu_tags thumbnail species_tags browse_filters %}
+<div class="browse_items">
{% for child in children %}
+{% if forloop.counter0|divisibleby:"2" %}
+{% if child.is_leaf_node %}
+<div class="browse_item_row">
+{% endif %}
+{% endif %}
+
{# Added on an ajax request for the tree's horizontal depth lines #}
{% if request.is_ajax %}
<div class="browse_item_wrapper">
@@ -34,4 +41,12 @@ <h3 {% if child|navnode_is_species_or_genus %}class="browse_genus_species"{% end
</div>
{% endif %}
+{% if forloop.counter|divisibleby:"2" or forloop.last %}
+{% if child.is_leaf_node %}
+<div style="clear: both; height: 0px"></div>
+</div>
+{% endif %}
+{% endif %}
+
{% endfor %}
+</div>
View
300 www/media/css_bak/styles.css
@@ -1,300 +0,0 @@
-/* ============================== */
-/* ! Layout for desktop version */
-/* ============================== */
-
- /* CMS TOOLBAR HOTFIX */
- .cms_toolbar_submenu {
- position: static !important;
- }
-
- body {
- background-color: #E2E2DD;
- }
-
- #title {
- background-color: #FFFFFF;
- }
-
- #title h1 {
- padding-left: 10px;
- margin-bottom: 0px;
- padding-bottom: 10px;
- }
-
- #mainnav {
- background-color: #0083D6;
- -webkit-border-bottom-right-radius: 10px;
- -webkit-border-bottom-left-radius: 10px;
- -moz-border-radius-bottomright: 10px;
- -moz-border-radius-bottomleft: 10px;
- border-bottom-right-radius: 10px;
- border-bottom-left-radius: 10px;
- }
-
- #mainnav ul {
- list-style:none;
- margin:0;
- padding:0;
- }
-
- #mainnav ul li {
- display: inline;
- width: auto;
- text-align: center;
- }
-
- #mainnav ul li a.first {
- background-color: #0083D6;
- padding-left: 20px;
- -webkit-border-bottom-left-radius: 10px;
- -moz-border-radius-bottomleft: 10px;
- border-bottom-left-radius: 10px;
- }
-
- #mainnav ul li a {
- font-size: 16px;
- display:inline-block;
- padding: 10px 10px 10px 10px;
- text-shadow: 1px 0px 1px #003F87;
- color: #FFFFFF;
- }
-
- #mainnav ul li a:hover {
- background-color: #003F87;
- color: #FFFFFF;
- }
-
- #mainnav select { display: none; }
-
- /* BODY */
- #body {
- clear: both;
- }
-
- #body>div {
- background-color: #FFFFFF;
- }
-
- #body>div.top {
- margin-top: 15px;
- background-color: #FFFFFF;
- -webkit-border-top-right-radius: 10px;
- -webkit-border-top-left-radius: 10px;
- -moz-border-radius-topright: 10px;
- -moz-border-radius-topleft: 10px;
- border-top-right-radius: 10px;
- border-top-left-radius: 10px;
- }
-
- #body>div.bottom {
- padding-top: 20px;
- margin-bottom: 15px;
- padding-bottom: 20px;
- background-color: #FFFFFF;
- -webkit-border-bottom-right-radius: 10px;
- -webkit-border-bottom-left-radius: 10px;
- -moz-border-radius-bottomright: 10px;
- -moz-border-radius-bottomleft: 10px;
- border-bottom-right-radius: 10px;
- border-bottom-left-radius: 10px;
- }
-
- /* Body Content */
- .lightButton {
- -moz-box-shadow:inset 0px 1px 0px 0px #cae3fc;
- -webkit-box-shadow:inset 0px 1px 0px 0px #cae3fc;
- box-shadow:inset 0px 1px 0px 0px #cae3fc;
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #4197ee) );
- background:-moz-linear-gradient( center top, #79bbff 5%, #4197ee 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#4197ee');
- background-color:#79bbff;
- -moz-border-radius:6px;
- -webkit-border-radius:6px;
- border-radius:6px;
- border:1px solid #469df5;
- display:inline-block;
- color:#ffffff;
- font-family:arial;
- font-size:16px;
- font-weight:bold;
- padding:6px 24px;
- text-decoration:none;
- text-shadow:1px 1px 0px #287ace;
- width: 85%;
- }.lightButton:hover {
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #4197ee), color-stop(1, #79bbff) );
- background:-moz-linear-gradient( center top, #4197ee 5%, #79bbff 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#4197ee', endColorstr='#79bbff');
- background-color:#4197ee;
- }.lightButton:active {
- position:relative;
- top:1px;
- }.lightButton h4 {
- color: white;
- }.lightButton span {
- width: 50px;
- }
-
- .darkButton {
- -moz-box-shadow:inset 0px 1px 0px 0px #97c4fe;
- -webkit-box-shadow:inset 0px 1px 0px 0px #97c4fe;
- box-shadow:inset 0px 1px 0px 0px #97c4fe;
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #3d94f6), color-stop(1, #1e62d0) );
- background:-moz-linear-gradient( center top, #3d94f6 5%, #1e62d0 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#3d94f6', endColorstr='#1e62d0');
- background-color:#3d94f6;
- -moz-border-radius:6px;
- -webkit-border-radius:6px;
- border-radius:6px;
- border:1px solid #337fed;
- display:inline-block;
- color:#ffffff;
- font-family:arial;
- font-size:16px;
- font-weight:bold;
- padding:6px 24px;
- text-decoration:none;
- text-shadow:1px 1px 0px #1570cd;
- width: 85%;
- }.darkButton:hover {
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #1e62d0), color-stop(1, #3d94f6) );
- background:-moz-linear-gradient( center top, #1e62d0 5%, #3d94f6 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e62d0', endColorstr='#3d94f6');
- background-color:#1e62d0;
- }.darkButton:active {
- position:relative;
- top:1px;
- }.darkButton h4 {
- color: white;
- }
-
- .leftButton {
- padding: 0 0px 0 20px;
- }.rightButton {
- padding: 0 20px 0 0px;
- }
-
- #featuredmoth>div {
- padding-left: 20px;
- }
- #fullmap>div {
- padding-right: 20px;
- }
-
- #stats_list li {
- display: inline-block;
- margin-right: 10px;
- }
-
- /* FOOTER */
- #footnavhead {
- background-color: #FFFFFF;
- -webkit-border-top-right-radius: 10px;
- -webkit-border-top-left-radius: 10px;
- -moz-border-radius-topright: 10px;
- -moz-border-radius-topleft: 10px;
- border-top-right-radius: 10px;
- border-top-left-radius: 10px;
- }
-
- #footnavhead div h5 {
- background-color: #0083D6;
- width: 115%;
- font-size: 16px;
- padding: 5px 0 5px 10px;
- border-left: 1px dotted #003F87;
- border-bottom: 1px dotted #003F87;
- color: #FFFFFF;
- text-shadow: 1px 1px 1px #003F87;
- }
-
- #footnavhead div.first h5 {
- border-left: none;
- }
-
- #footnavhead div ul {
- margin-left: 10px;
- margin-top: 10px;
- }
-
-
- #footnavhead div>ul {
- background-color: #FFFFFF;
- list-style-type: none;
- width: 100%;
- }
-
- #credits {
- margin:0 auto;
- border-top: 1px dotted #003F87;
- background-image: linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
- background-image: -o-linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
- background-image: -moz-linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
- background-image: -webkit-linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
- background-image: -ms-linear-gradient(bottom, #E2E2DD 24%, #FFFFFF 36%);
-
- background-image: -webkit-gradient(
- linear,
- left bottom,
- left top,
- color-stop(0.24, #E2E2DD),
- color-stop(0.36, #FFFFFF)
- );
- }
-
- #credits ul {
- text-align: center;
- margin: 20px 0 60px 0;
- }
- #credits ul li {
- display: inline;
- zoom: 1;
- margin: 0 10px 0 10px;
- }
-
-/* ============================= */
-/* ! Layout for mobile version */
-/* ============================= */
-
-@media handheld, only screen and (max-width: 767px) {
- #mainnav ul { display: none; }
- #mainnav select { display: inline-block; margin-top: 10px; margin-bottom: 10px; padding:5px; }
- #footnavhead div h5 {
- margin-left: -20px;
- }
- .leftButton {
- padding: 0 0 10px 0;
- }.rightButton {
- padding: 10px 0 0 0;
- }
- #featuredmoth div {
- padding-left: 0px;
- }
- #fullmap div {
- padding-right: 0px;
- }
- #title form {
- clear: both;
- float: left;
- }
- #header div:first-child {
- background-color: #FFFFFF;
- }
-}
-
-
-
-
-
-/* ========================================== */
-/* ! Provide higher res assets for iPhone 4 */
-/* ========================================== */
-
-@media only screen and (-webkit-min-device-pixel-ratio: 2) {
-
-/* .logo {
- background: url(logo2x.jpg) no-repeat;
- background-size: 212px 303px;
- }*/
-
-}
View
28 www/media/fs_map/script.js
@@ -434,6 +434,7 @@ PNWMOTHS.Filters = function () {
var finishInit = function() {
jQuery("#f-" + name).multiselect({
noneSelectedText: noneSelectedText,
+ classes: name + "-ms",
selectedText: selectedText,
selectedList: 10,
minWidth: "auto"
@@ -477,8 +478,9 @@ PNWMOTHS.Filters = function () {
return select;
},
- reset: function() {
- jQuery("#f-" + name).multiselect("uncheckAll");
+ reset: function(filter_delete) {
+ if (jQuery("#f-" + name).multiselect("getChecked").length)
+ jQuery("#f-" + name).multiselect("uncheckAll");
}
};
},
@@ -509,11 +511,13 @@ PNWMOTHS.Filters = function () {
return jQuery("#f-" + name);
},
ajaxPopulate: false,
- reset: function() {
+ reset: function(filter_delete) {
var m = jQuery("#f-" + name);
var b = m.dateRangeSlider("bounds");
m.dateRangeSlider("values", b.min, b.max);
- delete PNWMOTHS.Filters.filters[name];
+ if (filter_delete) {
+ delete PNWMOTHS.Filters.filters[name];
+ }
}
};
},
@@ -543,11 +547,13 @@ PNWMOTHS.Filters = function () {
return jQuery("#f-" + name);
},
ajaxPopulate: false,
- reset: function() {
+ reset: function(filter_delete) {
var m = jQuery("#f-" + name);
var b = m.editRangeSlider("bounds");
m.editRangeSlider("values", b.min, b.max);
- delete PNWMOTHS.Filters.filters[name];
+ if (filter_delete) {
+ delete PNWMOTHS.Filters.filters[name];
+ }
}
};
}
@@ -599,10 +605,11 @@ jQuery(document).ready(function () {
{"name": "county", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Counties", "selectedText": "Filtering on # counties", "ajax": true},
{"name": "state", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "States", "selectedText": "Filtering on # states", "ajax": true},
{"name": "collection", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Collections", "selectedText": "Filtering on # collections", "ajax": true},
+ {"name": "record_type", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Voucher Types", "selectedText": "Filtering on # types", "ajax": true},
{"name": "date", "type": PNWMOTHS.Filters.DateRangeFilter, "bounds": {min:new Date(1900,0,1), max:new Date()}},
- {"name": "year", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Years", "selectedText": "Filtering on # years", "ajax": false},
- {"name": "month", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Months", "selectedText": "Filtering on # months", "ajax": false},
- {"name": "day", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Days", "selectedText": "Filtering on # days", "ajax": false},
+ {"name": "year", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Years", "selectedText": "Filtering on # years", "ajax": true},
+ {"name": "month", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Months", "selectedText": "Filtering on # months", "ajax": true},
+ {"name": "day", "type": PNWMOTHS.Filters.MultiSelectFilter, "noneSelectedText": "Days", "selectedText": "Filtering on # days", "ajax": true},
{"name": "elevation", "type": PNWMOTHS.Filters.EditRangeFilter, "bounds": {min: 0, max: 10000}}
];
@@ -622,8 +629,9 @@ jQuery(document).ready(function () {
jQuery("#f-reset").click(function() {
jQuery.each(init_filters, function(index, f) {
- f.reset();
+ f.reset(false);
});
+ PNWMOTHS.Filters.filters = [];
jQuery(document).trigger("requestData");
});
View
13 www/media/fs_map/style.css
@@ -82,17 +82,28 @@ div.collections table td {
margin-left: auto;
margin-right: auto;
}
+#factsheet-filters .half {
+ width: 30%;
+ display: inline;
+}
#factsheet-filters .third {
width: 20%;
display: inline;
}
+.ui-multiselect.county-ms, .ui-multiselect.state-ms, .ui-multiselect.collection-ms, .ui-multiselect.record_type-ms {
+ width: 49% !important;
+}
+.ui-multiselect.year-ms, .ui-multiselect.month-ms, .ui-multiselect.day-ms {
+ width: 33% !important;
+}
+
/* multiselect styles */
.ui-multiselect:hover {
font-weight: bold !important;
}
-.ui-multiselect { padding:2px 0 2px 4px; text-align:left; width: 33% !important; }
+.ui-multiselect { padding:2px 0 2px 4px; text-align:left; }
.ui-multiselect span.ui-icon { float:right }
.ui-multiselect-single .ui-multiselect-checkboxes input { position:absolute !important; top: auto !important; left:-9999px; }
.ui-multiselect-single .ui-multiselect-checkboxes label { padding:5px !important }
View
6 www/media/js_pages/browse.js
@@ -40,7 +40,7 @@
var url = jQuery(this).parent().find('h3 a').attr('href');
jQuery(this).html('&nbsp;');
jQuery(this).addClass('loading_toggle');
- jQuery(this).parent().siblings('.ajax').load(url + ' .browse_item_wrapper', function() {
+ jQuery(this).parent().siblings('.ajax').load(url + ' .browse_items', function() {
jQuery(this).parent().find('.toggle_item').removeClass('loading_toggle').html("-");
jQuery(this).append('<div style="height: 0px; clear: both;">&nbsp;</div>');
jQuery(this).find('.browse_item:not(.species)').implement_browse();
@@ -108,13 +108,13 @@ jQuery(document).ready(function() {
);
//Make species div clickable using first link in the container
- jQuery(".ajax").delegate(".species" ,"click", function(){
+ jQuery("#content").delegate(".species" ,"click", function(){
window.location=jQuery(this).find("h3 a").attr("href");
return false;
});
// Set species div's hover effect
- jQuery(".ajax").delegate(".species", "hover", function() {
+ jQuery("#content").delegate(".species", "hover", function() {
jQuery(this).toggleClass('browse_item_hover');
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.