aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/admin.js6
-rw-r--r--app/assets/javascripts/admin/bootstrap-collapse.js138
-rw-r--r--app/assets/javascripts/admin/bootstrap-tab.js130
-rw-r--r--app/assets/javascripts/admin/holidays.js46
-rw-r--r--app/assets/javascripts/bootstrap-collapse.js138
-rw-r--r--app/assets/javascripts/bootstrap-tab.js130
-rw-r--r--app/assets/stylesheets/admin.scss35
-rw-r--r--app/assets/stylesheets/main.scss31
-rw-r--r--app/assets/stylesheets/responsive/_new_request_layout.scss42
-rw-r--r--app/assets/stylesheets/responsive/_new_request_style.scss7
10 files changed, 113 insertions, 590 deletions
diff --git a/app/assets/javascripts/admin.js b/app/assets/javascripts/admin.js
index 4925a65a4..9402f7f6c 100644
--- a/app/assets/javascripts/admin.js
+++ b/app/assets/javascripts/admin.js
@@ -3,8 +3,10 @@
//= require jquery.ui.tabs
//= require jquery.ui.sortable
//= require jquery.ui.effect-highlight
-//= require admin/bootstrap-collapse
-//= require admin/bootstrap-tab
+//= require bootstrap-collapse
+//= require bootstrap-tab
+//= require bootstrap-dropdown
//= require admin/admin
//= require admin/category-order
+//= require admin/holidays
//= require jquery_ujs
diff --git a/app/assets/javascripts/admin/bootstrap-collapse.js b/app/assets/javascripts/admin/bootstrap-collapse.js
deleted file mode 100644
index 9a364468b..000000000
--- a/app/assets/javascripts/admin/bootstrap-collapse.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/* =============================================================
- * bootstrap-collapse.js v2.0.2
- * http://twitter.github.com/bootstrap/javascript.html#collapse
- * =============================================================
- * 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"
-
- var Collapse = function ( element, options ) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.collapse.defaults, options)
-
- if (this.options["parent"]) {
- this.$parent = $(this.options["parent"])
- }
-
- this.options.toggle && this.toggle()
- }
-
- Collapse.prototype = {
-
- constructor: Collapse
-
- , dimension: function () {
- var hasWidth = this.$element.hasClass('width')
- return hasWidth ? 'width' : 'height'
- }
-
- , show: function () {
- var dimension = this.dimension()
- , scroll = $.camelCase(['scroll', dimension].join('-'))
- , actives = this.$parent && this.$parent.find('.in')
- , hasData
-
- if (actives && actives.length) {
- hasData = actives.data('collapse')
- actives.collapse('hide')
- hasData || actives.data('collapse', null)
- }
-
- this.$element[dimension](0)
- this.transition('addClass', 'show', 'shown')
- this.$element[dimension](this.$element[0][scroll])
-
- }
-
- , hide: function () {
- var dimension = this.dimension()
- this.reset(this.$element[dimension]())
- this.transition('removeClass', 'hide', 'hidden')
- this.$element[dimension](0)
- }
-
- , reset: function ( size ) {
- var dimension = this.dimension()
-
- this.$element
- .removeClass('collapse')
- [dimension](size || 'auto')
- [0].offsetWidth
-
- this.$element[size ? 'addClass' : 'removeClass']('collapse')
-
- return this
- }
-
- , transition: function ( method, startEvent, completeEvent ) {
- var that = this
- , complete = function () {
- if (startEvent == 'show') that.reset()
- that.$element.trigger(completeEvent)
- }
-
- this.$element
- .trigger(startEvent)
- [method]('in')
-
- $.support.transition && this.$element.hasClass('collapse') ?
- this.$element.one($.support.transition.end, complete) :
- complete()
- }
-
- , toggle: function () {
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
- }
-
- }
-
- /* COLLAPSIBLE PLUGIN DEFINITION
- * ============================== */
-
- $.fn.collapse = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('collapse')
- , options = typeof option == 'object' && option
- if (!data) $this.data('collapse', (data = new Collapse(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.collapse.defaults = {
- toggle: true
- }
-
- $.fn.collapse.Constructor = Collapse
-
-
- /* COLLAPSIBLE DATA-API
- * ==================== */
-
- $(function () {
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
- var $this = $(this), href
- , target = $this.attr('data-target')
- || e.preventDefault()
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
- $(target).collapse(option)
- })
- })
-
-}( window.jQuery ); \ No newline at end of file
diff --git a/app/assets/javascripts/admin/bootstrap-tab.js b/app/assets/javascripts/admin/bootstrap-tab.js
deleted file mode 100644
index 26c9ece75..000000000
--- a/app/assets/javascripts/admin/bootstrap-tab.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/* ========================================================
- * bootstrap-tab.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#tabs
- * ========================================================
- * 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"
-
- /* TAB CLASS DEFINITION
- * ==================== */
-
- var Tab = function ( element ) {
- this.element = $(element)
- }
-
- Tab.prototype = {
-
- constructor: Tab
-
- , show: function () {
- var $this = this.element
- , $ul = $this.closest('ul:not(.dropdown-menu)')
- , selector = $this.attr('data-target')
- , previous
- , $target
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- if ( $this.parent('li').hasClass('active') ) return
-
- previous = $ul.find('.active a').last()[0]
-
- $this.trigger({
- type: 'show'
- , relatedTarget: previous
- })
-
- $target = $(selector)
-
- this.activate($this.parent('li'), $ul)
- this.activate($target, $target.parent(), function () {
- $this.trigger({
- type: 'shown'
- , relatedTarget: previous
- })
- })
- }
-
- , activate: function ( element, container, callback) {
- var $active = container.find('> .active')
- , transition = callback
- && $.support.transition
- && $active.hasClass('fade')
-
- function next() {
- $active
- .removeClass('active')
- .find('> .dropdown-menu > .active')
- .removeClass('active')
-
- element.addClass('active')
-
- if (transition) {
- element[0].offsetWidth // reflow for transition
- element.addClass('in')
- } else {
- element.removeClass('fade')
- }
-
- if ( element.parent('.dropdown-menu') ) {
- element.closest('li.dropdown').addClass('active')
- }
-
- callback && callback()
- }
-
- transition ?
- $active.one($.support.transition.end, next) :
- next()
-
- $active.removeClass('in')
- }
- }
-
-
- /* TAB PLUGIN DEFINITION
- * ===================== */
-
- $.fn.tab = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('tab')
- if (!data) $this.data('tab', (data = new Tab(this)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tab.Constructor = Tab
-
-
- /* TAB DATA-API
- * ============ */
-
- $(function () {
- $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
- e.preventDefault()
- $(this).tab('show')
- })
- })
-
-}( window.jQuery ); \ No newline at end of file
diff --git a/app/assets/javascripts/admin/holidays.js b/app/assets/javascripts/admin/holidays.js
new file mode 100644
index 000000000..55eae9e2a
--- /dev/null
+++ b/app/assets/javascripts/admin/holidays.js
@@ -0,0 +1,46 @@
+$(function() {
+
+ // New button loads the 'new' form via AJAX
+ $('#new-holiday-button').click(function(){
+ var new_call = $.ajax({ type: 'GET', url: $(this).attr('href')});
+ new_call.done(function(response) {
+ $('#existing-holidays').before(response);
+ });
+ return false;
+
+ });
+
+ // Each edit button loads the 'edit' form for that holiday via AJAX
+ $('.holiday').each(function(index){
+ var holiday_row = $(this);
+ var edit_button = holiday_row.find('.edit-button');
+ edit_button.click(function(){
+ var edit_call = $.ajax({ type: 'GET', url: holiday_row.data('target') });
+ edit_call.done(function(response) {
+ holiday_row.html(response);
+ });
+ return false;
+ });
+ });
+
+ // Remove button removes form div for holiday from an import set
+ $('.remove-holiday').each(function(index){
+ $(this).click(function(){
+ $(this).parents('.import-holiday-info').remove();
+ return false;
+ });
+ });
+
+ if ($('#holiday_import_source_suggestions').is(':checked')){
+ $('#holiday_import_ical_feed_url').attr("disabled", "disabled");
+ }
+ // Enable and disable the feed element when that is selected as the import source
+ $('#holiday_import_source_feed').click(function(){
+ $('#holiday_import_ical_feed_url').removeAttr("disabled");
+ });
+
+ $('#holiday_import_source_suggestions').click(function(){
+ $('#holiday_import_ical_feed_url').attr("disabled", "disabled");
+ });
+
+});
diff --git a/app/assets/javascripts/bootstrap-collapse.js b/app/assets/javascripts/bootstrap-collapse.js
deleted file mode 100644
index 9a364468b..000000000
--- a/app/assets/javascripts/bootstrap-collapse.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/* =============================================================
- * bootstrap-collapse.js v2.0.2
- * http://twitter.github.com/bootstrap/javascript.html#collapse
- * =============================================================
- * 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"
-
- var Collapse = function ( element, options ) {
- this.$element = $(element)
- this.options = $.extend({}, $.fn.collapse.defaults, options)
-
- if (this.options["parent"]) {
- this.$parent = $(this.options["parent"])
- }
-
- this.options.toggle && this.toggle()
- }
-
- Collapse.prototype = {
-
- constructor: Collapse
-
- , dimension: function () {
- var hasWidth = this.$element.hasClass('width')
- return hasWidth ? 'width' : 'height'
- }
-
- , show: function () {
- var dimension = this.dimension()
- , scroll = $.camelCase(['scroll', dimension].join('-'))
- , actives = this.$parent && this.$parent.find('.in')
- , hasData
-
- if (actives && actives.length) {
- hasData = actives.data('collapse')
- actives.collapse('hide')
- hasData || actives.data('collapse', null)
- }
-
- this.$element[dimension](0)
- this.transition('addClass', 'show', 'shown')
- this.$element[dimension](this.$element[0][scroll])
-
- }
-
- , hide: function () {
- var dimension = this.dimension()
- this.reset(this.$element[dimension]())
- this.transition('removeClass', 'hide', 'hidden')
- this.$element[dimension](0)
- }
-
- , reset: function ( size ) {
- var dimension = this.dimension()
-
- this.$element
- .removeClass('collapse')
- [dimension](size || 'auto')
- [0].offsetWidth
-
- this.$element[size ? 'addClass' : 'removeClass']('collapse')
-
- return this
- }
-
- , transition: function ( method, startEvent, completeEvent ) {
- var that = this
- , complete = function () {
- if (startEvent == 'show') that.reset()
- that.$element.trigger(completeEvent)
- }
-
- this.$element
- .trigger(startEvent)
- [method]('in')
-
- $.support.transition && this.$element.hasClass('collapse') ?
- this.$element.one($.support.transition.end, complete) :
- complete()
- }
-
- , toggle: function () {
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
- }
-
- }
-
- /* COLLAPSIBLE PLUGIN DEFINITION
- * ============================== */
-
- $.fn.collapse = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('collapse')
- , options = typeof option == 'object' && option
- if (!data) $this.data('collapse', (data = new Collapse(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.collapse.defaults = {
- toggle: true
- }
-
- $.fn.collapse.Constructor = Collapse
-
-
- /* COLLAPSIBLE DATA-API
- * ==================== */
-
- $(function () {
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
- var $this = $(this), href
- , target = $this.attr('data-target')
- || e.preventDefault()
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
- $(target).collapse(option)
- })
- })
-
-}( window.jQuery ); \ No newline at end of file
diff --git a/app/assets/javascripts/bootstrap-tab.js b/app/assets/javascripts/bootstrap-tab.js
deleted file mode 100644
index 26c9ece75..000000000
--- a/app/assets/javascripts/bootstrap-tab.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/* ========================================================
- * bootstrap-tab.js v2.0.1
- * http://twitter.github.com/bootstrap/javascript.html#tabs
- * ========================================================
- * 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"
-
- /* TAB CLASS DEFINITION
- * ==================== */
-
- var Tab = function ( element ) {
- this.element = $(element)
- }
-
- Tab.prototype = {
-
- constructor: Tab
-
- , show: function () {
- var $this = this.element
- , $ul = $this.closest('ul:not(.dropdown-menu)')
- , selector = $this.attr('data-target')
- , previous
- , $target
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- if ( $this.parent('li').hasClass('active') ) return
-
- previous = $ul.find('.active a').last()[0]
-
- $this.trigger({
- type: 'show'
- , relatedTarget: previous
- })
-
- $target = $(selector)
-
- this.activate($this.parent('li'), $ul)
- this.activate($target, $target.parent(), function () {
- $this.trigger({
- type: 'shown'
- , relatedTarget: previous
- })
- })
- }
-
- , activate: function ( element, container, callback) {
- var $active = container.find('> .active')
- , transition = callback
- && $.support.transition
- && $active.hasClass('fade')
-
- function next() {
- $active
- .removeClass('active')
- .find('> .dropdown-menu > .active')
- .removeClass('active')
-
- element.addClass('active')
-
- if (transition) {
- element[0].offsetWidth // reflow for transition
- element.addClass('in')
- } else {
- element.removeClass('fade')
- }
-
- if ( element.parent('.dropdown-menu') ) {
- element.closest('li.dropdown').addClass('active')
- }
-
- callback && callback()
- }
-
- transition ?
- $active.one($.support.transition.end, next) :
- next()
-
- $active.removeClass('in')
- }
- }
-
-
- /* TAB PLUGIN DEFINITION
- * ===================== */
-
- $.fn.tab = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- , data = $this.data('tab')
- if (!data) $this.data('tab', (data = new Tab(this)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tab.Constructor = Tab
-
-
- /* TAB DATA-API
- * ============ */
-
- $(function () {
- $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
- e.preventDefault()
- $(this).tab('show')
- })
- })
-
-}( window.jQuery ); \ No newline at end of file
diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss
index 863a6c808..31fe7e95a 100644
--- a/app/assets/stylesheets/admin.scss
+++ b/app/assets/stylesheets/admin.scss
@@ -35,8 +35,8 @@ body.admin {
@import "bootstrap";
#main {
+ margin-bottom: 50px;
padding-top: 50px;
-
}
.form-inline {
@@ -80,6 +80,10 @@ body.admin {
}
}
+ .fieldWithErrors input{
+ border: 1px solid #ff0c11;
+ }
+
body.admin blockquote p {
font-size: 13px;
display: inline;
@@ -119,5 +123,34 @@ body.admin {
padding: 3px 0;
}
+ /* Holidays */
+ .day_select {
+ width: 75px;
+ }
+
+ .holiday-description, .holiday-day, .holiday-buttons, .holiday-destroy {
+ padding: 6px 4px;
+ }
+
+ .holiday-description, .holiday-day, .holiday-buttons{
+ display: inline-block;
+ }
+
+ .holiday-description {
+ width: 300px;
+ }
+ .holiday-day {
+ width: 240px;
+ text-align: center;
+ }
+ .holiday-buttons{
+ width: 200px;
+ text-align: right;
+ }
+
+ #import_start_year, #import_end_year {
+ width: 75px;
+ }
+
}
diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss
index 8aa8010ae..b063b0d77 100644
--- a/app/assets/stylesheets/main.scss
+++ b/app/assets/stylesheets/main.scss
@@ -586,26 +586,22 @@ width:40%;
width:26em;
}
-#authority_preview {
-width:45%;
-float:right;
-background-color:#FFFFE0;
-padding-left:1em;
-padding-right:1em;
-overflow:hidden;
-margin-top:-67px;
-}
-
-#authority_preview #header_left,#authority_preview.request_left,#authority_preview #stepwise_make_request {
-width:95%;
-}
-
#request_advice {
float:right;
width:250px;
margin-top:1em;
}
+#select_authority_help {
+background-color: #FEF1F6;
+float: right;
+margin-top: 31px;
+overflow: hidden;
+padding-left: 1em;
+padding-right: 1em;
+width: 45%;
+}
+
#request_advice ul {
margin:0 auto;
}
@@ -1717,16 +1713,11 @@ width:575px;
padding-right:50px;
}
-#authority_preview .request_left,
-#authority_preview #header_left {
- width: 100%;
-}
-
#request_sidebar h2,.list-filter-item {
margin-bottom:10px;
}
-div.ff-icon-printfix,.comment_in_request_text img.comment_quote,body.front #other-country-notice,#other-country-notice,#authority_preview .public-body-name-prefix,#authority_preview #list-filter,#authority_preview h2.foi_results,div#show_response_view p.event_actions, div.batch_public_body_toggle {
+div.ff-icon-printfix,.comment_in_request_text img.comment_quote,body.front #other-country-notice,#other-country-notice,div#show_response_view p.event_actions, div.batch_public_body_toggle {
display:none;
}
diff --git a/app/assets/stylesheets/responsive/_new_request_layout.scss b/app/assets/stylesheets/responsive/_new_request_layout.scss
index aba4ffc29..a8b24e1b1 100644
--- a/app/assets/stylesheets/responsive/_new_request_layout.scss
+++ b/app/assets/stylesheets/responsive/_new_request_layout.scss
@@ -11,6 +11,9 @@
@include lte-ie7 {
width: 27.125em;
}
+ #query {
+ width: 80%;
+ }
}
}
@@ -18,46 +21,19 @@
@include grid-row($behavior: nest);
}
-#authority_preview {
+#select_authority_help {
@include grid-column(12);
- @include respond-min( $main_menu-mobile_menu_cutoff ){
+ @include respond-min( $main_menu-mobile_menu_cutoff ) {
@include grid-column(6);
- margin-top:-67px;
- @include ie8{
+ @include ie8 {
padding-right: 0.9375em;
}
@include lte-ie7 {
width: 26.188em;
}
- /* Don't nest public body grid row in this context */
- #public_body_show {
- @include grid-row();
- }
-
- }
-
- /* Hide some elements of the public body that aren't appropriate in this
- context */
- #list-filter, h2.foi_results, .public-body-name-prefix {
- display: none;
- }
-
- /* Compact request list for viewing in authority preview column */
- .request_left, #header_left {
- @include grid-column(12, $collapse: true);
- }
-
- .request_right {
- @include grid-column(12, $collapse: true);
- }
-
- span.desc {
- background:none;
- line-height:18px;
- padding: 0;
}
-
}
+
/* /new/[body_name] page */
#request_header {
@include grid-row;
@@ -82,6 +58,10 @@
}
}
+#typeahead_response .close-button {
+ float: right;
+}
+
/* Advice sits on right hand side */
#request_advice {
diff --git a/app/assets/stylesheets/responsive/_new_request_style.scss b/app/assets/stylesheets/responsive/_new_request_style.scss
index ab144b39f..86e17cbfe 100644
--- a/app/assets/stylesheets/responsive/_new_request_style.scss
+++ b/app/assets/stylesheets/responsive/_new_request_style.scss
@@ -1,5 +1,12 @@
/* Styles for pages in making a new request */
+/* /select_authority page */
+#select_authority_help {
+ .info {
+ font-style: italic;
+ }
+}
+
/* /new/[body_name] page */
.new_info_request {
label {