r1776 - in trunk: wao-persistence/src/main/java/fr/ifremer/wao wao-web/src/main/java/fr/ifremer/wao/web wao-web/src/main/webapp wao-web/src/main/webapp/WEB-INF/content/obsmer wao-web/src/main/webapp/WEB-INF/decorators wao-web/src/main/webapp/bootstrap-2.3.1
Author: bleny Date: 2014-03-31 14:41:30 +0200 (Mon, 31 Mar 2014) New Revision: 1776 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1776 Log: refs #4483 add bootstrap-popover review layout for dcf5 codes Added: trunk/wao-web/src/main/webapp/bootstrap-2.3.1/ trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-popover.js trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-tooltip.js trunk/wao-web/src/main/webapp/moment-js-2.5.1/ trunk/wao-web/src/main/webapp/select2-3.4.5/ trunk/wao-web/src/main/webapp/wao.css trunk/wao-web/src/main/webapp/wao.js Removed: trunk/wao-web/src/main/webapp/css/ trunk/wao-web/src/main/webapp/js/ Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoApplicationConfig.java trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoApplicationConfigOption.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout-login.jsp trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoApplicationConfig.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoApplicationConfig.java 2014-03-31 11:12:10 UTC (rev 1775) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoApplicationConfig.java 2014-03-31 12:41:30 UTC (rev 1776) @@ -114,4 +114,8 @@ public File getLogConfigurationFile() { return applicationConfig.getOptionAsFile(WaoApplicationConfigOption.LOG_CONFIGURATION_FILE.key); } + + public boolean isGoogleAnalyticsEnabled() { + return applicationConfig.getOptionAsBoolean(WaoApplicationConfigOption.GOOGLE_ANALYTICS_ENABLED.key); + } } Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoApplicationConfigOption.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoApplicationConfigOption.java 2014-03-31 11:12:10 UTC (rev 1775) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoApplicationConfigOption.java 2014-03-31 12:41:30 UTC (rev 1776) @@ -59,8 +59,14 @@ "logConfigurationFile", "Chemin vers le fichier de configuration des journaux", null, - String.class); + String.class), + GOOGLE_ANALYTICS_ENABLED( + "googleAnalyticsEnabled", + "S'il faut activer les statistitques Google Analytics", + "false", + Boolean.class); + protected final String key; protected final String description; protected final Class<?> type; Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java 2014-03-31 11:12:10 UTC (rev 1775) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java 2014-03-31 12:41:30 UTC (rev 1776) @@ -66,4 +66,8 @@ return t("wao.ui.misc.month", date); } + public boolean isGoogleAnalyticsEnabled() { + return applicationConfig.isGoogleAnalyticsEnabled(); + } + } Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-03-31 11:12:10 UTC (rev 1775) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-03-31 12:41:30 UTC (rev 1776) @@ -303,9 +303,7 @@ <td class="only-in-full-view"><s:property value="fishingZonesInfos" /></td> <td class="only-in-full-view"> <s:iterator value="dcf5CodesAndDescriptions"> - <span> - <s:property value="key"/> (<s:property value="value"/>) - </span> + <abbr title="<s:property value="value"/>"><s:property value="key"/></abbr> </s:iterator> </td> <td class="only-in-full-view"><s:property value="professionMeshSize" /></td> @@ -317,9 +315,7 @@ <td class="only-in-full-view"><s:property value="%{formatMonth(periodEnd)}" /></td> <td class="only-in-compact-view"> <s:iterator value="dcf5CodesAndDescriptions"> - <span> - <s:property value="key"/> (<s:property value="value"/>) - </span> + <abbr title="<s:property value="value"/>"><s:property value="key"/></abbr> </s:iterator> <s:property value="professionDescriptionWithoutDCF5" /> </td> Modified: trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout-login.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout-login.jsp 2014-03-31 11:12:10 UTC (rev 1775) +++ trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout-login.jsp 2014-03-31 12:41:30 UTC (rev 1776) @@ -30,12 +30,9 @@ <title><decorator:title default="Wao"/> - Wao</title> <sj:head locale="fr" jqueryui="true" loadAtOnce="true" jquerytheme="start" /> <sb:head /> - <script type="text/javascript" src="<s:url value='/js/select2/select2.min.js' />"></script> - <script type="text/javascript" src="<s:url value='/js/select2/select2_locale_fr.js' />"></script> - <script type="text/javascript" src="<s:url value='/js/wao.js' />"></script> - <link rel="stylesheet" type="text/css" href="<s:url value='/css/select2/select2.css' />" /> - <link rel="stylesheet" type="text/css" href="<s:url value='/css/wao.css' />" media="all" /> - <link rel="stylesheet" type="text/css" href="<s:url value='/css/wao-screen.css' />" media="screen"> + <script type="text/javascript" src="<s:url value='/wao.js' />"></script> + <link rel="stylesheet" type="text/css" href="<s:url value='/wao.css' />" media="all" /> + <link rel="stylesheet" type="text/css" href="<s:url value='/wao-screen.css' />" media="screen"> <decorator:head /> </head> Modified: trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-03-31 11:12:10 UTC (rev 1775) +++ trunk/wao-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2014-03-31 12:41:30 UTC (rev 1776) @@ -30,14 +30,16 @@ <title><decorator:title default="Wao"/> - Wao</title> <sj:head locale="fr" loadFromGoogle="true" jqueryui="true" /> <sb:head /> - <script type="text/javascript" src="<s:url value='/js/moment-js-2.5.1/moment-with-langs.js' />"></script> - <script type="text/javascript" src="<s:url value='/js/select2-3.4.5/select2.min.js' />"></script> - <script type="text/javascript" src="<s:url value='/js/select2-3.4.5/select2_locale_fr.js' />"></script> - <script type="text/javascript" src="<s:url value='/js/wao.js' />"></script> - <link rel="stylesheet" type="text/css" href="<s:url value='/js/select2-3.4.5/select2.css' />" /> - <link rel="stylesheet" type="text/css" href="<s:url value='/js/select2-3.4.5/select2-bootstrap.css' />" /> - <link rel="stylesheet" type="text/css" href="<s:url value='/css/wao.css' />" media="all" /> - <link rel="stylesheet" type="text/css" href="<s:url value='/css/wao-screen.css' />" media="screen"> + <script type="text/javascript" src="<s:url value="/moment-js-2.5.1/moment-with-langs.js" />"></script> + <script type="text/javascript" src="<s:url value="/select2-3.4.5/select2.min.js" />"></script> + <script type="text/javascript" src="<s:url value="/select2-3.4.5/select2_locale_fr.js" />"></script> + <script type="text/javascript" src="<s:url value="/bootstrap-2.3.1/bootstrap-tooltip.js" />"></script> + <script type="text/javascript" src="<s:url value="/bootstrap-2.3.1/bootstrap-popover.js" />"></script> + <script type="text/javascript" src="<s:url value="/wao.js" />"></script> + <link rel="stylesheet" type="text/css" href="<s:url value="/select2-3.4.5/select2.css" />" /> + <link rel="stylesheet" type="text/css" href="<s:url value="/select2-3.4.5/select2-bootstrap.css" />" /> + <link rel="stylesheet" type="text/css" href="<s:url value="/wao.css" />" media="all" /> + <link rel="stylesheet" type="text/css" href="<s:url value="/wao-screen.css" />" media="screen"> <decorator:head /> </head> @@ -225,5 +227,22 @@ </div> </s:if> + <s:if test="googleAnalyticsEnabled"> + <!-- Script for Google Analytics --> + <script> + + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-12982015-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + + </script> + </s:if> + </body> </html> Added: trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-popover.js =================================================================== --- trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-popover.js (rev 0) +++ trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-popover.js 2014-03-31 12:41:30 UTC (rev 1776) @@ -0,0 +1,114 @@ +/* =========================================================== + * bootstrap-popover.js v2.3.1 + * http://twitter.github.com/bootstrap/javascript.html#popovers + * =========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* POPOVER PUBLIC CLASS DEFINITION + * =============================== */ + + var Popover = function (element, options) { + this.init('popover', element, options) + } + + + /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js + ========================================== */ + + Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { + + constructor: Popover + + , setContent: function () { + var $tip = this.tip() + , title = this.getTitle() + , content = this.getContent() + + $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) + $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) + + $tip.removeClass('fade top bottom left right in') + } + + , hasContent: function () { + return this.getTitle() || this.getContent() + } + + , getContent: function () { + var content + , $e = this.$element + , o = this.options + + content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) + || $e.attr('data-content') + + return content + } + + , tip: function () { + if (!this.$tip) { + this.$tip = $(this.options.template) + } + return this.$tip + } + + , destroy: function () { + this.hide().$element.off('.' + this.type).removeData(this.type) + } + + }) + + + /* POPOVER PLUGIN DEFINITION + * ======================= */ + + var old = $.fn.popover + + $.fn.popover = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('popover') + , options = typeof option == 'object' && option + if (!data) $this.data('popover', (data = new Popover(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.popover.Constructor = Popover + + $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { + placement: 'right' + , trigger: 'click' + , content: '' + , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' + }) + + + /* POPOVER NO CONFLICT + * =================== */ + + $.fn.popover.noConflict = function () { + $.fn.popover = old + return this + } + +}(window.jQuery); Added: trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-tooltip.js =================================================================== --- trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-tooltip.js (rev 0) +++ trunk/wao-web/src/main/webapp/bootstrap-2.3.1/bootstrap-tooltip.js 2014-03-31 12:41:30 UTC (rev 1776) @@ -0,0 +1,361 @@ +/* =========================================================== + * bootstrap-tooltip.js v2.3.1 + * http://twitter.github.com/bootstrap/javascript.html#tooltips + * Inspired by the original jQuery.tipsy by Jason Frame + * =========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* TOOLTIP PUBLIC CLASS DEFINITION + * =============================== */ + + var Tooltip = function (element, options) { + this.init('tooltip', element, options) + } + + Tooltip.prototype = { + + constructor: Tooltip + + , init: function (type, element, options) { + var eventIn + , eventOut + , triggers + , trigger + , i + + this.type = type + this.$element = $(element) + this.options = this.getOptions(options) + this.enabled = true + + triggers = this.options.trigger.split(' ') + + for (i = triggers.length; i--;) { + trigger = triggers[i] + if (trigger == 'click') { + this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) + } else if (trigger != 'manual') { + eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' + eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' + this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) + this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) + } + } + + this.options.selector ? + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : + this.fixTitle() + } + + , getOptions: function (options) { + options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options) + + if (options.delay && typeof options.delay == 'number') { + options.delay = { + show: options.delay + , hide: options.delay + } + } + + return options + } + + , enter: function (e) { + var defaults = $.fn[this.type].defaults + , options = {} + , self + + this._options && $.each(this._options, function (key, value) { + if (defaults[key] != value) options[key] = value + }, this) + + self = $(e.currentTarget)[this.type](options).data(this.type) + + if (!self.options.delay || !self.options.delay.show) return self.show() + + clearTimeout(this.timeout) + self.hoverState = 'in' + this.timeout = setTimeout(function() { + if (self.hoverState == 'in') self.show() + }, self.options.delay.show) + } + + , leave: function (e) { + var self = $(e.currentTarget)[this.type](this._options).data(this.type) + + if (this.timeout) clearTimeout(this.timeout) + if (!self.options.delay || !self.options.delay.hide) return self.hide() + + self.hoverState = 'out' + this.timeout = setTimeout(function() { + if (self.hoverState == 'out') self.hide() + }, self.options.delay.hide) + } + + , show: function () { + var $tip + , pos + , actualWidth + , actualHeight + , placement + , tp + , e = $.Event('show') + + if (this.hasContent() && this.enabled) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $tip = this.tip() + this.setContent() + + if (this.options.animation) { + $tip.addClass('fade') + } + + placement = typeof this.options.placement == 'function' ? + this.options.placement.call(this, $tip[0], this.$element[0]) : + this.options.placement + + $tip + .detach() + .css({ top: 0, left: 0, display: 'block' }) + + this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) + + pos = this.getPosition() + + actualWidth = $tip[0].offsetWidth + actualHeight = $tip[0].offsetHeight + + switch (placement) { + case 'bottom': + tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} + break + case 'top': + tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} + break + case 'left': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} + break + case 'right': + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} + break + } + + this.applyPlacement(tp, placement) + this.$element.trigger('shown') + } + } + + , applyPlacement: function(offset, placement){ + var $tip = this.tip() + , width = $tip[0].offsetWidth + , height = $tip[0].offsetHeight + , actualWidth + , actualHeight + , delta + , replace + + $tip + .offset(offset) + .addClass(placement) + .addClass('in') + + actualWidth = $tip[0].offsetWidth + actualHeight = $tip[0].offsetHeight + + if (placement == 'top' && actualHeight != height) { + offset.top = offset.top + height - actualHeight + replace = true + } + + if (placement == 'bottom' || placement == 'top') { + delta = 0 + + if (offset.left < 0){ + delta = offset.left * -2 + offset.left = 0 + $tip.offset(offset) + actualWidth = $tip[0].offsetWidth + actualHeight = $tip[0].offsetHeight + } + + this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') + } else { + this.replaceArrow(actualHeight - height, actualHeight, 'top') + } + + if (replace) $tip.offset(offset) + } + + , replaceArrow: function(delta, dimension, position){ + this + .arrow() + .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') + } + + , setContent: function () { + var $tip = this.tip() + , title = this.getTitle() + + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) + $tip.removeClass('fade in top bottom left right') + } + + , hide: function () { + var that = this + , $tip = this.tip() + , e = $.Event('hide') + + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + + $tip.removeClass('in') + + function removeWithAnimation() { + var timeout = setTimeout(function () { + $tip.off($.support.transition.end).detach() + }, 500) + + $tip.one($.support.transition.end, function () { + clearTimeout(timeout) + $tip.detach() + }) + } + + $.support.transition && this.$tip.hasClass('fade') ? + removeWithAnimation() : + $tip.detach() + + this.$element.trigger('hidden') + + return this + } + + , fixTitle: function () { + var $e = this.$element + if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { + $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') + } + } + + , hasContent: function () { + return this.getTitle() + } + + , getPosition: function () { + var el = this.$element[0] + return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { + width: el.offsetWidth + , height: el.offsetHeight + }, this.$element.offset()) + } + + , getTitle: function () { + var title + , $e = this.$element + , o = this.options + + title = $e.attr('data-original-title') + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) + + return title + } + + , tip: function () { + return this.$tip = this.$tip || $(this.options.template) + } + + , arrow: function(){ + return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") + } + + , validate: function () { + if (!this.$element[0].parentNode) { + this.hide() + this.$element = null + this.options = null + } + } + + , enable: function () { + this.enabled = true + } + + , disable: function () { + this.enabled = false + } + + , toggleEnabled: function () { + this.enabled = !this.enabled + } + + , toggle: function (e) { + var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this + self.tip().hasClass('in') ? self.hide() : self.show() + } + + , destroy: function () { + this.hide().$element.off('.' + this.type).removeData(this.type) + } + + } + + + /* TOOLTIP PLUGIN DEFINITION + * ========================= */ + + var old = $.fn.tooltip + + $.fn.tooltip = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('tooltip') + , options = typeof option == 'object' && option + if (!data) $this.data('tooltip', (data = new Tooltip(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.tooltip.Constructor = Tooltip + + $.fn.tooltip.defaults = { + animation: true + , placement: 'top' + , selector: false + , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' + , trigger: 'hover focus' + , title: '' + , delay: 0 + , html: false + , container: false + } + + + /* TOOLTIP NO CONFLICT + * =================== */ + + $.fn.tooltip.noConflict = function () { + $.fn.tooltip = old + return this + } + +}(window.jQuery); Copied: trunk/wao-web/src/main/webapp/wao.css (from rev 1775, trunk/wao-web/src/main/webapp/css/wao.css) =================================================================== --- trunk/wao-web/src/main/webapp/wao.css (rev 0) +++ trunk/wao-web/src/main/webapp/wao.css 2014-03-31 12:41:30 UTC (rev 1776) @@ -0,0 +1,262 @@ +/* + * #%L + * Wao :: Web + * %% + * Copyright (C) 2009 - 2014 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +/****************************************************************************** + * Personnalisation de Bootstrap + *****************************************************************************/ + +/* On surcharge left: 0px par left: 0% car ça pose problème pour Firefox qui place le menu complètement à gauche de la fenêtre et pas en dessous du bouton */ +.dropdown-menu { + left: 0%; +} + +legend+.control-group { + margin-top: 0px; +} + +/****************************************************************************** + * Des classes à usage transverse + *****************************************************************************/ + +.highlight { + background-color: #ffff99; +} + +/* pour représenter qu'on est à l'instant présent */ +.now { + background-color: #ffff99; +} + +/* pour représente qu'une entité (société, utilisateur) est inactive */ +.inactive { + text-decoration: line-through; +} + +/** + * Class permettant de faire faire une rotation à un élément de 90° sur la gauche. + * Ça peut par exemeple servir pour un th, afin de gagner de la largeur + * + * voir http://stackoverflow.com/questions/15806925/how-to-rotate-text-left-90-degre... + */ +.rotate { + display: block; + -moz-transform: rotate(-90.0deg); /* FF3.5+ */ + -o-transform: rotate(-90.0deg); /* Opera 10.5 */ + -webkit-transform: rotate(-90.0deg); /* Saf3.1+, Chrome */ + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)"; /* IE8 */ + +} + +td.ellipsis { + max-width: 100px; +} + +.ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +td.ellipsis:hover { + overflow: visible; + white-space: normal; + text-overflow: initial; +} + +.compact-view .only-in-full-view, +.full-view .only-in-compact-view, +.show-estimated .real, +.show-real .estimated { + display: none; +} + +.lower-than-expected { + color : red; +} + +.higher-than-expected { + color : green; +} + + +/****************************************************************************** + * Styles globaux à l'application + *****************************************************************************/ + +/** + * Le style du layout + */ + +footer { + text-align: center; + margin-left: auto; + margin-right: auto; +} + +footer ul { + list-style-type: none; +} + +footer ul li { + display: inline; + margin-left: 20px; +} + +main { + max-width: 800px; + margin-left: auto; + margin-right: auto; +} + +main.large { + width: 100%; + max-width: 100%; + margin-left: 10px; + margin-right: 10px; +} + +/** + * Le style général des formulaires + */ + +.form-actions { + margin-top: 75px; +} + +textarea { + width: 100%; + min-height: 150px; +} + +.form-actions button[type="submit"] { + float: right; +} + +th.actions, td.actions { + white-space: nowrap; +} + +.large-table, .large-table thead th { + border: solid 1px #aaaaaa; +} + +.large-table li { + list-style-type: none; +} + +.large-table tbody th, .large-table td { + border: solid 1px #aaaaaa; + border-left-style: dashed; + border-right-style: dashed; + padding: 2px; +} + +/** + * Les filtres + */ + +form.filters-form { + width: auto; + margin-left: auto; + margin-right: auto; +} + +form.filters-form .control-group { + float: left; + margin-left: 5px; + margin-right: 5px; +} + +form.filters-form .form-actions { + clear: both; + margin-top: 0px; + border: none; + background-color: white; +} + +/****************************************************************************** + * Styles spécifiques pour certaines pages de l'appli + *****************************************************************************/ + +#expectedObservationsByMonthsTable th { + white-space: nowrap; +} + +#expectedObservationsByMonthsTable input { + width: 40px; + text-align: right; +} + +form#login button[type="submit"] { + margin-left: 180px; +} + +#cgu { + overflow-y: auto; + max-height: 300px; + padding: 5px; + border: solid 5px #f2f2f2; + margin-bottom: 20px; +} + +table.sampling-plan tr.facade-row { + color: white; + background-color: seagreen; + background-color: darkslategrey; + font-size: 150%; + line-height: 150%; +} + +table.sampling-plan tr.sector-row { + color: white; + background-color: darkcyan; + background-color: darkseagreen; + font-size: 120%; + line-height: 120%; +} + +table.sampling-plan tr.facade-row th, +table.sampling-plan tr.sector-row th { + text-align: left; + padding: 10px; +} + +table.sampling-plan tbody tr.sample-row-row:nth-child(2n) { + background-color: #e6e6e6; +} + +table.sampling-plan tbody tr.sample-row-row:hover { + background-color: tan; + background-color: antiquewhite; + background-color: palegoldenrod; + background-color: papayawhip; + background-color: wheat; + background-color: beige; +} + +table.sampling-plan td.effort { + text-align: center; +} + +table.sampling-plan .actions .dropdown-menu { + left: -200px +} + Copied: trunk/wao-web/src/main/webapp/wao.js (from rev 1774, trunk/wao-web/src/main/webapp/js/wao.js) =================================================================== --- trunk/wao-web/src/main/webapp/wao.js (rev 0) +++ trunk/wao-web/src/main/webapp/wao.js 2014-03-31 12:41:30 UTC (rev 1776) @@ -0,0 +1,129 @@ +/* + * #%L + * Wao :: Web + * %% + * Copyright (C) 2009 - 2014 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +var SampleRowsFilterModel = function (filterValuesUrl) { + + var self = this; + + this.filterValues = {}; + this.filterValuesUrl = filterValuesUrl; + + this.setFilterValues = function (filterValues) { + this.filterValues = filterValues; + $(this).trigger('updated'); + }; + + this.updateFilterValues = function(filter) { + var successCallback = function (data) { + self.setFilterValues(data.filterValues) + }; + $.get(this.filterValuesUrl, filter, successCallback); + } + +}; + +var SampleRowsFilterView = function (sampleRowsFilterModel, $filtersForm) { + + var self = this; + + this.model = sampleRowsFilterModel; + this.$filtersForm = $filtersForm; + this.$selects = $filtersForm.find('select'); + this.$inputs = $filtersForm.find('input[type=text]'); + + this.getFilter = function () { + var filter = {}; + this.$selects.each(function (index, select) { + var $select = $(select); + var parameterName = $select.prop('name'); + var parameterValues = []; + $select.find('option:selected').each(function (index, option) { + parameterValues.push($(option).prop('value')); + }); + filter[parameterName] = parameterValues; + }); + this.$inputs.each(function (index, input) { + var $input = $(input); + var parameterName = $(input).prop('name'); + var parameterValue = $(input).prop('value'); + filter[parameterName] = parameterValue; + }); + return filter; + }; + + this.refreshFilterValues = function() { + // store options selected by user to re-select them after update + var filter = this.getFilter(); + var filterValues = this.model.filterValues; + this.$selects.each(function (index, select) { + var $select = $(select).empty(); + var name = $select.prop('name'); + // FIXME brendan 26/03/14 should be data-binding but freemarker break the template :-( + var binding = $select.attr('databinding'); + var options = filterValues[binding]; + $.each(options, function (index, option) { + var optionHtml = '<option value="' + option.value + '">' + option.label + '</option>'; + $select.append(optionHtml); + }); + var selectedOptions = filter[name]; + $.each(selectedOptions, function (index, selectedOption) { + $select.find('option[value="' + selectedOption + '"]').prop('selected', 'selected'); + }); + }); + this.$filtersForm.effect( "highlight", "slow" ); + } + + $(this.model).on('updated', function () { + self.refreshFilterValues(); + }); + +}; + +var SampleRowsFilterController = function (filterValuesUrl, $filtersForm) { + + var self = this; + + this.model = new SampleRowsFilterModel(filterValuesUrl); + this.view = new SampleRowsFilterView(this.model, $filtersForm); + + this.onFilterChange = function () { + var filter = this.view.getFilter(); + this.model.updateFilterValues(filter); + }; + + this.init = function () { + this.view.$selects.blur(function () { + self.onFilterChange(); + }); + this.view.$inputs.blur(function () { + self.onFilterChange(); + }); + } + +}; + +$(document).ready(function () { + + // $('select').select2(); + + $('a[data-toggle="popover"]').popover(); + +}); \ No newline at end of file
participants (1)
-
bleny@users.forge.codelutin.com