Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvanbreda committed Nov 29, 2017
2 parents 39d1161 + 27a32cc commit 789611c
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 47 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
.sass-cache
15 changes: 0 additions & 15 deletions css/default_site.css
Original file line number Diff line number Diff line change
Expand Up @@ -356,25 +356,10 @@ li.ui-state-error {
background: url(../images/desc.gif) no-repeat right;
}

table tr.odd {
background-color: #eeeeee;
border: none;
}

.report-grid .ui-widget td {
padding: 0 0.3em;
}

.report-grid .single img {
width: 100px;
margin: 2px;
}

.report-grid .multi img {
width: 50px;
margin: 1px;
}

#verification-grid .report-grid .single img {
width: 40px;
}
Expand Down
24 changes: 24 additions & 0 deletions css/theme-bootstrap-3.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions css/theme-bootstrap-3.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 58 additions & 8 deletions css/theme-generic.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions css/theme-generic.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions js/speciesFilterPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

(function ($) {
'use strict';

function applySpeciesFilterMode(gridId, type, group_id, nameFilterMode) {
var currentFilter;
//get the filter we are going to use. Use a) the provided parameter, when loading from a cookie,
// Get the filter we are going to use. Use a) the provided parameter, when loading from a cookie,
// b) the default name filter, when not in cookie and loading for first time, or c) the one selected on the form.
if (typeof nameFilterMode==='undefined') {
nameFilterMode = $('#filter-name').length===0 ? '$defaultFilterMode' : $('#filter-name').val();
if (typeof nameFilterMode === 'undefined') {
nameFilterMode = $('#filter-name').length === 0 ? '$defaultFilterMode' : $('#filter-name').val();
}
currentFilter=$.extend({}, indiciaData.speciesChecklistFilterOpts.nameFilter[nameFilterMode]);
// User preferred groups option should not be available if no groups set.
Expand All @@ -35,7 +35,7 @@
break;
case 'default':
$('.scTaxonCell input').unsetExtraParams('taxon_group_id');
break;
break;
case 'user':
currentFilter.taxon_group_id = JSON.stringify(indiciaData.usersPreferredTaxonGroups);
break;
Expand All @@ -49,7 +49,7 @@
$('.scTaxonCell input').unsetExtraParams("language");
$('.scTaxonCell input').unsetExtraParams("preferred");
$('.scTaxonCell input').unsetExtraParams("synonyms");
//Tell the system to use the current filter.
// Tell the system to use the current filter.
indiciaData['taxonExtraParams-' + gridId] = currentFilter;
$('.scTaxonCell input').setExtraParams(currentFilter);
// store in cookie
Expand All @@ -59,7 +59,7 @@
name_filter: nameFilterMode
}));
}

function applyButtonClicked(gridId) {
if ($('#filter-mode-default:checked').length>0) {
applySpeciesFilterMode(gridId, 'default');
Expand All @@ -70,7 +70,7 @@
}
$.fancybox.close();
}

function buildPopupFormHtml(userFilter) {
var t = indiciaData.lang.speciesChecklistFilter;
var defaultChecked = '';
Expand All @@ -94,10 +94,10 @@
'<label class="auto"><input type="radio" name="filter-mode" id="filter-mode-default"' + defaultChecked + '/>' +
indiciaData.speciesChecklistFilterOpts.defaultOptionLabel + '</label>';
if (typeof indiciaData.usersPreferredTaxonGroups !== "undefined") {
popupFormHtml += '<label class="auto"><input type="radio" name="filter-mode" id="filter-mode-user"' + userChecked+ '/>' +
popupFormHtml += '<label class="auto"><input type="radio" name="filter-mode" id="filter-mode-user"' + userChecked+ '/>' +
t.preferredGroupsOptionLabel+ '</label>';
}
popupFormHtml += '<label class="auto"><input type="radio" name="filter-mode" id="filter-mode-selected"'+selectedChecked+'/>' +
popupFormHtml += '<label class="auto"><input type="radio" name="filter-mode" id="filter-mode-selected"'+selectedChecked+'/>' +
t.singleGroupOptionLabel + '</label>' +
'<select name="filter-group" id="filter-group"></select>' +
'<label class="auto" for="filter-name">' + t.chooseSpeciesLabel + '</label>' +
Expand All @@ -111,7 +111,7 @@
'<button type="button" class="default-button" id="filter-popup-cancel">' + t.cancel + '</button></div>';
return popupFormHtml;
}

