Skip to content

Commit

Permalink
Merge branch 'release/0.26.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
garethrees committed Dec 14, 2016
2 parents 0191535 + 373437e commit 47bce79
Show file tree
Hide file tree
Showing 341 changed files with 14,537 additions and 6,669 deletions.
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--color --drb
--color
2 changes: 2 additions & 0 deletions .ruby-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ Style/BlockDelimiters:
Prefer {...} over do...end for single-line blocks.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
Enabled: false
Exclude:
- 'spec/**/*'

Style/BracesAroundHashParameters:
Description: 'Enforce braces style around hash parameters.'
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
group: deprecated
language: ruby
branches:
only:
Expand All @@ -17,6 +18,7 @@ before_install:
- sudo locale-gen --no-archive en_GB
- sudo locale-gen --no-archive en_GB.UTF-8
- sudo update-locale
- gem install bundler
- gem install rake --version=0.9.2.2
- git submodule update --init --recursive
- psql -c "create database template_utf8 template template0 encoding 'UTF-8';" -U postgres
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ gem 'rack-utf8_sanitizer', '~> 1.3.0'
gem 'rails-i18n', '~> 3.0.0'
gem 'recaptcha', '~> 0.4.0', :require => 'recaptcha/rails'
gem 'rmagick', '~> 2.15.0'
gem 'ruby-msg', '~> 1.5.0', :git => 'https://github.com/mysociety/ruby-msg.git', :ref => 'f9f928ed76c024b4bc3a08bc1a59beb62df36663'
gem 'ruby-msg', '~> 1.5.0', :git => 'https://github.com/mysociety/ruby-msg.git', :branch => 'ascii-encoding'
gem 'sass', '3.4.21' # pinned because later versions cause problems (see blame)
gem 'secure_headers', '~> 3.1.2'
gem 'statistics2', '~> 0.54'
gem 'strip_attributes', :git => 'https://github.com/mysociety/strip_attributes.git', :branch => 'globalize3'
gem 'strong_parameters', '~> 0.2.3'
gem 'syslog_protocol', '~> 0.9.2'
gem 'thin', '~> 1.5.1'
gem 'vpim', '~> 13.11.11'
Expand Down Expand Up @@ -78,7 +79,6 @@ group :test, :development do
gem 'rspec-activemodel-mocks', '~> 1.0.1'
gem 'rspec-rails', '~> 3.4.0'
gem 'test-unit', '~> 3.1.0'
gem 'spork-rails', '~> 4.0.0'
gem 'pry-debugger', '~> 0.2.3', :platforms => :ruby_19
end

Expand All @@ -88,4 +88,5 @@ group :development do
gem 'mailcatcher', '~> 0.5.12'
gem 'quiet_assets', '~> 1.1.0'
gem 'rdoc', '~> 3.12.2'
gem 'launchy', '~> 2.4.3'
end
24 changes: 14 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ GIT

