Commit 063cffef authored by Matija Obreza's avatar Matija Obreza

Use 2016 GUI by default

parent 4ae89628
This diff is collapsed.
...@@ -46,7 +46,7 @@ import com.fasterxml.jackson.databind.JsonMappingException; ...@@ -46,7 +46,7 @@ import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
@Controller @Controller
@RequestMapping("/explore/0/charts") @RequestMapping("/explore/charts")
public class ChartsController extends BaseController { public class ChartsController extends BaseController {
@Autowired @Autowired
...@@ -78,7 +78,7 @@ public class ChartsController extends BaseController { ...@@ -78,7 +78,7 @@ public class ChartsController extends BaseController {
return "/charts/map"; return "/charts/map";
} }
@RequestMapping(value = "data/country-collection-size", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE }) @RequestMapping(value = "/data/country-collection-size", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })
@ResponseBody @ResponseBody
public List<Map<String, Object>> accessionsCollection(@RequestParam(value = "filter", required = false, defaultValue = "{}") String jsonFilter) public List<Map<String, Object>> accessionsCollection(@RequestParam(value = "filter", required = false, defaultValue = "{}") String jsonFilter)
throws JsonParseException, JsonMappingException, IOException, SearchException { throws JsonParseException, JsonMappingException, IOException, SearchException {
......
...@@ -81,7 +81,7 @@ i18n.content-not-translated=This content is not available in your language. Plea ...@@ -81,7 +81,7 @@ i18n.content-not-translated=This content is not available in your language. Plea
data.error.404=The data you requested was not found in the system. data.error.404=The data you requested was not found in the system.
page.rendertime=Processing this page took {0}ms. page.rendertime=Processing this page took {0}ms.
footer.copyright-statement=&copy; 2013 - 2015 Data Providers and the Crop Trust footer.copyright-statement=&copy; 2013 - 2016 Data Providers and the Crop Trust
menu.home=Home menu.home=Home
menu.browse=Browse menu.browse=Browse
......
...@@ -61,7 +61,7 @@ google.analytics.account= ...@@ -61,7 +61,7 @@ google.analytics.account=
# CDN # CDN
cdn.server=${base.url} cdn.server=${base.url}
cdn.base=${cdn.server} cdn.base=${cdn.server}
cdn.flags.url=${cdn.base}/html/0/images/flags cdn.flags.url=${cdn.base}/html/1/images/flags
# Content creation on startup # Content creation on startup
......
This diff is collapsed.
This diff is collapsed.
'use strict';
if (typeof Object.create !== 'function') {
Object.create = function(object) {
var F = function() {
};
F.prototype = object;
return new F();
};
}
(function($, window, document, undefined) {
var TagComponent = {
init : function(options) {
this.options = $.extend({}, $.fn.activateTag.options, options);
this.buttonId = this.options.buttonId;
this.selectId = this.options.selectId;
this.containerId = this.options.containerId;
this.hiddenId = this.options.hiddenId;
this._bindListeners();
},
_bindListeners : function() {
var scope = this;
scope._addTagsListener();
scope._removeTagsListener();
},
_addTagsListener : function() {
var scope = this;
$(document).on(
'click',
this.buttonId,
function() {
var selectedOption = $(scope.selectId).find(':selected');
var name = selectedOption.text();
var id = selectedOption.val();
var tagHtml = '<div data-id="' + id + '" data-name="' + name + '" class="alert alert-info inline> ' + name +
' <span class="deleteTag close">&times;</span>' + '<input type="hidden" name="' + scope.hiddenId + '[0][id]" value="' + id + '" /></div>';
$(scope.containerId).append(tagHtml);
selectedOption.remove();
if ($(scope.selectId).find('option').length === 0) {
$(scope.selectId).parent().css('display', 'none');
}
scope._reindexHiddenFields(scope.hiddenId, scope.containerId);
});
},
_removeTagsListener : function() {
var scope = this;
$(document).on('click', '.deleteTag', function() {
var element = $(this);
var parent = element.parent();
var id = parent.attr('data-id');
var name = parent.attr('data-name');
var selectElement = $(scope.selectId);
if (selectElement.parent().css('display') === 'none') {
selectElement.parent().css('display', 'block');
}
$('<option></option>', {
value : id,
text : name
}).appendTo(selectElement);
parent.remove();
scope._reindexHiddenFields(scope.hiddenId, scope.containerId);
});
},
_reindexHiddenFields : function(hiddenId, containerId) {
var hiddenFields = $(containerId).find('input[type="hidden"]');
$.each(hiddenFields, function(index, element) {
var name = hiddenId + '[' + index + '][id]';
$(element).attr('name', name);
});
}
};
/* === plugin method === */
$.fn.activateTag = function(options) {
return this.each(function() {
var tagComponent = Object.create(TagComponent);
tagComponent.init(options);
});
};
/* === default options === */
$.fn.activateTag.options = {
buttonId : '#addOrganizationButton',
selectId : '#availableOrganizations',
containerId : '#addedOrganizations',
hiddenId : 'organizations'
};
})($, window, document);
$(document).ready(function() {
$(document).activateTag({
buttonId : '#addOrganizationButton',
selectId : '#availableOrganizations',
containerId : '#addedOrganizations',
hiddenId : 'organizations'
});
$(document).activateTag({
buttonId : '#addUserGroupsButton',
selectId : '#availableUserGroups',
containerId : '#addedUserGroups',
hiddenId : 'userGroups'
});
$('body').on('click', 'a[id*="invite"]', function() {
var inviteId = $(this).data('invite'), countNetwork = $('input[id*="networks"]').length;
$(this).prev().remove();
$(this).replaceWith('<span class="btn disabled">' + $(this).text() + '</span>');