function speciesFilterButtonClicked() {
var gridId = $(this).closest('table').attr('id');
var userFilter = $.cookie('user_selected_taxon_filter');
Expand All @@ -123,9 +123,9 @@
popupFormHtml = buildPopupFormHtml(userFilter);
$.fancybox(popupFormHtml);
// Fill in the list of available taxon groups to choose from.
$.getJSON(indiciaData.warehouseUrl +
$.getJSON(indiciaData.warehouseUrl +
'index.php/services/report/requestReport?report=library/taxon_groups/taxon_groups_used_in_checklist.xml&reportSource=local&mode=json' +
'&taxon_list_id=' + indiciaData.speciesChecklistFilterOpts.taxon_list_id +
'&taxon_list_id=' + indiciaData.speciesChecklistFilterOpts.taxon_list_id +
'&auth_token=' + indiciaData.read.auth_token + '&nonce=' + indiciaData.read.nonce + '&callback=?', function(data) {
$.each(data, function(idx, item) {
var selected = userFilter!==null && (item.id===userFilter.group_id) ? ' selected="selected"' : '';
Expand All @@ -134,8 +134,8 @@
});
// By defult assume that the filter mode is the default one
var filterMode = indiciaData.speciesChecklistFilterOpts.defaultFilterMode;
// If the cookie is present and it holds one of the name type filters it means the last time the user used the
// screen they selected to filter for a particular name type, so auto-select those previous settings when the user
// If the cookie is present and it holds one of the name type filters it means the last time the user used the
// screen they selected to filter for a particular name type, so auto-select those previous settings when the user
// opens the popup (overriding the defaultFilterMode)
if(userFilter) {
if (typeof indiciaData.speciesChecklistFilterOpts.nameFilter[userFilter.name_filter] !== "undefined") {
Expand All @@ -158,11 +158,11 @@
$('#filter-popup-apply').click(function() { applyButtonClicked(gridId); });
$('#filter-popup-cancel').click(jQuery.fancybox.close);
}

/* Public functions */

/**
*
*
* @param string gridId
*/
indiciaFns.applyInitialSpeciesFilterMode = function(gridId) {
Expand All @@ -173,7 +173,7 @@
applySpeciesFilterMode(gridId, userFilter.type, userFilter.group_id, userFilter.name_filter);
}
};

/**
* Sets up the click handled on the filter button in the column title of the species column of the species checklist
* input grid.
Expand All @@ -182,5 +182,5 @@
indiciaFns.setupSpeciesFilterPopup = function(gridId) {
$('#' + gridId + ' .species-filter').click(speciesFilterButtonClicked);
};

}(jQuery));
5 changes: 5 additions & 0 deletions scss/bootstrap-3/_form-controls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@
&:last-child {
margin-bottom: $form-group-margin-bottom;
}
input[type="checkbox"] {
margin-left: 8px;
margin-right: 8px;
font-size: 150%;
}
}
25 changes: 25 additions & 0 deletions scss/common/_report-grid.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
table.report-grid {
tr {
/* Odd row colouration */
&.odd {
background-color: #eeeeee;
border: none;
}
/* Workflow related styling */
&.overdue {
border-left: solid 8px $colour-range-1-a;
}
&.overdue-soon {
border-left: solid 8px $colour-range-1-b;
}
}
/* Sizing of thumbnails in image columns */
.single img {
width: 100px;
margin: 2px;
}
.multi img {
width: 50px;
margin: 1px;
}
}
5 changes: 5 additions & 0 deletions scss/common/_variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Accessible colour ranges from colorbrewer */
$colour-range-1-a: #d7191c;
$colour-range-1-b: #fdae61;
$colour-range-1-c: #abd9e9;
$colour-range-1-d: #2c7bb6;
2 changes: 2 additions & 0 deletions scss/theme-bootstrap-3.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Theme extension to the default_site.css file which provides Bootstrap 3 optimised style output */
@import "common/variables";
@import "bootstrap-3/variables";
@import "common/report-grid";
@import "bootstrap-3/form-controls";
2 changes: 2 additions & 0 deletions scss/theme-generic.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Theme extension to the default_site.css file which provides the default Indicia style output */
@import "common/variables";
@import "generic/variables";
@import "common/report-grid";
@import "generic/form-controls";

0 comments on commit 789611c

Please sign in to comment.