GIT
remote: https://github.com/mysociety/ruby-msg.git
revision: f9f928ed76c024b4bc3a08bc1a59beb62df36663
ref: f9f928ed76c024b4bc3a08bc1a59beb62df36663
revision: fae72e547299ab1f8b23239a79f5a1d353426b40
branch: ascii-encoding
specs:
ruby-msg (1.5.2)
ruby-ole (>= 1.2.8)
Expand Down Expand Up @@ -156,7 +156,7 @@ GEM
fakeweb (1.3.0)
fancybox-rails (0.3.1)
railties (>= 3.1.0)
fast_gettext (1.0.0)
fast_gettext (1.1.0)
ffi (1.9.10)
foundation-rails (5.5.3.2)
railties (>= 3.1.0)
Expand Down Expand Up @@ -184,6 +184,8 @@ GEM
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
json (1.8.3)
launchy (2.4.3)
addressable (~> 2.3)
libv8 (3.16.14.13)
locale (2.0.8)
mahoro (0.4)
Expand Down Expand Up @@ -213,7 +215,7 @@ GEM
net-ssh (2.6.7)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
newrelic_rpm (3.16.0.318)
newrelic_rpm (3.17.1.326)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
Expand Down Expand Up @@ -298,7 +300,7 @@ GEM
rspec-mocks (~> 3.4.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
ruby-ole (1.2.11.8)
ruby-ole (1.2.12)
sass (3.4.21)
sass-rails (3.2.6)
railties (~> 3.2.0)
Expand All @@ -318,17 +320,18 @@ GEM
eventmachine (~> 1.0.0)
thin (>= 1.5, < 1.7)
slop (3.6.0)
spork (1.0.0rc4)
spork-rails (4.0.0)
rails (>= 3.0.0, < 5)
spork (>= 1.0rc0)
sprockets (2.2.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.11)
statistics2 (0.54)
strong_parameters (0.2.3)
actionpack (~> 3.0)
activemodel (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
syslog_protocol (0.9.2)
test-unit (3.1.8)
power_assert
Expand Down Expand Up @@ -395,6 +398,7 @@ DEPENDENCIES
jquery-rails (~> 3.1.4)
jquery-ui-rails (~> 5.0.0)
json (~> 1.8.1)
launchy (~> 2.4.3)
locale (~> 2.0.8)
mahoro (~> 0.4)
mailcatcher (~> 0.5.12)
Expand All @@ -421,9 +425,9 @@ DEPENDENCIES
sass (= 3.4.21)
sass-rails (~> 3.2.3)
secure_headers (~> 3.1.2)
spork-rails (~> 4.0.0)
statistics2 (~> 0.54)
strip_attributes!
strong_parameters (~> 0.2.3)
syslog_protocol (~> 0.9.2)
test-unit (~> 3.1.0)
therubyracer (~> 0.12.2)
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ We have some more notes for developers [on the project site](http://alaveteli.or
* [fyi.org.nz](https://fyi.org.nz)

See more at [alaveteli.org](http://alaveteli.org/deployments/).

## Acknowledgements

Thanks to [Browserstack](https://www.browserstack.com/) who let us use their
web-based cross-browser testing tools for this project.

This product includes GeoLite data created by MaxMind, available from
<a href="http://www.maxmind.com">http://www.maxmind.com</a>.
3 changes: 3 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ ALAVETELI_OS = ENV['ALAVETELI_VAGRANT_OS'] || 'precise64'

SUPPORTED_OPERATING_SYSTEMS = {
'precise64' => 'https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box',
'trusty64' => 'https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20160714.0.0/providers/virtualbox.box',
'wheezy64' => 'http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box',
'jessie64' => 'https://atlas.hashicorp.com/puppetlabs/boxes/debian-8.2-64-nocm'
}
Expand Down Expand Up @@ -143,6 +144,8 @@ EOF
config.vm.provision :shell, :inline => "chmod +x /etc/update-motd.d/*"
config.vm.provision :shell, :inline => "rm /etc/motd"
config.vm.provision :shell, :inline => "ln -s /var/run/motd /etc/motd"
elsif ALAVETELI_OS == 'trusty64'
config.vm.provision :shell, :inline => "echo '#{ motd }' >> /etc/motd"
end
config.vm.provision :shell, :inline => "echo '#{ motd }' >> /etc/motd.tail"

Expand Down
Binary file removed app/assets/images/facebook-16.png
Binary file not shown.
Binary file removed app/assets/images/facebook-32.png
Binary file not shown.
Binary file added app/assets/images/facebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/assets/images/medium-16.png
Binary file not shown.
Binary file removed app/assets/images/medium-32.png
Binary file not shown.
Binary file added app/assets/images/medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/rss-grey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/classification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/delayed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/delivery_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/status/locked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/status/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/notheld.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/overdue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/partiallysuccessful.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/postal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/status/[email protected]
Binary file modified app/assets/images/status/refused.png
Binary file modified app/assets/images/status/[email protected]
Binary file modified app/assets/images/status/reported.png
Binary file modified app/assets/images/status/[email protected]
Binary file modified app/assets/images/status/review.png
Binary file modified app/assets/images/status/[email protected]
Binary file modified app/assets/images/status/successful.png
Binary file modified app/assets/images/status/[email protected]
Binary file modified app/assets/images/status/unusual.png
Binary file modified app/assets/images/status/[email protected]
Binary file modified app/assets/images/status/waiting.png
Binary file modified app/assets/images/status/[email protected]
Binary file modified app/assets/images/status/withdrawn.png
Binary file modified app/assets/images/status/[email protected]
Binary file removed app/assets/images/twitter-16.png
Diff not rendered.
Binary file modified app/assets/images/twitter.png
Binary file added app/assets/images/[email protected]
Binary file modified app/assets/images/widget.png
Binary file added app/assets/images/[email protected]
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
//= require jquery-ui/datepicker
//= require jquery-ui/position
//= require jquery.cookie
//= require dropit
//= require general
//= require ba-throttle-debounce
97 changes: 97 additions & 0 deletions app/assets/javascripts/dropit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* Dropit v1.1.0
* http://dev7studios.com/dropit
*
* Copyright 2012, Dev7studios
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/

;(function($) {

$.fn.dropit = function(method) {

var methods = {

init : function(options) {
this.dropit.settings = $.extend({}, this.dropit.defaults, options);
return this.each(function() {
var $el = $(this),
el = this,
settings = $.fn.dropit.settings;

// Hide initial submenus
$el.addClass('dropit')
.find('>'+ settings.triggerParentEl +':has('+ settings.submenuEl +')').addClass('dropit-trigger')
.find(settings.submenuEl).addClass('dropit-submenu').hide();

// Open on click
$el.off(settings.action).on(settings.action, settings.triggerParentEl +':has('+ settings.submenuEl +') > '+ settings.triggerEl +'', function(){
// Close click menu's if clicked again
if(settings.action == 'click' && $(this).parents(settings.triggerParentEl).hasClass('dropit-open')){
settings.beforeHide.call(this);
$(this).parents(settings.triggerParentEl).removeClass('dropit-open').find(settings.submenuEl).hide();
settings.afterHide.call(this);
return false;
}

// Hide open menus
settings.beforeHide.call(this);
$('.dropit-open').removeClass('dropit-open').find('.dropit-submenu').hide();
settings.afterHide.call(this);

// Open this menu
settings.beforeShow.call(this);
$(this).parents(settings.triggerParentEl).addClass('dropit-open').find(settings.submenuEl).show();
settings.afterShow.call(this);

return false;
});

// Close if outside click
$(document).on('click', function(){
settings.beforeHide.call(this);
$('.dropit-open').removeClass('dropit-open').find('.dropit-submenu').hide();
settings.afterHide.call(this);
});

// If hover
if(settings.action == 'mouseenter'){
$el.on('mouseleave', '.dropit-open', function(){
settings.beforeHide.call(this);
$(this).removeClass('dropit-open').find(settings.submenuEl).hide();
settings.afterHide.call(this);
});
}

settings.afterLoad.call(this);
});
}

};

if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error( 'Method "' + method + '" does not exist in dropit plugin!');
}

};

$.fn.dropit.defaults = {
action: 'click', // The open action for the trigger
submenuEl: 'ul', // The submenu element
triggerEl: 'a', // The trigger element
triggerParentEl: 'li', // The trigger parent element
afterLoad: function(){}, // Triggers when plugin has loaded
beforeShow: function(){}, // Triggers before submenu is shown
afterShow: function(){}, // Triggers after submenu is shown
beforeHide: function(){}, // Triggers before submenu is hidden
afterHide: function(){} // Triggers before submenu is hidden
};

$.fn.dropit.settings = {};

})(jQuery);
98 changes: 58 additions & 40 deletions app/assets/javascripts/general.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,55 @@
$(document).ready(function() {
// flash message for people coming from other countries
if(window.location.search.substring(1).search("country_name") == -1) {
if (!$.cookie('has_seen_country_message')) {
$.ajax({
url: "/country_message",
dataType: 'html',
success: function(country_message){
var htmlWrapperFront = [
'<div class="popup popup--popup popup--locality" role="alert" id="locality-popup">',
' <div class="row">',
' <div class="popup__content">',
];
var htmlWrapperBack = [
' <a href="#top" class="popup__close js-popup__close" aria-label="close">',
' <span aria-hidden="true">&times;</span>',
' </a>',
' </div>',
' </div>',
'</div>',
];
var wholeMessage = '';
if(window.location.search.substring(1).search("country_name") == -1) {
if (!$.cookie('has_seen_country_message')) {
$.ajax({
url: "/country_message",
dataType: 'html',
success: function(country_message){
if (country_message != ''){
$('#other-country-notice .popup-content').html(country_message);
$('body:not(.front) #other-country-notice').show()
wholeMessage = htmlWrapperFront.join('') + country_message + htmlWrapperBack.join('');
$('#country-message').html(wholeMessage);
$('body:not(.front) #locality-popup').show()
}
}
})

}
}

// popup messages
$('#other-country-notice .popup-close').click(function() {
$('#other-country-notice').hide('slow');
$.cookie('has_seen_country_message', 1, {expires: 365, path: '/'});
});
$('#everypage .popup-close').click(function() {
$('#everypage').hide('slow');
$.cookie('seen_foi2', 1, { expires: 7, path: '/' });
return false;
});

// "link to this" widget
$('a.link_to_this').click(function() {
var box = $('div#link_box');
var location = window.location.protocol + "//" + window.location.hostname + $(this).attr('href');
box.width(location.length + " em");
box.find('input').val(location).attr('size', location.length + " em");
box.show();
box.position({
my: "right center",
at: "left bottom",
of: this,
collision: "fit" });
box.find('input').select();
return false;
$('#locality-popup .js-popup__close').click(function() {
$('#locality-popup').hide('slow');
$.cookie('has_seen_country_message', 1, {expires: 365, path: '/'});
return false;
});
}
})
}
}

// popups
$('#standard-popup .js-popup__close').click(function() {
$('#standard-popup').hide('slow');
$.cookie('seen_foi2', 1, { expires: 7, path: '/' });
return false;
});


// "link to this" box
$('.cplink__button').click(function() {
var box = $(this).prev('.cplink__field');
box.select();
});


$('.close-button').click(function() { $(this).parent().hide() });
$('div#variety-filter a').each(function() {
$(this).click(function() {
Expand All @@ -54,7 +61,7 @@ $(document).ready(function() {
})

if($.cookie('seen_foi2') == 1) {
$('#everypage').hide();
//$('#standard-popup').hide();
}

// "Create widget" page
Expand Down Expand Up @@ -113,3 +120,14 @@ $(document).ready(function() {
});
}
})


$(document).ready(function() {
$('.after-actions__action-menu').dropit({
submenuEl: '.action-menu__menu'
});

if ($('body').hasClass('no-js')) {
$('body').removeClass('no-js').addClass('js-loaded');
}
});
Loading

0 comments on commit 47bce79

Please sign in to comment.