aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.compass/config.rb30
-rw-r--r--.gitignore3
-rw-r--r--.travis.yml2
-rw-r--r--Gemfile4
-rw-r--r--Gemfile.lock1
-rw-r--r--README.md2
-rw-r--r--app/controllers/admin_censor_rule_controller.rb14
-rw-r--r--app/controllers/admin_general_controller.rb18
-rw-r--r--app/controllers/admin_public_body_controller.rb4
-rw-r--r--app/controllers/admin_request_controller.rb42
-rw-r--r--app/controllers/admin_track_controller.rb1
-rw-r--r--app/controllers/admin_user_controller.rb12
-rw-r--r--app/controllers/api_controller.rb4
-rw-r--r--app/controllers/application_controller.rb30
-rw-r--r--app/controllers/general_controller.rb6
-rw-r--r--app/controllers/public_body_controller.rb8
-rw-r--r--app/controllers/request_controller.rb177
-rw-r--r--app/controllers/services_controller.rb4
-rw-r--r--app/controllers/user_controller.rb2
-rw-r--r--app/helpers/admin_helper.rb37
-rwxr-xr-xapp/helpers/link_to_helper.rb182
-rw-r--r--app/mailers/request_mailer.rb31
-rw-r--r--app/mailers/track_mailer.rb2
-rw-r--r--app/models/foi_attachment.rb3
-rw-r--r--app/models/info_request.rb156
-rw-r--r--app/models/info_request_event.rb34
-rw-r--r--app/models/track_thing.rb2
-rw-r--r--app/sass/admin.scss112
-rw-r--r--app/views/admin_censor_rule/_form.html.erb101
-rw-r--r--app/views/admin_censor_rule/_show.html.erb12
-rw-r--r--app/views/admin_censor_rule/edit.html.erb16
-rw-r--r--app/views/admin_censor_rule/new.html.erb8
-rw-r--r--app/views/admin_general/_admin_navbar.html.erb23
-rw-r--r--app/views/admin_general/admin.coffee24
-rw-r--r--app/views/admin_general/admin.js32
-rw-r--r--app/views/admin_general/admin_js.erb32
-rw-r--r--app/views/admin_general/debug.html.erb8
-rw-r--r--app/views/admin_general/index.html.erb278
-rw-r--r--app/views/admin_general/stats.html.erb96
-rw-r--r--app/views/admin_general/timeline.html.erb30
-rw-r--r--app/views/admin_public_body/_form.html.erb116
-rw-r--r--app/views/admin_public_body/_locale_selector.html.erb10
-rw-r--r--app/views/admin_public_body/_one_list.html.erb53
-rw-r--r--app/views/admin_public_body/_tag_help.html.erb30
-rw-r--r--app/views/admin_public_body/_tags.html.erb7
-rw-r--r--app/views/admin_public_body/edit.html.erb52
-rw-r--r--app/views/admin_public_body/import_csv.html.erb33
-rw-r--r--app/views/admin_public_body/list.html.erb34
-rw-r--r--app/views/admin_public_body/new.html.erb37
-rw-r--r--app/views/admin_public_body/show.html.erb148
-rw-r--r--app/views/admin_request/_incoming_message_actions.html.erb55
-rw-r--r--app/views/admin_request/_some_requests.html.erb61
-rw-r--r--app/views/admin_request/edit.html.erb20
-rw-r--r--app/views/admin_request/edit_comment.html.erb8
-rw-r--r--app/views/admin_request/edit_outgoing.html.erb8
-rw-r--r--app/views/admin_request/hidden_user_explanation.html.erb3
-rw-r--r--app/views/admin_request/list.html.erb12
-rw-r--r--app/views/admin_request/list_old_unclassified.html.erb16
-rw-r--r--app/views/admin_request/show.html.erb531
-rw-r--r--app/views/admin_request/show_raw_email.html.erb58
-rw-r--r--app/views/admin_track/_some_tracks.html.erb99
-rw-r--r--app/views/admin_track/list.html.erb45
-rw-r--r--app/views/admin_user/_form.html.erb77
-rw-r--r--app/views/admin_user/_user_table.html.erb63
-rw-r--r--app/views/admin_user/edit.html.erb24
-rw-r--r--app/views/admin_user/list.html.erb12
-rw-r--r--app/views/admin_user/list_banned.html.erb2
-rw-r--r--app/views/admin_user/show.html.erb94
-rw-r--r--app/views/api/request_events.atom.builder4
-rw-r--r--app/views/comment/_single_comment.html.erb6
-rw-r--r--app/views/comment/new.html.erb6
-rw-r--r--app/views/contact_mailer/from_admin_message.text.erb2
-rw-r--r--app/views/contact_mailer/to_admin_message.text.erb8
-rw-r--r--app/views/contact_mailer/user_message.text.erb2
-rw-r--r--app/views/general/_advanced_search_tips.html.erb34
-rw-r--r--app/views/general/_footer.html.erb2
-rw-r--r--app/views/general/_frontpage_bodies_list.html.erb2
-rw-r--r--app/views/general/_frontpage_intro_sentence.html.erb2
-rw-r--r--app/views/general/_frontpage_requests_list.html.erb8
-rw-r--r--app/views/general/_frontpage_search_box.html.erb2
-rw-r--r--app/views/general/_locale_switcher.html.erb2
-rw-r--r--app/views/general/_orglink.html.erb2
-rw-r--r--app/views/general/_topnav.html.erb12
-rw-r--r--app/views/general/blog.html.erb2
-rw-r--r--app/views/general/exception_caught.html.erb4
-rw-r--r--app/views/general/search.html.erb14
-rw-r--r--app/views/help/api.html.erb14
-rw-r--r--app/views/help/contact.html.erb2
-rw-r--r--app/views/help/officers.html.erb5
-rw-r--r--app/views/help/unhappy.html.erb4
-rw-r--r--app/views/layouts/admin.html.erb53
-rw-r--r--app/views/layouts/default.html.erb13
-rw-r--r--app/views/layouts/no_chrome.html.erb3
-rw-r--r--app/views/outgoing_mailer/followup.text.erb4
-rw-r--r--app/views/outgoing_mailer/initial_request.text.erb2
-rw-r--r--app/views/public_body/_alphabet.html.erb2
-rw-r--r--app/views/public_body/_body_listing_single.html.erb4
-rw-r--r--app/views/public_body/_list_sidebar_extra.html.erb2
-rw-r--r--app/views/public_body/list.html.erb4
-rw-r--r--app/views/public_body/show.html.erb16
-rw-r--r--app/views/public_body/view_email.html.erb4
-rw-r--r--app/views/request/_after_actions.html.erb14
-rw-r--r--app/views/request/_bubble.html.erb12
-rw-r--r--app/views/request/_correspondence.html.erb6
-rw-r--r--app/views/request/_describe_state.html.erb7
-rw-r--r--app/views/request/_followup.html.erb8
-rw-r--r--app/views/request/_other_describe_state.html.erb1
-rw-r--r--app/views/request/_request_listing_short_via_event.html.erb6
-rw-r--r--app/views/request/_request_listing_via_event.html.erb8
-rw-r--r--app/views/request/_sidebar.html.erb4
-rw-r--r--app/views/request/_view_html_prefix.html.erb2
-rw-r--r--app/views/request/_wall_listing.html.erb4
-rw-r--r--app/views/request/describe_state_message.rhtml30
-rw-r--r--app/views/request/details.html.erb4
-rw-r--r--app/views/request/new.html.erb54
-rw-r--r--app/views/request/select_authority.html.erb4
-rw-r--r--app/views/request/show.html.erb10
-rw-r--r--app/views/request_game/play.html.erb8
-rw-r--r--app/views/request_mailer/new_response.text.erb4
-rw-r--r--app/views/request_mailer/new_response_reminder_alert.text.erb2
-rw-r--r--app/views/request_mailer/overdue_alert.text.erb2
-rw-r--r--app/views/request_mailer/requires_admin.text.erb6
-rw-r--r--app/views/request_mailer/very_overdue_alert.text.erb2
-rw-r--r--app/views/track/_tracking_links.html.erb8
-rw-r--r--app/views/track_mailer/event_digest.text.erb8
-rw-r--r--app/views/user/_show_user_info.html.erb8
-rw-r--r--app/views/user/_signin.html.erb2
-rw-r--r--app/views/user/_signup.html.erb6
-rw-r--r--app/views/user/_user_listing_single.html.erb4
-rw-r--r--app/views/user/set_draft_profile_photo.html.erb2
-rw-r--r--app/views/user/show.html.erb8
-rw-r--r--app/views/user_mailer/already_registered.text.erb4
-rw-r--r--app/views/user_mailer/changeemail_confirm.text.erb2
-rw-r--r--app/views/user_mailer/confirm_login.text.erb4
-rw-r--r--config/environments/production.rb5
-rw-r--r--config/general.yml-example19
-rw-r--r--config/memcached.yml-test2
-rw-r--r--config/test.yml9
-rw-r--r--config/varnish-alaveteli.vcl40
-rw-r--r--db/.gitignore1
-rw-r--r--db/development_structure.sql2095
-rw-r--r--doc/ADMIN.md21
-rw-r--r--doc/CHANGES.md55
-rw-r--r--doc/INSTALL.md28
-rw-r--r--lib/ability.rb5
-rw-r--r--lib/configuration.rb3
-rw-r--r--lib/cookie_store_with_line_break_fix.rb19
-rw-r--r--lib/make_html_4_compliant.rb8
-rw-r--r--locale/he_IL/app.po757
-rw-r--r--public/admin/images/glyphicons-halflings-white.pngbin0 -> 8777 bytes
-rw-r--r--public/admin/images/glyphicons-halflings.pngbin0 -> 13826 bytes
-rw-r--r--public/admin/javascripts/bootstrap-collapse.js138
-rw-r--r--public/admin/javascripts/bootstrap-tab.js130
-rw-r--r--public/admin/javascripts/jquery-ui.min.js356
-rw-r--r--public/admin/stylesheets/admin.css1005
-rw-r--r--public/down.default.html3
-rw-r--r--public/stylesheets/main.css4
-rwxr-xr-xscript/runner2
-rw-r--r--spec/controllers/public_body_controller_spec.rb5
-rw-r--r--spec/controllers/request_controller_spec.rb105
-rw-r--r--spec/controllers/track_controller_spec.rb3
-rw-r--r--spec/fixtures/files/incoming-request-empty.email8
-rw-r--r--spec/fixtures/info_request_events.yml11
-rw-r--r--spec/fixtures/info_requests.yml12
-rw-r--r--spec/fixtures/outgoing_messages.yml11
-rw-r--r--spec/fixtures/public_bodies.yml15
-rw-r--r--spec/fixtures/public_body_translations.yml13
-rw-r--r--spec/fixtures/users.yml22
-rw-r--r--spec/helpers/link_to_helper_spec.rb4
-rw-r--r--spec/integration/request_controller_spec.rb41
-rw-r--r--spec/lib/ability_spec.rb51
-rw-r--r--spec/mailers/request_mailer_spec.rb43
-rw-r--r--spec/models/info_request_spec.rb4
-rw-r--r--spec/models/purge_request_spec.rb9
-rw-r--r--spec/script/mailin-spec.rb21
-rw-r--r--spec/script/mailin_spec.rb37
-rw-r--r--spec/views/request/show.html.erb_spec.rb4
177 files changed, 6932 insertions, 1983 deletions
diff --git a/.compass/config.rb b/.compass/config.rb
new file mode 100644
index 000000000..5e8e8cc2d
--- /dev/null
+++ b/.compass/config.rb
@@ -0,0 +1,30 @@
+require 'bootstrap-sass'
+# Require any additional compass plugins here.
+
+
+# Set this to the root of your project when deployed:
+http_path = "/admin/"
+css_dir = "public/admin/stylesheets"
+http_css_dir = "stylesheets"
+sass_dir = "app/sass"
+images_dir = "public/admin/images"
+http_images_dir = "images"
+javascripts_dir = "public/admin/javascripts"
+
+output_style = :compact
+#output_style = :compressed
+# You can select your preferred output style here (can be overridden via the command line):
+# output_style = :expanded or :nested or :compact or :compressed
+
+# To enable relative paths to assets via compass helper functions. Uncomment:
+relative_assets = true
+
+# To disable debugging comments that display the original location of your selectors. Uncomment:
+line_comments = false
+
+
+# If you prefer the indented syntax, you might want to regenerate this
+# project again passing --syntax sass, or you can uncomment this:
+# preferred_syntax = :sass
+# and then run:
+# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
diff --git a/.gitignore b/.gitignore
index 45865fd02..efba35668 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,7 +9,6 @@
._*
.DS_Store
.autotest
-/db/test_structure.sql
*#*#
TAGS
/vendor/plugins/*theme
@@ -17,8 +16,10 @@ TAGS
/files/
/public/download
/public/*theme
+!/public/adminbootstraptheme
/vendor/bundle
.bundle
bin/
config/aliases
.sass-cache
+alaveteli.sublime*
diff --git a/.travis.yml b/.travis.yml
index ffcfdbaa9..2f06f6cd9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,6 +13,8 @@ before_install:
- git submodule update --init --recursive
- psql -c "create database foi_test template template0 encoding 'SQL_ASCII';" -U postgres
- cp config/database.yml-test config/database.yml
+ - cp config/general.yml-example config/general.yml
+ - cp config/newrelic.yml-example config/newrelic.yml
- sudo apt-get update
- export DEBIAN_FRONTEND=noninteractive
- sudo apt-get -y install exim4-daemon-light
diff --git a/Gemfile b/Gemfile
index 82ea4089c..2329f7f5d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -14,8 +14,9 @@ gem 'fast_gettext', '>= 0.6.0'
gem 'fastercsv', '>=1.5.5'
gem 'gettext_i18n_rails', '>= 0.7.1'
gem 'gettext', '~> 2.3.3'
-gem 'json', '~> 1.5.1'
+gem 'json'
gem 'mahoro'
+gem 'mail', :platforms => :ruby_19
gem 'memcache-client', :require => 'memcache'
gem 'locale', '>= 2.0.5'
gem 'net-http-local'
@@ -47,6 +48,7 @@ gem 'exception_notification'
group :test do
gem 'fakeweb'
gem 'test-unit', '~> 1.2.3', :platforms => :ruby_19
+ gem 'coveralls', :require => false
gem 'webrat'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 8e3f95350..fda779b0f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -246,6 +246,7 @@ DEPENDENCIES
json (~> 1.5.1)
locale (>= 2.0.5)
mahoro
+ mail
mailcatcher
memcache-client
net-http-local
diff --git a/README.md b/README.md
index 7313df071..a7e4e0dc5 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Welcome to Alaveteli!
-[![Build Status](https://secure.travis-ci.org/mysociety/alaveteli.png)](http://travis-ci.org/mysociety/alaveteli) [![Dependency Status](https://gemnasium.com/mysociety/alaveteli.png)](https://gemnasium.com/mysociety/alaveteli)
+[![Build Status](https://secure.travis-ci.org/mysociety/alaveteli.png)](http://travis-ci.org/mysociety/alaveteli) [![Dependency Status](https://gemnasium.com/mysociety/alaveteli.png)](https://gemnasium.com/mysociety/alaveteli) [![Coverage Status](https://coveralls.io/repos/mysociety/alaveteli/badge.png?branch=master)](https://coveralls.io/r/mysociety/alaveteli) [![Code Climate](https://codeclimate.com/github/mysociety/alaveteli.png)](https://codeclimate.com/github/mysociety/alaveteli)
This is an open source project to create a standard, internationalised
platform for making Freedom of Information (FOI) requests in different
diff --git a/app/controllers/admin_censor_rule_controller.rb b/app/controllers/admin_censor_rule_controller.rb
index 5381921bf..d3e9e47d2 100644
--- a/app/controllers/admin_censor_rule_controller.rb
+++ b/app/controllers/admin_censor_rule_controller.rb
@@ -10,7 +10,7 @@ class AdminCensorRuleController < AdminController
@info_request = InfoRequest.find(params[:info_request_id])
end
if params[:user_id]
- @user = User.find(params[:user_id])
+ @censor_user = User.find(params[:user_id])
end
end
@@ -26,9 +26,9 @@ class AdminCensorRuleController < AdminController
end
flash[:notice] = 'CensorRule was successfully created.'
if !@censor_rule.info_request.nil?
- redirect_to admin_url('request/show/' + @censor_rule.info_request.id.to_s)
+ redirect_to admin_request_show_url(@censor_rule.info_request)
elsif !@censor_rule.user.nil?
- redirect_to admin_url('user/show/' + @censor_rule.user.id.to_s)
+ redirect_to admin_user_show_url(@censor_rule.user)
else
raise "internal error"
end
@@ -53,9 +53,9 @@ class AdminCensorRuleController < AdminController
end
flash[:notice] = 'CensorRule was successfully updated.'
if !@censor_rule.info_request.nil?
- redirect_to admin_url('request/show/' + @censor_rule.info_request.id.to_s)
+ redirect_to admin_request_show_url(@censor_rule.info_request)
elsif !@censor_rule.user.nil?
- redirect_to admin_url('user/show/' + @censor_rule.user.id.to_s)
+ redirect_to admin_user_show_url(@censor_rule.user)
else
raise "internal error"
end
@@ -79,9 +79,9 @@ class AdminCensorRuleController < AdminController
flash[:notice] = "CensorRule was successfully destroyed."
if !info_request.nil?
- redirect_to admin_url('request/show/' + info_request.id.to_s)
+ redirect_to admin_request_show_url(info_request)
elsif !user.nil?
- redirect_to admin_url('user/show/' + user.id.to_s)
+ redirect_to admin_user_show_url(user)
else
raise "internal error"
end
diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb
index 9f4c398c1..800678787 100644
--- a/app/controllers/admin_general_controller.rb
+++ b/app/controllers/admin_general_controller.rb
@@ -5,6 +5,8 @@
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
class AdminGeneralController < AdminController
+ skip_before_filter :authenticate, :only => :admin_js
+
def index
# ensure we have a trailing slash
current_uri = request.env['REQUEST_URI']
@@ -115,6 +117,17 @@ class AdminGeneralController < AdminController
end
def stats
+ # Overview counts of things
+ @public_body_count = PublicBody.count
+
+ @info_request_count = InfoRequest.count
+ @outgoing_message_count = OutgoingMessage.count
+ @incoming_message_count = IncomingMessage.count
+
+ @user_count = User.count
+ @track_thing_count = TrackThing.count
+
+ @comment_count = Comment.count
@request_by_state = InfoRequest.count(:group => 'described_state')
@tracks_by_type = TrackThing.count(:group => 'track_type')
end
@@ -128,5 +141,10 @@ class AdminGeneralController < AdminController
@github_origin = "https://github.com/#{repo}/tree/"
@request_env = request.env
end
+
+ # TODO: Remove this when support for proxy admin interface is removed
+ def admin_js
+ render :layout => false, :content_type => "application/javascript"
+ end
end
diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb
index 079022777..ec1848fd3 100644
--- a/app/controllers/admin_public_body_controller.rb
+++ b/app/controllers/admin_public_body_controller.rb
@@ -90,7 +90,7 @@ class AdminPublicBodyController < AdminController
@public_body = PublicBody.new(params[:public_body])
if @public_body.save
flash[:notice] = 'PublicBody was successfully created.'
- redirect_to admin_url('body/show/' + @public_body.id.to_s)
+ redirect_to admin_body_show_url(@public_body)
else
render :action => 'new'
end
@@ -109,7 +109,7 @@ class AdminPublicBodyController < AdminController
@public_body = PublicBody.find(params[:id])
if @public_body.update_attributes(params[:public_body])
flash[:notice] = 'PublicBody was successfully updated.'
- redirect_to admin_url('body/show/' + @public_body.id.to_s)
+ redirect_to admin_body_show_url(@public_body)
else
render :action => 'edit'
end
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index fc2cf8e97..3ad2713d2 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -56,7 +56,7 @@ class AdminRequestController < AdminController
@outgoing_message = OutgoingMessage.find(params[:outgoing_message_id])
@outgoing_message.resend_message
flash[:notice] = "Outgoing message resent"
- redirect_to request_admin_url(@outgoing_message.info_request)
+ redirect_to admin_request_show_url(@outgoing_message.info_request)
end
def edit
@@ -102,7 +102,7 @@ class AdminRequestController < AdminController
# expire cached files
expire_for_request(@info_request)
flash[:notice] = 'Request successfully updated.'
- redirect_to request_admin_url(@info_request)
+ redirect_to admin_request_show_url(@info_request)
else
render :action => 'edit'
end
@@ -118,7 +118,7 @@ class AdminRequestController < AdminController
# expire cached files
expire_for_request(@info_request)
flash[:notice] = "Request #{url_title} has been completely destroyed. Email of user who made request: " + user.email
- redirect_to admin_url('request/list')
+ redirect_to admin_request_list_url
end
def edit_outgoing
@@ -135,7 +135,7 @@ class AdminRequestController < AdminController
{ :editor => admin_current_user(), :deleted_outgoing_message_id => outgoing_message_id })
flash[:notice] = 'Outgoing message successfully destroyed.'
- redirect_to request_admin_url(@info_request)
+ redirect_to admin_request_show_url(@info_request)
end
def update_outgoing
@@ -148,7 +148,7 @@ class AdminRequestController < AdminController
{ :outgoing_message_id => @outgoing_message.id, :editor => admin_current_user(),
:old_body => old_body, :body => @outgoing_message.body })
flash[:notice] = 'Outgoing message successfully updated.'
- redirect_to request_admin_url(@outgoing_message.info_request)
+ redirect_to admin_request_show_url(@outgoing_message.info_request)
else
render :action => 'edit_outgoing'
end
@@ -172,7 +172,7 @@ class AdminRequestController < AdminController
:old_visible => old_visible, :visible => @comment.visible,
})
flash[:notice] = 'Comment successfully updated.'
- redirect_to request_admin_url(@comment.info_request)
+ redirect_to admin_request_show_url(@comment.info_request)
else
render :action => 'edit_comment'
end
@@ -190,7 +190,7 @@ class AdminRequestController < AdminController
# expire cached files
expire_for_request(@info_request)
flash[:notice] = 'Incoming message successfully destroyed.'
- redirect_to request_admin_url(@info_request)
+ redirect_to admin_request_show_url(@info_request)
end
def redeliver_incoming
@@ -207,7 +207,7 @@ class AdminRequestController < AdminController
end
if destination_request.nil?
flash[:error] = "Failed to find destination request '" + m + "'"
- return redirect_to request_admin_url(previous_request)
+ return redirect_to admin_request_show_url(previous_request)
end
raw_email_data = incoming_message.raw_email.data
@@ -227,7 +227,7 @@ class AdminRequestController < AdminController
expire_for_request(previous_request)
incoming_message.fully_destroy
end
- redirect_to request_admin_url(destination_request)
+ redirect_to admin_request_show_url(destination_request)
end
# change user or public body of a request magically
@@ -250,7 +250,7 @@ class AdminRequestController < AdminController
info_request.reindex_request_events
flash[:notice] = "Message has been moved to new user"
end
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
elsif params[:commit] == 'Move request to authority' && !params[:public_body_url_name].blank?
old_public_body = info_request.public_body
destination_public_body = PublicBody.find_by_url_name(params[:public_body_url_name])
@@ -269,10 +269,10 @@ class AdminRequestController < AdminController
flash[:notice] = "Request has been moved to new body"
end
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
else
flash[:error] = "Please enter the user or authority to move the request to"
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
end
end
@@ -296,20 +296,20 @@ class AdminRequestController < AdminController
if !info_request.public_body.is_foi_officer?(user)
flash[:notice] = user.email + " is not an email at the domain @" + info_request.public_body.foi_officer_domain_required + ", so won't be able to upload."
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
return
end
# Bejeeps, look, sometimes a URL is something that belongs in a controller, jesus.
- # XXX hammer this square peg into the round MVC hole - should be calling main_url(upload_response_url())
+ # XXX hammer this square peg into the round MVC hole
post_redirect = PostRedirect.new(
- :uri => main_url(upload_response_url(:url_title => info_request.url_title, :only_path => true)),
+ :uri => upload_response_url(:url_title => info_request.url_title),
:user_id => user.id)
post_redirect.save!
- url = main_url(confirm_url(:email_token => post_redirect.email_token, :only_path => true))
+ url = confirm_url(:email_token => post_redirect.email_token)
- flash[:notice] = 'Send "' + name + '" &lt;<a href="mailto:' + email + '">' + email + '</a>&gt; this URL: <a href="' + url + '">' + url + "</a> - it will log them in and let them upload a response to this request.".html_safe
- redirect_to request_admin_url(info_request)
+ flash[:notice] = ("Send \"#{name}\" &lt;<a href=\"mailto:#{email}\">#{email}</a>&gt; this URL: <a href=\"#{url}\">#{url}</a> - it will log them in and let them upload a response to this request.").html_safe
+ redirect_to admin_request_show_url(info_request)
end
def show_raw_email
@@ -359,7 +359,7 @@ class AdminRequestController < AdminController
info_request_event.save!
flash[:notice] = "Old response marked as having been a clarification"
- redirect_to request_admin_url(info_request_event.info_request)
+ redirect_to admin_request_show_url(info_request_event.info_request)
end
def hide_request
@@ -383,7 +383,7 @@ class AdminRequestController < AdminController
ContactMailer.from_admin_message(
info_request.user,
subject,
- params[:explanation]
+ params[:explanation].strip.html_safe
).deliver
flash[:notice] = _("Your message to {{recipient_user_name}} has been sent",:recipient_user_name=>CGI.escapeHTML(info_request.user.name))
else
@@ -391,7 +391,7 @@ class AdminRequestController < AdminController
end
# expire cached files
expire_for_request(info_request)
- redirect_to request_admin_url(info_request)
+ redirect_to admin_request_show_url(info_request)
end
end
diff --git a/app/controllers/admin_track_controller.rb b/app/controllers/admin_track_controller.rb
index 65b3cf589..bd0eee27b 100644
--- a/app/controllers/admin_track_controller.rb
+++ b/app/controllers/admin_track_controller.rb
@@ -13,6 +13,7 @@ class AdminTrackController < AdminController
track_things = TrackThing
end
@admin_tracks = track_things.paginate :order => "created_at desc", :page => params[:page], :per_page => 100
+ @popular = ActiveRecord::Base.connection.select_all("select count(*) as count, title, info_request_id from track_things join info_requests on info_request_id = info_requests.id where info_request_id is not null group by info_request_id, title order by count desc limit 10;")
end
private
diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb
index f7d8d3f56..e6a167de8 100644
--- a/app/controllers/admin_user_controller.rb
+++ b/app/controllers/admin_user_controller.rb
@@ -52,7 +52,7 @@ class AdminUserController < AdminController
if @admin_user.valid?
@admin_user.save!
flash[:notice] = 'User successfully updated.'
- redirect_to user_admin_url(@admin_user)
+ redirect_to admin_user_show_url(@admin_user)
else
render :action => 'edit'
end
@@ -62,7 +62,7 @@ class AdminUserController < AdminController
track_thing = TrackThing.find(params[:track_id].to_i)
track_thing.destroy
flash[:notice] = 'Track destroyed'
- redirect_to user_admin_url(track_thing.tracking_user)
+ redirect_to admin_user_show_url(track_thing.tracking_user)
end
def clear_bounce
@@ -70,15 +70,15 @@ class AdminUserController < AdminController
user.email_bounced_at = nil
user.email_bounce_message = ""
user.save!
- redirect_to user_admin_url(user)
+ redirect_to admin_user_show_url(user)
end
def login_as
@admin_user = User.find(params[:id]) # check user does exist
- post_redirect = PostRedirect.new( :uri => main_url(user_url(@admin_user)), :user_id => @admin_user.id, :circumstance => "login_as" )
+ post_redirect = PostRedirect.new( :uri => user_url(@admin_user), :user_id => @admin_user.id, :circumstance => "login_as" )
post_redirect.save!
- url = main_url(confirm_url(:email_token => post_redirect.email_token, :only_path => true))
+ url = confirm_url(:email_token => post_redirect.email_token)
redirect_to url
end
@@ -95,7 +95,7 @@ class AdminUserController < AdminController
end
flash[:notice] = "Profile photo cleared"
- redirect_to user_admin_url(@admin_user)
+ redirect_to admin_user_show_url(@admin_user)
end
private
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index f039390b3..49b226e4b 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -215,7 +215,7 @@ class ApiController < ApplicationController
:event_id => event.id,
:created_at => event.created_at.iso8601,
:event_type => event.event_type,
- :request_url => main_url(request_url(request)),
+ :request_url => request_url(request),
:request_email => request.incoming_email,
:title => request.title,
:body => event.outgoing_message.body,
@@ -223,7 +223,7 @@ class ApiController < ApplicationController
:user_name => request.user_name,
}
if request.user
- this_event[:user_url] = main_url(user_url(request.user))
+ this_event[:user_url] = user_url(request.user)
end
@event_data.push(this_event)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index a6df11ef7..df522519d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -449,11 +449,7 @@ class ApplicationController < ActionController::Base
end
end
- def param_exists(item)
- return params[item] && !params[item].empty?
- end
-
- def get_request_variety_from_params
+ def get_request_variety_from_params(params)
query = ""
sortby = "newest"
varieties = []
@@ -475,7 +471,7 @@ class ApplicationController < ActionController::Base
return query
end
- def get_status_from_params
+ def get_status_from_params(params)
query = ""
if params[:latest_status]
statuses = []
@@ -510,24 +506,24 @@ class ApplicationController < ActionController::Base
return query
end
- def get_date_range_from_params
+ def get_date_range_from_params(params)
query = ""
- if param_exists(:request_date_after) && !param_exists(:request_date_before)
+ if params.has_key?(:request_date_after) && !params.has_key?(:request_date_before)
params[:request_date_before] = Time.now.strftime("%d/%m/%Y")
query += " #{params[:request_date_after]}..#{params[:request_date_before]}"
- elsif !param_exists(:request_date_after) && param_exists(:request_date_before)
+ elsif !params.has_key?(:request_date_after) && params.has_key?(:request_date_before)
params[:request_date_after] = "01/01/2001"
end
- if param_exists(:request_date_after)
+ if params.has_key?(:request_date_after)
query = " #{params[:request_date_after]}..#{params[:request_date_before]}"
end
return query
end
- def get_tags_from_params
+ def get_tags_from_params(params)
query = ""
tags = []
- if param_exists(:tags)
+ if params.has_key?(:tags)
params[:tags].split().each do |tag|
tags << "tag:#{tag}"
end
@@ -538,12 +534,12 @@ class ApplicationController < ActionController::Base
return query
end
- def make_query_from_params
+ def make_query_from_params(params)
query = params[:query] || "" if query.nil?
- query += get_date_range_from_params
- query += get_request_variety_from_params
- query += get_status_from_params
- query += get_tags_from_params
+ query += get_date_range_from_params(params)
+ query += get_request_variety_from_params(params)
+ query += get_status_from_params(params)
+ query += get_tags_from_params(params)
return query
end
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index e52be7cf8..6f79c50cb 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -151,10 +151,10 @@ class GeneralController < ApplicationController
params[:query] = @query
end
if @variety_postfix != "all" && @requests
- @query, _ = make_query_from_params
+ @query, _ = make_query_from_params(params)
end
@inputted_sortby = @sortby
- @common_query = get_tags_from_params
+ @common_query = get_tags_from_params(params)
if @sortby.nil?
# Parse query, so can work out if it has prefix terms only - if so then it is a
# structured query which should show newest first, rather than a free text search
@@ -229,7 +229,5 @@ class GeneralController < ApplicationController
@locale = self.locale_from_params()
render(:layout => false, :content_type => 'text/css')
end
-
-
end
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 985467de3..8d4883938 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -25,22 +25,20 @@ class PublicBodyController < ApplicationController
end
# If found by historic name, or alternate locale name, redirect to new name
if @public_body.url_name != params[:url_name]
- redirect_to show_public_body_url(:url_name => @public_body.url_name)
+ redirect_to :url_name => @public_body.url_name
return
end
set_last_body(@public_body)
- top_url = main_url("/")
+ top_url = frontpage_url
@searched_to_send_request = false
referrer = request.env['HTTP_REFERER']
if !referrer.nil? && referrer.match(%r{^#{top_url}search/.*/bodies$})
@searched_to_send_request = true
end
@view = params[:view]
- params[:latest_status] = @view
-
- query = make_query_from_params
+ query = make_query_from_params(params.merge(:latest_status => @view))
query += " requested_from:#{@public_body.url_name}"
# Use search query for this so can collapse and paginate easily
# XXX really should just use SQL query here rather than Xapian.
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 241010049..33f18e737 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -166,7 +166,7 @@ class RequestController < ApplicationController
@view = params[:view]
@page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect
if @view == "recent"
- return redirect_to request_list_all_path(:action => "list", :view => "all", :page => @page), :status => :moved_permanently
+ return redirect_to request_list_all_url(:action => "list", :view => "all", :page => @page), :status => :moved_permanently
end
# Later pages are very expensive to load
@@ -174,8 +174,7 @@ class RequestController < ApplicationController
raise ActiveRecord::RecordNotFound.new("Sorry. No pages after #{MAX_RESULTS / PER_PAGE}.")
end
- params[:latest_status] = @view
- query = make_query_from_params
+ query = make_query_from_params(params.merge(:latest_status => @view))
@title = _("View and search requests")
sortby = "newest"
xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse')
@@ -378,93 +377,79 @@ class RequestController < ApplicationController
# Submitted to the describing state of messages form
def describe_state
- @info_request = InfoRequest.find(params[:id].to_i)
- set_last_request(@info_request)
-
- # If this isn't a form submit, go to the request page
- if params[:submitted_describe_state].nil?
- redirect_to request_url(@info_request)
- return
- end
+ info_request = InfoRequest.find(params[:id].to_i)
+ set_last_request(info_request)
# If this is an external request, go to the request page - we don't allow
# state change from the front end interface.
- if @info_request.is_external?
- redirect_to request_url(@info_request)
+ if info_request.is_external?
+ redirect_to request_url(info_request)
return
end
- @is_owning_user = @info_request.is_owning_user?(authenticated_user)
- @last_info_request_event_id = @info_request.last_event_id_needing_description
- @old_unclassified = @info_request.is_old_unclassified? && !authenticated_user.nil?
-
- # Check authenticated, and parameters set. We check is_owning_user
- # to get admin overrides (see is_owning_user? above)
- if !@old_unclassified && !@is_owning_user && !authenticated_as_user?(@info_request.user,
+ # Check authenticated, and parameters set.
+ unless Ability::can_update_request_state?(authenticated_user, info_request)
+ authenticated_as_user?(info_request.user,
:web => _("To classify the response to this FOI request"),
- :email => _("Then you can classify the FOI response you have got from ") + @info_request.public_body.name + ".",
- :email_subject => _("Classify an FOI response from ") + @info_request.public_body.name
- )
+ :email => _("Then you can classify the FOI response you have got from ") + info_request.public_body.name + ".",
+ :email_subject => _("Classify an FOI response from ") + info_request.public_body.name)
# do nothing - as "authenticated?" has done the redirect to signin page for us
return
end
if !params[:incoming_message]
flash[:error] = _("Please choose whether or not you got some of the information that you wanted.")
- redirect_to request_url(@info_request)
+ redirect_to request_url(info_request)
return
end
- if params[:last_info_request_event_id].to_i != @last_info_request_event_id
+ if params[:last_info_request_event_id].to_i != info_request.last_event_id_needing_description
flash[:error] = _("The request has been updated since you originally loaded this page. Please check for any new incoming messages below, and try again.")
- redirect_to request_url(@info_request)
+ redirect_to request_url(info_request)
+ return
+ end
+
+ described_state = params[:incoming_message][:described_state]
+ message = params[:incoming_message][:message]
+ # For requires_admin and error_message states we ask for an extra message to send to
+ # the administrators.
+ # If this message hasn't been included then ask for it
+ if ["error_message", "requires_admin"].include?(described_state) && message.nil?
+ redirect_to describe_state_message_url(:url_title => info_request.url_title, :described_state => described_state)
return
end
# Make the state change
- old_described_state = @info_request.described_state
- @info_request.set_described_state(params[:incoming_message][:described_state])
+ info_request.set_described_state(described_state, authenticated_user, message)
# If you're not the *actual* requester. e.g. you are playing the
# classification game, or you're doing this just because you are an
# admin user (not because you also own the request).
- if !@info_request.is_actual_owning_user?(authenticated_user)
- # Log the status change by someone other than the requester
- event = @info_request.log_event("status_update",
- { :user_id => authenticated_user.id,
- :old_described_state => old_described_state,
- :described_state => @info_request.described_state,
- })
- # Create a classification event for league tables
- RequestClassification.create!(:user_id => authenticated_user.id,
- :info_request_event_id => event.id)
-
+ if !info_request.is_actual_owning_user?(authenticated_user)
# Don't give advice on what to do next, as it isn't their request
- RequestMailer.old_unclassified_updated(@info_request).deliver if !@info_request.is_external?
+ RequestMailer.deliver_old_unclassified_updated(@info_request) if !@info_request.is_external?
if session[:request_game]
- flash[:notice] = _('Thank you for updating the status of the request \'<a href="{{url}}">{{info_request_title}}</a>\'. There are some more requests below for you to classify.',:info_request_title=>CGI.escapeHTML(@info_request.title), :url=>CGI.escapeHTML(request_url(@info_request)))
- redirect_to play_url
+ flash[:notice] = _('Thank you for updating the status of the request \'<a href="{{url}}">{{info_request_title}}</a>\'. There are some more requests below for you to classify.',:info_request_title=>CGI.escapeHTML(info_request.title), :url=>CGI.escapeHTML(request_path(info_request)))
+ redirect_to categorise_play_url
else
flash[:notice] = _('Thank you for updating this request!')
- redirect_to request_url(@info_request)
+ redirect_to request_url(info_request)
end
return
end
calculated_status = @info_request.calculate_status
# Display advice for requester on what to do next, as appropriate
- if calculated_status == 'waiting_response'
- flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response promptly, and normally before the end of <strong>
-{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
- redirect_to request_url(@info_request)
- elsif calculated_status == 'waiting_response_overdue'
- flash[:notice] = _("<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and normally before the end of <strong>{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(@info_request.date_response_required_by))
- redirect_to request_url(@info_request)
- elsif calculated_status == 'waiting_response_very_overdue'
- flash[:notice] = _("<p>Thank you! Your request is long overdue, by more than {{very_late_number_of_days}} working days. Most requests should be answered within {{late_number_of_days}} working days. You might like to complain about this, see below.</p>", :very_late_number_of_days => AlaveteliConfiguration::reply_very_late_after_days, :late_number_of_days => AlaveteliConfiguration::reply_late_after_days)
- redirect_to unhappy_url(@info_request)
- elsif calculated_status == 'not_held'
- flash[:notice] = _("<p>Thank you! Here are some ideas on what to do next:</p>
+ flash[:notice] = case info_request.calculate_status
+ when 'waiting_response'
+ _("<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response promptly, and normally before the end of <strong>
+{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(info_request.date_response_required_by))
+ when 'waiting_response_overdue'
+ _("<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and normally before the end of <strong>{{date_response_required_by}}</strong>.</p>",:date_response_required_by=>simple_date(info_request.date_response_required_by))
+ when 'waiting_response_very_overdue'
+ _("<p>Thank you! Your request is long overdue, by more than {{very_late_number_of_days}} working days. Most requests should be answered within {{late_number_of_days}} working days. You might like to complain about this, see below.</p>", :very_late_number_of_days => Configuration::reply_very_late_after_days, :late_number_of_days => Configuration::reply_late_after_days)
+ when 'not_held'
+ _("<p>Thank you! Here are some ideas on what to do next:</p>
<ul>
<li>To send your request to another authority, first copy the text of your request below, then <a href=\"{{find_authority_url}}\">find the other authority</a>.</li>
<li>If you would like to contest the authority's claim that they do not hold the information, here is
@@ -475,44 +460,60 @@ class RequestController < ApplicationController
</li>
</ul>",
:find_authority_url => "/new",
- :complain_url => CGI.escapeHTML(unhappy_url(@info_request)),
- :other_means_url => CGI.escapeHTML(unhappy_url(@info_request)) + "#other_means")
- redirect_to request_url(@info_request)
- elsif calculated_status == 'rejected'
- flash[:notice] = _("Oh no! Sorry to hear that your request was refused. Here is what to do now.")
- redirect_to unhappy_url(@info_request)
- elsif calculated_status == 'successful'
- flash[:notice] = _("<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p>", :site_name=>site_name, :donation_url => "http://www.mysociety.org/donate/")
- redirect_to request_url(@info_request)
- elsif calculated_status == 'partially_successful'
- flash[:notice] = _("<p>We're glad you got some of the information that you wanted. If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>", :site_name=>site_name, :donation_url=>"http://www.mysociety.org/donate/")
- redirect_to unhappy_url(@info_request)
- elsif calculated_status == 'waiting_clarification'
- flash[:notice] = _("Please write your follow up message containing the necessary clarifications below.")
- redirect_to respond_to_last_url(@info_request)
- elsif calculated_status == 'gone_postal'
- redirect_to respond_to_last_url(@info_request) + "?gone_postal=1"
- elsif calculated_status == 'internal_review'
- flash[:notice] = _("<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within {{late_number_of_days}} days, or be told if it will take longer (<a href=\"{{review_url}}\">details</a>).</p>",:late_number_of_days => AlaveteliConfiguration.reply_late_after_days, :review_url => unhappy_url(@info_request) + "#internal_review")
- redirect_to request_url(@info_request)
- elsif calculated_status == 'error_message'
- flash[:notice] = _("<p>Thank you! We'll look into what happened and try and fix it up.</p><p>If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.</p>")
- redirect_to help_general_url(:action => 'contact')
- elsif calculated_status == 'requires_admin'
- flash[:notice] = _("Please use the form below to tell us more.")
- redirect_to help_general_url(:action => 'contact')
- elsif calculated_status == 'user_withdrawn'
- flash[:notice] = _("If you have not done so already, please write a message below telling the authority that you have withdrawn your request. Otherwise they will not know it has been withdrawn.")
- redirect_to respond_to_last_url(@info_request)
+ :complain_url => CGI.escapeHTML(unhappy_url(info_request)),
+ :other_means_url => CGI.escapeHTML(unhappy_url(info_request)) + "#other_means")
+ when 'rejected'
+ _("Oh no! Sorry to hear that your request was refused. Here is what to do now.")
+ when 'successful'
+ _("<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p>", :site_name=>site_name, :donation_url => "http://www.mysociety.org/donate/")
+ when 'partially_successful'
+ _("<p>We're glad you got some of the information that you wanted. If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>", :site_name=>site_name, :donation_url=>"http://www.mysociety.org/donate/")
+ when 'waiting_clarification'
+ _("Please write your follow up message containing the necessary clarifications below.")
+ when 'gone_postal'
+ nil
+ when 'internal_review'
+ _("<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within {{late_number_of_days}} days, or be told if it will take longer (<a href=\"{{review_url}}\">details</a>).</p>",:late_number_of_days => Configuration.reply_late_after_days, :review_url => unhappy_url(info_request) + "#internal_review")
+ when 'error_message', 'requires_admin'
+ _("Thank you! We'll look into what happened and try and fix it up.")
+ when 'user_withdrawn'
+ _("If you have not done so already, please write a message below telling the authority that you have withdrawn your request. Otherwise they will not know it has been withdrawn.")
+ end
+
+ case info_request.calculate_status
+ when 'waiting_response', 'waiting_response_overdue', 'not_held', 'successful',
+ 'internal_review', 'error_message', 'requires_admin'
+ redirect_to request_url(info_request)
+ when 'waiting_response_very_overdue', 'rejected', 'partially_successful'
+ redirect_to unhappy_url(info_request)
+ when 'waiting_clarification', 'user_withdrawn'
+ redirect_to respond_to_last_url(info_request)
+ when 'gone_postal'
+ redirect_to respond_to_last_url(info_request) + "?gone_postal=1"
else
if @@custom_states_loaded
- return self.theme_describe_state(@info_request)
+ return self.theme_describe_state(info_request)
else
- raise "unknown calculate_status " + calculated_status
+ raise "unknown calculate_status #{info_request.calculate_status}"
end
end
end
+ # Collect a message to include with the change of state
+ def describe_state_message
+ @info_request = InfoRequest.find_by_url_title!(params[:url_title])
+ @described_state = params[:described_state]
+ @last_info_request_event_id = @info_request.last_event_id_needing_description
+ @title = case @described_state
+ when "error_message"
+ _("I've received an error message")
+ when "requires_admin"
+ _("This request requires administrator attention")
+ else
+ raise "Unsupported state"
+ end
+ end
+
# Used for links from polymorphic URLs e.g. in Atom feeds - just redirect to
# proper URL for the message the event refers to
def show_request_event
@@ -890,7 +891,7 @@ class RequestController < ApplicationController
:email_subject => _("Log in to download a zip file of {{info_request_title}}",
:info_request_title=>@info_request.title)
)
- updated = Digest::SHA1.hexdigest(@info_request.get_last_event.created_at.to_i.to_s + @info_request.updated_at.to_i.to_s)
+ updated = Digest::SHA1.hexdigest(@info_request.info_request_events.last.created_at.to_i.to_s + @info_request.updated_at.to_i.to_s)
@url_path = File.join("/download",
request_dirs(@info_request),
updated,
@@ -902,7 +903,7 @@ class RequestController < ApplicationController
convert_command = AlaveteliConfiguration::html_to_pdf_command
done = false
if !convert_command.blank? && File.exists?(convert_command)
- url = "http://#{AlaveteliConfiguration::domain}#{request_url(@info_request)}?print_stylesheet=1"
+ url = "http://#{AlaveteliConfiguration::domain}#{request_path(@info_request)}?print_stylesheet=1"
tempfile = Tempfile.new('foihtml2pdf')
output = AlaveteliExternalCommand.run(convert_command, url, tempfile.path)
if !output.nil?
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index 35c178aac..11ed4ac8f 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -15,7 +15,7 @@ class ServicesController < ApplicationController
FastGettext.locale = FastGettext.best_locale_in(request.env['HTTP_ACCEPT_LANGUAGE'])
if found_country && found_country[:country_name] && found_country[:url] && found_country[:name]
text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}",
- :country_name => found_country[:country_name], :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>")
+ :country_name => found_country[:country_name], :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>".html_safe)
else
current_country = WorldFOIWebsites.by_code(iso_country_code)[:country_name]
text = _("Hello! We have an <a href=\"/help/alaveteli?country_name=#{CGI.escape(current_country)}\">important message</a> for visitors outside {{country_name}}", :country_name => current_country)
@@ -38,7 +38,7 @@ class ServicesController < ApplicationController
:locals => {:name_to => info_request.user_name,
:name_from => AlaveteliConfiguration::contact_name,
:info_request => info_request, :reason => params[:reason],
- :info_request_url => 'http://' + AlaveteliConfiguration::domain + request_url(info_request),
+ :info_request_url => 'http://' + AlaveteliConfiguration::domain + request_path(info_request),
:site_name => site_name}
end
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index c1f9661b7..658daeeff 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -422,7 +422,7 @@ class UserController < ApplicationController
ContactMailer.user_message(
@user,
@recipient_user,
- main_url(user_url(@user)),
+ user_url(@user),
params[:contact][:subject],
params[:contact][:message]
).deliver
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
new file mode 100644
index 000000000..059cebdfa
--- /dev/null
+++ b/app/helpers/admin_helper.rb
@@ -0,0 +1,37 @@
+module AdminHelper
+ def icon(name)
+ content_tag(:i, "", :class => "icon-#{name}")
+ end
+
+ def eye
+ icon("eye-open")
+ end
+
+ def chevron_right
+ icon("chevron-right")
+ end
+
+ def chevron_down
+ icon("chevron-down")
+ end
+
+ def arrow_right
+ icon("arrow-right")
+ end
+
+ def request_both_links(info_request)
+ link_to(eye, request_path(info_request), :title => "view request on public website") + " " +
+ link_to(info_request.title, admin_request_show_path(info_request), :title => "view full details")
+ end
+
+ def public_body_both_links(public_body)
+ link_to(eye, public_body_path(public_body), :title => "view authority on public website") + " " +
+ link_to(h(public_body.name), admin_body_show_path(public_body), :title => "view full details")
+ end
+
+ def user_both_links(user)
+ link_to(eye, user_path(user), :title => "view user's page on public website") + " " +
+ link_to(h(user.name), admin_user_show_path(user), :title => "view full details")
+ end
+end
+
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 74de5eb6d..ffa34e345 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -10,95 +10,93 @@ module LinkToHelper
# Links to various models
# Requests
- def request_url(info_request, extra_params={})
- params = {:url_title => info_request.url_title, :only_path => true}
- return show_request_url(params.merge(extra_params))
+ def request_url(info_request, options = {})
+ show_request_url({:url_title => info_request.url_title}.merge(options))
end
- def request_link(info_request, cls=nil )
- link_to h(info_request.title), request_url(info_request), :class => cls
+ def request_path(info_request, options = {})
+ request_url(info_request, {:only_path => true}.merge(options))
end
- def request_admin_url(info_request)
- return admin_url('request/show/' + info_request.id.to_s)
+ def request_link(info_request, cls=nil )
+ link_to h(info_request.title), request_path(info_request), :class => cls
end
- def request_admin_link(info_request, name="admin", cls=nil)
- link_to name, request_admin_url(info_request), :class => cls
+ def request_details_path(info_request)
+ details_request_path(:url_title => info_request.url_title)
end
- def request_both_links(info_request)
- link_to(h(info_request.title), main_url(request_url(info_request))) + " (" + link_to("admin", request_admin_url(info_request)) + ")"
+ # Incoming / outgoing messages
+ def incoming_message_url(incoming_message, options = {})
+ return request_url(incoming_message.info_request, options.merge(:anchor => "incoming-#{incoming_message.id}"))
end
- def request_similar_url(info_request)
- return similar_request_url(:url_title => info_request.url_title, :only_path => true)
+ def incoming_message_path(incoming_message)
+ incoming_message_url(incoming_message, :only_path => true)
end
- def request_details_url(info_request)
- return details_request_url(:url_title => info_request.url_title, :only_path => true)
+ def outgoing_message_url(outgoing_message, options = {})
+ return request_path(outgoing_message.info_request, options.merge(:anchor => "outgoing-#{outgoing_message.id}"))
end
- # Incoming / outgoing messages
- def incoming_message_url(incoming_message)
- return request_url(incoming_message.info_request)+"#incoming-"+incoming_message.id.to_s
+ def outgoing_message_path(outgoing_message)
+ outgoing_message_url(outgoing_message, :only_path => true)
end
- def outgoing_message_url(outgoing_message)
- return request_url(outgoing_message.info_request)+"#outgoing-"+outgoing_message.id.to_s
+ def comment_url(comment, options = {})
+ request_url(comment.info_request, options.merge(:anchor => "comment-#{comment.id}"))
end
- def comment_url(comment)
- return request_url(comment.info_request)+"#comment-"+comment.id.to_s
+ def comment_path(comment)
+ comment_url(comment, :only_path => true)
end
# Respond to request
- def respond_to_last_url(info_request)
+ def respond_to_last_url(info_request, options = {})
last_response = info_request.get_last_response
if last_response.nil?
- respond_url = show_response_no_followup_url(:id => info_request.id)
+ show_response_no_followup_url(options.merge(:id => info_request.id))
else
- respond_url = show_response_url(:id => info_request.id, :incoming_message_id => last_response.id)
+ show_response_url(options.merge(:id => info_request.id, :incoming_message_id => last_response.id))
end
- return respond_url
end
- # Public bodies
- def public_body_url(public_body)
- public_body.url_name.nil? ? '' : show_public_body_url(:url_name => public_body.url_name, :only_path => true)
+ def respond_to_last_path(info_request)
+ respond_to_last_url(info_request, :only_path => true)
end
- def public_body_link_short(public_body)
- link_to h(public_body.short_or_long_name), public_body_url(public_body)
+ # Public bodies
+ def public_body_url(public_body, options = {})
+ public_body.url_name.nil? ? '' : show_public_body_url(options.merge(:url_name => public_body.url_name))
end
- def public_body_link(public_body, cls=nil)
- link_to h(public_body.name), public_body_url(public_body), :class => cls
+ def public_body_path(public_body)
+ public_body_url(public_body, :only_path => true)
end
- def public_body_link_absolute(public_body) # e.g. for in RSS
- link_to h(public_body.name), main_url(public_body_url(public_body))
+ def public_body_link_short(public_body)
+ link_to h(public_body.short_or_long_name), public_body_path(public_body)
end
- def public_body_admin_url(public_body)
- return admin_url('body/show/' + public_body.id.to_s)
+ def public_body_link(public_body, cls=nil)
+ link_to h(public_body.name), public_body_path(public_body), :class => cls
end
- def public_body_both_links(public_body)
- link_to(h(public_body.name), main_url(public_body_url(public_body))) + " (" + link_to("admin", public_body_admin_url(public_body)) + ")"
+ def public_body_link_absolute(public_body) # e.g. for in RSS
+ link_to h(public_body.name), public_body_url(public_body)
end
- def list_public_bodies_default
- list_public_bodies_url(:tag => 'all')
+ # Users
+ def user_url(user, options = {})
+ show_user_url(options.merge(:url_name => user.url_name))
end
- # Users
- def user_url(user)
- return show_user_url(:url_name => user.url_name, :only_path => true)
+ def user_path(user)
+ user_url(user, :only_path => true)
end
def user_link(user, cls=nil)
- link_to h(user.name), user_url(user), :class => cls
+ link_to h(user.name), user_path(user), :class => cls
end
def user_link_for_request(request, cls=nil)
@@ -110,21 +108,24 @@ module LinkToHelper
user_name
end
else
- link_to h(request.user.name), user_url(request.user), :class => cls
+ link_to h(request.user.name), user_path(request.user), :class => cls
end
end
def user_admin_link_for_request(request, external_text=nil, internal_text=nil)
if request.is_external?
- text = external_text ? external_text : (request.external_user_name || _("Anonymous user")) + " (external)"
+ external_text || (request.external_user_name || _("Anonymous user")) + " (external)"
else
- text = internal_text ? internal_text : request.user.name
- link_to(h(text), user_admin_url(request.user))
+ link_to(h(internal_text || request.user.name), admin_user_show_url(request.user))
end
end
def user_link_absolute(user)
- link_to h(user.name), main_url(user_url(user))
+ link_to h(user.name), user_url(user)
+ end
+
+ def user_link(user)
+ link_to h(user.name), user_path(user)
end
def request_user_link_absolute(request)
@@ -135,11 +136,19 @@ module LinkToHelper
end
end
+ def request_user_link(request)
+ if request.is_external?
+ request.external_user_name || _("Anonymous user")
+ else
+ user_link(request.user)
+ end
+ end
+
def user_or_you_link(user)
if @user && user == @user
- link_to h("you"), user_url(user)
+ link_to h("you"), user_path(user)
else
- link_to h(user.name), user_url(user)
+ link_to h(user.name), user_path(user)
end
end
@@ -152,40 +161,36 @@ module LinkToHelper
end
def user_or_you_capital_link(user)
- link_to user_or_you_capital(user), user_url(user)
- end
-
- def user_admin_url(user)
- return admin_url('user/show/' + user.id.to_s)
+ link_to user_or_you_capital(user), user_path(user)
end
def user_admin_link(user, name="admin", cls=nil)
- link_to name, user_admin_url(user), :class => cls
- end
-
- def user_both_links(user)
- link_to(h(user.name), main_url(user_url(user))) + " (" + link_to("admin", user_admin_url(user)) + ")"
+ link_to name, admin_user_show_url(user), :class => cls
end
# Tracks. feed can be 'track' or 'feed'
- def do_track_url(track_thing, feed = 'track')
+ def do_track_url(track_thing, feed = 'track', options = {})
if track_thing.track_type == 'request_updates'
- track_request_url(:url_title => track_thing.info_request.url_title, :feed => feed)
+ track_request_url(options.merge(:url_title => track_thing.info_request.url_title, :feed => feed))
elsif track_thing.track_type == 'all_new_requests'
- track_list_url(:view => 'recent', :feed => feed)
+ track_list_url(options.merge(:view => 'recent', :feed => feed))
elsif track_thing.track_type == 'all_successful_requests'
- track_list_url(:view => 'successful', :feed => feed)
+ track_list_url(options.merge(:view => 'successful', :feed => feed))
elsif track_thing.track_type == 'public_body_updates'
- track_public_body_url(:url_name => track_thing.public_body.url_name, :feed => feed)
+ track_public_body_url(options.merge(:url_name => track_thing.public_body.url_name, :feed => feed))
elsif track_thing.track_type == 'user_updates'
- track_user_url(:url_name => track_thing.tracked_user.url_name, :feed => feed)
+ track_user_url(options.merge(:url_name => track_thing.tracked_user.url_name, :feed => feed))
elsif track_thing.track_type == 'search_query'
- track_search_url(:query_array => track_thing.track_query, :feed => feed)
+ track_search_url(options.merge(:query_array => track_thing.track_query, :feed => feed))
else
raise "unknown tracking type " + track_thing.track_type
end
end
+ def do_track_path(track_thing, feed = 'track')
+ do_track_url(track_thing, feed, :only_path => true)
+ end
+
# General pages.
def search_url(query, params = nil)
if query.kind_of?(Array)
@@ -217,27 +222,25 @@ module LinkToHelper
link_to h(query), search_url(query)
end
- # Admin pages
- def admin_url(relative_path)
- admin_url_prefix = AlaveteliConfiguration::admin_base_url
- (admin_url_prefix.empty? ? admin_general_index_url + '/' : admin_url_prefix) + relative_path
+ def search_path(query, options = {})
+ search_url(query, options.merge(:only_path => true))
end
- # About page URLs
- def about_url
- return help_general_url(:action => 'about')
+ def search_link(query)
+ link_to h(query), search_url(query)
end
- def unhappy_url(info_request = nil)
- if info_request.nil?
- return help_general_url(:action => 'unhappy')
- else
- return help_unhappy_url(:url_title => info_request.url_title)
- end
+ # Deprecated helper
+ # TODO: Remove in next release
+ def admin_url(relative_path)
+ warn "[DEPRECATION] admin_url is deprecated. Please remove it from your theme."
+ relative_path
end
-
+ # Deprecated helper
+ # TODO: Remove in next release
def main_url(relative_path, append = nil)
+ warn "[DEPRECATION] main_url is deprecated. Please remove it from your theme."
url_prefix = "http://" + AlaveteliConfiguration::domain
url = url_prefix + relative_path
if !append.nil?
@@ -253,6 +256,19 @@ module LinkToHelper
return url
end
+ # About page URLs
+ def about_url
+ return help_general_url(:action => 'about')
+ end
+
+ def unhappy_url(info_request = nil)
+ if info_request.nil?
+ return help_general_url(:action => 'unhappy')
+ else
+ return help_unhappy_url(:url_title => info_request.url_title)
+ end
+ end
+
# Basic date format
def simple_date(date)
date = date.in_time_zone.to_date unless date.is_a? Date
diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb
index 750f6f9b5..3e0b05b65 100644
--- a/app/mailers/request_mailer.rb
+++ b/app/mailers/request_mailer.rb
@@ -56,14 +56,10 @@ class RequestMailer < ApplicationMailer
# An FOI response is outside the scope of the system, and needs admin attention
def requires_admin(info_request, set_by = nil)
- if !set_by.nil?
- user = set_by
- else
- user = info_request.user
- end
+ user = set_by || info_request.user
@reported_by = user
- @url = main_url(request_url(info_request))
- @admin_url = request_admin_url(info_request)
+ @url = request_url(info_request)
+ @admin_url = admin_request_show_url(info_request)
@info_request = info_request
mail(:from => user.name_and_email,
@@ -75,7 +71,7 @@ class RequestMailer < ApplicationMailer
def new_response(info_request, incoming_message)
# Don't use login link here, just send actual URL. This is
# because people tend to forward these emails amongst themselves.
- @url = main_url(incoming_message_url(incoming_message))
+ @url = incoming_message_url(incoming_message)
@incoming_message, @info_request = incoming_message, info_request
headers('Return-Path' => blackhole_email,
@@ -92,10 +88,13 @@ class RequestMailer < ApplicationMailer
# Tell the requester that the public body is late in replying
def overdue_alert(info_request, user)
+ respond_url = respond_to_last_url(info_request) + "#followup"
+
post_redirect = PostRedirect.new(
:uri => respond_to_last_url(info_request) + "#followup",
:user_id => user.id)
post_redirect.save!
+ url = confirm_url(:email_token => post_redirect.email_token)
@url = confirm_url(:email_token => post_redirect.email_token)
@info_request = info_request
@@ -106,11 +105,13 @@ class RequestMailer < ApplicationMailer
mail(:from => contact_from_name_and_email,
:to => user.name_and_email,
- :subject => _("Delayed response to your FOI request - ") + info_request.title)
+ :subject => _("Delayed response to your FOI request - ") + info_request.title).html_safe
end
# Tell the requester that the public body is very late in replying
def very_overdue_alert(info_request, user)
+ respond_url = respond_to_last_url(info_request) + "#followup"
+
post_redirect = PostRedirect.new(
:uri => respond_to_last_url(info_request) + "#followup",
:user_id => user.id)
@@ -124,7 +125,7 @@ class RequestMailer < ApplicationMailer
mail(:from => contact_from_name_and_email,
:to => user.name_and_email,
- :subject => _("You're long overdue a response to your FOI request - ") + info_request.title)
+ :subject => _("You're long overdue a response to your FOI request - ") + info_request.title).html_safe
end
# Tell the requester that they need to say if the new response
@@ -133,7 +134,7 @@ class RequestMailer < ApplicationMailer
# Make a link going to the form to describe state, and which logs the
# user in.
post_redirect = PostRedirect.new(
- :uri => main_url(request_url(info_request)) + "#describe_state_form_1",
+ :uri => request_url(info_request) + "#describe_state_form_1",
:user_id => info_request.user.id)
post_redirect.save!
@url = confirm_url(:email_token => post_redirect.email_token)
@@ -151,7 +152,7 @@ class RequestMailer < ApplicationMailer
# Tell the requester that someone updated their old unclassified request
def old_unclassified_updated(info_request)
- @url = main_url(request_url(info_request))
+ @url = request_url(info_request)
@info_request = info_request
headers('Return-Path' => blackhole_email, 'Reply-To' => contact_from_name_and_email, # not much we can do if the user's email is broken
@@ -188,7 +189,7 @@ class RequestMailer < ApplicationMailer
# Tell requester that somebody add an annotation to their request
def comment_on_alert(info_request, comment)
@comment, @info_request = comment, info_request
- @url = main_url(comment_url(comment))
+ @url = comment_url(comment)
headers('Return-Path' => blackhole_email, 'Reply-To' => contact_from_name_and_email, # not much we can do if the user's email is broken
'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
@@ -196,7 +197,7 @@ class RequestMailer < ApplicationMailer
mail(:from => contact_from_name_and_email,
:to => info_request.user.name_and_email,
- :subject => _("Somebody added a note to your FOI request - ") + info_request.title)
+ :subject => _("Somebody added a note to your FOI request - ") + info_request.title).html_safe
end
def comment_on_alert_plural(info_request, count, earliest_unalerted_comment)
@count, @info_request = count, info_request
@@ -208,7 +209,7 @@ class RequestMailer < ApplicationMailer
mail(:from => contact_from_name_and_email,
:to => info_request.user.name_and_email,
- :subject => _("Some notes have been added to your FOI request - ") + info_request.title)
+ :subject => _("Some notes have been added to your FOI request - ") + info_request.title).html_safe
end
# Class function, called by script/mailin with all incoming responses.
diff --git a/app/mailers/track_mailer.rb b/app/mailers/track_mailer.rb
index 263b406e9..ea5489726 100644
--- a/app/mailers/track_mailer.rb
+++ b/app/mailers/track_mailer.rb
@@ -9,7 +9,7 @@ class TrackMailer < ApplicationMailer
@user, @email_about_things = user, email_about_things
post_redirect = PostRedirect.new(
- :uri => main_url(user_url(user)) + "#email_subscriptions",
+ :uri => user_url(user) + "#email_subscriptions",
:user_id => user.id)
post_redirect.save!
@unsubscribe_url = confirm_url(:email_token => post_redirect.email_token)
diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb
index e73294f0f..a55f98b10 100644
--- a/app/models/foi_attachment.rb
+++ b/app/models/foi_attachment.rb
@@ -299,8 +299,7 @@ class FoiAttachment < ActiveRecord::Base
text = CGI.escapeHTML(text)
text = MySociety::Format.make_clickable(text)
html = text.gsub(/\n/, '<br>')
- return '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd"><html><head><title></title></head><body>' + html + "</body></html>", wrapper_id
+ return '<!DOCTYPE html><html><head><title></title></head><body>' + html + "</body></html>", wrapper_id
end
# the extractions will also produce image files, which go in the
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 5f5cc28c7..130c5b02c 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -160,8 +160,31 @@ class InfoRequest < ActiveRecord::Base
rescue MissingSourceFile, NameError
end
+ # only check on create, so existing models with mixed case are allowed
+ def validate_on_create
+ if !self.title.nil? && !MySociety::Validate.uses_mixed_capitals(self.title, 10)
+ errors.add(:title, _('Please write the summary using a mixture of capital and lower case letters. This makes it easier for others to read.'))
+ end
+ if !self.title.nil? && title.size > 200
+ errors.add(:title, _('Please keep the summary short, like in the subject of an email. You can use a phrase, rather than a full sentence.'))
+ end
+ if !self.title.nil? && self.title =~ /^(FOI|Freedom of Information)\s*requests?$/i
+ errors.add(:title, _('Please describe more what the request is about in the subject. There is no need to say it is an FOI request, we add that on anyway.'))
+ end
+ end
+
OLD_AGE_IN_DAYS = 21.days
+ def after_initialize
+ if self.described_state.nil?
+ self.described_state = 'waiting_response'
+ end
+ # FOI or EIR?
+ if !self.public_body.nil? && self.public_body.eir_only?
+ self.law_used = 'eir'
+ end
+ end
+
def visible_comments
self.comments.find(:all, :conditions => 'visible')
end
@@ -529,15 +552,15 @@ public
end
def requires_admin?
- return true if InfoRequest.requires_admin_states.include?(described_state)
- return false
+ ['requires_admin', 'error_message', 'attention_requested'].include?(described_state)
end
# change status, including for last event for later historical purposes
- def set_described_state(new_state, set_by = nil)
+ def set_described_state(new_state, set_by = nil, message = "")
+ old_described_state = described_state
ActiveRecord::Base.transaction do
self.awaiting_description = false
- last_event = self.get_last_event
+ last_event = self.info_request_events.last
last_event.described_state = new_state
self.described_state = new_state
last_event.save!
@@ -549,9 +572,23 @@ public
if self.requires_admin?
# Check there is someone to send the message "from"
if !set_by.nil? || !self.user.nil?
- RequestMailer.requires_admin(self, set_by).deliver
+ RequestMailer.requires_admin(self, set_by, message).deliver
end
end
+
+ unless set_by.nil? || is_actual_owning_user?(set_by) || described_state == 'attention_requested'
+ # Log the status change by someone other than the requester
+ event = log_event("status_update",
+ { :user_id => set_by.id,
+ :old_described_state => old_described_state,
+ :described_state => described_state,
+ })
+ # Create a classification event for league tables
+ RequestClassification.create!(:user_id => set_by.id,
+ :info_request_event_id => event.id)
+
+ RequestMailer.deliver_old_unclassified_updated(self) if !is_external?
+ end
end
# Work out what the situation of the request is. In addition to values of
@@ -700,41 +737,28 @@ public
self.info_request_events.create!(:event_type => type, :params => params)
end
+ def response_events
+ self.info_request_events.select{|e| e.response?}
+ end
+
# The last response is the default one people might want to reply to
def get_last_response_event_id
- for e in self.info_request_events.reverse
- if e.event_type == 'response'
- return e.id
- end
- end
- return nil
-
+ get_last_response_event.id if get_last_response_event
end
def get_last_response_event
- for e in self.info_request_events.reverse
- if e.event_type == 'response'
- return e
- end
- end
- return nil
+ response_events.last
end
def get_last_response
- last_response_event = self.get_last_response_event
- if last_response_event.nil?
- return nil
- else
- return last_response_event.incoming_message
- end
+ get_last_response_event.incoming_message if get_last_response_event
+ end
+
+ def outgoing_events
+ info_request_events.select{|e| e.outgoing? }
end
# The last outgoing message
def get_last_outgoing_event
- for e in self.info_request_events.reverse
- if [ 'sent', 'followup_sent' ].include?(e.event_type)
- return e
- end
- end
- return nil
+ outgoing_events.last
end
# Text from the the initial request, for use in summary display
@@ -802,46 +826,31 @@ public
# Display version of status
def InfoRequest.get_status_description(status)
- if status == 'waiting_classification'
- _("Awaiting classification.")
- elsif status == 'waiting_response'
- _("Awaiting response.")
- elsif status == 'waiting_response_overdue'
- _("Delayed.")
- elsif status == 'waiting_response_very_overdue'
- _("Long overdue.")
- elsif status == 'not_held'
- _("Information not held.")
- elsif status == 'rejected'
- _("Refused.")
- elsif status == 'partially_successful'
- _("Partially successful.")
- elsif status == 'successful'
- _("Successful.")
- elsif status == 'waiting_clarification'
- _("Waiting clarification.")
- elsif status == 'gone_postal'
- _("Handled by post.")
- elsif status == 'internal_review'
- _("Awaiting internal review.")
- elsif status == 'error_message'
- _("Delivery error")
- elsif status == 'requires_admin'
- _("Unusual response.")
- elsif status == 'attention_requested'
- _("Reported for administrator attention.")
- elsif status == 'user_withdrawn'
- _("Withdrawn by the requester.")
- elsif status == 'vexatious'
- _("Considered by administrators as vexatious and hidden from site.")
- elsif status == 'not_foi'
- _("Considered by administrators as not an FOI request and hidden from site.")
+ descriptions = {
+ 'waiting_classification' => _("Awaiting classification."),
+ 'waiting_response' => _("Awaiting response."),
+ 'waiting_response_overdue' => _("Delayed."),
+ 'waiting_response_very_overdue' => _("Long overdue."),
+ 'not_held' => _("Information not held."),
+ 'rejected' => _("Refused."),
+ 'partially_successful' => _("Partially successful."),
+ 'successful' => _("Successful."),
+ 'waiting_clarification' => _("Waiting clarification."),
+ 'gone_postal' => _("Handled by post."),
+ 'internal_review' => _("Awaiting internal review."),
+ 'error_message' => _("Delivery error"),
+ 'requires_admin' => _("Unusual response."),
+ 'attention_requested' => _("Reported for administrator attention."),
+ 'user_withdrawn' => _("Withdrawn by the requester."),
+ 'vexatious' => _("Considered by administrators as vexatious and hidden from site."),
+ 'not_foi' => _("Considered by administrators as not an FOI request and hidden from site."),
+ }
+ if descriptions[status]
+ descriptions[status]
+ elsif respond_to?(:theme_display_status)
+ theme_display_status(status)
else
- begin
- return self.theme_display_status(status)
- rescue NoMethodError
- raise _("unknown status ") + status
- end
+ raise _("unknown status ") + status
end
end
@@ -968,13 +977,8 @@ public
end
def is_old_unclassified?
- return false if is_external?
- return false if !awaiting_description
- return false if url_title == 'holding_pen'
- last_response_event = get_last_response_event
- return false unless last_response_event
- return false if last_response_event.created_at >= Time.now - OLD_AGE_IN_DAYS
- return true
+ !is_external? && awaiting_description && url_title != 'holding_pen' && get_last_response_event &&
+ Time.now > get_last_response_event.created_at + OLD_AGE_IN_DAYS
end
# List of incoming messages to followup, by unique email
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index bddd1db01..b52bb371e 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.rb
@@ -77,17 +77,18 @@ class InfoRequestEvent < ActiveRecord::Base
end
def user_can_view?(user)
- if !self.info_request.user_can_view?(user)
+ unless info_request.user_can_view?(user)
raise "internal error, called user_can_view? on event when there is not permission to view entire request"
end
- if self.prominence == 'hidden'
- return User.view_hidden_requests?(user)
- end
- if self.prominence == 'requester_only'
- return self.info_request.is_owning_user?(user)
+ case prominence
+ when 'hidden'
+ User.view_hidden_requests?(user)
+ when 'requester_only'
+ info_request.is_owning_user?(user)
+ else
+ true
end
- return true
end
@@ -363,16 +364,19 @@ class InfoRequestEvent < ActiveRecord::Base
end
def is_sent_sort?
- if [ 'sent', 'resent'].include?(self.event_type)
- return true
- end
- return false
+ ['sent', 'resent'].include?(event_type)
end
+
def is_followup_sort?
- if [ 'followup_sent', 'followup_resent'].include?(self.event_type)
- return true
- end
- return false
+ ['followup_sent', 'followup_resent'].include?(event_type)
+ end
+
+ def outgoing?
+ ['sent', 'followup_sent'].include?(event_type)
+ end
+
+ def response?
+ event_type == 'response'
end
def same_email_as_previous_send?
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb
index 8dbeaca7e..219c66811 100644
--- a/app/models/track_thing.rb
+++ b/app/models/track_thing.rb
@@ -23,6 +23,8 @@
require 'set'
+# TODO: TrackThing looks like a good candidate for single table inheritance
+
class TrackThing < ActiveRecord::Base
belongs_to :tracking_user, :class_name => 'User'
validates_presence_of :track_query
diff --git a/app/sass/admin.scss b/app/sass/admin.scss
new file mode 100644
index 000000000..584b0d00d
--- /dev/null
+++ b/app/sass/admin.scss
@@ -0,0 +1,112 @@
+/* As we're namespacing bootstrap to class admin, which is applied to the body
+ element in the admin interface (no id or class allowed on the HTML element
+ in HTML 4.01) and to the navbar also, so it can be styled with bootstrap
+ when showing for admin users on the front end, re-apply the bootstrap html
+ and body styles here.
+*/
+html {
+ font-size: 100%;
+ -webkit-text-size-adjust: 100%;
+ -ms-text-size-adjust: 100%;
+}
+
+body.admin {
+ margin: 0;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ line-height: 20px;
+ color: #333333;
+ background-color: white;
+}
+
+/* When the admin stylesheet is loaded (and so the user is seeing the admin navbar), pad the banner of the front end interface so that it isn't hidden, and move any special notice down too.
+*/
+
+.entirebody, #banner {
+ padding-top: 50px;
+}
+
+#special-notice {
+ margin-top: 50px;
+}
+
+.admin {
+
+ @import "compass/css3";
+ @import "bootstrap";
+
+ #main {
+ padding-top: 50px;
+
+ }
+
+ .form-inline {
+ display: inline;
+ }
+
+ table .form {
+ display: inline-block;
+ margin: 0;
+ }
+
+ .accordion-group {
+ border: none;
+ }
+ .accordion-heading {
+ .btn {
+ float: left;
+ margin: 6px 15px;
+ }
+ .accordion-toggle {
+ padding: 2px;
+ &:hover {
+ text-decoration: none;
+ }
+ }
+ }
+
+ div.item-detail {
+ div:nth-child(odd) span {
+ background-color: #eee;
+ }
+ }
+
+ span.label.tag {
+ margin-right: 2px;
+ a {
+ color: white;
+ }
+ }
+
+ body.admin blockquote p {
+ font-size: 13px;
+ display: inline;
+ }
+
+ div#user_locale_switcher {
+ div.btn-group:before,
+ div.btn-group:after {
+ display: inline;
+ }
+ }
+
+ #request_hidden_user_subject_field {
+ width: 440px;
+ }
+ #request_hidden_user_explanation_field {
+ width: 100%;
+ height: 15em;
+ }
+ #request_hidden_user_subject,
+ #request_hide_button,
+ #request_hidden_user_explanation {
+ display: none;
+ }
+
+ #outgoing_message_body,
+ #comment_body {
+ width: 750px;
+ }
+
+}
+
diff --git a/app/views/admin_censor_rule/_form.html.erb b/app/views/admin_censor_rule/_form.html.erb
index ac43de704..5035238d6 100644
--- a/app/views/admin_censor_rule/_form.html.erb
+++ b/app/views/admin_censor_rule/_form.html.erb
@@ -1,40 +1,75 @@
<%= error_messages_for 'censor_rule' %>
-<p>Applies to:
- <% if !info_request.nil? %>
- <%=request_both_links(info_request)%> request
- <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>
- <% end %>
- <% if !user.nil? %>
- <%=user_both_links(user)%> user
- <%= hidden_field 'censor_rule', 'user_id', { :value => user.id } %>
- <% end %>
-</p>
+<div class="well">
+ <%=_("Applies to")%>
+ <% unless info_request.nil? %>
+ <%= request_both_links(info_request) %>
+ <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>
+ <% end %>
+ <% unless user.nil? %>
+ <%= user_both_links(user) %>
+ <%= hidden_field 'censor_rule', 'user_id', { :value => user.id } %>
+<% end %>
+</div>
-<p><label for="censor_rule_regexp">Is it regexp replacement?</label> (Leave unchecked if you are not sure about this)<br/>
-<%= check_box 'censor_rule', 'regexp' %></p>
+<div class="control-group">
+ <label for="censor_rule_regexp" class="control-label">Is it regexp replacement?</label>
+ <div class="controls">
+ <%= check_box 'censor_rule', 'regexp' %>
+ <div class="help-block">
+ Leave unchecked if you are not sure about this
+ </div>
+ </div>
+</div>
-<p><label for="censor_rule_text">Text</label> (that you want to remove, case sensitive)<br/>
-<%= text_field 'censor_rule', 'text', :size => 60 %></p>
+<div class="control-group">
+ <label for="censor_rule_text" class="control-label">Text</label>
+ <div class="controls">
+ <%= text_field 'censor_rule', 'text', :class => "span3" %>
+ <div class="help-block">
+ that you want to remove, case sensitive
+ </div>
+ </div>
+</div>
-<p><label for="censor_rule_replacement">Replacement</label> (put it in <strong>[square brackets]</strong>, e.g. [personal information removed]. applies to text in emails and HTML conversions of binaries; binaries themselves must stay the same length and the replacement is just a bunch of 'x's)<br/>
-<%= text_field 'censor_rule', 'replacement', :size => 60 %></p>
+<div class="control-group">
+ <label for="censor_rule_replacement" class="control-label">Replacement</label>
+ <div class="controls">
+ <%= text_field 'censor_rule', 'replacement', :class => "span3" %>
+ <div class="help-block">
+ put it in <strong>[square brackets]</strong>, e.g. [personal information removed]. applies to text in emails and HTML conversions of binaries; binaries themselves must stay the same length and the replacement is just a bunch of 'x's
+ </div>
+ </div>
+</div>
-<p><label for="censor_rule_last_edit_comment">Comment for this edit</label> (put purpose of the rule, and why the change)<br/>
-<%= text_area 'censor_rule', 'last_edit_comment', :rows => 2, :cols => 60 %></p>
-
-<p><strong>Warning and notes:</strong> This does replace text in binary files, but for
-most formats only in a naive way. It works well on surprisingly many Word documents. Notably
-it doesn't even do UCS-2 (unicode sometimes used in Word). There is also special code
-which works on some PDFs. Please <strong>carefully check</strong> all attachments have
-changed in the way you expect, and haven't become corrupted.
-</p>
-
-<p>You may need to manually rebuild the search index afterwards. You can redact
-things by individual request or by user by adding the censor rule from the
-appropriate page. If you need to redact across a whole
-authority, it will be easy enough to make code changes to add it, so do ask.
-</p>
-<p><strong>Regexp rules that are hard to process will really slow down request display.</strong> Please only use regexps if you really need to.
-</p>
+<div class="control-group">
+ <label for="censor_rule_last_edit_comment" class="control-label">Comment for this edit</label>
+ <div class="controls">
+ <%= text_area 'censor_rule', 'last_edit_comment', :rows => 2, :class => "span6" %>
+ <div class="help-block">
+ put purpose of the rule, and why the change
+ </div>
+ </div>
+</div>
+<div class="row">
+ <div class="span10 offset2">
+ <div class="alert alert-info">
+ <h3>Warning and notes:</h3>
+ <p> This does replace text in binary files, but for
+ most formats only in a naive way. It works well on surprisingly many Word documents. Notably
+ it doesn't even do UCS-2 (unicode sometimes used in Word). There is also special code
+ which works on some PDFs. Please <strong>carefully check</strong> all attachments have
+ changed in the way you expect, and haven't become corrupted.
+ </p>
+ <p>You may need to manually rebuild the search index afterwards. You can redact
+ things by individual request or by user by adding the censor rule from the
+ appropriate page. If you need to redact across a whole
+ authority, it will be easy enough to make code changes to add it, so do ask.
+ </p>
+ <p>
+ <strong>Regexp rules that are hard to process will really slow down request display.</strong> Please only use regexps if you really need to.
+ </p>
+ </div>
+ </div>
+</div>
diff --git a/app/views/admin_censor_rule/_show.html.erb b/app/views/admin_censor_rule/_show.html.erb
index 363c3fb6f..0d4cece93 100644
--- a/app/views/admin_censor_rule/_show.html.erb
+++ b/app/views/admin_censor_rule/_show.html.erb
@@ -1,6 +1,6 @@
<% if censor_rules.size > 0 %>
- <table>
+ <table class="table table-condensed">
<tr>
<th>Id</th>
<% for column in CensorRule.content_columns %>
@@ -16,7 +16,7 @@
<td><%=h censor_rule.send(column) %></td>
<% end %>
<td>
- <%= link_to "Edit", '../../censor/edit/' + censor_rule.id.to_s %>
+ <%= link_to "Edit", admin_rule_edit_path(censor_rule) %>
</td>
</tr>
<% end %>
@@ -26,14 +26,10 @@
<% end %>
<% if defined? info_request %>
- <p>
- <%= link_to "New censor rule", '../../censor/new?info_request_id=' + info_request.id.to_s %> (for this request only)
- </p>
+ <%= link_to "New censor rule (for this request only)", admin_rule_new_path(:info_request_id => info_request.id), :class => "btn btn-info" %>
<% end %>
<% if defined? user %>
- <p>
- <%= link_to "New censor rule", '../../censor/new?user_id=' + user.id.to_s %> (for all requests by this user)
- </p>
+ <%= link_to "New censor rule", admin_rule_new_path(:user_id => user.id), :class => "btn btn-info" %> <span class="label label-info">for all requests by this user</span>
<% end %>
diff --git a/app/views/admin_censor_rule/edit.html.erb b/app/views/admin_censor_rule/edit.html.erb
index 844908418..230446ed3 100644
--- a/app/views/admin_censor_rule/edit.html.erb
+++ b/app/views/admin_censor_rule/edit.html.erb
@@ -2,15 +2,17 @@
<h1><%=@title%></h1>
-<%= form_tag '../update/' + @censor_rule.id.to_s do %>
+<%= form_tag admin_rule_update_path(@censor_rule), :class => "form form-horizontal" do %>
<%= render :partial => 'form', :locals => { :info_request => @censor_rule.info_request, :user => @censor_rule.user } %>
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
+ <div class="form-actions">
+ <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %>
+ </div>
<% end %>
-<%= form_tag('../destroy/' + @censor_rule.id.to_s) do %>
- <p>
- <%= hidden_field_tag(:censor_rule_id, @censor_rule.id) %>
- Permanent! --&gt; <%= submit_tag "Destroy rule" %>
- </p>
+<%= form_tag admin_rule_destroy_path(@censor_rule), :class => "form form-horizontal" do %>
+ <%= hidden_field_tag(:censor_rule_id, @censor_rule.id) %>
+ <div class="form-actions">
+ Permanent! --&gt; <%= submit_tag "Destroy rule", :class => "btn btn-primary" %>
+ </div>
<% end %>
diff --git a/app/views/admin_censor_rule/new.html.erb b/app/views/admin_censor_rule/new.html.erb
index ad3bf7e8e..1694308f3 100644
--- a/app/views/admin_censor_rule/new.html.erb
+++ b/app/views/admin_censor_rule/new.html.erb
@@ -2,8 +2,10 @@
<h1><%=@title%></h1>
-<%= form_tag 'create' do %>
- <%= render :partial => 'form', :locals => { :info_request => @info_request, :user => @user } %>
- <p><%= submit_tag "Create" %></p>
+<%= form_tag admin_rule_create_path, :class => "form form-horizontal" do %>
+ <%= render :partial => 'form', :locals => { :info_request => @info_request, :user => @censor_user } %>
+ <div class="form-actions">
+ <%= submit_tag "Create", :class => "btn btn-primary" %>
+ </div>
<% end %>
diff --git a/app/views/admin_general/_admin_navbar.html.erb b/app/views/admin_general/_admin_navbar.html.erb
index 8b1378917..5cc740f70 100644
--- a/app/views/admin_general/_admin_navbar.html.erb
+++ b/app/views/admin_general/_admin_navbar.html.erb
@@ -1 +1,22 @@
-
+<div class="admin">
+ <div class="navbar navbar-fixed-top navbar-inverse">
+ <div class="navbar-inner">
+ <div class="container">
+ <%= link_to 'Alaveteli', frontpage_path, :class => "brand" %>
+ <div class="nav-collapse">
+ <ul class="nav">
+ <li><%= link_to 'Summary', admin_general_index_path %></li>
+ <li><%= link_to 'Timeline', admin_timeline_path %></li>
+ <li><%= link_to 'Stats', admin_stats_path %></li>
+ <li><%= link_to 'Debug', admin_debug_path %></li>
+ <li><%= link_to 'Authorities', admin_body_list_path %></li>
+ <li><%= link_to 'Requests', admin_request_list_path %></li>
+ <li><%= link_to 'Users', admin_user_list_path %></li>
+ <li><%= link_to 'Tracks', admin_track_list_path %></li>
+ <li><%= link_to 'Log out', signout_path %></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/app/views/admin_general/admin.coffee b/app/views/admin_general/admin.coffee
new file mode 100644
index 000000000..8f9e879ae
--- /dev/null
+++ b/app/views/admin_general/admin.coffee
@@ -0,0 +1,24 @@
+jQuery ->
+ $('.locales a:first').tab('show')
+ $('.accordion-body').on('hidden', ->
+ $(@).prev().find('i').first().removeClass().addClass('icon-chevron-right')
+ )
+ $('.accordion-body').on('shown', ->
+ $(@).prev().find('i').first().removeClass().addClass('icon-chevron-down'))
+ $('.toggle-hidden').live('click', ->
+ $(@).parents('td').find('div:hidden').show()
+ false)
+ $('#request_hidden_user_explanation_reasons input').live('click', ->
+ $('#request_hidden_user_subject, #request_hidden_user_explanation, #request_hide_button').show()
+ info_request_id = $('#hide_request_form').attr('info_request_id')
+ reason = $(this).val()
+ $('#request_hidden_user_explanation_field').attr("value", "[loading default text...]")
+ $.ajax "/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id,
+ type: "GET"
+ dataType: "text"
+ error: (data, textStatus, jqXHR) ->
+ $('#request_hidden_user_explanation_field').attr("value", "Error: #{textStatus}")
+ success: (data, textStatus, jqXHR) ->
+ $('#request_hidden_user_explanation_field').attr("value", data)
+ )
+
diff --git a/app/views/admin_general/admin.js b/app/views/admin_general/admin.js
new file mode 100644
index 000000000..61382dab3
--- /dev/null
+++ b/app/views/admin_general/admin.js
@@ -0,0 +1,32 @@
+(function() {
+ jQuery(function() {
+ $('.locales a:first').tab('show');
+ $('.accordion-body').on('hidden', function() {
+ return $(this).prev().find('i').first().removeClass().addClass('icon-chevron-right');
+ });
+ $('.accordion-body').on('shown', function() {
+ return $(this).prev().find('i').first().removeClass().addClass('icon-chevron-down');
+ });
+ $('.toggle-hidden').live('click', function() {
+ $(this).parents('td').find('div:hidden').show();
+ return false;
+ });
+ return $('#request_hidden_user_explanation_reasons input').live('click', function() {
+ var info_request_id, reason;
+ $('#request_hidden_user_subject, #request_hidden_user_explanation, #request_hide_button').show();
+ info_request_id = $('#hide_request_form').attr('info_request_id');
+ reason = $(this).val();
+ $('#request_hidden_user_explanation_field').attr("value", "[loading default text...]");
+ return $.ajax("/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, {
+ type: "GET",
+ dataType: "text",
+ error: function(data, textStatus, jqXHR) {
+ return $('#request_hidden_user_explanation_field').attr("value", "Error: " + textStatus);
+ },
+ success: function(data, textStatus, jqXHR) {
+ return $('#request_hidden_user_explanation_field').attr("value", data);
+ }
+ });
+ });
+ });
+}).call(this);
diff --git a/app/views/admin_general/admin_js.erb b/app/views/admin_general/admin_js.erb
new file mode 100644
index 000000000..61382dab3
--- /dev/null
+++ b/app/views/admin_general/admin_js.erb
@@ -0,0 +1,32 @@
+(function() {
+ jQuery(function() {
+ $('.locales a:first').tab('show');
+ $('.accordion-body').on('hidden', function() {
+ return $(this).prev().find('i').first().removeClass().addClass('icon-chevron-right');
+ });
+ $('.accordion-body').on('shown', function() {
+ return $(this).prev().find('i').first().removeClass().addClass('icon-chevron-down');
+ });
+ $('.toggle-hidden').live('click', function() {
+ $(this).parents('td').find('div:hidden').show();
+ return false;
+ });
+ return $('#request_hidden_user_explanation_reasons input').live('click', function() {
+ var info_request_id, reason;
+ $('#request_hidden_user_subject, #request_hidden_user_explanation, #request_hide_button').show();
+ info_request_id = $('#hide_request_form').attr('info_request_id');
+ reason = $(this).val();
+ $('#request_hidden_user_explanation_field').attr("value", "[loading default text...]");
+ return $.ajax("/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, {
+ type: "GET",
+ dataType: "text",
+ error: function(data, textStatus, jqXHR) {
+ return $('#request_hidden_user_explanation_field').attr("value", "Error: " + textStatus);
+ },
+ success: function(data, textStatus, jqXHR) {
+ return $('#request_hidden_user_explanation_field').attr("value", data);
+ }
+ });
+ });
+ });
+}).call(this);
diff --git a/app/views/admin_general/debug.html.erb b/app/views/admin_general/debug.html.erb
index f37cfe012..bf984c2e1 100644
--- a/app/views/admin_general/debug.html.erb
+++ b/app/views/admin_general/debug.html.erb
@@ -2,14 +2,18 @@
<h1><%=@title%></h1>
-<p>You are <%= h @admin_current_user %></p>
+<p>You are <%= h @http_auth_user %></p>
<h2>Version numbers</h2>
<p>
Alaveteli version: <%= link_to @current_version, @github_origin + @current_version %>
<br>
-Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %>
+<% if @current_branch == "(no branch)" %>
+ Alaveteli branch: (no branch)
+<% else %>
+ Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %>
+<% end %>
<br>
Alaveteli commit: <%= link_to @current_commit, @github_origin + @current_commit %>
<br>
diff --git a/app/views/admin_general/index.html.erb b/app/views/admin_general/index.html.erb
index 48bd7f694..9940434ac 100644
--- a/app/views/admin_general/index.html.erb
+++ b/app/views/admin_general/index.html.erb
@@ -1,109 +1,185 @@
<% @title = "Summary" %>
-<h1><%=@title%></h1>
-
-<ul>
-<li><%=@public_body_count%> public authorities</li>
-<li><%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
- <%=@incoming_message_count%> incoming messages
-</li>
-<li><%=@user_count%> users, <%=@track_thing_count%> tracked things</li>
-<li><%=@comment_count%> annotations</li>
-</ul>
-
-<hr>
-
-<h1>Things to do</h1>
-
-<% if @holding_pen_messages.size > 0 %>
- <h3>Put misdelivered responses with the right request (<%=@holding_pen_messages.size%> total)</h3>
+<div class="row">
+ <div class="span12">
+ <h1><%=@title%></h1>
<ul>
- <% for message in @holding_pen_messages %>
- <li>
- <% if message.get_body_for_quoting.strip.size == 0 %>
- <%= link_to "(no body)", "request/show_raw_email/" + message.raw_email_id.to_s %>
- <% else %>
- <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %>
- <% end %>
- (<%=simple_date(message.sent_at)%>)
- </li>
- <% end %>
+ <li><%=@public_body_count%> public authorities</li>
+ <li>
+ <%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
+ <%=@incoming_message_count%> incoming messages
+ </li>
+ <li><%=@user_count%> users, <%=@track_thing_count%> tracked things</li>
+ <li><%=@comment_count%> annotations</li>
</ul>
+ </div>
+</div>
-<% end %>
-
-<% if @error_message_requests.size > 0 %>
- <h3>Fix these delivery and other errors (<%=@error_message_requests.size%> total)</h3>
-
- <ul>
- <% for @request in @error_message_requests %>
- <li>
- <%= request_both_links(@request)%>
- &ndash; <%=simple_date(@request.get_last_event.created_at)%>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-<% if @attention_requests.size > 0 %>
- <h3>Review requests which have been marked as requiring your attention by users (<%=@error_message_requests.size%> total)</h3>
-
- <ul>
- <% for @request in @attention_requests %>
- <li>
- <%= request_both_links(@request)%>
- &ndash; <%=simple_date(@request.get_last_event.created_at)%>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-
-<% if @requires_admin_requests.size > 0 %>
- <h3>These require administrator attention (<%=@requires_admin_requests.size%> total)</h3>
-
- <ul>
- <% for @request in @requires_admin_requests %>
- <li>
- <%= request_both_links(@request)%>
- &ndash; <%=simple_date(@request.get_last_event.created_at)%>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-<% if @blank_contacts.size > 0 %>
- <h3>Find missing FOI email for these public authorities (try phoning!) (<%=@blank_contacts.size%> total)</h3>
- <ul>
- <% for @blank_contact in @blank_contacts %>
- <li>
- <%= public_body_both_links(@blank_contact)%>
- &ndash; <%=simple_date(@blank_contact.updated_at)%>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-<% if @old_unclassified.size > 0 %>
- <h3>Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response</h3>
-
- <ul>
- <% for @request in @old_unclassified %>
- <li>
- <%= request_both_links(@request) %>
- &ndash; <%=simple_date(@request.get_last_response_event.created_at)%>
- </li>
- <% end %>
- </ul>
-
- <p>(<%= link_to "Full list", admin_url("unclassified") %>, or play public
- <%= link_to "Categorisation game", main_url(play_url(:only_path => true)) %>)
- </p>
-<% end %>
+<hr>
-<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 %>
- <p>No pending administration required.</p>
+<div class="row">
+ <div class="span12">
+ <h1>Things to do</h1>
+ </div>
+</div>
+
+<div class="accordion" id="things-to-do">
+ <% if @holding_pen_messages.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#holding-pen" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@holding_pen_messages.size%></span><%= chevron_right %> Put misdelivered responses with the right request</a>
+ </div>
+ <div id="holding-pen" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for message in @holding_pen_messages %>
+ <tr>
+ <td>
+ <% if message.get_body_for_quoting.strip.size == 0 %>
+ <%= link_to "(no body)", admin_request_show_raw_email_path(message.raw_email_id) %>
+ <% else %>
+ <%= link_to excerpt(message.get_body_for_quoting, "", 60), admin_request_show_raw_email_path(message.raw_email_id) %>
+ <% end %>
+ </td>
+ <td class="span2">
+ <%=simple_date(message.sent_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @error_message_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#error-messages" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@error_message_requests.size%></span> <%= chevron_right %>Fix these delivery and other errors</a>
+ </div>
+ <div id="error-messages" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @request in @error_message_requests %>
+ <tr>
+ <td class="link">
+ <%= request_both_links(@request) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@request.get_last_event.created_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @attention_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#attention-messages" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@attention_requests.size%></span><%= chevron_right %> Review requests marked by users as requiring your attention
+</a>
+ </div>
+ <div id="attention-messages" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @request in @attention_requests %>
+ <tr>
+ <td class="link">
+ <%= request_both_links(@request) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@request.get_last_event.created_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @requires_admin_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#requires-admin" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@requires_admin_requests.size%></span><%= chevron_right %> These require administrator attention</a>
+ </div>
+ <div id="requires-admin" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @request in @requires_admin_requests %>
+ <tr>
+ <td class="link">
+ <%= request_both_links(@request) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@request.get_last_event.created_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @blank_contacts.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#blank-contacts" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@blank_contacts.size%></span><%= chevron_right %> Find missing FOI email for these public authorities (try phoning!)</a>
+ </div>
+ <div id="blank-contacts" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @blank_contact in @blank_contacts %>
+ <tr>
+ <td class="link">
+ <%= public_body_both_links(@blank_contact) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@blank_contact.updated_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @old_unclassified.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#unclassified" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@old_unclassified.size%></span><%= chevron_right %> Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response</a>
+ </div>
+ <div id="unclassified" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @request in @old_unclassified %>
+ <tr>
+ <td class="link">
+ <%= request_both_links(@request) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@request.get_last_response_event.created_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+
+ </table>
+ </div>
+ </div>
+ <% end %>
+</div>
+
+<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 && @attention_requests.size == 0 %>
+ <div class="row">
+ <div class="span12 alert alert-success">
+ No pending administration required.
+ </div>
+ </div>
<% end %>
-
-
diff --git a/app/views/admin_general/stats.html.erb b/app/views/admin_general/stats.html.erb
index b22adb581..27dc25ee0 100644
--- a/app/views/admin_general/stats.html.erb
+++ b/app/views/admin_general/stats.html.erb
@@ -1,38 +1,60 @@
<% @title = "Statistics" %>
-
-<h1>Statistics</h1>
-
-<h2>Chart of requests (excluding backpaged)</h2>
-
-<p>
- <img src="<%= main_url("/foi-live-creation.png")%>">
-</p>
-
-<h2>State of requests (includes backpaged)</h2>
-
-<table>
-<% for state, count in @request_by_state %>
-<tr> <td><%=state %></td><td><%= count %></td> </tr>
-<% end %>
-</table>
-
-<h2>Chart of users</h2>
-
-<p>
- <img src="<%= main_url("/foi-user-use.png")%>">
-</p>
-
-<h2>Tracks by type</h2>
-
-<table>
-<% for state, count in @tracks_by_type %>
-<tr> <td><%=state %></td><td><%= count %></td> </tr>
-<% end %>
-</table>
-
-<h2>Web analytics</h2>
-
-
-</p>
-
-
+<div class="hero-unit">
+ <h2><%=@public_body_count%> public authorities</h2>
+ <h2><%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages, <%=@incoming_message_count%> incoming messages</h2>
+ <h2><%=@user_count%> users, <%=@track_thing_count%> tracked things</h2>
+ <h2><%=@comment_count%> annotations</h2>
+</div>
+
+<div class="row">
+ <div class="span12">
+ <h1>Statistics</h1>
+ <h2>Chart of requests (excluding backpaged)</h2>
+ <img src="/foi-live-creation.png" alt="Chart of requests">
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h2>State of requests (includes backpaged)</h2>
+ <div class="container">
+ <% for state, count in @request_by_state %>
+ <div class="row">
+ <div class="span1">
+ <span class="label label-info"><%=count%></span>
+ </div>
+ <div class="span4">
+ <%=state%>
+ </div>
+ </div>
+ <% end %>
+ </div>
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h2>Chart of users</h2>
+ <img src="/foi-user-use.png" alt="Chart of users">
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h2>Tracks by type</h2>
+ <div class="container">
+ <% for state, count in @tracks_by_type %>
+ <div class="row">
+ <div class="span1">
+ <span class="label label-info"><%=count%></span>
+ </div>
+ <div class="span4">
+ <%=state%>
+ </div>
+ </div>
+ <% end %>
+ </div>
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h2>Web analytics</h2>
+ </div>
+</div>
diff --git a/app/views/admin_general/timeline.html.erb b/app/views/admin_general/timeline.html.erb
index e84539970..8fd8875b6 100644
--- a/app/views/admin_general/timeline.html.erb
+++ b/app/views/admin_general/timeline.html.erb
@@ -1,14 +1,19 @@
<% @title = "Timeline" %>
-
-<h1><%=h @events_title%></h1>
-
-<p>
-<a href="?hour=1">Hour</a>
-| <a href="?day=1">Day</a>
-| <a href="?">2 days</a>
-| <a href="?week=1">Week</a>
-| <a href="?month=1">Month</a>
-| <a href="?all=1">All time</a></p>
+<div class="btn-toolbar">
+ <div class="btn-group">
+ <%= link_to "Hour", admin_timeline_path(:hour => 1), :class => "btn" %>
+ <%= link_to "Day", admin_timeline_path(:day => 1), :class => "btn" %>
+ <%= link_to "2 days", admin_timeline_path, :class => "btn" %>
+ <%= link_to "Week", admin_timeline_path(:week => 1), :class => "btn" %>
+ <%= link_to "Month", admin_timeline_path(:month => 1), :class => "btn" %>
+ <%= link_to "All time", admin_timeline_path(:all => 1), :class => "btn" %>
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h1><%=h @events_title%></h1>
+ </div>
+</div>
<% last_date = nil %>
<% for event, event_at in @events %>
@@ -72,7 +77,7 @@
<% elsif event.event_type == 'response' %>
<% incoming_message = event.incoming_message %>
received
- <%= link_to 'a response', main_url(incoming_message_url(incoming_message)) %>
+ <%= link_to 'a response', incoming_message_path(incoming_message) %>
from <%=h event.info_request.public_body.name %>.
<% elsif event.event_type == 'sent' %>
was initially sent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
@@ -92,8 +97,7 @@
was created/updated by administrator <strong><%=h event.last_edit_editor %></strong>
<% end %>
<% end %>
+<%= will_paginate(@events, :class => 'paginator') %>
<% if not @events.empty? %>
</p>
<% end %>
-<%= will_paginate(@events) %>
-
diff --git a/app/views/admin_public_body/_form.html.erb b/app/views/admin_public_body/_form.html.erb
index 7392b5bf3..68069e838 100644
--- a/app/views/admin_public_body/_form.html.erb
+++ b/app/views/admin_public_body/_form.html.erb
@@ -3,63 +3,97 @@
<!--[form:public_body]-->
<div id="div-locales">
- <ul>
- <% for locale in I18n.available_locales do %>
- <li><a href="#div-locale-<%=locale.to_s%>"><%=locale_name(locale.to_s)%></a></li>
- <% end %>
- </ul>
-
-<%
+ <ul class="locales nav nav-tabs">
+ <% I18n.available_locales.each_with_index do |locale, i| %>
+ <li><a href="#div-locale-<%=locale.to_s%>" data-toggle="tab" ><%=locale_name(locale.to_s) || _("Default locale")%></a></li>
+ <% end %>
+ </ul>
+ <div class="tab-content">
+<%
for locale in I18n.available_locales do
if locale==I18n.default_locale # The default locale is submitted as part of the bigger object...
prefix = 'public_body'
object = @public_body
else # ...but additional locales go "on the side"
prefix = "public_body[translated_versions][]"
- object = @public_body.new_record? ?
- PublicBody::Translation.new :
+ object = @public_body.new_record? ?
+ PublicBody::Translation.new :
@public_body.find_translation_by_locale(locale.to_s) || PublicBody::Translation.new
end
fields_for prefix, object do |t|
%>
- <div id="div-locale-<%=locale.to_s%>">
+ <div class="tab-pane" id="div-locale-<%=locale.to_s%>">
+ <div class="control-group">
<%= t.hidden_field :locale, :value => locale.to_s %>
-
- <p><label for="<%= form_tag_id(t.object_name, :name, locale) %>">Name</label><br/>
- <%= t.text_field :name, :size => 60, :id => form_tag_id(t.object_name, :name, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :short_name, locale) %>">Short name <small>(only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)</small></label><br/>
- <%= t.text_field :short_name, :size => 60, :id => form_tag_id(t.object_name, :short_name, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :request_email, locale) %>">Request email <small>(set to <strong>blank</strong> (empty string) if can't find an address; these emails are <strong>public</strong> as anyone can view with a CAPTCHA)</small></label><br/>
- <%= t.text_field :request_email, :size => 40, :id => form_tag_id(t.object_name, :request_email, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>">Publication scheme URL</label><br/>
- <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :disclosure_log, locale) %>">Disclosure log URL</label><br/>
- <%= t.text_field :disclosure_log, :size => 60, :id => form_tag_id(t.object_name, :disclosure_log, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :notes, locale) %>">Public notes</label> <small>(HTML, for users to consider when making FOI requests to the authority)</small><br/>
- <%= t.text_area :notes, :rows => 3, :cols => 60, :id => form_tag_id(t.object_name, :notes, locale) %></p>
+ <label for="<%= form_tag_id(t.object_name, :name, locale) %>" class="control-label">Name</label>
+ <div class="controls">
+ <%= t.text_field :name, :id => form_tag_id(t.object_name, :name, locale), :class => "span4" %>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :short_name, locale) %>", class="control-label"><%=_("Short name")%></label>
+ <div class="controls">
+ <%= t.text_field :short_name, :id => form_tag_id(t.object_name, :short_name, locale), :class => "span2" %>
+ <p class="help-block"><%=_("Only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL – don't worry about breaking URLs through renaming, as the history is used to redirect")%></p>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :request_email, locale) %>" class="control-label"><%=_("Request email")%></label>
+ <div class="controls">
+ <%= t.text_field :request_email, :id => form_tag_id(t.object_name, :request_email, locale), :class => "span3" %>
+ <p class="help-block"><%=_("set to <strong>blank</strong> (empty string) if can't find an address; these emails are <strong>public</strong> as anyone can view with a CAPTCHA")%></p>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>" class="control-label"><%=_("Publication scheme URL")%></label>
+ <div class="controls">
+ <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale), :class => "span3" %>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :disclosure_log, locale) %>" class="control-label"><%=_("Disclosure log URL")%></label>
+ <div class="controls">
+ <%= t.text_field :disclosure_log, :size => 60, :id => form_tag_id(t.object_name, :disclosure_log, locale), :class => "span3" %>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :notes, locale) %>" class="control-label"><%=_("Public notes")%></label>
+ <div class="controls">
+ <%= t.text_area :notes, :rows => 3, :id => form_tag_id(t.object_name, :notes, locale), :class => "span6" %>
+ <p class="help-block">
+ HTML, for users to consider when making FOI requests to the authority
+ </p>
+ </div>
+ </div>
</div>
-<%
+<%
end
- end
+ end
%>
+ </div>
</div>
<h3>Common Fields</h3>
-
-<p><label for="public_body_tag_string">Tags <small>(space separated; see list of tags on the right; also <strong>not_apply</strong> if FOI and EIR no longer apply to authority, <strong>eir_only</strong> if EIR but not FOI applies to authority, <strong>defunct</strong> if the authority no longer exists; charity:NUMBER if a registered charity)</small></label><br/>
-
-<%= text_field :public_body, :tag_string, :size => 60, :id => 'public_body_tag_string' %></p>
-
-<p><label for="public_body_home_page">Home page <small>(of whole authority, not just their FOI page; set to <strong>blank</strong> (empty string) to guess it from the email)</small></label><br/>
-<%= text_field :public_body, :home_page, :size => 60, :id => 'public_body_home_page' %></p>
-
-<p><label for="public_body_last_edit_comment"><strong>Comment</strong> for this edit</label> <small>(put URL or other source of new info)</small><br/>
-<%= text_area :public_body, :last_edit_comment, :rows => 3, :cols => 60, :id => 'public_body_last_edit_comment' %></p>
-
+<div class="control-group">
+ <label for="public_body_tag_string" class="control-label"><%=_("Tags")%></label>
+ <div class="controls">
+ <%= f.text_field :tag_string, :class => "span4" %>
+ <p class="help-block">space separated; see list of tags on the right; also <strong>not_apply</strong> if FOI and EIR no longer apply to authority, <strong>eir_only</strong> if EIR but not FOI applies to authority, <strong>defunct</strong> if the authority no longer exists; charity:NUMBER if a registered charity</p>
+ </div>
+</div>
+<div class="control-group">
+ <label for="public_body_home_page"><%=_("Home page")%></label>
+ <div class="controls">
+ <%= f.text_field :home_page, :class => "span4" %>
+ <p class="help-block">(of whole authority, not just their FOI page; set to <strong>blank</strong> (empty string) to guess it from the email)</p>
+ </div>
+</div>
+<div class="control-group">
+ <label for="public_body_last_edit_comment" class="control-label"><strong>Comment</strong> for this edit</label>
+ <div class="controls">
+ <%= f.text_area :last_edit_comment, :rows => 3, :class => "span6" %></p>
+ <p class="help-block">put URL or other source of new info</p>
+ </div>
+</div>
<!--[eoform:public_body]-->
diff --git a/app/views/admin_public_body/_locale_selector.html.erb b/app/views/admin_public_body/_locale_selector.html.erb
deleted file mode 100644
index 5ef79f2df..000000000
--- a/app/views/admin_public_body/_locale_selector.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-<div id="locale_switcher">
-<%= _('Edit language version:') %>
-<% for possible_locale in @locales %>
- <% if possible_locale == @locale %>
- <%= possible_locale %>
- <% else %>
- <a href="?show_locale=<%=possible_locale%>"><%= possible_locale %></a>
- <% end %>
-<% end %>
-</div>
diff --git a/app/views/admin_public_body/_one_list.html.erb b/app/views/admin_public_body/_one_list.html.erb
index 2925c5e33..8f1d719ec 100644
--- a/app/views/admin_public_body/_one_list.html.erb
+++ b/app/views/admin_public_body/_one_list.html.erb
@@ -1,29 +1,44 @@
-<table>
- <tr>
- <th>Name</th>
- <th>Tags</th>
- <% for column in PublicBody.content_columns.map { |c| c.human_name } - [ "Name", "Last edit comment" ] %>
- <th><%= column %></th>
- <% end %>
- </tr>
-<% for public_body in bodies %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%= public_body_both_links(public_body) %></td>
- <td><%= render :partial => 'tags', :locals => { :body => public_body} %></td>
- <% for column in PublicBody.content_columns.map { |c| c.name } - [ "name", "last_edit_comment" ] %>
- <td><%=h public_body.send(column) %></td>
+<div class="accordion" id="bodies">
+ <% for public_body in bodies %>
+ <div class="accordion-group">
+ <div class="accordion-heading accordion-toggle row">
+ <span class="item-title span6">
+ <a href="#body_<%=public_body.id%>" data-toggle="collapse" data-parent="requests"><%= chevron_right %></a>
+ <%= link_to(public_body.name, admin_body_show_path(public_body), :title => "view full details")%>
+ </span>
+ <span class="item-metadata span6">
+ <%= render :partial => 'tags', :locals => { :body => public_body} %>
+ </span>
+ </div>
+ <div id="body_<%=public_body.id%>" class="item-detail accordion-body collapse row">
+ <% public_body.for_admin_column do |name, value, type| %>
+ <div>
+ <span class="span6">
+ <b><%=name%></b>
+ </span>
+ <span class="span6">
+ <% if type == 'datetime' %>
+ <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
+ <% else %>
+ <%= h value %>&nbsp;
+ <% end %>
+ </span>
+ </div>
+ <% end %>
+ </div>
+ </div>
<% end %>
- </tr>
-<% end %>
-</table>
+</div>
-<%= form_tag(admin_url("body/mass_tag_add"), :method => "post", :class => "forms_on_one_line" ) do %>
+<%= form_tag(admin_body_mass_tag_add_url, :method => "post", :class => "form form-inline" ) do %>
<p>
<%= text_field_tag 'new_tag', params[:new_tag], { :size => 15, :id => "mass_add_tag_new_tag_" + table_name } %>
<%= hidden_field_tag(:query, params[:query], { :id => "mass_add_tag_query_" + table_name } ) %>
<%= hidden_field_tag(:page, params[:page], { :id => "mass_add_page_" + table_name } ) %>
<%= hidden_field_tag(:table_name, table_name, { :id => "mass_add_tag_table_name_" + table_name } ) %>
- <%= submit_tag "Add tag to all" %> (in table just above)
+ <%= submit_tag "Add tag to all", :class => "btn btn-primary" %>
+ (in table just above)
</p>
<% end %>
diff --git a/app/views/admin_public_body/_tag_help.html.erb b/app/views/admin_public_body/_tag_help.html.erb
index 0d0f84dda..b64e65877 100644
--- a/app/views/admin_public_body/_tag_help.html.erb
+++ b/app/views/admin_public_body/_tag_help.html.erb
@@ -1,18 +1,16 @@
-<div id="tag_help">
- <h2>List of tags</h2>
- <% first_row = true %>
- <% for row in PublicBodyCategories::get().with_headings() %>
- <% if row.instance_of?(Array) %>
- <% if row[0] != 'other' %>
- <strong><%= row[0] %></strong>=<%= row[1] %>
- <br/>
- <% end %>
- <% elsif row != 'Miscellaneous' %>
- <% if not first_row %>
- <% else %>
- <% first_row = false %>
- <% end %>
- <h3><%=h row%></h3>
+<h2>List of tags</h2>
+<% first_row = true %>
+<% for row in PublicBodyCategories::get().with_headings() %>
+ <% if row.instance_of?(Array) %>
+ <% if row[0] != 'other' %>
+ <strong><%= row[0] %></strong>=<%= row[1] %>
+ <br/>
<% end %>
+ <% elsif row != 'Miscellaneous' %>
+ <% if not first_row %>
+ <% else %>
+ <% first_row = false %>
+ <% end %>
+ <h3><%=h row%></h3>
<% end %>
-</div> \ No newline at end of file
+<% end %>
diff --git a/app/views/admin_public_body/_tags.html.erb b/app/views/admin_public_body/_tags.html.erb
index 85dc942fd..26526f304 100644
--- a/app/views/admin_public_body/_tags.html.erb
+++ b/app/views/admin_public_body/_tags.html.erb
@@ -1,10 +1,11 @@
<% for t in body.tags %>
+ <span class="label label-info tag">
<% if t.value %>
- <%= link_to(h(t.name), main_url(list_public_bodies_url(:tag => t.name, :only_path => true))) %>:<%= link_to(h(t.value), main_url(list_public_bodies_url(:tag => t.name_and_value, :only_path => true))) %>
+ <%= link_to(h(t.name), list_public_bodies_path(:tag => t.name)) %>:<%= link_to(h(t.value), list_public_bodies_path(:tag => t.name_and_value)) %>
<% else %>
- <%= link_to(h(t.name), main_url(list_public_bodies_url(:tag => t.name, :only_path => true))) %>
+ <%= link_to(h(t.name), list_public_bodies_path(:tag => t.name)) %>
<% end %>
- (<a href="<%= admin_url('body/list') %>?query=<%= h(t.name)%>">admin</a>)
+ </span>
<% end %>
diff --git a/app/views/admin_public_body/edit.html.erb b/app/views/admin_public_body/edit.html.erb
index 5d85ae756..a24122671 100644
--- a/app/views/admin_public_body/edit.html.erb
+++ b/app/views/admin_public_body/edit.html.erb
@@ -1,30 +1,34 @@
<h1><%=@title%></h1>
-<script type="text/javascript">
- $(function() {
- $("#div-locales").tabs();
- });
-</script>
-
-<%= render :partial => 'tag_help' %>
-
-<div id="public_body_form">
- <%= form_tag '../update/' + @public_body.id.to_s do %>
- <%= render :partial => 'form' %>
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
- <% end %>
+<div class="row">
+ <div class="span8">
+ <div id="public_body_form">
+ <% form_for @public_body, :url => admin_body_update_path(@public_body), :html => { :class => "form form-horizontal" } do |f| %>
+ <%= render :partial => 'form', :locals => {:f => f} %>
+ <div class="form-actions">
+ <%= f.submit 'Save', :accesskey => 's', :class => "btn btn-success" %></p>
+ </div>
+ <% end %>
- <p>
- <%= link_to 'Show', '../show/' + @public_body.id.to_s %> |
- <%= link_to 'List all', '../list' %>
- </p>
+ <div class="row">
+ <div class="span8">
+ <div class="well">
+ <%= link_to 'Show', admin_body_show_path(@public_body), :class => "btn" %>
+ <%= link_to 'List all', admin_body_list_path, :class => "btn" %>
+ </div>
+ </div>
+ </div>
- <% if @public_body.info_requests.size == 0 %>
- <%= form_tag('../destroy/' + @public_body.id.to_s) do %>
- <p>
- <%= hidden_field_tag(:public_body_id, { :value => @public_body.id } ) %>
- <%= submit_tag "Destroy " + @public_body.name %> (this is permanent!)
- </p>
+ <% if @public_body.info_requests.empty? %>
+ <%= form_tag(admin_body_destroy_path(@public_body), :class => "form form-inline") do %>
+ <%= hidden_field_tag(:public_body_id, { :value => @public_body.id } ) %>
+ <%= submit_tag _("Destroy {{name}}", :name => @public_body.name), :class => "btn btn-danger" %> (this is permanent!)
<% end %>
- <% end %>
+ <% end %>
+ </div>
+
+ </div>
+ <div class="span4">
+ <%= render :partial => 'tag_help' %>
+ </div>
</div>
diff --git a/app/views/admin_public_body/import_csv.html.erb b/app/views/admin_public_body/import_csv.html.erb
index 678758b23..afda5a468 100644
--- a/app/views/admin_public_body/import_csv.html.erb
+++ b/app/views/admin_public_body/import_csv.html.erb
@@ -11,16 +11,16 @@
<%= form_tag 'import_csv', :multipart => true do %>
<p>
- <% if @original_csv_file && @temporary_csv_file %>
- CSV file:
- <%= @original_csv_file %>
- <%= hidden_field_tag :original_csv_file, @original_csv_file %>
- <%= hidden_field_tag :temporary_csv_file, @temporary_csv_file %>
- <%= link_to 'Clear current file', 'import_csv', :class => "btn btn-warning" %>
- <% else %>
- <label for="csv_file">CSV file:</label>
- <%= file_field_tag :csv_file, :size => 40 %>
- <% end %>
+ <% if @original_csv_file && @temporary_csv_file %>
+ CSV file:
+ <%= @original_csv_file %>
+ <%= hidden_field_tag :original_csv_file, @original_csv_file %>
+ <%= hidden_field_tag :temporary_csv_file, @temporary_csv_file %>
+ <%= link_to 'Clear current file', 'import_csv', :class => "btn btn-warning" %>
+ <% else %>
+ <label for="csv_file">CSV file:</label>
+ <%= file_field_tag :csv_file, :size => 40 %>
+ <% end %>
</p>
<p>
@@ -32,14 +32,15 @@
<label for="tag_behaviour">What to do with existing tags?</label>
<%= select_tag 'tag_behaviour',
"<option value='add' selected>Add new tags to existing ones</option>
- <option value='replace'>Replace existing tags with new ones</option>".html_safe
+ <option value='replace'>Replace existing tags with new ones</option>"
%>
</p>
- <p><strong>CSV file format:</strong> A first row with the list of fields,
- starting with '#', is optional but highly recommended. The fields 'name'
- and 'request_email' are required; additionally, translated values are supported by
- adding the locale name to the field name, e.g. 'name.es', 'name.de'... Example:
+ <p><strong>CSV file format:</strong>The first row should be a list
+ of fields, starting with '#'. The fields 'name' and
+ 'request_email' are required; additionally, translated values are
+ supported by adding the locale name to the field name,
+ e.g. 'name.es', 'name.de'... Example:
</p>
<blockquote>
@@ -57,7 +58,7 @@
actually altering the database. Choose <strong>upload</strong> to actually
make the changes. In either case, you will be shown any errors, or details
of the changes. When uploading, any changes since last import will be
- overwritten - e.g. email addresses changed back.
+ overwritten – e.g. email addresses changed back.
</p>
<p><strong>Note:</strong> The import tag will also be added to the imported bodies
diff --git a/app/views/admin_public_body/list.html.erb b/app/views/admin_public_body/list.html.erb
index 561944f9a..3d7d9c4cd 100644
--- a/app/views/admin_public_body/list.html.erb
+++ b/app/views/admin_public_body/list.html.erb
@@ -1,24 +1,27 @@
<% if @query.nil? %>
- <% @title = 'Listing public authorities' %>
+ <% @title = _('Listing public authorities') %>
<% else %>
- <% @title = "Listing public authorities matching '" + @query + "'" %>
+ <% @title = _("Listing public authorities matching '{{query}}'", :query => @query ) %>
<% end %>
<h1><%=@title%></h1>
-<p>
+<div class="btn-toolbar">
+ <div class="btn-group">
+ <%= link_to 'New public authority', admin_body_new_path, :class => "btn btn-primary" %>
+ </div>
+ <div class="btn-group">
+ <%= link_to 'Import from CSV file', admin_body_import_csv_path, :class => "btn btn-warning" %>
+ </div>
+</div>
+
+<%= form_tag({}, :method => "get", :class => "form form-search") do %>
+ <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query" } %>
+ <%= submit_tag "Search", :class => "btn" %>
<% if !@query.nil? %>
- <%= link_to 'Show all', 'list' %> |
- <% end %>
- <%= link_to 'New public authority', 'new' %>
- | <%= link_to 'Import from CSV file', 'import_csv' %>
-</p>
-
-<%= form_tag("", :method => "get") do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %> (substring search in names and emails; exact match of tags)
- </p>
+ <%= link_to 'Show all', admin_body_list_path, :class => "btn" %>
+ <% end %><br>
+ (substring search in names and emails; exact match of tags)
<% end %>
@@ -36,5 +39,4 @@
<%= render :partial => 'one_list', :locals => { :bodies => @public_bodies, :table_name => 'substring' } %>
<% end %>
-<%= will_paginate(@public_bodies) %>
-
+<%= will_paginate(@public_bodies, :class => "paginator") %>
diff --git a/app/views/admin_public_body/new.html.erb b/app/views/admin_public_body/new.html.erb
index 9cfcf7db3..2ee96c466 100644
--- a/app/views/admin_public_body/new.html.erb
+++ b/app/views/admin_public_body/new.html.erb
@@ -1,22 +1,23 @@
<% @title = 'New public authority' %>
<h1><%=@title%></h1>
-
-<script type="text/javascript">
- $(function() {
- $("#div-locales").tabs();
- });
-</script>
-
-<%= render :partial => 'tag_help' %>
-
-<div id="public_body_form">
- <%= form_tag './create/' + @public_body.id.to_s do %>
- <%= render :partial => 'form' %>
- <p><%= submit_tag "Create" %></p>
- <% end %>
-
- <p>
- <%= link_to 'List all', 'list' %>
- </p>
+<div class="row">
+ <div class="span8">
+ <div id="public_body_form">
+ <%= form_for :public_body, @public_body, :url => admin_body_create_path, :html => {:class => "form form-horizontal"} do |f| %>
+ <%= render :partial => 'form', :locals => {:f => f} %>
+ <div class="form-actions">
+ <%= f.submit "Create", :class => "btn btn-primary" %>
+ </div>
+ <% end %>
+ <div class="row">
+ <div class="span8 well">
+ <%= link_to _('List all'), 'list' %>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="span4">
+ <%= render :partial => 'tag_help' %>
+ </div>
</div>
diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb
index cee306988..cfb10b24e 100644
--- a/app/views/admin_public_body/show.html.erb
+++ b/app/views/admin_public_body/show.html.erb
@@ -1,83 +1,89 @@
-<% @title = "Public authority - " + h(@public_body.name) %>
+<% @title = _("Public authority – {{name}}", :name => h(@public_body.name)) %>
<h1><%=@title%></h1>
-<p>
-<%
- columns = PublicBody.content_columns + [] # force dup
- columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}
-
- for column in columns %>
- <b><%= column.human_name %>:</b>
- <% if ['home_page', 'publication_scheme', 'disclosure_log'].include? column.name %>
- <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name)) %>
- <% elsif column.name == 'request_email' %>
- <%= link_to(h(@public_body.send(column.name)), "mailto:#{@public_body.send(column.name)}") %>
- <% if !@public_body.is_requestable? %>
- (not requestable due to: <%=h @public_body.not_requestable_reason %><% if @public_body.is_followupable? %>; but followupable<% end %>)
- <% end %>
- <% else %>
- <%=h @public_body.send(column.name) %>
- <% end %>
- <br/>
-<% end %>
-<b>Calculated home page:</b>
-<% if !@public_body.calculated_home_page.nil? %>
- <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
+<table class="table table-striped table-condensed">
+ <tbody>
+ <% @public_body.for_admin_column do |name, value, type, column_name| %>
+ <tr>
+ <td>
+ <b><%=name%></b>
+ </td>
+ <td>
+ <% if ['home_page', 'publication_scheme', 'disclosure_log'].include? column_name %>
+ <%= link_to(h(value), value) %>
+ <% elsif column_name == 'request_email' %>
+ <%= link_to(h(value), "mailto:#{value}") %>
+ <% unless @public_body.is_requestable? %>
+ <%=_("not requestable due to: {{reason}}", :reason => h(@public_body.not_requestable_reason))%><% if @public_body.is_followupable? %>; <%=_("but followupable")%><% end %>
+ <% end %>
+ <% else %>
+ <%=h value %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ <tr>
+ <td>
+ <b><%=_("Calculated home page")%></b>
+ </td>
+ <td>
+ <% unless @public_body.calculated_home_page.nil? %>
+ <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
+ <% else %>
+ <%=_("*unknown*")%>
+ <% end %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><%=_("Tags")%></b>
+ </td>
+ <td>
+ <%= render :partial => 'tags', :locals => { :body => @public_body} %>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<%= link_to _("Edit"), admin_body_edit_path(@public_body), :class => "btn btn-primary" %>
+<% unless @public_body.url_name.nil? %>
+ <%=link_to _("Public page"), public_body_path(@public_body), :class => "btn" %>
<% else %>
- *unknown*
+ <%=_("Public page not available")%>
<% end %>
-<br/><b>Tags:</b> <%= render :partial => 'tags', :locals => { :body => @public_body} %>
-<br/>
-</p>
-
-<p>
- <%=
- # url_name can be missing if the name hasn't been set for this locale
- if !@public_body.url_name.nil?
- link_to 'Public page', main_url(public_body_url(@public_body))
- else
- 'Public page not available'
- end
- %>
- | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>
-</p>
-
+<hr>
<h2>History</h2>
-<table border="1">
-<tr>
-<th>Updated at</th>
-<%
- history_columns = PublicBody.content_columns + [] # force dup
- history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter', 'api_key'].include?(c.name)}
- for column in history_columns %>
- <th><%= column.human_name %></th>
-<% end %>
-</tr>
<%# There may be an option to versions() to specify order, but I can't find it. TB 2009-03-09 %>
-<% for historic_public_body in @public_body.reverse_sorted_versions %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h historic_public_body.updated_at %></td>
- <% for column in history_columns %>
- <%
- value = h(historic_public_body.send(column.name))
- if column.name == 'last_edit_comment'
- value = historic_public_body.last_edit_comment_for_html_display
- end
- # Highlight entries which have changed since previous version
- changed = (!['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.sorted_versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
- <td <%= changed ? ' class="entry_changed" '.html_safe: '' %> >
- <%=value%>
- </td>
+<% versions = @public_body.reverse_sorted_versions; versions.each_with_index do |historic_public_body, i| %>
+ <div class="row">
+ <div class="span2">
+ <b>
+ <%= _("Version {{version}}", :version => historic_public_body.version)%>
+ </b>
+ </div>
+ <div class="span4">
+ <%= I18n.l(historic_public_body.updated_at, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(historic_public_body.updated_at)) %>)
+ </div>
+ <% if i == versions.length - 1 %>
+ <div class="span6">
+ <%=_("This is the first version.")%>
+ </div>
+ <% else %>
+ <div class="span6">
+ <p>“<%= h(historic_public_body.last_edit_comment) %>”</p>
+ <ul>
+ <% historic_public_body.compare(versions[i+1]) do |change| %>
+ <li><%= _("{{thing_changed}} was changed from <code>{{from_value}}</code> to <code>{{to_value}}</code>", :thing_changed => change[:name], :from_value => (change[:from] or "-"), :to_value => (change[:to] or "-")) %></li>
+ <% end %>
+ </ul>
+ </div>
<% end %>
- </tr>
+ </div>
<% end %>
-</table>
-
+<hr>
<h2>Requests</h2>
<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>
-
+<hr>
<h2>Track things</h2>
-<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>
-
-
+<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things, :include_destroy => true } %>
diff --git a/app/views/admin_request/_incoming_message_actions.html.erb b/app/views/admin_request/_incoming_message_actions.html.erb
index 3090185e2..653e73337 100644
--- a/app/views/admin_request/_incoming_message_actions.html.erb
+++ b/app/views/admin_request/_incoming_message_actions.html.erb
@@ -1,26 +1,45 @@
-<%= form_tag '../redeliver_incoming' do %>
- <div>
- id or url_title of request (or a list of requests, comma-separated):
+<fieldset class="form-horizontal">
+ <legend>Actions</legend>
+ <%= form_tag admin_request_redeliver_incoming_path, :class => "form form-inline" do %>
+ <div class="control-group">
+ <label class="control-label" for="url_title_<%= incoming_message.id %>">Redeliver message to one or more other requests</label>
+ <div class="controls">
<% if @info_requests && @info_requests.size == 1 %>
- <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %>
+ <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20, :id => "url_title_#{incoming_message.id}" } %>
<% else %>
- <%= text_field_tag 'url_title', "", { :size => 20 } %>
+ <%= text_field_tag 'url_title', "", { :size => 20, :id => "url_title_#{incoming_message.id}" } %>
<% end %>
- <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %>
- <%= submit_tag "Redeliver to another request" %>
+ <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id, :id => nil %>
+ <%= submit_tag "Redeliver to another request", :class => "btn" %>
+ <p class="help-block"><code>id</code> or <code>url_title</code>; you can supply more than one, separated by commas</p>
</div>
-<% end %>
-
-<p>
-<%= link_to 'FOI officer upload URL', '../generate_upload_url/' + incoming_message.info_request.id.to_s + "?incoming_message_id=" + incoming_message.id.to_s %>
-</p>
+ </div>
+ <% end %>
+ <div class="control-group">
+ <label class="control-label">Generate FOI officer upload URL</label>
+ <div class="controls">
+ <%= link_to 'Generate and take me there', admin_request_generate_upload_url_path(incoming_message.info_request, :incoming_message_id => incoming_message.id), :class => "btn" %>
+ </div>
+ </div>
-<%= form_tag '../destroy_incoming' do %>
- <div>
- <%= hidden_field_tag 'incoming_message_id', incoming_message.id %>
- Warning, this is permanent! ---&gt;
- <%= submit_tag "Destroy message" %>
+ <%= form_tag admin_request_destroy_incoming_path, :class => "form form-inline" do %>
+ <div class="control-group">
+ <label class="control-label" for="destroy_message_<%= incoming_message.id %>">Destroy message</label>
+ <div class="controls">
+ <%= hidden_field_tag 'incoming_message_id', incoming_message.id, :id => nil %>
+ <%= submit_tag "Destroy message", :class => "btn btn-danger", :confirm => "This is permanent! Are you sure?", :id => "destroy_message_#{incoming_message.id}" %>
+ </div>
</div>
-<% end %>
+ <% end %>
+ <% if @raw_email.nil? %>
+ <%# we're not on the raw_email page itself %>
+ <div class="control-group">
+ <label class="control-label">Inspect email</label>
+ <div class="controls">
+ <%= link_to "View raw email", admin_request_show_raw_email_path(incoming_message.raw_email_id), :class => "btn" %>
+ </div>
+ </div>
+ <% end %>
+</fieldset>
diff --git a/app/views/admin_request/_some_requests.html.erb b/app/views/admin_request/_some_requests.html.erb
index dc11e0f55..cff94956d 100644
--- a/app/views/admin_request/_some_requests.html.erb
+++ b/app/views/admin_request/_some_requests.html.erb
@@ -1,31 +1,32 @@
-<table>
- <tr>
- <th>Title</th>
- <th>Authority</th>
- <th>User</th>
- <% for column in InfoRequest.content_columns.map { |c| c.human_name } - [ "Url title", "Title" ] %>
- <th><%= column %></th>
+<div class="accordion" id="requests">
+ <% for info_request in info_requests %>
+ <div class="accordion-group">
+ <div class="accordion-heading accordion-toggle row">
+ <span class="item-title span6">
+ <a href="#request_<%=info_request.id%>" data-toggle="collapse" data-parent="requests"><%= chevron_right %></a>
+ <%= link_to(info_request.title, admin_request_show_path(info_request), :title => "view full details") %>
+ </span>
+ <span class="item-metadata span6">
+ <%= user_admin_link_for_request(info_request) %> <%= arrow_right %> <%= link_to("#{info_request.public_body.name}", admin_body_show_path(info_request.public_body)) %>, <%= time_ago_in_words(info_request.updated_at) %> ago
+ </span>
+ </div>
+ <div id="request_<%=info_request.id%>" class="item-detail accordion-body collapse row">
+ <% info_request.for_admin_column do | name, value, type | %>
+ <div>
+ <span class="span6">
+ <%= h name %>
+ </span>
+ <span class="span6">
+ <% if type == 'datetime' %>
+ <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
+ <% else %>
+ <%=h value %>
+ <% end %>
+ </span>
+ </div>
+ <% end %>
+ </div>
+ </div>
<% end %>
- </tr>
-
-<% for info_request in info_requests %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%= request_both_links(info_request) %></td>
- <td><%= public_body_both_links(info_request.public_body) %></td>
- <% if info_request.is_external? %>
- <% if info_request.external_user_name.nil? %>
- <td><i><%= _("Anonymous user") %></i></td>
- <% else %>
- <td><%= h(info_request.external_user_name) %></td>
- <% end %>
- <% else %>
- <td><%= user_both_links(info_request.user) %></td>
- <% end %>
- <% for column in InfoRequest.content_columns.map { |c| c.name } - [ "title", "url_title" ] %>
- <td><%=h info_request.send(column) %></td>
- <% end %>
- </tr>
-<% end %>
-</table>
-
-
+</div>
diff --git a/app/views/admin_request/edit.html.erb b/app/views/admin_request/edit.html.erb
index 900947321..0e9c68aea 100644
--- a/app/views/admin_request/edit.html.erb
+++ b/app/views/admin_request/edit.html.erb
@@ -2,7 +2,7 @@
<%= error_messages_for 'info_request' %>
-<%= form_tag '../update/' + @info_request.id.to_s do %>
+<%= form_tag admin_request_update_path(@info_request) do %>
<p><label for="info_request_title"><strong>Title</strong></label> (warning: editing this will break URLs right now)<br/>
<%= text_field 'info_request', 'title', :size => 50 %></p>
@@ -22,16 +22,14 @@
</p>
<p><label for="info_request_described_state"><strong>Described state</strong></label>
- <%= select( 'info_request', "described_state", InfoRequest.enumerate_states ) %>;
+ <%= select( 'info_request', "described_state", InfoRequest.enumerate_states) %>
<label for="info_request_awaiting_description"><strong>Awaiting description</strong></label>
- <%= select('info_request', "awaiting_description", [["Yes - needs state updating",true],["No - state is up to date",false]]) %>
+ <%= select('info_request', "awaiting_description", [["Yes – needs state updating",true],["No – state is up to date",false]]) %>
<br/>(don't forget to change 'awaiting description' when you set described state)<br/>
</p>
-
- <p><label for="info_request_comments_allowed"><strong>Are comments allowed?</strong></label>
- <%= select('info_request', "comments_allowed", [["Yes – comments allowed", true], ["No – comments disabled", false]]) %>
- </p>
-
+ <p><label for="info_request_comments_allowed"><strong>Are comments allowed?</strong></label>
+ <%= select('info_request', "comments_allowed", [["Yes – comments allowed", true], ["No – comments disabled", false]]) %>
+ </p>
<p><label for="info_request_tag_string"><strong>Tags</strong> <small>(space separated, can use key:value)</small></label><br/>
<%= text_field 'info_request', 'tag_string', :size => 60 %></p>
@@ -45,13 +43,13 @@
<% end %>
<p>
-<%= link_to 'Show', '../show/' + @info_request.id.to_s %> |
-<%= link_to 'List all', '../list' %>
+<%= link_to 'Show', admin_request_show_path(@info_request) %> |
+<%= link_to 'List all', admin_request_list_path %>
</p>
<hr>
-<%= form_tag '../destroy/' + @info_request.id.to_s do %>
+<%= form_tag admin_request_destroy_path(@info_request) do %>
<p>
<strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destroy request entirely' %>
<br>Use it mainly if someone posts private information, e.g. made a Data Protection request. It
diff --git a/app/views/admin_request/edit_comment.html.erb b/app/views/admin_request/edit_comment.html.erb
index 2152ee72f..2cf49a4a8 100644
--- a/app/views/admin_request/edit_comment.html.erb
+++ b/app/views/admin_request/edit_comment.html.erb
@@ -2,13 +2,13 @@
<%= error_messages_for 'comment' %>
-<%= form_tag '../update_comment/' + @comment.id.to_s do %>
+<%= form_tag admin_request_update_comment_path(@comment) do %>
<p><label for="comment_body">Body of annotation</label><br/>
<%= text_area 'comment', 'body', :rows => 10, :cols => 60 %></p>
<p><label for="comment_visible">Visible</label>
- <%= select('comment', "visible", [["Yes - show comment",true],["No - hide comment",false]]) %>
+ <%= select('comment', "visible", [["Yes – show comment",true],["No – hide comment",false]]) %>
</p>
@@ -16,7 +16,7 @@
<% end %>
<p>
-<%= link_to 'Show', '../show/' + @comment.info_request.id.to_s %> |
-<%= link_to 'List all', '../list' %>
+<%= link_to 'Show', admin_request_show_path(@comment.info_request) %> |
+<%= link_to 'List all', admin_request_list_path %>
</p>
diff --git a/app/views/admin_request/edit_outgoing.html.erb b/app/views/admin_request/edit_outgoing.html.erb
index f749eac7b..a0c60520a 100644
--- a/app/views/admin_request/edit_outgoing.html.erb
+++ b/app/views/admin_request/edit_outgoing.html.erb
@@ -2,7 +2,7 @@
<%= error_messages_for 'outgoing_message' %>
-<%= form_tag '../update_outgoing/' + @outgoing_message.id.to_s do %>
+<%= form_tag admin_request_update_outgoing_path(@outgoing_message) do %>
<p><label for="outgoing_message_body">Body of message</label><br/>
<%= text_area 'outgoing_message', 'body', :rows => 10, :cols => 60 %></p>
@@ -18,11 +18,11 @@
<% end %>
<p>
-<%= link_to 'Show', '../show/' + @outgoing_message.info_request.id.to_s %> |
-<%= link_to 'List all', '../list' %>
+<%= link_to 'Show', admin_request_show_path(@outgoing_message.info_request) %> |
+<%= link_to 'List all', admin_request_list_path %>
</p>
-<%= form_tag '../destroy_outgoing' do %>
+<%= form_tag admin_request_destroy_outgoing_path do %>
<div>
<%= hidden_field_tag 'outgoing_message_id', @outgoing_message.id %>
Warning, this is permanent! ---&gt;
diff --git a/app/views/admin_request/hidden_user_explanation.html.erb b/app/views/admin_request/hidden_user_explanation.html.erb
index 64387ffee..7084e986f 100644
--- a/app/views/admin_request/hidden_user_explanation.html.erb
+++ b/app/views/admin_request/hidden_user_explanation.html.erb
@@ -1,9 +1,10 @@
Dear <%= name_to %>,
-Your request '<%= info_request.title %>' at <%= info_request_url %> has been reviewed by moderators.
+Your request '<%= info_request.title.html_safe %>' at <%= info_request_url %> has been reviewed by moderators.
We consider it <% if reason == 'not_foi' %>is not a valid FOI request<% else %>to be vexatious<% end%>, and have therefore hidden it from other users. You will still be able to view it while logged in to the site. Please reply to this email if you would like to discuss this decision further.
Yours,
The <%= site_name %> team.
+
diff --git a/app/views/admin_request/list.html.erb b/app/views/admin_request/list.html.erb
index ae95cb5ad..2bd3e3326 100644
--- a/app/views/admin_request/list.html.erb
+++ b/app/views/admin_request/list.html.erb
@@ -1,15 +1,13 @@
-<% @title = 'Listing FOI/EIR requests' %>
+<% @title = _("Listing FOI requests") %>
<h1><%=@title%></h1>
-<%= form_tag("", :method => "get") do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %> (substring search, titles only)
- </p>
+<%= form_tag({}, :method => "get", :class => "form form-search") do %>
+ <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query" } %>
+ <%= submit_tag "Search", :class => "btn" %> (substring search, titles only)
<% end %>
<%= render :partial => 'some_requests', :locals => { :info_requests => @info_requests } %>
-<%= will_paginate(@info_requests) %>
+<%= will_paginate(@info_requests, :class => "paginator") %>
diff --git a/app/views/admin_request/list_old_unclassified.html.erb b/app/views/admin_request/list_old_unclassified.html.erb
deleted file mode 100644
index 2e75c2174..000000000
--- a/app/views/admin_request/list_old_unclassified.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<% @title = "Unclassified responses" %>
-
-<h1><%=@title%></h1>
-
-<p>Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response:</p>
-<ul>
-<% for @request in @info_requests %>
- <li>
- <%= request_both_links(@request) %>
- &ndash; <%=simple_date(@request.get_last_response_event.created_at)%>
- </li>
-<% end %>
-</ul>
-<%= will_paginate(@info_requests) %>
-
-
diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb
index 3dd39347b..c725f42c4 100644
--- a/app/views/admin_request/show.html.erb
+++ b/app/views/admin_request/show.html.erb
@@ -1,74 +1,164 @@
-<% @title = "FOI request - " + h(@info_request.title) %>
-<%= javascript_include_tag :defaults %>
+<% @title = _("FOI request – {{title}}", :title => h(@info_request.title)) %>
<h1><%=@title%></h1>
-<%= form_tag '../move_request', { :class => "inline" } do %>
-<p>
-<%= hidden_field_tag 'info_request_id', @info_request.id %>
-<% for column in InfoRequest.content_columns %>
- <strong><%= column.human_name %>:</strong> <%=h @info_request.send(column.name) %>
- <% if column.name == 'described_state' %>
- <strong>Calculated status:</strong> <%= @info_request.calculate_status %>
- <br/><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %>
- <strong>Date response required by:</strong> <%= @info_request.date_response_required_by %>
- <strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %>
- <% end %>
- <% if ![ 'allow_new_responses_from' ].include?(column.name) %>
- <br/>
- <% end %>
+<%= form_tag admin_request_move_request_path, { :class => "form form-horizontal" } do %>
+ <%= hidden_field_tag 'info_request_id', @info_request.id %>
+ <div class="accordion" id="info_request">
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <span class="item-title">
+ <a href="#metadata_<%=@info_request.id%>" data-toggle="collapse" data-parent="#info_request"><%= chevron_down %></a>Request metadata
+ </span>
+ </div>
+ <div id="metadata_<%=@info_request.id%>" class="accordion-body collapse in">
+ <table class="table table-striped table-condensed">
+ <thead>
+ <tr>
+ <td colspan="2">
+ <%= link_to 'Edit metadata', admin_request_edit_path(@info_request), :class => "btn" %>
+ </td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th>Public page:</th>
+ <td><%= link_to request_url(@info_request), request_path(@info_request) %></td>
+ </tr>
+ <% @info_request.for_admin_column do |name, value, type, column_name|%>
+ <tr>
+ <td>
+ <b><%= name %>:</b>
+ </td>
+ <td>
+ <% if type == 'datetime' %>
+ <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
+ <% else %>
+ <%= h value %>
+ <% end %>
+ <% if column_name == 'described_state' %>
+ <ul>
+ <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %></li>
+ <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %></li>
+ <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %></li>
+ <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %></li>
+ </ul>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ <tr>
+ <td>
+ <b>Created by</b>
+ </td>
+ <td>
+ <% if @info_request.is_external? %>
+ <%= link_to(eye, @info_request.external_url, :title => "view URL of original request on external website") %>
+ <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API)
+ <% else %>
+ <%= user_both_links(@info_request.user) %>
+ <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %>
+ <div style="display:none;">
+ <strong>url_name of new user:</strong>
+ <%= text_field_tag 'user_url_name', "", { :size => 20 } %>
+ <%= submit_tag "Move request to user", :class => "btn btn-info" %>
+ </div>
+ <% end %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Public authority:</b>
+ </td>
+ <td>
+ <%= public_body_both_links(@info_request.public_body) %>
+ <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %>
+ <div style="display:none;">
+ <strong>url_name of new authority:</strong>
+ <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %>
+ <%= submit_tag "Move request to authority", :class => "btn btn-info" %>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><%=_("Incoming email address")%></b>
+ </td>
+ <td>
+ <%= link_to h(@info_request.incoming_email), "mailto:#{@info_request.incoming_email}" %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><%=_("Tags")%></b>
+ </td>
+ <td>
+ <%= render :partial => 'tags', :locals => { :info_request => @info_request} %>
+ </td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <td colspan="2">
+ <%= link_to 'Edit metadata', admin_request_edit_path(@info_request), :class => "btn" %>
+ </td>
+ </tr>
+ </tfoot>
+ </table>
+ </div>
+ </div>
+ </div>
<% end %>
- <strong>Created by:</strong>
- <% if @info_request.is_external? %>
- <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API)
- <% else %>
- <%= user_both_links(@info_request.user) %>
- <% end %>
+<fieldset class="form-horizontal">
+ <legend>Actions</legend>
+ <div class="control-group">
+ <label class="control-label">
+ FOI officer upload URL
+ </label>
+ <div class="controls">
+ <%= link_to 'Generate URL', admin_request_generate_upload_url_path(@info_request), :class => "btn" %>
+ <p class="help-block">(see also option to general URLs for individual incoming messages below)</p>
+ </div>
+ </div>
+ <%= form_tag admin_request_hide_path(@info_request), :class => "form form-inline", :id => "hide_request_form" do %>
+ <div class="control-group">
+ <% if @info_request.is_external? %>
+ <label class="control-label">Hide the request:</label>
+ <% else %>
+ <label class="control-label">Hide the request and notify the user:</label>
+ <% end %>
- <span>
- <span>
- (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>)
- </span>
- <span style="display:none;">
- <strong>url_name of new user:</strong>
- <%= text_field_tag 'user_url_name', "", { :size => 20 } %>
- <%= submit_tag "Move request to user" %>
- </span>
- </span>
- <br>
-<strong>Public authority:</strong> <%= public_body_both_links(@info_request.public_body) %>
- <span>
- <span>
- (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>)
- </span>
- <span style="display:none;">
- <strong>url_name of new authority:</strong>
- <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %>
- <%= submit_tag "Move request to authority" %>
- </span>
- </span>
- <br>
-<strong>Incoming email address:</strong> <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %> <br>
-<b>Tags:</b> <%= render :partial => 'tags', :locals => { :info_request => @info_request} %> <br>
-</p>
-<% end %>
+ <div class="controls" id="request_hidden_user_explanation_reasons">
+ <% if ['hidden', 'requester_only'].include? @info_request.prominence %>
+ <p class="help-block">This request has already been hidden</p>
+ <% else %>
+ <label class="radio inline">
+ <%= radio_button_tag "reason", "not_foi" %> <%= _("Not a valid FOI request") %>
+ </label>
+ <label class="radio inline">
+ <%= radio_button_tag "reason", "vexatious" %> <%= _("A vexatious request") %>
+ </label>
+ <% end %>
+ </div>
+ </div>
-<p>
- <%= link_to 'Public page', main_url(request_url(@info_request)) %>
- | <%= link_to 'Edit', '../edit/' + @info_request.id.to_s %>
- | <%= link_to 'FOI officer upload URL', '../generate_upload_url/' + @info_request.id.to_s %> (see also links on incoming messages below)
-</p>
+ <% if !['hidden', 'requester_only'].include? @info_request.prominence %>
+ <% if ! @info_request.is_external? %>
-<h2>Events</h2>
+ <div class="control-group" id="request_hidden_user_subject">
+ <label for="request_hidden_user_subject_field" class="control-label">Subject of email:</label>
+ <div class="controls">
+ <%= text_field_tag "subject", "Your request on WhatDoTheyKnow.com hidden", {:id => "request_hidden_user_subject_field", :cols => 100} %>
+ </div>
+ </div>
-<table>
- <tr>
- <th>Id</th>
- <% for column in InfoRequestEvent.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
+ <div class="control-group" id="request_hidden_user_explanation">
+ <label for="request_hidden_user_explanation_field" class="control-label">Reason for hiding the request (will be emailed to user):</label>
+ <div class="controls">
+ <%= text_area_tag "explanation", h(@request_hidden_user_explanation), {:id => "request_hidden_user_explanation_field"} %>
+ </div>
+ </div>
<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
<tr class="<%= cycle('odd', 'even') %>">
@@ -82,149 +172,226 @@
<% else %>
<%=h info_request_event.send(column.name) %>
<% end %>
- </td>
- <% end %>
- <td>
- <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
- <%= form_tag '../mark_event_as_clarification' do %>
- <div>
- <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
- <%= submit_tag "Was clarification request" %>
- </div>
- <% end %>
- <% end %>
- </td>
- </tr>
-<% end %>
-</table>
-
-<h2>Outgoing messages</h2>
-
-<table>
- <tr>
- <th>Id</th>
- <% for column in OutgoingMessage.content_columns %>
- <th><%= column.human_name %></th>
+ <div class="form-actions" id="request_hide_button">
+ <%= submit_tag _("Hide request"), :class => "btn" %>
+ </div>
<% end %>
- <th>Actions</th>
- </tr>
-
-<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h outgoing_message.id %></td>
- <% for column in OutgoingMessage.content_columns.map { |c| c.name } %>
+ <% end %>
+</fieldset>
- <% if column == 'body' %>
- <td>
- <div><%= simple_format( truncate(outgoing_message.body, :length => 400,
- :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
- )) %></div>
- <div style="display:none;"><%= simple_format( outgoing_message.body ) %></div>
- </td>
- <% else %>
- <td><%= simple_format( outgoing_message.send(column).to_s ) %></td>
- <% end %>
+<hr>
+<h2>Events</h2>
+<div class="accordion" id="events">
+ <% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <span class="item-title">
+ <a href="#event_<%=info_request_event.id%>" data-toggle="collapse" data-parent="#events"><%= chevron_right %></a>
+ <%= _("Event {{id}}", :id => info_request_event.id) %>:
+ <strong>
+ <%=h info_request_event.event_type.humanize %><% if !info_request_event.calculated_state.nil? %>; state: <%= info_request_event.calculated_state %><% end %>
+ </strong>
+ <em>
+ <%= info_request_event.created_at%>
+ </em>
+ </span>
+ </div>
+ <div id="event_<%=info_request_event.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <tr>
+ <td>
+ <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
+ <%= form_tag admin_request_clarification_path, :class => "form form-inline admin-table-form admin-inline-form" do %>
+ <%= hidden_field_tag 'info_request_event_id', info_request_event.id, :id => nil %>
+ <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %>
+ <% end %>
+ <% end %>
+ </td>
+ <td></td>
+ </tr>
+ <% info_request_event.for_admin_column do |name, value, type, column_name| %>
+ <tr>
+ <td>
+ <b><%=h name%></b>
+ </td>
+ <td>
+ <% if column_name == 'params_yaml' %>
+ <%= info_request_event.params_yaml_as_html %>
+ <% elsif value.nil? %>
+ nil
+ <% elsif %w(text string).include?(type) %>
+ <%=h value.humanize %>
+ <% elsif type == 'datetime' %>
+ <%= admin_date value %>
+ <% else %>
+ <%=h value %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
<% end %>
- <td>
- <%= form_tag '../resend' do %>
- <div>
- <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
- <%= submit_tag "Resend" %>
+</div>
+<hr>
+<h2>Outgoing messages</h2>
+<div class="accordion" id="outgoing_messages">
+ <% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a href="#outgoing_<%=outgoing_message.id%>" data-toggle="collapse" data-parent="#outgoing_messages"><%= chevron_right %></a>
+ <% link_to admin_request_edit_outgoing_path(outgoing_message) do %>
+ #<%= outgoing_message.id %> -- <%= outgoing_message.status.humanize %> <%= outgoing_message.message_type.humanize %>
+ <% end %>
+ <blockquote>
+ <%= truncate(outgoing_message.body, :length => 400) %>
+ </blockquote>
</div>
+ <div id="outgoing_<%=outgoing_message.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <tr>
+ <td colspan="2">
+ <%= form_tag admin_request_resend_path, :class => "admin-table-form" do %>
+ <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
+ <%= submit_tag "Resend", :class => "btn" %>
+ <% end %>
+ </td>
+ </tr>
+ <% outgoing_message.for_admin_column do |name, value, type, column_name| %>
+ <tr>
+ <td class="span3">
+ <b><%=name%></b>
+ </td>
+ <td>
+ <% if column_name == 'body' %>
+ <%= simple_format(truncate(outgoing_message.body, :length => 400, :omission => link_to("...", "#", :class => "toggle-hidden" ))) %>
+ <div style="display:none;"><%= simple_format( outgoing_message.body ) %></div>
+ <% else %>
+ <%= admin_value(value) %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
<% end %>
- <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %>
- </td>
- </tr>
-<% end %>
-</table>
-
+</div>
+<hr>
<h2>Incoming messages</h2>
-
-<table>
- <tr>
- <th>Id</th>
- <% for column in IncomingMessage.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
-
-<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
- <tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>">
- <td><%=h incoming_message.id %></td>
- <% for column in IncomingMessage.content_columns.map { |c| c.name } %>
- <% if column =~ /^cached_.*?$/ %>
- <td>
- <div><%= simple_format( truncate(incoming_message.send(column), :length => 400,
- :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
- )) %></div>
- <div style="display:none;"><%= simple_format( incoming_message.send(column) ) %></div>
- </td>
- <% else %>
- <td><%= simple_format( incoming_message.send(column).to_s ) %></td>
- <% end %>
+<div class="accordion" id="incoming_messages">
+ <% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a href="#incoming_<%=incoming_message.id%>" data-toggle="collapse" data-parent="#incoming_messages"><%= chevron_right %></a>
+ <%=incoming_message.id%> -- <%= h(incoming_message.mail_from) %> <%=_("at")%> <%=admin_value(incoming_message.sent_at)%>
+ <blockquote class="incoming-message">
+ <% if !incoming_message.cached_main_body_text_folded.nil? %>
+ <%= truncate(incoming_message.cached_main_body_text_folded.gsub('FOLDED_QUOTED_SECTION', ''), :length => 400) %>
+ <% end %>
+ </blockquote>
+ </div>
+ <div id="incoming_<%=incoming_message.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <thead>
+ <tr>
+ <td colspan="2" class="well">
+ <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>
+ </td>
+ </tr>
+ </thead>
+ <tbody>
+ <% incoming_message.for_admin_column do |name, value, type, column_name| %>
+ <tr>
+ <td>
+ <b><%=name%></b>
+ </td>
+ <td>
+ <% if column_name =~ /^cached_.*?$/ %>
+ <%= simple_format( truncate(value, :length => 400, :omission => link_to("...", "#", :class => "toggle-hidden"))) %>
+ <div style="display:none;"><%= simple_format(value) %></div>
+ <% else %>
+ <%= simple_format(value) %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
<% end %>
- <td>
- <% if !incoming_message.raw_email_id.nil? %>
- <p>
- <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %>
- </p>
- <% end %>
- <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>
- </td>
- </tr>
-<% end %>
-</table>
-
+</div>
+<hr>
<h2>Annotations</h2>
<% if @info_request.comments.size > 0 %>
- <table>
- <tr>
- <th>Id</th>
- <th>Posted by</th>
- <% for column in Comment.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
-
- <% for comment in @info_request.comments %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h comment.id %></td>
- <td><%= user_both_links(comment.user) %></td>
- <% for column in Comment.content_columns.map { |c| c.name } %>
- <% if column == 'body' && !comment.visible %>
- <td><s><%=h comment.send(column) %></s></td>
- <% else %>
- <td><%=h comment.send(column) %></td>
- <% end %>
+ <div class="accordion" id="comments">
+ <% for comment in @info_request.comments %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a href="#comment_<%=comment.id%>" data-toggle="collapse" data-parent="#comments"><%= chevron_right %></a>
+ <% link_to admin_request_edit_comment_path(comment) do %>
+ #<%=comment.id%>
+ --
+ <%=h(comment.user.name)%>
+ <%=admin_value(comment.created_at)%>
+ <% end %>
+ <blockquote class="incoming-message">
+ <%= truncate(comment.body, :length => 400) %>
+ </blockquote>
+ </div>
+ <div id="comment_<%=comment.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <tr>
+ <td colspan="2">
+ By <%= user_both_links(comment.user) %>
+ </td>
+ </tr>
+ <% comment.for_admin_column do |name, value, type, column_name |%>
+ <tr>
+ <td>
+ <b><%=name%></b>
+ </td>
+ <td>
+ <% if column_name == 'body' && !comment.visible %>
+ <s><%=h comment.send(column_name) %></s>
+ <% else %>
+ <%=h comment.send(column_name) %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
<% end %>
- <td>
- <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>
- </td>
- </tr>
- <% end %>
- </table>
+ </div>
<% else %>
<p>None yet.</p>
<% end %>
-
-
-
+<hr>
<h2>Mail server delivery logs</h2>
<p><i>(Lines containing the request incoming email address, updated hourly.)</i></p>
<% for mail_server_log_done_id, mail_server_logs in @info_request.mail_server_logs.group_by(&:mail_server_log_done_id) %>
- <!-- <h3><%=h mail_server_logs[0].mail_server_log_done.filename %></h3> -->
- <pre><% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %></pre>
+ <!-- <h3><%=h mail_server_logs[0].mail_server_log_done.filename %></h3> -->
+ <pre><% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %></pre>
<% end %>
<% if @info_request.mail_server_logs.size == 0 %>
- <p>None (perhaps this is an old or a very new request)</p>
+ <p>None (perhaps this is an old or a very new request)</p>
<% end %>
+<hr>
<h2>Censor rules</h2>
<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %>
diff --git a/app/views/admin_request/show_raw_email.html.erb b/app/views/admin_request/show_raw_email.html.erb
index ea0d6017e..72c782ad6 100644
--- a/app/views/admin_request/show_raw_email.html.erb
+++ b/app/views/admin_request/show_raw_email.html.erb
@@ -1,37 +1,67 @@
-<% @title = 'Incoming message ' + @raw_email.incoming_message.id.to_s + ' of FOI request \'' + h(@raw_email.incoming_message.info_request.title) + "'" %>
+<% @title = "Incoming message #{@raw_email.incoming_message.id} of FOI request '#{@raw_email.incoming_message.info_request.title}'" %>
-<h1>Incoming message <%=@raw_email.incoming_message.id.to_s %></h1>
+<h1>Incoming message <%=@raw_email.incoming_message.id %></h1>
<p>
FOI request: <%= request_both_links(@raw_email.incoming_message.info_request) %>
- <% if @holding_pen %>
+ <% if @holding_pen %>
<br>This is in the holding pen because: <strong><%= @rejected_reason %></strong>
<% if @public_bodies.size > 0 %>
<br>Guessed authority:
- <% for public_body in @public_bodies %>
- <%=public_body_both_links(public_body)%>
+ <% @public_bodies.each do |public_body| %>
+ <%=public_body_both_links(public_body)%>
<% end %>
(based on From: email domain)
<% end %>
<% if @info_requests.size > 0 %>
- <br>Guessed request:
- <% for info_request in @info_requests %>
- <%=request_both_links(info_request)%>
- <% end %>
- (based on id, not hash, in To/Cc email)
+ <div class="accordion" id="guessed-requests">
+ Guessed request:
+ <% @info_requests.each do |info_request| %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a href="#info_request_<%= info_request.id %>" data-toggle="collapse"><i class="icon-chevron-right"></i></a>
+ <%=request_both_links(info_request)%>
+ </div>
+ <div class="accordion-body collapse" id="info_request_<%= info_request.id %>">
+ <table class="table table-striped table-condensed">
+ <tr>
+ <td><strong>Last outgoing message:</strong></td>
+ <td><%= info_request.outgoing_messages.last.body %></td>
+ </tr>
+ <tr>
+ <td><strong>Created by:</strong></td>
+ <td><%= user_admin_link_for_request(info_request) %></td>
+ </tr>
+ <tr>
+ <td><strong>Authority:</strong></td>
+ <td>
+ <%= link_to(info_request.public_body.name, admin_body_show_path(info_request.public_body)) %>
+ </td>
+ </tr>
+ <tr>
+ <td><strong>url_title:</strong></td>
+ <td><%= info_request.url_title %></td>
+ </tr>
+ </table>
+ <p>
+ This request was guessed because it has an incoming email address of <strong><%= info_request.incoming_email %></strong> and this incoming message was sent to <strong><%= @raw_email.incoming_message.mail.to %></strong>.
+ </p>
+ </div>
+ </div>
+ <% end %>
+ (based on id, not hash, in To/Cc email)
+ </div>
<% end %>
<% end %>
</p>
-<h2>Actions</h2>
-
<div>
<%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => @raw_email.incoming_message } %>
</div>
<h2>Raw email</h2>
-<p><%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %></p>
+<p><%= link_to "Download", admin_request_download_raw_email_path(@raw_email) %></p>
-<pre><%= h(@raw_email.data).gsub(/\n/, '<br>').html_safe %></pre>
+<pre><%=h(@raw_email.data).gsub(/\n/, '<br>').html_safe %></pre>
diff --git a/app/views/admin_track/_some_tracks.html.erb b/app/views/admin_track/_some_tracks.html.erb
index 1d2b358b7..e9facfb5d 100644
--- a/app/views/admin_track/_some_tracks.html.erb
+++ b/app/views/admin_track/_some_tracks.html.erb
@@ -1,31 +1,74 @@
-<table>
- <tr>
- <th>Id</th>
- <th>User</th>
- <% for column in TrackThing.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Items sent by email (in last month)</th>
- <th>Actions</th>
- </tr>
-
-<% for track_thing in track_things %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h track_thing.id %></td>
- <td><%=user_both_links(track_thing.tracking_user) %></td>
- <% for column in TrackThing.content_columns.map { |c| c.name } %>
- <td><%=h track_thing.send(column) %></td>
- <% end %>
- <td><%= track_thing.track_things_sent_emails.size %></td>
- <td>
- <%= form_tag '../../user/destroy_track' do %>
- <div>
- <%= hidden_field_tag 'track_id', track_thing.id %>
- <%= submit_tag "Destroy track" %>
- </div>
- <% end %>
- </td>
- </tr>
+<% include_destroy = include_destroy || false %>
+<% if track_things.empty? %>
+ <div class="row">
+ <div class="span12">
+ <%=_("No tracked things found.")%>
+ </div>
+ </div>
+<% else %>
+ <div class="accordion" id="tracks">
+ <% for track_thing in track_things %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a href="#track_<%=track_thing.id%>" data-toggle="collapse" data-parent="requests"><%= chevron_right %></a>
+ <%=track_thing.id%>:
+ <% if track_thing.public_body_id %>
+ <%= link_to "<code>#{h track_thing.track_query}</code>".html_safe, public_body_path(track_thing.public_body) %>
+ <% elsif track_thing.info_request_id %>
+ <%= link_to "<code>#{h track_thing.track_query}</code>".html_safe, request_path(track_thing.info_request) %>
+ <% elsif track_thing.tracked_user_id %>
+ <%= link_to "<code>#{h track_thing.track_query}</code>".html_safe, user_path(track_thing.tracked_user) %>
+ <% else %>
+ <code><%=h track_thing.track_query%></code>
+ <% end %>
+ <% if @admin_user.nil? %>
+ <%# Do not show this on the list of tracks on the user page, because it’s rather repetitive there %>
+ tracked by <%= user_both_links track_thing.tracking_user %>
+ <% end %>
+ </div>
+ <div id="track_<%=track_thing.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% if include_destroy %>
+ <tr>
+ <td colspan="2">
+ <%= form_tag admin_user_destroy_track_path, :class => "form form-inline admin-table-form" do %>
+ <div>
+ <%= hidden_field_tag 'track_id', track_thing.id %>
+ <%= submit_tag "Destroy track", :class => "btn btn-warning" %>
+ </div>
+ <% end %>
+ </td>
+ </tr>
+
+ <% end %>
+ <% TrackThing.content_columns.each do |column| %>
+ <tr>
+ <td>
+ <b><%=column.human_name%></b>
+ </td>
+ <td>
+ <% if column.type.to_s == 'datetime' %>
+ <%= I18n.l(track_thing.send(column.name), :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(track_thing.send(column.name))) %>)
+ <% elsif column.name == 'track_medium' and track_thing.track_medium == 'feed' %>
+ <%= link_to track_thing.track_medium, atom_feed_path(:track_id => track_thing.id) %>
+ <% else %>
+ <%= h track_thing.send(column.name)%>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ <tr>
+ <td><b><%=_("Items sent in last month")%></b></td>
+ <td><%= track_thing.track_things_sent_emails.size %></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+ </div>
<% end %>
</table>
diff --git a/app/views/admin_track/list.html.erb b/app/views/admin_track/list.html.erb
index 1105f965e..5e967a926 100644
--- a/app/views/admin_track/list.html.erb
+++ b/app/views/admin_track/list.html.erb
@@ -1,39 +1,20 @@
-<% @title = 'Listing tracks' %>
+<% @title = _('Listing tracks') %>
<h1><%=@title%></h1>
-<%= form_tag("", :method => "get") do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %> (substring search the query - so use url_names_for_a_particular_request_or_authority_or_person)
- </p>
+<%= form_tag({}, :method => "get", :class => "form form-search") do %>
+ <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query" } %>
+ <%= submit_tag "Search", :class => "btn" %> (substring search the query – so use url_names_for_a_particular_request_or_authority_or_person)
<% end %>
-<table>
- <tr>
- <th>Id</th>
- <th>Tracked by</th>
- <% for column in TrackThing.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Items sent by email (in last month)</th>
- </tr>
-
-<% for track_thing in @admin_tracks %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h track_thing.id %></td>
- <td><%= user_both_links(track_thing.tracking_user) %></td>
- <% for column in TrackThing.content_columns.map { |c| c.name } %>
- <% if column == 'track_medium' and track_thing.track_medium == 'feed'%>
- <td><%= link_to track_thing.track_medium, atom_feed_url(:track_id => track_thing.id) %></td>
- <% else %>
- <td><%=h track_thing.send(column) %></td>
- <% end %>
- <% end %>
- <td><%= track_thing.track_things_sent_emails.size %></td>
- </tr>
-<% end %>
-</table>
+<%= render :partial => 'some_tracks', :locals => { :track_things => @admin_tracks } %>
+
+<%= will_paginate(@admin_tracks, :class => "paginator" ) %>
-<%= will_paginate(@admin_tracks) %>
+<h2>Current top tracks:</h2>
+<ol>
+<% for row in @popular %>
+ <li><%= link_to row['title'], admin_request_show_path(row['info_request_id']) %> (<%= row['count'] %> people following)</li>
+<% end %>
+</ol>
diff --git a/app/views/admin_user/_form.html.erb b/app/views/admin_user/_form.html.erb
index be69d9a80..e7175d09c 100644
--- a/app/views/admin_user/_form.html.erb
+++ b/app/views/admin_user/_form.html.erb
@@ -2,26 +2,65 @@
<!--[form:admin_user]-->
-<p><label for="admin_user_name">Name</label> (will change URL name and break URLs; unlike authorities, there is no history; you will need to rebuild the search index afterwards)<br/>
-<%= text_field 'admin_user', 'name', :size => 60 %></p>
+<div class="control-group">
+ <label for="admin_user_name" class="control-label">Name</label>
+ <div class="controls">
+ <%= text_field 'admin_user', 'name', :class => "span3" %>
+ <div class="help-block">
+ will change URL name and break URLs; unlike authorities, there is no history; you will need to rebuild the search index afterwards
+ </div>
+ </div>
+</div>
-<p><label for="admin_user_email">Email</label> (<strong>you must</strong> first validate this)<br/>
-<%= text_field 'admin_user', 'email', :size => 60 %></p>
+<div class="control-group">
+ <label for="admin_user_email" class="control-label">Email</label>
+ <div class="controls">
+ <%= text_field 'admin_user', 'email', :class => "span3" %>
+ <div class="help-block">
+ <strong>you must</strong> first validate this
+ </div>
+ </div>
+</div>
-<p><label for="admin_user_admin_level">Admin level</label> (<strong>none</strong> or <strong>super</strong>; this is for admin features and links which are in the site proper)<br/>
-<%= text_field 'admin_user', 'admin_level', :size => 60 %></p>
+<div class="control-group">
+ <label for="admin_level" class="control-label">Admin level</label>
+ <div class="controls">
+ <%= text_field 'admin_user', 'admin_level', :class => "span3" %>
+ <div class="help-block">
+ <strong>none</strong> or <strong>super</strong>; this is for admin features and links which are in the site proper
+ </div>
+ </div>
+</div>
-<p><label for="admin_user_ban_text">Ban text</label> <small>(if not blank will stop the
- user from filing new requests, making annotations or messaging other users;
- the text is shown in public on the user's page and when they try to do a
- forbidden action; write in the second person (you); see
- <%= link_to 'banned users', '../banned' %> for examples</small>)<br/>
-
-<%= text_area 'admin_user', 'ban_text', :cols => 60, :rows => 3 %></p>
-
-<p><label for="admin_user_about_me">About me</label> (user's own text on their profile, format like comments):<br/>
-<%= text_area 'admin_user', 'about_me', :cols => 60, :rows => 3 %></p>
-
-<p><%= check_box 'admin_user', 'no_limit' %>
-<label for="admin_user_no_limit">No rate limit</label> (disable the limit on daily requests)</p>
+<div class="control-group">
+ <label for="ban_text" class="control-label">Ban text</label>
+ <div class="controls">
+ <%= text_area 'admin_user', 'ban_text', :class => "span6", :rows => 3 %>
+ <div class="help-block">
+ if not blank will stop the
+ user from filing new requests, making annotations or messaging other users;
+ the text is shown in public on the user's page and when they try to do a
+ forbidden action; write in the second person (you); see
+ <%= link_to 'banned users', admin_user_list_banned_path %> for examples</small>
+ </div>
+ </div>
+</div>
+<div class="control-group">
+ <label for="about_me" class="control-label">About me</label>
+ <div class="controls">
+ <%= text_area 'admin_user', 'about_me', :class => "span6", :rows => 3 %>
+ <div class="help-block">
+ user's own text on their profile, format like comments
+ </div>
+ </div>
+</div>
+<div class="control-group">
+ <label for="admin_user_no_limit" class="control-label">No rate limit</label>
+ <div class="controls">
+ <%= check_box 'admin_user', 'no_limit' %>
+ <div class="help-block">
+ disable the limit on daily requests
+ </div>
+ </div>
+</div>
diff --git a/app/views/admin_user/_user_table.html.erb b/app/views/admin_user/_user_table.html.erb
index d35c78594..57066bf3f 100644
--- a/app/views/admin_user/_user_table.html.erb
+++ b/app/views/admin_user/_user_table.html.erb
@@ -1,22 +1,47 @@
-<table>
- <tr>
- <th>Id</th>
- <% for column in ['Name', 'Email', 'Created at', 'Updated at', 'Email confirmed', 'Admin'] + (banned_column ? ['Ban text'] : []) %>
- <th><%= column %></th>
+<div class="accordion" id="users">
+ <% for user in users %>
+ <div class="accordion-group">
+ <div class="accordion-heading accordion-toggle">
+ <span class="item-title">
+ <a href="#user_<%=user.id%>" data-toggle="collapse" data-parent="requests"><%= chevron_right %></a>
+ <% if user.admin_level == "super" %>
+ <span class="label">superuser</span>
+ <% end %>
+ <%= link_to("#{h(user.name)}", admin_user_show_path(user))%>
+ <%= link_to("(#{h(user.email)})", "mailto:#{h(user.email)}")%>
+ </span>
+ <span class="item-metadata">
+ updated <%=I18n.l(user.updated_at, :format => "%e %B %Y %H:%M:%S")%>
+ </span>
+ </div>
+ <div id="user_<%=user.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% if banned_column %>
+ <tr>
+ <td><b>Ban text</b></td>
+ <td><%= h user.ban_text %></td>
+ </tr>
+ <% end %>
+ <% user.for_admin_column do |name, value, type|%>
+ <tr>
+ <td><b><%=h name%></b></td>
+ <td>
+ <% if type == 'datetime' %>
+ <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
+ <% else %>
+ <%= h value %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
<% end %>
- </tr>
-
-<% for user in users %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%= user.id.to_s %></td>
- <td><%= user_both_links(user) %></td>
- <td><a href="mailto:<%=h user.email %>"><%=h user.email%></a></td>
- <% for column in ['created_at', 'updated_at', 'email_confirmed', 'admin_level'] + (banned_column ? ['ban_text'] : []) %>
- <td><%=h user.send(column) %></td>
- <% end %>
- </tr>
-<% end %>
-</table>
+</div>
-<%= will_paginate(users) %>
+<%= will_paginate(users, :class => "paginator") %>
diff --git a/app/views/admin_user/edit.html.erb b/app/views/admin_user/edit.html.erb
index fb59dffe2..e641a13d6 100644
--- a/app/views/admin_user/edit.html.erb
+++ b/app/views/admin_user/edit.html.erb
@@ -1,23 +1,11 @@
-
-
<h1><%=@title%></h1>
-<%= form_tag '../update/' + @admin_user.id.to_s do %>
+<%= form_tag admin_user_update_path(@admin_user), :class => "form form-horizontal" do %>
<%= render :partial => 'form' %>
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
-<% end %>
-
-<p>
-<%= link_to 'Show', '../show/' + @admin_user.id.to_s %> |
-<%= link_to 'List all', '../list' %>
-</p>
-
-<% if false #@admin_user.info_requests.size == 0 %>
- <%= form_tag('../destroy/' + @admin_user.id.to_s) do %>
- <p>
- <%= hidden_field_tag(:admin_user_id, { :value => @admin_user.id } ) %>
- <%= submit_tag "Destroy " + @admin_user.name %> (this is permanent!)
- </p>
- <% end %>
+ <div class="form-actions">
+ <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %>
+ </div>
<% end %>
+<%= link_to 'Show', admin_user_show_path(@admin_user), :class => "btn" %>
+<%= link_to 'List all', admin_user_list_path, :class => "btn" %>
diff --git a/app/views/admin_user/list.html.erb b/app/views/admin_user/list.html.erb
index 377f5fc10..b1238f87a 100644
--- a/app/views/admin_user/list.html.erb
+++ b/app/views/admin_user/list.html.erb
@@ -1,13 +1,11 @@
-<% @title = 'Listing users' %>
+<% @title = _('Listing users') %>
<h1><%=@title%></h1>
-<%= form_tag("", :method => "get") do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %> (substring search, names and emails)
- <%= link_to 'Banned users', 'banned' %>
- </p>
+<%= form_tag({}, :method => "get", :class => "form form-search") do %>
+ <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query"} %>
+ <%= submit_tag "Search", :class => "btn" %> (substring search, names and emails)
+ <%= link_to 'Banned users', admin_user_list_banned_path, :class => "btn btn-info" %>
<% end %>
<%= render :partial => 'user_table', :locals => { :users => @admin_users, :banned_column => false } %>
diff --git a/app/views/admin_user/list_banned.html.erb b/app/views/admin_user/list_banned.html.erb
index be2d45399..e535415e6 100644
--- a/app/views/admin_user/list_banned.html.erb
+++ b/app/views/admin_user/list_banned.html.erb
@@ -2,7 +2,7 @@
<h1><%=@title%></h1>
-<p><%= link_to 'List all', 'list' %></p>
+<p><%= link_to 'List all', admin_user_list_path %></p>
<%= render :partial => 'user_table', :locals => { :users => @banned_users, :banned_column => true } %>
diff --git a/app/views/admin_user/show.html.erb b/app/views/admin_user/show.html.erb
index 03e3d30c5..26a385f31 100644
--- a/app/views/admin_user/show.html.erb
+++ b/app/views/admin_user/show.html.erb
@@ -1,63 +1,81 @@
-<% @title = "User - " + h(@admin_user.name) %>
+<% @title = _("User – {{name}}", :name => h(@admin_user.name)) %>
<h1><%=@title%></h1>
<% if @admin_user.profile_photo %>
- <div class="user_photo_on_admin">
- <%= form_tag '../clear_profile_photo/' + @admin_user.id.to_s, :multipart => true do %>
- <img src="<%= main_url(get_profile_photo_url(:url_name => @admin_user.url_name, :only_path => true)) %>">
- <br>
- <%= submit_tag "Clear photo" %>
- <% end %>
- </div>
+ <div class="user_photo_on_admin">
+ <%= form_tag admin_clear_profile_photo_path(@admin_user), :multipart => true, :class => "form" do %>
+ <img src="<%= get_profile_photo_url(:url_name => @admin_user.url_name) %>">
+ <br>
+ <%= submit_tag "Clear photo", :class => "btn btn-info" %>
+ <% end %>
+ </div>
<% end %>
-
-<div>
-<strong>Id:</strong> <%= @admin_user.id%> <br>
-<% for column in User.content_columns %>
- <strong><%= column.human_name %>:</strong>
- <% if column.name == 'email' %>
- <a href="mailto:<%=h @admin_user.email %>"><%=h @admin_user.email%></a>
- <% elsif column.name == 'email_bounce_message' %>
- <% if !@admin_user.email_bounce_message.empty? %>
- <a href="../show_bounce_message/<%= @admin_user.id.to_s %>">See bounce message</a>
- <% end %>
- <% else %>
- <%=h @admin_user.send(column.name) %>
+<table class="table table-striped table-condensed">
+ <tbody>
+ <tr>
+ <td>
+ <b><%=_("Id")%></b>
+ </td>
+ <td>
+ <%=@admin_user.id%>
+ </td>
+ </tr>
+ <% @admin_user.for_admin_column(:complete => true) do |name, value, type, column_name| %>
+ <tr>
+ <td>
+ <b><%=_(name)%></b>
+ </td>
+ <td>
+ <% if column_name == 'email' %>
+ <%=link_to @admin_user.email, "mailto:#{h @admin_user.email}"%>
+ <% elsif column_name == 'email_bounce_message' %>
+ <% unless @admin_user.email_bounce_message.empty? %>
+ <%= link_to _("See bounce message"), admin_user_show_bounce(@admin_user.id) %>
+ <% end %>
+ <% else %>
+ <%=h admin_value(value)%>
+ <% end %>
+ <% if column_name == 'email_bounced_at' && !@admin_user.email_bounced_at.nil? %>
+ <% form_tag admin_user_clear_bounce_path(@admin_user), :class => "form form-inline" do %>
+ <input type="submit" name="action" value="Clear bounce" class="btn btn-info">
+ <% end %>
+ <% end %>
+ </td>
+ </tr>
<% end %>
- <% if column.name == 'email_bounced_at' && !@admin_user.email_bounced_at.nil? %>
- <form action="../clear_bounce/<%= @admin_user.id.to_s %>" style="display: inline;"><input type="submit" name="action" value="Clear bounce"></form>
- <% end %>
- <br>
-<% end %>
-</div>
+ </tbody>
+</table>
-<p>
- <%= link_to 'Public page', main_url(user_url(@admin_user)) %>
- | <%= link_to 'Edit', '../edit/' + @admin_user.id.to_s %>
- | <%= link_to 'Log in as this user', '../login_as/' + @admin_user.id.to_s %> (also confirms their email)
-</p>
+
+<%= link_to 'Edit', admin_user_edit_path(@admin_user), :class => "btn btn-primary" %>
+<%= link_to 'Public page', user_path(@admin_user), :class => "btn" %>
+<%= link_to "Log in as #{@admin_user.name} (also confirms their email)", admin_user_login_as_path(@admin_user), :class => "btn btn-info" %>
+
+<hr>
<h2>Track things</h2>
-<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @admin_user.track_things } %>
+<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @admin_user.track_things, :include_destroy => true } %>
+
+<hr>
<h2>Post redirects</h2>
-<table>
+<table class="table table-condensed table-striped">
<tr>
<th>Id</th>
<% for column in PostRedirect.content_columns %>
<th><%= column.human_name %></th>
<% end %>
</tr>
-
+
<% for post_redirect in @admin_user.post_redirects.find(:all, :order => 'created_at desc') %>
<tr class="<%= cycle('odd', 'even') %>">
<td><%=h post_redirect.id %></td>
<% for column in PostRedirect.content_columns.map { |c| c.name } %>
<% if column == 'email_token' %>
- <td><%=link_to post_redirect.send(column), main_url(confirm_url(:email_token => post_redirect.send(column), :only_path => true)) %></td>
+ <td><%=link_to post_redirect.send(column), confirm_path(:email_token => post_redirect.send(column)) %></td>
<% else %>
<td><%=h post_redirect.send(column) %></td>
<% end %>
@@ -66,9 +84,13 @@
<% end %>
</table>
+<hr>
+
<h2>Requests</h2>
<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @admin_user.info_requests } %>
+<hr>
+
<h2>Censor rules</h2>
<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @admin_user.censor_rules, :user => @admin_user } %>
diff --git a/app/views/api/request_events.atom.builder b/app/views/api/request_events.atom.builder
index 44759ae7e..648a81e5c 100644
--- a/app/views/api/request_events.atom.builder
+++ b/app/views/api/request_events.atom.builder
@@ -8,7 +8,7 @@ atom_feed("xmlns:alaveteli" => "http://www.alaveteli.org/API/v2/RequestEvents/At
entry.updated(event.created_at.utc.iso8601)
entry.tag!("alaveteli:event_type", event.event_type)
- entry.tag!("alaveteli:request_url", main_url(request_url(request)))
+ entry.tag!("alaveteli:request_url", request_url(request))
entry.title(request.title)
entry.content(event.outgoing_message.body, :type => 'text')
@@ -16,7 +16,7 @@ atom_feed("xmlns:alaveteli" => "http://www.alaveteli.org/API/v2/RequestEvents/At
entry.author do |author|
author.name(request.user_name)
if !request.user.nil?
- author.uri(main_url(user_url(request.user)))
+ author.uri(user_url(request.user))
end
author.email(request.incoming_email)
end
diff --git a/app/views/comment/_single_comment.html.erb b/app/views/comment/_single_comment.html.erb
index b645721cf..421a9d4ba 100644
--- a/app/views/comment/_single_comment.html.erb
+++ b/app/views/comment/_single_comment.html.erb
@@ -17,11 +17,11 @@
</div>
<p class="event_actions">
<% if !comment.id.nil? %>
- <%= link_to "Link to this", comment_url(comment), :class => "link_to_this" %>
+ <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %>
<% if !@user.nil? && @user.admin_page_links? %>
- | <%= link_to "Admin", admin_url("request/edit_comment/" + comment.id.to_s) %>
+ | <%= link_to "Admin", admin_request_edit_comment_path(comment) %>
<% end %>
- <!-- | <%= link_to _('Report abuse'), comment_url(comment) %> -->
+ <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> -->
<% end %>
</p>
</div>
diff --git a/app/views/comment/new.html.erb b/app/views/comment/new.html.erb
index aa5b6051c..578732cdb 100644
--- a/app/views/comment/new.html.erb
+++ b/app/views/comment/new.html.erb
@@ -67,10 +67,10 @@
</ul>
<p>
- <big><%= _('Annotations will be posted publicly here, and are
- <strong>not</strong> sent to {{public_body_name}}.',:public_body_name=>h(@info_request.public_body.name)) %></big>
+ <span class="big"><%= _('Annotations will be posted publicly here, and are
+ <strong>not</strong> sent to {{public_body_name}}.',:public_body_name=>h(@info_request.public_body.name)) %></span>
<% if @info_request.is_external? %>
- <big><%= _('Note that the requester will not be notified about your annotation, because the request was published by {{public_body_name}} on their behalf.', :public_body_name => @info_request.public_body.name) %></big>
+ <span class="big"><%= _('Note that the requester will not be notified about your annotation, because the request was published by {{public_body_name}} on their behalf.', :public_body_name => @info_request.public_body.name) %></span>
<% end %>
</p>
diff --git a/app/views/contact_mailer/from_admin_message.text.erb b/app/views/contact_mailer/from_admin_message.text.erb
index bdb48d580..4169d8d3a 100644
--- a/app/views/contact_mailer/from_admin_message.text.erb
+++ b/app/views/contact_mailer/from_admin_message.text.erb
@@ -1,2 +1,2 @@
-<%= @message.strip %>
+<%= raw @message %>
diff --git a/app/views/contact_mailer/to_admin_message.text.erb b/app/views/contact_mailer/to_admin_message.text.erb
index 9c0a74c02..dc9b1090b 100644
--- a/app/views/contact_mailer/to_admin_message.text.erb
+++ b/app/views/contact_mailer/to_admin_message.text.erb
@@ -1,11 +1,11 @@
-<%= @message.strip %>
+<%= raw @message.strip %>
---------------------------------------------------------------------
<%= _('Message sent using {{site_name}} contact form, ', :site_name=>site_name)%>
-<%=(@logged_in_user ? ("logged in as user " + main_url(user_url(@logged_in_user))) : "not logged in")%><% if !@last_request.nil? %>
+<%=(@logged_in_user ? ("logged in as user " + user_url(@logged_in_user)) : "not logged in")%><% if !@last_request.nil? %>
-<%= _('Last request viewed: ')%><%= main_url(request_url(@last_request)) %>
+<%= _('Last request viewed: ')%><%= request_url(@last_request) %>
<% end %> <% if !@last_body.nil? %>
-<%= _('Last authority viewed: ')%><%= main_url(public_body_url(@last_body)) %>
+<%= _('Last authority viewed: ')%><%= public_body_url(@last_body) %>
<% end %>---------------------------------------------------------------------
diff --git a/app/views/contact_mailer/user_message.text.erb b/app/views/contact_mailer/user_message.text.erb
index b1d6e81ae..afa1494db 100644
--- a/app/views/contact_mailer/user_message.text.erb
+++ b/app/views/contact_mailer/user_message.text.erb
@@ -5,7 +5,7 @@
learn your email address. Only reply if that is okay.', :user_name => @from_user.name) %>
---------------------------------------------------------------------
-<%= @message.strip %>
+<%= raw @message.strip %>
---------------------------------------------------------------------
<%= _('View Freedom of Information requests made by {{user_name}}:', :user_name=>@from_user.name)%>
diff --git a/app/views/general/_advanced_search_tips.html.erb b/app/views/general/_advanced_search_tips.html.erb
index 914abc1af..08ce04439 100644
--- a/app/views/general/_advanced_search_tips.html.erb
+++ b/app/views/general/_advanced_search_tips.html.erb
@@ -23,27 +23,27 @@
<p><%= _("All the options below can use <strong>status</strong> or <strong>latest_status</strong> before the colon. For example, <strong>status:not_held</strong> will match requests which have <em>ever</em> been marked as not held; <strong>latest_status:not_held</strong> will match only requests that are <em>currently</em> marked as not held.") %></p>
<table class="status_table">
- <tr><td><strong><%=search_link('status:waiting_response', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr>
- <tr><td><strong><%=search_link('status:not_held', nil, nil, true)%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr>
- <tr><td><strong><%=search_link('status:rejected', nil, nil, true)%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr>
- <tr><td><strong><%=search_link('status:partially_successful', nil, nil, true)%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr>
- <tr><td><strong><%=search_link('status:successful', nil, nil, true)%></strong></td><td><%= _('All of the information requested has been received') %></td></tr>
- <tr><td><strong><%=search_link('status:waiting_clarification', nil, nil, true)%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr>
- <tr><td><strong><%=search_link('status:gone_postal', nil, nil, true)%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr>
- <tr><td><strong><%=search_link('status:internal_review', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr>
- <tr><td><strong><%=search_link('status:error_message', nil, nil, true)%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr>
- <tr><td><strong><%=search_link('status:requires_admin', nil, nil, true)%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr>
- <tr><td><strong><%=search_link('status:user_withdrawn', nil, nil, true)%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr>
+ <tr><td><strong><%=search_link('status:waiting_response')%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr>
+ <tr><td><strong><%=search_link('status:not_held')%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr>
+ <tr><td><strong><%=search_link('status:rejected')%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr>
+ <tr><td><strong><%=search_link('status:partially_successful')%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr>
+ <tr><td><strong><%=search_link('status:successful')%></strong></td><td><%= _('All of the information requested has been received') %></td></tr>
+ <tr><td><strong><%=search_link('status:waiting_clarification')%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr>
+ <tr><td><strong><%=search_link('status:gone_postal')%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr>
+ <tr><td><strong><%=search_link('status:internal_review')%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr>
+ <tr><td><strong><%=search_link('status:error_message')%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr>
+ <tr><td><strong><%=search_link('status:requires_admin')%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr>
+ <tr><td><strong><%=search_link('status:user_withdrawn')%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr>
</table>
<h2 id="varieties"><%= _('Table of varieties') %></h2>
<p><%= _("All the options below can use <strong>variety</strong> or <strong>latest_variety</strong> before the colon. For example, <strong>variety:sent</strong> will match requests which have <em>ever</em> been sent; <strong>latest_variety:sent</strong> will match only requests that are <em>currently</em> marked as sent.") %></p>
<table class="status_table">
- <tr><td><strong><%=search_link('variety:sent', nil, nil, true)%></strong></td><td><%= _('Original request sent') %></td></tr>
- <tr><td><strong><%=search_link('variety:followup_sent', nil, nil, true)%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr>
- <tr><td><strong><%=search_link('variety:response', nil, nil, true)%></strong></td><td><%= _('Response from a public authority') %></td></tr>
- <tr><td><strong><%=search_link('variety:comment', nil, nil, true)%></strong></td><td><%= _('Annotation added to request') %></td></tr>
- <tr><td><strong><%=search_link('variety:authority', nil, nil, true)%></strong></td><td><%= _('A public authority') %></td></tr>
- <tr><td><strong><%=search_link('variety:user', nil, nil, true)%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr>
+ <tr><td><strong><%=search_link('variety:sent')%></strong></td><td><%= _('Original request sent') %></td></tr>
+ <tr><td><strong><%=search_link('variety:followup_sent')%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr>
+ <tr><td><strong><%=search_link('variety:response')%></strong></td><td><%= _('Response from a public authority') %></td></tr>
+ <tr><td><strong><%=search_link('variety:comment')%></strong></td><td><%= _('Annotation added to request') %></td></tr>
+ <tr><td><strong><%=search_link('variety:authority')%></strong></td><td><%= _('A public authority') %></td></tr>
+ <tr><td><strong><%=search_link('variety:user')%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr>
</table>
</div>
diff --git a/app/views/general/_footer.html.erb b/app/views/general/_footer.html.erb
index 3ec4f40e6..990093694 100644
--- a/app/views/general/_footer.html.erb
+++ b/app/views/general/_footer.html.erb
@@ -1,5 +1,5 @@
<div id="footer">
- <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
+ <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_path %>
| <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>"><%= _("Follow us on twitter") %></a>
<%= render :partial => 'general/credits' %>
</div>
diff --git a/app/views/general/_frontpage_bodies_list.html.erb b/app/views/general/_frontpage_bodies_list.html.erb
index 503b38953..54400602b 100644
--- a/app/views/general/_frontpage_bodies_list.html.erb
+++ b/app/views/general/_frontpage_bodies_list.html.erb
@@ -11,7 +11,7 @@
<% end%>
</ul>
<p><strong>
- <%= link_to _('Browse all authorities...'), list_public_bodies_default %>
+ <%= link_to _('Browse all authorities...'), list_public_bodies_default_path %>
</strong></p>
</div>
<% end %>
diff --git a/app/views/general/_frontpage_intro_sentence.html.erb b/app/views/general/_frontpage_intro_sentence.html.erb
index 70b47ad06..74b849fc9 100644
--- a/app/views/general/_frontpage_intro_sentence.html.erb
+++ b/app/views/general/_frontpage_intro_sentence.html.erb
@@ -1,4 +1,4 @@
<h2>
Your <strong>Right to Know</strong>
</h2>
-<p>Every citizen has the right to access information held by public authorities. <strong>By law, they have to respond</strong>. <a href="<%= help_about_url %>">Find out more about freedom of information.</a></p>
+<p>Every citizen has the right to access information held by public authorities. <strong>By law, they have to respond</strong>. <a href="<%= help_about_path %>">Find out more about freedom of information.</a></p>
diff --git a/app/views/general/_frontpage_requests_list.html.erb b/app/views/general/_frontpage_requests_list.html.erb
index 3b0efb65e..fa498dfa7 100644
--- a/app/views/general/_frontpage_requests_list.html.erb
+++ b/app/views/general/_frontpage_requests_list.html.erb
@@ -19,17 +19,17 @@
:public_body_link => public_body_link(event.info_request.public_body)) %>
<% end %>
- <%=link_to h(event.info_request.title), request_url(event.info_request)%>
+ <%=link_to h(event.info_request.title), request_path(event.info_request)%>
<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %>
- <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", 200) %></p>
+ <p class="excerpt" onclick="document.location.href='<%=request_path(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", 200) %></p>
</li>
<% end %>
</ul>
<p><strong>
<% if @request_events_all_successful %>
- <%=link_to _('More successful requests...'), request_list_successful_url %>
+ <%=link_to _('More successful requests...'), request_list_successful_path %>
<% else %>
- <%=link_to _('More requests...'), request_list_all_url %>
+ <%=link_to _('More requests...'), request_list_all_path %>
<% end %>
</strong></p>
</div>
diff --git a/app/views/general/_frontpage_search_box.html.erb b/app/views/general/_frontpage_search_box.html.erb
index d2718b3a3..890602416 100644
--- a/app/views/general/_frontpage_search_box.html.erb
+++ b/app/views/general/_frontpage_search_box.html.erb
@@ -6,7 +6,7 @@
</h2>
<form id="search_form" method="post" action="<%= search_redirect_path %>">
<div>
- <input id="query" type="text" size="30" name="query">
+ <input id="query" type="text" size="30" name="query" title="type your search term here" >
<input type="submit" value="<%= _('Search') %>">
</div>
</form>
diff --git a/app/views/general/_locale_switcher.html.erb b/app/views/general/_locale_switcher.html.erb
index 2521b5eb5..d0040bb0d 100644
--- a/app/views/general/_locale_switcher.html.erb
+++ b/app/views/general/_locale_switcher.html.erb
@@ -5,7 +5,7 @@
<% if possible_locale == I18n.locale.to_s %>
<a href="#" class="btn disabled"><%= locale_name(possible_locale) %></a>
<% else %>
- <a href="<%= locale_switcher(possible_locale, params) %>" class="btn"><%= locale_name(possible_locale) %></a>
+ <a href="<%= url_for params.merge(:locale => possible_locale) %>" class="btn"><%= locale_name(possible_locale) %></a>
<% end %>
<% end %>
</div>
diff --git a/app/views/general/_orglink.html.erb b/app/views/general/_orglink.html.erb
index fbe688d85..66002c021 100644
--- a/app/views/general/_orglink.html.erb
+++ b/app/views/general/_orglink.html.erb
@@ -1,2 +1,2 @@
<%# Put the link to your organisation here, or leave blank %>
-<%= link_to image_tag('logo.png'), frontpage_url, :id=>'logo' %>
+<%= link_to image_tag('logo.png'), frontpage_path, :id=>'logo' %>
diff --git a/app/views/general/_topnav.html.erb b/app/views/general/_topnav.html.erb
index 8ef928bba..c7f2cedea 100644
--- a/app/views/general/_topnav.html.erb
+++ b/app/views/general/_topnav.html.erb
@@ -1,10 +1,10 @@
<div id="topnav">
<ul id="navigation">
- <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] != 'blog' and params[:action] != 'search' %>"><%= link_to _("Home"), frontpage_url %></li>
- <li class="<%= 'selected' if params[:controller] == 'request' and ['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("Make a request"), select_authority_url, :id => 'make-request-link' %></li>
- <li class="<%= 'selected' if params[:controller] == 'request' and !['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("View requests"), request_list_successful_url %></li>
- <li class="<%= 'selected' if params[:controller] == 'public_body' %>"><%= link_to _("View authorities"), list_public_bodies_default %></li>
- <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] == 'blog' %>"><%= link_to _("Read blog"), blog_url %></li>
- <li class="<%= 'selected' if params[:controller] == 'help' %>"><%= link_to _("Help"), help_about_url %></li>
+ <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] != 'blog' and params[:action] != 'search' %>"><%= link_to _("Home"), frontpage_path %></li>
+ <li class="<%= 'selected' if params[:controller] == 'request' and ['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("Make a request"), select_authority_path, :id => 'make-request-link' %></li>
+ <li class="<%= 'selected' if params[:controller] == 'request' and !['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("View requests"), request_list_successful_path %></li>
+ <li class="<%= 'selected' if params[:controller] == 'public_body' %>"><%= link_to _("View authorities"), list_public_bodies_default_path %></li>
+ <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] == 'blog' %>"><%= link_to _("Read blog"), blog_path %></li>
+ <li class="<%= 'selected' if params[:controller] == 'help' %>"><%= link_to _("Help"), help_about_path %></li>
</ul>
</div>
diff --git a/app/views/general/blog.html.erb b/app/views/general/blog.html.erb
index 76935cedf..7146aab5d 100644
--- a/app/views/general/blog.html.erb
+++ b/app/views/general/blog.html.erb
@@ -5,7 +5,7 @@
<div class="act_link">
<h2><%= _("Stay up to date") %></h2>
<img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/>
- <img src="/images/feed-16.png" alt="RSS icon" valign="middle"> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a>
+ <img src="/images/feed-16.png" alt="RSS icon"> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a>
</div>
<% if AlaveteliConfiguration::twitter_widget_id %>
<div id="twitter">
diff --git a/app/views/general/exception_caught.html.erb b/app/views/general/exception_caught.html.erb
index 94b0d0db7..8d78e2e92 100644
--- a/app/views/general/exception_caught.html.erb
+++ b/app/views/general/exception_caught.html.erb
@@ -7,8 +7,8 @@
<ul>
<li><%= _("Check for mistakes if you typed or copied the address.")%></li>
<li><%= _("Search the site to find what you were looking for.")%>
- <%= form_tag({:controller => "general", :action => "search_redirect"}, {:id => "search_form"}) do %>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
+ <%= form_tag({:controller => "general", :action => "search_redirect"}, {:id => "search_form" }) do %>
+ <%= text_field_tag 'query', params[:query], { :size => 30, :title => "type your search term here" } %>
<%= submit_tag _("Search") %>
<% end %>
</li>
diff --git a/app/views/general/search.html.erb b/app/views/general/search.html.erb
index de42d3937..7072ab90f 100644
--- a/app/views/general/search.html.erb
+++ b/app/views/general/search.html.erb
@@ -37,13 +37,13 @@
<% else %>
<%= form_tag(request.url, {:method => "get", :id => "search_form"}) do %>
<p>
- <%= text_field_tag 'query', params[:query], { :size => 40 } %>
+ <%= text_field_tag 'query', params[:query], { :size => 40, :title => "type your search term here" } %>
<%= hidden_field_tag 'sortby', @inputted_sortby %>
<% if @bodies %>
<%= hidden_field_tag 'bodies', 1 %>
<% end %>
<%= submit_tag _("Search") %>
- <%= link_to(_("Advanced search"), advanced_search_url) %>
+ <%= link_to(_("Advanced search"), advanced_search_path) %>
</p>
<div id="common-subfilters">
@@ -56,7 +56,7 @@
["all", _("everything")]]%>
<% for variety, label in labels %>
<% if @variety_postfix != variety %>
- <%= link_to label, search_url([params[:query], variety, @sort_postfix]) %>
+ <%= link_to label, search_path([params[:query], variety, @sort_postfix]) %>
<% else %>
<%= label %>
<% end %>
@@ -122,9 +122,9 @@
<% if !@query.nil? %>
<p id="search_controls">
- <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url([params[:query], @variety_postfix, 'relevant'], params) %>
+ <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_path([params[:query], @variety_postfix, 'relevant'], params) %>
|
- <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url([params[:query], @variety_postfix, 'newest'], params) %>
+ <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_path([params[:query], @variety_postfix, 'newest'], params) %>
<% if @sortby == 'described' %>
| <%= _('Recently described results first') %>
<% end %>
@@ -162,9 +162,9 @@
<%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
<% elsif @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>
<% if @spelling_correction %>
- <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p>
+ <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction)) %></p>
<% end %>
- <p><%= raw(_('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body']) %></p>
+ <p><%= raw(_('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default_url, help_requesting_path + '#missing_body']) %></p>
<% end %>
</div>
diff --git a/app/views/help/api.html.erb b/app/views/help/api.html.erb
index da6253f87..57390d65a 100644
--- a/app/views/help/api.html.erb
+++ b/app/views/help/api.html.erb
@@ -19,7 +19,7 @@
<dt>Linking to new requests</dt>
<dd>
<p>To encourage your users to make links to a particular public authority, use URLs of the form
- <%= link_to new_request_to_body_url(:url_name => "liverpool_city_council") , new_request_to_body_url(:url_name => "liverpool_city_council") %>.
+ <%= link_to new_request_to_body_path(:url_name => "liverpool_city_council") , new_request_to_body_path(:url_name => "liverpool_city_council") %>.
These are the parameters you can add to those URLs, either in the URL or from a form.
<ul>
@@ -30,15 +30,15 @@
</ul>
</dd>
- <dt>RSS (actually, Atom) feeds</h2>
+ <dt>RSS (actually, Atom) feeds</dt>
<dd>
<p>There are Atom feeds on most pages which list FOI requests, which you can
use to get updates and links in XML format. Find the URL of the Atom feed in
one of these ways:
<ul>
<li>Look for the <img src="/images/feed-16.png" alt=""> RSS feed links.</li>
- <li>Examine the <tt>&lt;link rel="alternate" type="application/atom+xml"&gt;</tt> tag in the head of the HTML. </li>
- <li>Add <tt>/feed</tt> to the start of another URL.
+ <li>Examine the <code>&lt;link rel="alternate" type="application/atom+xml"&gt;</code> tag in the head of the HTML. </li>
+ <li>Add <code>/feed</code> to the start of another URL.
</ul>
<p>In particular, even complicated search queries have Atom feeds.
@@ -53,8 +53,8 @@
objects in a structured form. Find them by:
</p>
<ul>
- <li>Adding <tt>.json</tt> to the end of the URL. </li>
- <li>Look for the <tt>&lt;link rel="alternate" type="application/json"&gt;</tt> tag in the head of the HTML. </li>
+ <li>Adding <code>.json</code> to the end of the URL. </li>
+ <li>Look for the <code>&lt;link rel="alternate" type="application/json"&gt;</code> tag in the head of the HTML. </li>
</ul>
<p>Requests, users and authorities all have JSON versions containing basic
@@ -67,7 +67,7 @@
<dd>
<p>
A spreadsheet file listing every body in WhatDoTheyKnow is available:
- <%= link_to "all-authorities.csv", all_public_bodies_csv_url() %>
+ <%= link_to "all-authorities.csv", all_public_bodies_csv_path %>
</p>
</dd>
diff --git a/app/views/help/contact.html.erb b/app/views/help/contact.html.erb
index 0c245ace7..ad89db9ec 100644
--- a/app/views/help/contact.html.erb
+++ b/app/views/help/contact.html.erb
@@ -46,7 +46,7 @@
<p>
<label class="form_label" for="contact_name">Your name:</label>
<%= f.text_field :name, :size => 20 %>
- (or <%= link_to "sign in", signin_url(:r => request.fullpath) %>)
+ (or <%= link_to "sign in", signin_path(:r => request.fullpath) %>)
</p>
<p>
diff --git a/app/views/help/officers.html.erb b/app/views/help/officers.html.erb
index b13e225fe..6db706f78 100644
--- a/app/views/help/officers.html.erb
+++ b/app/views/help/officers.html.erb
@@ -222,7 +222,7 @@
form in an annotation.
</dd>
- <dt id="copyright"><a name="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt>
+ <dt id="copyright"><a id="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt>
<dd>Our Freedom of Information law is "applicant blind", so anyone in the
world can request the same document and get a copy of it.
@@ -235,9 +235,6 @@
</dl>
-
- </dl>
-
<p><strong>If you haven't already</strong>, read <a href="<%= help_about_path %>">the introduction</a> --&gt;
<br><strong>Otherwise</strong>, the <a href="<%= help_credits_path %>">credits</a> or the <a href="<%= help_api_path %>">programmers API</a> --&gt;
diff --git a/app/views/help/unhappy.html.erb b/app/views/help/unhappy.html.erb
index 2b00341c2..79e3f8273 100644
--- a/app/views/help/unhappy.html.erb
+++ b/app/views/help/unhappy.html.erb
@@ -29,7 +29,7 @@ to your request '<%=request_link(@info_request) %>'?
<p>
<% if !@info_request.nil? %>
- <%= link_to "Request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup", :class => 'link_button_green' %> and then write a message asking the authority to review your request.
+ <%= link_to "Request an internal review", show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup", :class => 'link_button_green' %> and then write a message asking the authority to review your request.
<% else %>
At the bottom of the relevant request page on <%= site_name %> choose
"request an internal review". Then write a message asking for an internal
@@ -62,7 +62,7 @@ to the Scottish Information Commissioner</a>.
Information Commissioner, either
<% if !@info_request.nil? %>
include a link to your request
- <strong><%=h main_url(request_url(@info_request)) %></strong>
+ <strong><%=h request_url(@info_request) %></strong>
<% else %>
include a link to your request on <%= site_name %>
<% end %>
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb
index d85eecbf2..a58913892 100644
--- a/app/views/layouts/admin.html.erb
+++ b/app/views/layouts/admin.html.erb
@@ -1,39 +1,38 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
<html lang="en-gb">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" >
<title><%= site_name %> admin<%= @title ? ":" : "" %> <%=@title%></title>
-
- <%= javascript_include_tag 'jquery.js', 'jquery-ui.min' %>
+ <%= javascript_include_tag '/javascripts/jquery.js', '/admin/javascripts/jquery-ui.min.js', '/admin/javascripts/bootstrap-collapse', '/admin/javascripts/bootstrap-tab', '/admin/javascripts/admin' %>
<%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>
- <%= stylesheet_link_tag 'admin', :title => "Main", :rel => "stylesheet" %>
+ <%= stylesheet_link_tag "/admin/stylesheets/admin", :title => "Main", :rel => "stylesheet" %>
+
</head>
<body class="admin">
+ <div id="main" class="container">
+ <%= render :partial => 'admin_general/admin_navbar' %>
+ <% if flash[:error] %>
+ <div class="row">
+ <div class="span12">
+ <div class="alert alert-error">
+ <%= flash[:error] %>
+ </div>
+ </div>
+ </div>
+ <% end %>
- <p>
- <strong><%= link_to 'Alaveteli', main_url('/') %> admin:</strong>
- <%= link_to 'Summary', admin_url("") %>
- | <%= link_to 'Timeline', admin_url("timeline") %>
- | <%= link_to 'Stats', admin_url("stats") %>
- | <%= link_to 'Debug', admin_url("debug") %>
- <strong>View:</strong>
- <%= link_to 'Authorities', admin_url("body/list") %>
- | <%= link_to 'Requests', admin_url("request/list") %>
- | <%= link_to 'Users', admin_url("user/list") %>
- | <%= link_to 'Tracks', admin_url("track/list") %>
- </p>
- <%= render :partial => 'general/locale_switcher' %>
-
- <% if flash[:error] %>
- <p id="error"><%= flash[:error] %></p>
- <% end %>
-
- <% if flash[:notice] %>
- <p id="notice"><%= flash[:notice] %></p>
- <% end %>
+ <% if flash[:notice] %>
+ <div class="row">
+ <div class="span12">
+ <div class="alert alert-info">
+ <%= flash[:notice] %>
+ </div>
+ </div>
+ </div>
+ <% end %>
- <%= yield %>
-
+ <%= yield %>
+ </div>
</body>
</html>
diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb
index da9bed4b3..023a93138 100644
--- a/app/views/layouts/default.html.erb
+++ b/app/views/layouts/default.html.erb
@@ -1,6 +1,7 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
<head>
+ <meta charset="utf-8">
<title>
<% if @title %>
<%=@title%> - <%= site_name %>
@@ -13,7 +14,7 @@
<%= render :partial => 'general/stylesheet_includes' %>
<% if is_admin? %>
- <%= stylesheet_link_tag "/adminbootstraptheme/stylesheets/admin", :title => "Main", :rel => "stylesheet" %>
+ <%= stylesheet_link_tag "/admin/stylesheets/admin", :title => "Main", :rel => "stylesheet" %>
<% end %>
<%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %>
@@ -32,7 +33,7 @@
<% end %>
<% end %>
<% if @has_json %>
- <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h main_url(request.fullpath, '.json') %>">
+ <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h url_for(request.query_parameters.merge(:format => 'json')) %>">
<% end %>
<% if @no_crawl %>
@@ -92,9 +93,9 @@
<% end %>
- <%= link_to _("Sign out"), signout_url(:r => request.fullpath) %>
+ <%= link_to _("Sign out"), signout_path(:r => request.fullpath) %>
<% else %>
- <%= link_to _("Sign in or sign up"), signin_url(:r => request.fullpath) %>
+ <%= link_to _("Sign in or sign up"), signin_path(:r => request.fullpath) %>
<% end %>
</div>
<% end %>
@@ -102,7 +103,7 @@
<div id="navigation_search">
<form id="navigation_search_form" method="post" action="<%= search_redirect_path %>">
<p>
- <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
+ <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query", :title => "type your search term here" } %>
<input id="navigation_search_button" type="submit" value="search">
</p>
</form>
diff --git a/app/views/layouts/no_chrome.html.erb b/app/views/layouts/no_chrome.html.erb
index 74c79b701..120ba6f28 100644
--- a/app/views/layouts/no_chrome.html.erb
+++ b/app/views/layouts/no_chrome.html.erb
@@ -1,6 +1,7 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
<head>
+ <meta charset="utf-8">
<title>
<% if @title %>
<%=@title%> - <%= site_name %>
diff --git a/app/views/outgoing_mailer/followup.text.erb b/app/views/outgoing_mailer/followup.text.erb
index 7050a295b..049ebc881 100644
--- a/app/views/outgoing_mailer/followup.text.erb
+++ b/app/views/outgoing_mailer/followup.text.erb
@@ -1,6 +1,6 @@
-<%= @outgoing_message.body.strip %>
+<%= raw @outgoing_message.body.strip %>
-<%= @outgoing_message.quoted_part_to_append_to_email.strip %>
+<%= raw @outgoing_message.quoted_part_to_append_to_email.strip %>
-------------------------------------------------------------------
<%= _('Please use this email address for all replies to this request:')%>
diff --git a/app/views/outgoing_mailer/initial_request.text.erb b/app/views/outgoing_mailer/initial_request.text.erb
index d537a20bc..5c418ecc7 100644
--- a/app/views/outgoing_mailer/initial_request.text.erb
+++ b/app/views/outgoing_mailer/initial_request.text.erb
@@ -1,4 +1,4 @@
-<%= @outgoing_message.body.strip %>
+<%= raw @outgoing_message.body.strip %>
-------------------------------------------------------------------
diff --git a/app/views/public_body/_alphabet.html.erb b/app/views/public_body/_alphabet.html.erb
index a3359f3ab..111da5b3b 100644
--- a/app/views/public_body/_alphabet.html.erb
+++ b/app/views/public_body/_alphabet.html.erb
@@ -1,3 +1,3 @@
<%= "A".upto("Z") do |l| -%>
- <%= link_to_unless (@tag == l), l, list_public_bodies_url(:tag => l.downcase) %>
+ <%= link_to_unless (@tag == l), l, list_public_bodies_path(:tag => l.downcase) %>
<% end %>
diff --git a/app/views/public_body/_body_listing_single.html.erb b/app/views/public_body/_body_listing_single.html.erb
index b01d2ebb2..d0496fbb8 100644
--- a/app/views/public_body/_body_listing_single.html.erb
+++ b/app/views/public_body/_body_listing_single.html.erb
@@ -4,7 +4,7 @@
<div class="body_listing">
<span class="head">
- <%= link_to highlight_words(public_body.name, @highlight_words), public_body_url(public_body) %>
+ <%= link_to highlight_words(public_body.name, @highlight_words), public_body_path(public_body) %>
</span>
<span class="desc">
<% if !public_body.short_name.empty? || !public_body.notes_without_html.empty? %>
@@ -20,7 +20,7 @@
<span class="bottomline">
<%= n_('%d request made.', '%d requests made.', public_body.info_requests.size) % public_body.info_requests.size %>
<% if !@include_request_link_in_authority_listing.nil? %>
- <%= link_to _("Make your own request"), public_body_url(public_body) %>.
+ <%= link_to _("Make your own request"), public_body_path(public_body) %>.
<% end %>
<br>
<span class="date_added">
diff --git a/app/views/public_body/_list_sidebar_extra.html.erb b/app/views/public_body/_list_sidebar_extra.html.erb
index 54f20a736..d3d65fec8 100644
--- a/app/views/public_body/_list_sidebar_extra.html.erb
+++ b/app/views/public_body/_list_sidebar_extra.html.erb
@@ -2,5 +2,5 @@
<%= raw(_('<a href="%s">Are we missing a public authority?</a>') % [help_requesting_path + '#missing_body']) %>
</p>
<p>
- <%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_url() %>
+ <%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_path %>
</p>
diff --git a/app/views/public_body/list.html.erb b/app/views/public_body/list.html.erb
index 171e02679..3d73090d4 100644
--- a/app/views/public_body/list.html.erb
+++ b/app/views/public_body/list.html.erb
@@ -10,7 +10,7 @@
<% for row in PublicBodyCategories::get().with_headings() %>
<% if row.instance_of?(Array) %>
<li>
- <%= link_to_unless (@tag == row[0]), row[1], list_public_bodies_url(:tag => row[0]) %>
+ <%= link_to_unless (@tag == row[0]), row[1], list_public_bodies_path(:tag => row[0]) %>
</li>
<% else %>
<% if not first_row %>
@@ -34,7 +34,7 @@
<%= form_tag(list_public_bodies_default_url, :method => "get", :id=>"search_form") do %>
<div>
- <%= text_field_tag(:public_body_query, params[:public_body_query]) %>
+ <%= text_field_tag(:public_body_query, params[:public_body_query], { :title => "type your search term here" } ) %>
<%= submit_tag(_("Search")) %>
</div>
<% end %>
diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb
index 6431b4742..df6346e4f 100644
--- a/app/views/public_body/show.html.erb
+++ b/app/views/public_body/show.html.erb
@@ -26,23 +26,23 @@
<% end %>
<% end %>
<% end %>
- <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br>
- </div>
+ <%= link_to _('View FOI email address'), view_public_body_email_path(@public_body.url_name) %><br>
+ </div>
<div id="header_left">
<p class="public-body-name-prefix"><%= _("Freedom of information requests to") %></p>
<h1><%=h(@public_body.name)%></h1>
<p class="subtitle">
- <%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>,
+ <%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>,
<%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name))%><% end %>
<% if !@user.nil? && @user.admin_page_links? %>
- (<%= link_to _("admin"), public_body_admin_url(@public_body) %>)
+ (<%= link_to _("admin"), admin_body_show_path(@public_body) %>)
<% end %>
</p>
<% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %>
- <p><%= @public_body.notes_as_html %></p>
+ <p><%= @public_body.notes_as_html.html_safe %></p>
<% end %>
<% if @public_body.eir_only? %>
@@ -58,7 +58,7 @@
<% end %>
&nbsp;<%= _('<a class="link_button_green" href="{{url}}">{{text}}</a>', :url=>new_request_to_body_url(:url_name => @public_body.url_name), :text=>_("Start"))%>
<% elsif @public_body.has_notes? %>
- <%= @public_body.notes_as_html %>
+ <%= @public_body.notes_as_html.html_safe %>
<% elsif @public_body.not_requestable_reason == 'not_apply' %>
<%= _('Freedom of Information law does not apply to this authority, so you cannot make
a request to it.')%>
@@ -99,7 +99,7 @@
<%= @page_desc %>
</h2>
<a name="results"></a>
-
+
<% if @public_body.info_requests.size > 4 %>
<%= render :partial => 'request/request_filter_form' %>
<% end %>
@@ -120,7 +120,7 @@
<p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p>
<% end %>
- <% else %>
+ <% else %>
<% if @public_body.eir_only? %>
<h2><%= _('Environmental Information Regulations requests made') %></h2>
<% else %>
diff --git a/app/views/public_body/view_email.html.erb b/app/views/public_body/view_email.html.erb
index 79d7f7f4c..3799d227b 100644
--- a/app/views/public_body/view_email.html.erb
+++ b/app/views/public_body/view_email.html.erb
@@ -35,9 +35,9 @@
<div id="stepwise_make_request_view_email">
<strong>
<% if @public_body.eir_only? %>
- <%= link_to "Make a new EIR request", new_request_to_body_url(:url_name => @public_body.url_name)%>
+ <%= link_to "Make a new EIR request", new_request_to_body_path(:url_name => @public_body.url_name)%>
<% else %>
- <%= link_to "Make a new FOI request", new_request_to_body_url(:url_name => @public_body.url_name)%>
+ <%= link_to "Make a new FOI request", new_request_to_body_path(:url_name => @public_body.url_name)%>
<% end %>
to <%= h(@public_body.name) %>
</strong>
diff --git a/app/views/request/_after_actions.html.erb b/app/views/request/_after_actions.html.erb
index 3d74cf42d..d3ddb981b 100644
--- a/app/views/request/_after_actions.html.erb
+++ b/app/views/request/_after_actions.html.erb
@@ -7,7 +7,7 @@
<ul>
<% if @info_request.comments_allowed? %>
<li>
- <%= raw(_('<a href="%s">Add an annotation</a> (to help the requester or others)') % [new_comment_url(:url_title => @info_request.url_title)]) %>
+ <%= raw(_('<a href="%s">Add an annotation</a> (to help the requester or others)') % [new_comment_path(:url_title => @info_request.url_title)]) %>
</li>
<% end %>
<% if @old_unclassified %>
@@ -17,7 +17,7 @@
<% end %>
<% if @info_request.all_can_view? %>
<li>
- <%= link_to _("Download a zip file of all correspondence"), download_entire_request_url(:url_title => @info_request.url_title) %>
+ <%= link_to _("Download a zip file of all correspondence"), download_entire_request_path(:url_title => @info_request.url_title) %>
</li>
<% end %>
</ul>
@@ -29,18 +29,18 @@
<li>
<% if @last_response.nil? %>
- <%= link_to _("Send a followup"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
+ <%= link_to _("Send a followup"), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
<% else %>
- <%= link_to _("Write a reply"), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
+ <%= link_to _("Write a reply"), show_response_path(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
<% end %>
</li>
<% if !@old_unclassified %>
<li>
- <%= link_to _("Update the status of this request"), request_url(@info_request, :update_status => 1) %>
+ <%= link_to _("Update the status of this request"), request_path(@info_request, :update_status => 1) %>
</li>
<% end %>
<li>
- <%= link_to _("Request an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>
+ <%= link_to _("Request an internal review"), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>
</li>
</ul>
</div>
@@ -50,7 +50,7 @@
<strong><%= _('{{public_body_name}} only:',:public_body_name=>h(@info_request.public_body.name) ) %> </strong>
<ul>
<li>
- <%= link_to _("Respond to request"), upload_response_url(:url_title => @info_request.url_title) %>
+ <%= link_to _("Respond to request"), upload_response_path(:url_title => @info_request.url_title) %>
</li>
</ul>
</div>
diff --git a/app/views/request/_bubble.html.erb b/app/views/request/_bubble.html.erb
index 747e2aa1f..94498612a 100644
--- a/app/views/request/_bubble.html.erb
+++ b/app/views/request/_bubble.html.erb
@@ -5,26 +5,26 @@
<% attachments.each do |a| %>
<p class="attachment">
<%
- attachment_url = get_attachment_url(:id => incoming_message.info_request_id,
+ attachment_path = get_attachment_path(:id => incoming_message.info_request_id,
:incoming_message_id => incoming_message.id, :part => a.url_part_number,
:file_name => a.display_filename)
- attachment_as_html_url = get_attachment_as_html_url(:id => incoming_message.info_request_id,
+ attachment_as_html_path = get_attachment_as_html_path(:id => incoming_message.info_request_id,
:incoming_message_id => incoming_message.id, :part => a.url_part_number,
:file_name => a.display_filename + '.html')
%>
<% img_filename = "icon_" + a.content_type.sub('/', '_') + "_large.png"
full_filename = File.expand_path(File.join(File.dirname(__FILE__), "../../../public/images", img_filename))
if File.exist?(full_filename) %>
- <a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/<%=img_filename%>"></a>
+ <a href="<%=attachment_path%>"><img class="attachment_image" alt="Attachment" src="/images/<%=img_filename%>"></a>
<% else %>
- <a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/icon_unknown.png"></a>
+ <a href="<%=attachment_path%>"><img class="attachment_image" alt="Attachment" src="/images/icon_unknown.png"></a>
<% end %>
<strong><%= h a.display_filename %></strong>
<br>
<%= a.display_size %>
- <%= link_to "Download", attachment_url %>
+ <%= link_to "Download", attachment_path %>
<% if a.has_body_as_html? && incoming_message.info_request.all_can_view? %>
- <%= link_to "View as HTML", attachment_as_html_url %>
+ <%= link_to "View as HTML", attachment_as_html_path %>
<% end %>
<!-- (<%= a.content_type %>) -->
<%= a.extra_note %>
diff --git a/app/views/request/_correspondence.html.erb b/app/views/request/_correspondence.html.erb
index 99c6c7d26..68711b259 100644
--- a/app/views/request/_correspondence.html.erb
+++ b/app/views/request/_correspondence.html.erb
@@ -21,9 +21,9 @@ if not incoming_message.nil?
<p class="event_actions">
<% if !@user.nil? && @user.admin_page_links? %>
- <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
+ <%= link_to "Admin", admin_request_show_raw_email_path(incoming_message.raw_email_id) %> |
<% end %>
- <%= link_to _("Link to this"), incoming_message_url(incoming_message), :class => "link_to_this" %>
+ <%= link_to _("Link to this"), incoming_message_path(incoming_message), :class => "link_to_this" %>
</p>
</div>
<%
@@ -51,7 +51,7 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type)
<% end %>
-->
- <%= link_to _("Link to this"), outgoing_message_url(outgoing_message), :class => "link_to_this" %>
+ <%= link_to _("Link to this"), outgoing_message_path(outgoing_message), :class => "link_to_this" %>
</p>
</div>
<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>
diff --git a/app/views/request/_describe_state.html.erb b/app/views/request/_describe_state.html.erb
index 0441dd4ce..05cce013e 100644
--- a/app/views/request/_describe_state.html.erb
+++ b/app/views/request/_describe_state.html.erb
@@ -3,7 +3,7 @@
<%= form_for(@info_request, :as => :incoming_message, :url => describe_state_url(:id => @info_request.id), :html => {:id => "describe_form_#{id_suffix}"}) do |f| %>
<h2><%= _('What best describes the status of this request now?') %></h2>
- <hr> <!------------------------------------------------>
+ <hr>
<h3><%= _('This request is still in progress:') %></h3>
<% if @info_request.described_state != 'internal_review' %>
<div>
@@ -40,7 +40,7 @@
<%= render :partial => 'general/custom_state_transitions_pending', :locals => {:id_suffix => id_suffix } %>
- <hr> <!------------------------------------------------>
+ <hr>
<h3><%= _('This particular request is finished:') %></h3>
<% if @info_request.described_state == 'internal_review' %>
@@ -67,7 +67,7 @@
<%= render :partial => 'general/custom_state_transitions_complete', :locals => {:id_suffix => id_suffix } %>
- <hr> <!------------------------------------------------>
+ <hr>
<h3><%= _('Other:') %></h3>
<div>
@@ -97,7 +97,6 @@
<p>
<%= hidden_field_tag 'last_info_request_event_id', @last_info_request_event_id, :id => 'last_info_request_event_id' + id_suffix %>
- <%= hidden_field_tag 'submitted_describe_state', 1, :id => 'submitted_describe_state' + id_suffix %>
<%= submit_tag _("Submit status") %> (<%= _('and we\'ll suggest <strong>what to do next</strong>') %>)
</p>
<% end %>
diff --git a/app/views/request/_followup.html.erb b/app/views/request/_followup.html.erb
index 6ccf5fd5a..6d2282613 100644
--- a/app/views/request/_followup.html.erb
+++ b/app/views/request/_followup.html.erb
@@ -25,18 +25,18 @@
<ul>
<% @info_request.who_can_followup_to(incoming_message).each do |name, email, id| %>
<% if id.nil? && !incoming_message.nil? && incoming_message.valid_to_reply_to? %>
- <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil)) %></li>
<% else %>
<% if !id.nil? %>
<% if @info_request.public_body.request_email == email %>
<% if !incoming_message.nil? %>
- <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil)) %></li>
<% end %>
<% else %>
- <li><%= link_to name, show_response_url(:id => @info_request.id, :incoming_message_id => id)%></li>
+ <li><%= link_to name, show_response_path(:id => @info_request.id, :incoming_message_id => id)%></li>
<% end %>
<% else %>
- <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil)) %></li>
<% end %>
<% end %>
diff --git a/app/views/request/_other_describe_state.html.erb b/app/views/request/_other_describe_state.html.erb
index a20851282..e49f9ecb3 100644
--- a/app/views/request/_other_describe_state.html.erb
+++ b/app/views/request/_other_describe_state.html.erb
@@ -75,7 +75,6 @@
<p>
<%= hidden_field_tag 'last_info_request_event_id', @last_info_request_event_id, :id => 'last_info_request_event_id' + id_suffix %>
- <%= hidden_field_tag 'submitted_describe_state', 1, :id => 'submitted_describe_state' + id_suffix %>
<%= submit_tag "Submit status" %>
</p>
<% end %>
diff --git a/app/views/request/_request_listing_short_via_event.html.erb b/app/views/request/_request_listing_short_via_event.html.erb
index d93a91070..c2f6474a1 100644
--- a/app/views/request/_request_listing_short_via_event.html.erb
+++ b/app/views/request/_request_listing_short_via_event.html.erb
@@ -3,11 +3,11 @@
end %>
<div class="request_short_listing">
- <h3><%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %></h3>
+ <h3><%= link_to highlight_words(info_request.title, @highlight_words), request_path(info_request) %></h3>
<p>
-<%= _('To {{public_body_link_absolute}}',:public_body_link_absolute => public_body_link_absolute(info_request.public_body))%>
-<%= _('by {{user_link_absolute}}',:user_link_absolute => request_user_link_absolute(info_request))%>
+<%= _('To {{public_body_link_absolute}}',:public_body_link_absolute => public_body_link(info_request.public_body))%>
+<%= _('by {{user_link_absolute}}',:user_link_absolute => request_user_link(info_request))%>
<%= simple_date(info_request.created_at) %>
</p>
</div>
diff --git a/app/views/request/_request_listing_via_event.html.erb b/app/views/request/_request_listing_via_event.html.erb
index 2ba9613e5..cc8bae8a9 100644
--- a/app/views/request/_request_listing_via_event.html.erb
+++ b/app/views/request/_request_listing_via_event.html.erb
@@ -6,13 +6,13 @@ end %>
<div class="request_left">
<span class="head">
<% if event.is_incoming_message? %>
- <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")) %>
+ <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_path(event.incoming_message_selective_columns("incoming_messages.id")) %>
<% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
- <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
+ <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_path(event.outgoing_message) %>
<% elsif event.is_comment? %>
- <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
+ <%= link_to highlight_words(info_request.title, @highlight_words), comment_path(event.comment) %>
<% else %>
- <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
+ <%= link_to highlight_words(info_request.title, @highlight_words), request_path(info_request) %>
<% end %>
</span>
<div class="requester">
diff --git a/app/views/request/_sidebar.html.erb b/app/views/request/_sidebar.html.erb
index 0c897a0da..80536da3e 100644
--- a/app/views/request/_sidebar.html.erb
+++ b/app/views/request/_sidebar.html.erb
@@ -53,12 +53,12 @@
<%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
<% end %>
<% if @xapian_similar_more %>
- <p><%= link_to _("More similar requests"), request_similar_url(@info_request) %></p>
+ <p><%= link_to _("More similar requests"), similar_request_path(@info_request) %></p>
<% end %>
<!-- Important terms: <%= @xapian_similar.important_terms.join(" ") %> -->
<% end %>
- <p><%= link_to _('Event history details'), request_details_url(@info_request) %></p>
+ <p><%= link_to _('Event history details'), request_details_path(@info_request) %></p>
<!-- this link with this wording is here for legal reasons, discuss with
board and our lawyer before changing or removing it -->
diff --git a/app/views/request/_view_html_prefix.html.erb b/app/views/request/_view_html_prefix.html.erb
index b29830ac7..3a9946745 100644
--- a/app/views/request/_view_html_prefix.html.erb
+++ b/app/views/request/_view_html_prefix.html.erb
@@ -7,6 +7,6 @@
<br>(<%=h @attachment.name_of_content_type %>)
</div>
<%= _('This is an HTML version of an attachment to the Freedom of Information request')%>
- '<%=link_to h(@info_request.title), incoming_message_url(@incoming_message)%>'.
+ '<%=link_to h(@info_request.title), incoming_message_path(@incoming_message)%>'.
</div>
diff --git a/app/views/request/_wall_listing.html.erb b/app/views/request/_wall_listing.html.erb
index 26d34e1a1..4a76b09bf 100644
--- a/app/views/request/_wall_listing.html.erb
+++ b/app/views/request/_wall_listing.html.erb
@@ -6,11 +6,11 @@ end %>
<div class="request_left">
<div class="requester">
<% if event.event_type == 'sent' %>
- <%= _('A new request, <em><a href="{{request_url}}">{{request_title}}</a></em>, was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>request_url(info_request),:request_title=>info_request.title) %>
+ <%= _('A new request, <em><a href="{{request_url}}">{{request_title}}</a></em>, was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>request_path(info_request),:request_title=>info_request.title) %>
<% elsif event.event_type == 'followup_sent' %>
<%= _('A <a href="{{request_url}}">follow up</a> to <em>{{request_title}}</em> was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>outgoing_message_url(event.outgoing_message),:request_title=>info_request.title) %>
<% elsif event.event_type == 'response' %>
- <%= _('A <a href="{{request_url}}">response</a> to <em>{{request_title}}</em> was sent by {{public_body_name}} to {{info_request_user}} on {{date}}. The request status is: {{request_status}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")),:request_title=>info_request.title,:request_status=>info_request.display_status) %>
+ <%= _('A <a href="{{request_url}}">response</a> to <em>{{request_title}}</em> was sent by {{public_body_name}} to {{info_request_user}} on {{date}}. The request status is: {{request_status}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>incoming_message_path(event.incoming_message_selective_columns("incoming_messages.id")),:request_title=>info_request.title,:request_status=>info_request.display_status) %>
<% elsif event.event_type == 'comment' %>
<%= _('An <a href="{{request_url}}">annotation</a> to <em>{{request_title}}</em> was made by {{event_comment_user}} on {{date}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at),:request_url=>comment_url(event.comment),:request_title=>info_request.title) %>
<% else %>
diff --git a/app/views/request/describe_state_message.rhtml b/app/views/request/describe_state_message.rhtml
new file mode 100644
index 000000000..1427fea22
--- /dev/null
+++ b/app/views/request/describe_state_message.rhtml
@@ -0,0 +1,30 @@
+<h1><%= @title %></h1>
+
+
+<p>
+ <% if @described_state == "error_message" %>
+ <%= _("If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.") %>
+ <% else %>
+ <%= _("Just one more thing") %>
+ <% end %>
+</p>
+
+<% form_for :incoming_message, :url => describe_state_url(:id => @info_request.id) do |f| %>
+
+ <p>
+ <label class="form_label" for="incoming_message_message">Please tell us more:</label>
+ <%= f.text_area :message, :rows => 10, :cols => 60 %>
+ </p>
+
+ <div>
+ <%= hidden_field_tag "incoming_message[described_state]", @described_state %>
+ <%= hidden_field_tag :last_info_request_event_id, @last_info_request_event_id %>
+ </div>
+
+ <div class="form_button">
+ <%= submit_tag _("Submit status and send message") %>
+ </div>
+
+<% end %>
+
+
diff --git a/app/views/request/details.html.erb b/app/views/request/details.html.erb
index d4c63902f..3cb2f5afe 100644
--- a/app/views/request/details.html.erb
+++ b/app/views/request/details.html.erb
@@ -36,10 +36,10 @@ way authorities use it. Plus you\'ll need to be an elite statistician. Please
<% end %>
<td>
<% if info_request_event.outgoing_message %>
- <%= link_to "outgoing", outgoing_message_url(info_request_event.outgoing_message) %>
+ <%= link_to "outgoing", outgoing_message_path(info_request_event.outgoing_message) %>
<% end %>
<% if info_request_event.incoming_message %>
- <%= link_to "incoming", incoming_message_url(info_request_event.incoming_message) %>
+ <%= link_to "incoming", incoming_message_path(info_request_event.incoming_message) %>
<% end %>
</td>
</tr>
diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb
index f4abb27d1..398147041 100644
--- a/app/views/request/new.html.erb
+++ b/app/views/request/new.html.erb
@@ -7,26 +7,26 @@
$("#typeahead_response").load("<%=search_ahead_url%>?q="+encodeURI(this.value), function() {
// When following links in typeahead results, open new tab/window
$("#typeahead_response a").attr("target","_blank");
-
+
// Update the public body site search link
$("#body-site-search-link").attr("href", "http://www.google.com/#q="+encodeURI($("#typeahead_search").val())+
"+site:<%= @info_request.public_body.calculated_home_page %>");
});
}));
-
+
});
</script>
<% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name)) %>
<h1><%= _('2. Ask for Information') %></h1>
-
+
<% if @existing_request %>
<div class="errorExplanation" id="errorExplanation"><ul>
<li>
<%= _('{{existing_request_user}} already
created the same request on {{date}}. You can either view the <a href="{{existing_request}}">existing request</a>,
- or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_url(@existing_request)) %>
+ or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_path(@existing_request)) %>
</li>
</ul></div>
<% end %>
@@ -37,29 +37,29 @@
<div id="request_header">
<div id="request_header_body">
- <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label>
+ <label class="form_label"><%= _('To:') %></label>
<span id="to_public_body"><%=h(@info_request.public_body.name)%></span>
<div class="form_item_note">
<% if @info_request.public_body.info_requests.size > 0 %>
- <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %>
+ <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_path(@info_request.public_body)) %>
<% else %>
<%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %>
<% end %>
</div>
<% if @info_request.public_body.has_notes? %>
- <div id="request_header_text">
+ <div id="request_header_text">
<h3><%= _('Special note for this authority!') %></h3>
- <p><%= @info_request.public_body.notes_as_html %></p>
+ <p><%= @info_request.public_body.notes_as_html.html_safe %></p>
</div>
<% end %>
<% if @info_request.public_body.eir_only? %>
<h3><%= _('Please ask for environmental information only') %></h3>
- <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>.
+ <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>.
<%= _('However, you have the right to request environmental
- information under a different law') %> (<a href="/help/requesting#eir">explanation</a>).
+ information under a different law') %> (<a href="/help/requesting#eir">explanation</a>).
<%= _('This covers a very wide spectrum of information about the state of
the <strong>natural and built environment</strong>, such as:') %>
@@ -79,21 +79,21 @@
<% end %>
</div>
- <div id="request_header_subject">
+ <div id="request_header_subject">
<p>
- <label class="form_label" for="typeahead_search"><%= _('Summary:') %></label>
+ <label class="form_label" for="typeahead_search"><%= _('Summary:') %></label>
<%= f.text_field :title, :size => 50, :id =>"typeahead_search" %>
</p>
<div class="form_item_note">
- (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %>
+ (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %>
<%= render :partial => "summary_suggestion" %>)
</div>
</div>
-
+
<div id="typeahead_response">
</div>
</div>
-
+
<div id="request_advice">
<ul>
<li><%= _('Write your request in <strong>simple, precise language</strong>.') %></li>
@@ -102,35 +102,35 @@
</ul>
</div>
- <div id="request_form">
+ <div id="request_form">
<%= fields_for :outgoing_message do |o| %>
<p>
- <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label>
+ <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label>
<%= o.text_area :body, :rows => 20, :cols => 60 %>
</p>
<% end %>
-
+
<% if !@user %>
<p class="form_note">
- <%= raw(_('Everything that you enter on this page, including <strong>your name</strong>,
+ <%= raw(_('Everything that you enter on this page, including <strong>your name</strong>,
will be <strong>displayed publicly</strong> on
- this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"]) %>
+ this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"]) %>
<%= raw(_('If you are thinking of using a pseudonym,
please <a href="%s">read this first</a>.') % [help_privacy_path+"#real_name"]) %>
</p>
<% else %>
<p class="form_note">
- <%= raw(_('Everything that you enter on this page
+ <%= raw(_('Everything that you enter on this page
will be <strong>displayed publicly</strong> on
- this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"]) %>
+ this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"]) %>
</p>
<% end %>
-
+
<p class="form_note">
<%= raw(_("<strong> Can I request information about myself?</strong>\n" +
- "\t\t\t<a href=\"%s\">No! (Click here for details)</a>") % [help_requesting_path+"#data_protection"]) %>
+ "\t\t\t<a href=\"%s\">No! (Click here for details)</a>") % [help_requesting_path+"#data_protection"]) %>
</p>
-
+
<div class="form_button">
<%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
<%= hidden_field_tag(:submitted_new_request, 1 ) %>
@@ -140,14 +140,14 @@
<% if !@info_request.tag_string.empty? %>
<p class="form_note">
- <!-- <label class="form_label" for="info_request_tag_string">Tags:</label>
+ <!-- <label class="form_label" for="info_request_tag_string">Tags:</label>
<%= f.text_field :tag_string, :size => 50 %> -->
<%= f.hidden_field(:tag_string) %>
<strong>Tags:</strong> <%=h @info_request.tag_string %>
</p>
<% end %>
-
+
</div>
<% end %>
diff --git a/app/views/request/select_authority.html.erb b/app/views/request/select_authority.html.erb
index ece3b57d7..43a91beff 100644
--- a/app/views/request/select_authority.html.erb
+++ b/app/views/request/select_authority.html.erb
@@ -35,9 +35,9 @@
<p>
<%= raw(_('First, type in the <strong>name of the UK public authority</strong> you\'d
like information from. <strong>By law, they have to respond</strong>
- (<a href="%s#%s">why?</a>).') % [help_about_url, "whybother_them"]) %>
+ (<a href="%s#%s">why?</a>).') % [help_about_path, "whybother_them"]) %>
</p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
+ <%= text_field_tag 'query', params[:query], { :size => 30, :title => "type your search term here" } %>
<%= hidden_field_tag 'bodies', 1 %>
<%= submit_tag _('Search') %>
</div>
diff --git a/app/views/request/show.html.erb b/app/views/request/show.html.erb
index fa75a6529..54006b291 100644
--- a/app/views/request/show.html.erb
+++ b/app/views/request/show.html.erb
@@ -37,9 +37,9 @@
:user => @info_request.is_external? ? (@info_request.user_name || _('An anonymous user')) : user_link(@info_request.user),
:law_used_full => h(@info_request.law_used_full),
:user_admin_link => user_admin_link_for_request(@info_request, _('external'), _('admin')),
- :request_admin_url => request_admin_url(@info_request),
+ :request_admin_url => admin_request_show_url(@info_request),
:public_body_link => public_body_link(@info_request.public_body),
- :public_body_admin_url => public_body_admin_url(@info_request.public_body)) %>
+ :public_body_admin_url => admin_body_show_url(@info_request.public_body)) %>
<% else %>
<%= _('{{user}} made this {{law_used_full}} request',:user=>@info_request.is_external? ? (@info_request.user_name || _('An anonymous user')) : user_link(@info_request.user), :law_used_full=>h(@info_request.law_used_full)) %>
<%= _('to {{public_body}}',:public_body=>public_body_link(@info_request.public_body)) %>
@@ -87,7 +87,7 @@
(<%= raw(_('<a href="%s">details</a>') % [help_requesting_path + '#quickly_response']) %>).
<% if !@info_request.is_external? %>
<%= _('You can <strong>complain</strong> by') %>
- <%= link_to _("requesting an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>.
+ <%= link_to _("requesting an internal review"), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>.
<% end %>
<% elsif @status == 'not_held' %>
<%= public_body_link(@info_request.public_body) %> <%= _('<strong>did not have</strong> the information requested.') %>
@@ -101,12 +101,12 @@
<% if @is_owning_user && !@info_request.is_external? %>
<%=h @info_request.public_body.name %> <%= _('is <strong>waiting for your clarification</strong>.') %>
<%= _('Please') %>
- <%= link_to _("send a follow up message"), respond_to_last_url(@info_request) + '#followup' %>.
+ <%= link_to _("send a follow up message"), respond_to_last_path(@info_request) + '#followup' %>.
<% else %>
<%= _('The request is <strong>waiting for clarification</strong>.') %>
<% if !@info_request.is_external? %>
<%= _('If you are {{user_link}}, please',:user_link=>user_link_for_request(@info_request)) %>
- <%= link_to _("sign in"), signin_url(:r => request.fullpath) %> <%= _('to send a follow up message.') %>
+ <%= link_to _("sign in"), signin_path(:r => request.fullpath) %> <%= _('to send a follow up message.') %>
<% end %>
<% end %>
<% elsif @status == 'gone_postal' %>
diff --git a/app/views/request_game/play.html.erb b/app/views/request_game/play.html.erb
index eedf19ca2..d5aa0d00e 100644
--- a/app/views/request_game/play.html.erb
+++ b/app/views/request_game/play.html.erb
@@ -11,7 +11,7 @@
<tr>
<td> <%= c += 1 %>. <td>
<td> <%= user_link(classifications.user) %> </td>
- <td> <%=pluralize(classifications.cnt, 'request').gsub(" ", "&nbsp;")%> </td>
+ <td> <%=pluralize(classifications.cnt, 'request').gsub(" ", "&nbsp;").html_safe %> </td>
</tr>
<% end %>
</table>
@@ -22,7 +22,7 @@
<tr>
<td> <%= c += 1 %>. <td>
<td> <%= user_link(classifications.user) %> </td>
- <td> <%= pluralize(classifications.cnt, 'request').gsub(" ", "&nbsp;")%> </td>
+ <td> <%= pluralize(classifications.cnt, 'request').gsub(" ", "&nbsp;").html_safe %> </td>
</tr>
<% end %>
</table>
@@ -36,8 +36,8 @@ information has been provided. Everyone'll be exceedingly grateful.")%></p>
<%= render :partial => 'request/request_listing_single', :locals => { :info_request => info_request } %>
<% end %>
<p id="game_buttons">
-<%= button_to _('I don\'t like these ones &mdash; give me some more!'), play_url %>
-<%= button_to _('I don\'t want to do any more tidying now!'), stop_url %>
+<%= button_to _('I don\'t like these ones &mdash; give me some more!'), categorise_play_url %>
+<%= button_to _('I don\'t want to do any more tidying now!'), categorise_stop_url %>
</p>
<p><%= _('Thanks for helping - your work will make it easier for everyone to find successful
responses, and maybe even let us make league tables...')%></p>
diff --git a/app/views/request_mailer/new_response.text.erb b/app/views/request_mailer/new_response.text.erb
index 083f873b4..672212f20 100644
--- a/app/views/request_mailer/new_response.text.erb
+++ b/app/views/request_mailer/new_response.text.erb
@@ -1,6 +1,6 @@
<%= _('You have a new response to the {{law_used_full}} request ',:law_used_full=>@info_request.law_used_full)%>
-'<%= @info_request.title %>' <%=_('that you made to')%>
-<%= @info_request.public_body.name %>.
+'<%= raw @info_request.title %>' <%=_('that you made to')%>
+<%= raw @info_request.public_body.name %>.
<%= _('To view the response, click on the link below.')%>
diff --git a/app/views/request_mailer/new_response_reminder_alert.text.erb b/app/views/request_mailer/new_response_reminder_alert.text.erb
index 86fc71de7..c196dafe6 100644
--- a/app/views/request_mailer/new_response_reminder_alert.text.erb
+++ b/app/views/request_mailer/new_response_reminder_alert.text.erb
@@ -3,7 +3,7 @@
<%=@url%>
<%= _('Your request was called {{info_request}}. Letting everyone know whether you got the information will help us keep tabs on',:info_request=>@info_request.title)%>
-<%= @info_request.public_body.name %>.
+<%= raw @info_request.public_body.name %>.
-- <%= _('the {{site_name}} team', :site_name=>site_name) %>
diff --git a/app/views/request_mailer/overdue_alert.text.erb b/app/views/request_mailer/overdue_alert.text.erb
index b8a9ba525..249bf6bb8 100644
--- a/app/views/request_mailer/overdue_alert.text.erb
+++ b/app/views/request_mailer/overdue_alert.text.erb
@@ -1,4 +1,4 @@
-<%= @info_request.public_body.name %> <%= _('have delayed.')%>
+<%= raw @info_request.public_body.name %> <%= _('have delayed.')%>
<%= _('They have not replied to your {{law_used_short}} request {{title}} promptly, as normally required by law',:law_used_short=>@info_request.law_used_short,:title=>@info_request.title)%><% if @info_request.public_body.is_school? %> <%=_('during term time')%> <% end %>.
diff --git a/app/views/request_mailer/requires_admin.text.erb b/app/views/request_mailer/requires_admin.text.erb
index 06a798792..b2e58295e 100644
--- a/app/views/request_mailer/requires_admin.text.erb
+++ b/app/views/request_mailer/requires_admin.text.erb
@@ -1,9 +1,11 @@
+<%= raw @message %>
+
---------------------------------------------------------------------
-<%=@reported_by.name%> <%= _('has reported an')%> <%=@info_request.law_used_short%>
+<%= raw @reported_by.name %> <%= _('has reported an')%> <%= raw @info_request.law_used_short %>
<%= _('response as needing administrator attention. Take a look, and reply to this
email to let them know what you are going to do about it.')%>
-Request '<%=@info_request.title%>':
+Request '<%= raw @info_request.title %>':
<%= @url %>
<%= _('Administration URL:') %>
diff --git a/app/views/request_mailer/very_overdue_alert.text.erb b/app/views/request_mailer/very_overdue_alert.text.erb
index 6abd198a0..80597473c 100644
--- a/app/views/request_mailer/very_overdue_alert.text.erb
+++ b/app/views/request_mailer/very_overdue_alert.text.erb
@@ -1,4 +1,4 @@
-<%= @info_request.public_body.name %> <%= _('are long overdue.')%>
+<%= raw @info_request.public_body.name %> <%= _('are long overdue.')%>
<%= _('They have not replied to your {{law_used_short}} request {{title}},
as required by law',:law_used_short=>@info_request.law_used_short,:title=>@info_request.title)%><% if @info_request.public_body.is_school? %> <%= _('even during holidays')%><% end %>.
diff --git a/app/views/track/_tracking_links.html.erb b/app/views/track/_tracking_links.html.erb
index ee18ec475..a16dbc78f 100644
--- a/app/views/track/_tracking_links.html.erb
+++ b/app/views/track/_tracking_links.html.erb
@@ -14,15 +14,15 @@
<% elsif track_thing %>
<div class="feed_link feed_link_<%=location%>">
<% if defined? follower_count && follower_count > 0 %>
- <%= link_to _("I like this request"), do_track_url(track_thing), :class => "link_button_green" %>
+ <%= link_to _("I like this request"), do_track_path(track_thing), :class => "link_button_green" %>
<% else %>
- <%= link_to _("Follow"), do_track_url(track_thing), :class => "link_button_green" %>
+ <%= link_to _("Follow"), do_track_path(track_thing), :class => "link_button_green" %>
<% end %>
</div>
<div class="feed_link feed_link_<%=location%>">
- <%= link_to '<img src="/images/feed-16.png" alt="">'.html_safe, do_track_url(track_thing, 'feed') %>
- <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')), do_track_url(track_thing, 'feed') %>
+ <%= link_to '<img src="/images/feed-16.png" alt="">'.html_safe, do_track_path(track_thing, 'feed') %>
+ <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')), do_track_path(track_thing, 'feed') %>
</div>
<% end %>
diff --git a/app/views/track_mailer/event_digest.text.erb b/app/views/track_mailer/event_digest.text.erb
index dc8132b99..8dbc7fe06 100644
--- a/app/views/track_mailer/event_digest.text.erb
+++ b/app/views/track_mailer/event_digest.text.erb
@@ -17,17 +17,17 @@
# e.g. Julian Burgess sent a request to Royal Mail Group (15 May 2008)
if event.event_type == 'response'
- url = main_url(incoming_message_url(event.incoming_message))
+ url = incoming_message_url(event.incoming_message)
main_text += _("{{public_body}} sent a response to {{user_name}}", :public_body => event.info_request.public_body.name, :user_name => event.info_request.user_name)
elsif event.event_type == 'followup_sent'
- url = main_url(outgoing_message_url(event.outgoing_message))
+ url = outgoing_message_url(event.outgoing_message)
main_text += _("{{user_name}} sent a follow up message to {{public_body}}", :user_name => event.info_request.user_name, :public_body => event.info_request.public_body.name)
elsif event.event_type == 'sent'
# this is unlikely to happen in real life, but happens in the test code
- url = main_url(outgoing_message_url(event.outgoing_message))
+ url = outgoing_message_url(event.outgoing_message)
main_text += _("{{user_name}} sent a request to {{public_body}}", :user_name => event.info_request.user_name, :public_body => event.info_request.public_body.name)
elsif event.event_type == 'comment'
- url = main_url(comment_url(event.comment))
+ url = comment_url(event.comment)
main_text += _("{{user_name}} added an annotation", :user_name => event.comment.user.name)
else
raise "unknown type in event_digest " + event.event_type
diff --git a/app/views/user/_show_user_info.html.erb b/app/views/user/_show_user_info.html.erb
index 3c229e9ce..305300236 100644
--- a/app/views/user/_show_user_info.html.erb
+++ b/app/views/user/_show_user_info.html.erb
@@ -4,7 +4,7 @@
<img class="comment_quote" src="/images/quote-marks.png" alt="">
<%= @display_user.get_about_me_for_html_display %>
<% if @is_you %>
- (<%= link_to _("edit text about you"), set_profile_about_me_url() %>)
+ (<%= link_to _("edit text about you"), set_profile_about_me_path %>)
<% end %>
</div>
<% end %>
@@ -12,9 +12,9 @@
<% if @is_you %>
<p id="user_change_password_email">
<% if @display_user.profile_photo %>
- <%= link_to _('Change profile photo'), set_profile_photo_url() %> |
+ <%= link_to _('Change profile photo'), set_profile_photo_path %> |
<% end %>
- <%= link_to _('Change your password'), signchangepassword_url() %> |
- <%= link_to _('Change your email'), signchangeemail_url() %>
+ <%= link_to _('Change your password'), signchangepassword_path %> |
+ <%= link_to _('Change your email'), signchangeemail_path %>
</p>
<% end %>
diff --git a/app/views/user/_signin.html.erb b/app/views/user/_signin.html.erb
index d7a9c03f0..afc55d249 100644
--- a/app/views/user/_signin.html.erb
+++ b/app/views/user/_signin.html.erb
@@ -18,7 +18,7 @@
</p>
<p class="form_note">
- <%= link_to _('Forgotten your password?'), signchangepassword_url + "?pretoken=" + h(params[:token]), :tabindex => 30 %>
+ <%= link_to _('Forgotten your password?'), signchangepassword_path + "?pretoken=" + h(params[:token]), :tabindex => 30 %>
</p>
<p class="form_checkbox">
diff --git a/app/views/user/_signup.html.erb b/app/views/user/_signup.html.erb
index 315ae6838..ac4fd3e10 100644
--- a/app/views/user/_signup.html.erb
+++ b/app/views/user/_signup.html.erb
@@ -16,7 +16,7 @@
<p>
<label class="form_label" for="user_signup_name"> <%= _('Your name:')%></label>
- <%= text_field 'user_signup', 'name', { :size => 20, :tabindex => 70 } %>
+ <%= text_field 'user_signup', 'name', { :size => 20, :tabindex => 70, :autocomplete => "off" } %>
</p>
<div class="form_item_note">
<%= raw(_('Your <strong>name will appear publicly</strong>
@@ -28,12 +28,12 @@
<p>
<label class="form_label" for="user_signup_password"> <%= _('Password:')%></label>
- <%= password_field 'user_signup', 'password', { :size => 15, :tabindex => 80 } %>
+ <%= password_field 'user_signup', 'password', { :size => 15, :tabindex => 80, :autocomplete => "off" } %>
</p>
<p>
<label class="form_label" for="user_signup_password_confirmation"> <%= _('Password: (again)')%></label>
- <%= password_field 'user_signup', 'password_confirmation', { :size => 15, :tabindex => 90 } %>
+ <%= password_field 'user_signup', 'password_confirmation', { :size => 15, :tabindex => 90, :autocomplete => "off" } %>
</p>
<% if @request_from_foreign_country %>
diff --git a/app/views/user/_user_listing_single.html.erb b/app/views/user/_user_listing_single.html.erb
index 53df3a7e8..ed1b95718 100644
--- a/app/views/user/_user_listing_single.html.erb
+++ b/app/views/user/_user_listing_single.html.erb
@@ -5,14 +5,14 @@ end %>
<div class="user_listing">
<% if display_user.profile_photo %>
<div class="user_photo_on_search">
- <a href="<%=user_url(display_user)%>">
+ <a href="<%=user_path(display_user)%>">
<img src="<%= get_profile_photo_url(:url_name => display_user.url_name) %>" alt="">
</a>
</div>
<% end %>
<span class="head <% if display_user.profile_photo %>no_icon<% end %>">
- <%= link_to highlight_words(display_user.name, @highlight_words), user_url(display_user) %>
+ <%= link_to highlight_words(display_user.name, @highlight_words), user_path(display_user) %>
</span>
<span class="bottomline">
diff --git a/app/views/user/set_draft_profile_photo.html.erb b/app/views/user/set_draft_profile_photo.html.erb
index a44c78f57..b4bdd80f3 100644
--- a/app/views/user/set_draft_profile_photo.html.erb
+++ b/app/views/user/set_draft_profile_photo.html.erb
@@ -52,7 +52,7 @@
<% end %>
<p>
- <%= link_to _("Cancel, return to your profile page"), user_url(@user) %>
+ <%= link_to _("Cancel, return to your profile page"), user_path(@user) %>
</p>
</div>
diff --git a/app/views/user/show.html.erb b/app/views/user/show.html.erb
index e67d3b719..b92ffcff2 100644
--- a/app/views/user/show.html.erb
+++ b/app/views/user/show.html.erb
@@ -55,7 +55,7 @@
<% else %>
<% if @is_you %>
<span id="set_photo">
- <%= link_to _('Set your profile photo'), set_profile_photo_url() %>
+ <%= link_to _('Set your profile photo'), set_profile_photo_path %>
</span>
<% end %>
<% end %>
@@ -66,12 +66,12 @@
<p class="subtitle">
<%= _('Joined {{site_name}} in', :site_name=>site_name) %> <%= year_from_date(@display_user.created_at) %>
<% if !@user.nil? && @user.admin_page_links? %>
- (<%= link_to "admin", user_admin_url(@display_user) %>)
+ (<%= link_to "admin", admin_user_show_path(@display_user) %>)
<% end %>
</p>
<p>
- <%= link_to _('Send message to ') + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
+ <%= link_to _('Send message to ') + h(@display_user.name), contact_user_path(:id => @display_user.id) %>
<% if @is_you %>
(<%= _('just to see how it works')%>)
<% end %>
@@ -109,7 +109,7 @@
<div id="user_profile_search">
<%= form_tag(show_user_url, :method => "get", :id=>"search_form") do %>
<div>
- <%= text_field_tag(:user_query, params[:user_query]) %>
+ <%= text_field_tag(:user_query, params[:user_query], {:title => "type your search term here" }) %>
<% if @is_you %>
<%= submit_tag(_("Search your contributions")) %>
<% else %>
diff --git a/app/views/user_mailer/already_registered.text.erb b/app/views/user_mailer/already_registered.text.erb
index 59ffcbf94..32c2c7e63 100644
--- a/app/views/user_mailer/already_registered.text.erb
+++ b/app/views/user_mailer/already_registered.text.erb
@@ -1,10 +1,10 @@
-<%= @name %>,
+<%= raw @name %>,
<%= _('You just tried to sign up to {{site_name}}, when you
already have an account. Your name and password have been
left as they previously were.
-Please click on the link below.', :site_name=>site_name)%> <%=@reasons[:email]%>
+Please click on the link below.', :site_name=>site_name)%> <%=raw @reasons[:email] %>
<%=@url%>
diff --git a/app/views/user_mailer/changeemail_confirm.text.erb b/app/views/user_mailer/changeemail_confirm.text.erb
index ffb9737f7..c73e9486b 100644
--- a/app/views/user_mailer/changeemail_confirm.text.erb
+++ b/app/views/user_mailer/changeemail_confirm.text.erb
@@ -1,4 +1,4 @@
-<%= @name %>,
+<%= raw @name %>,
<%= _('Please click on the link below to confirm that you want to
change the email address that you use for {{site_name}}
diff --git a/app/views/user_mailer/confirm_login.text.erb b/app/views/user_mailer/confirm_login.text.erb
index 6f4feff00..fa86dc2b1 100644
--- a/app/views/user_mailer/confirm_login.text.erb
+++ b/app/views/user_mailer/confirm_login.text.erb
@@ -1,7 +1,7 @@
-<%= @name %>,
+<%= raw @name %>,
<%= _('Please click on the link below to confirm your email address.')%>
-<%=@reasons[:email]%>
+<%= raw @reasons[:email] %>
<%=@url%>
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 20274cd2b..0c1929366 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -26,4 +26,9 @@ Alaveteli::Application.configure do
:sender_address => AlaveteliConfiguration::exception_notifications_from,
:exception_recipients => AlaveteliConfiguration::exception_notifications_to
end
+
+ require 'rack/ssl'
+ if AlaveteliConfiguration::force_ssl
+ config.middleware.insert_before ActionDispatch::Cookies, ::Rack::SSL
+ end
end
diff --git a/config/general.yml-example b/config/general.yml-example
index bfe289541..5005fda77 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -12,6 +12,11 @@ SITE_NAME: 'Alaveteli'
# Domain used in URLs generated by scripts (e.g. for going in some emails)
DOMAIN: '127.0.0.1:3000'
+# If true forces everyone (in the production environment) to use encrypted connections
+# (via https) by redirecting unencrypted connections. This is *highly* recommended
+# so that logins can't be intercepted by naughty people.
+FORCE_SSL: true
+
# ISO country code of country currrently deployed in
# (http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
ISO_COUNTRY_CODE: GB
@@ -53,7 +58,6 @@ FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq'
# script). Earlier in the list means the templates have a higher
# priority.
THEME_URLS:
- - 'git://github.com/mysociety/adminbootstraptheme.git'
- 'git://github.com/mysociety/alavetelitheme.git'
# When rails-post-deploy installs the themes it will try this branch first
@@ -100,19 +104,6 @@ TRACK_SENDER_NAME: 'Alaveteli Webmaster'
# this up!
RAW_EMAILS_LOCATION: 'files/raw_emails'
-# The base URL for admin pages, must always end with a '/'
-# e.g. https://www.example.com/secure/alaveteli-admin/
-# If not specified, it will default to the path to the admin controller,
-# which is usually what you want. It is useful in situations where admin
-# requests are proxied via a secure server, for example.
-ADMIN_BASE_URL: ''
-
-# Where /stylesheets sits under for admin pages. See asset_host in
-# config/environment.rb. Can be full domain or relative path (not an
-# absolute path beginning with /). Again, unlikely to want to change
-# this.
-ADMIN_PUBLIC_URL: ''
-
# Secret key for signing cookie_store sessions
COOKIE_STORE_SESSION_SECRET: 'your secret key here, make it long and random'
diff --git a/config/memcached.yml-test b/config/memcached.yml-test
deleted file mode 100644
index 18d959876..000000000
--- a/config/memcached.yml-test
+++ /dev/null
@@ -1,2 +0,0 @@
-test:
- disabled: true \ No newline at end of file
diff --git a/config/test.yml b/config/test.yml
index ecd7c2898..fbec24346 100644
--- a/config/test.yml
+++ b/config/test.yml
@@ -71,15 +71,6 @@ CONTACT_NAME: 'Alaveteli Webmaster'
# this up!
RAW_EMAILS_LOCATION: 'files/raw_emails'
-# The base URL for admin pages. You probably don't want to change this.
-ADMIN_BASE_URL: ''
-
-# Where /stylesheets sits under for admin pages. See asset_host in
-# config/environment.rb. Can be full domain or relative path (not an
-# absolute path beginning with /). Again, unlikely to want to change
-# this.
-ADMIN_PUBLIC_URL: ''
-
# Secret key for signing cookie_store sessions
COOKIE_STORE_SESSION_SECRET: 'your secret key here, make it long and random'
diff --git a/config/varnish-alaveteli.vcl b/config/varnish-alaveteli.vcl
index 77350a8c8..5dd0ac83c 100644
--- a/config/varnish-alaveteli.vcl
+++ b/config/varnish-alaveteli.vcl
@@ -115,3 +115,43 @@ sub vcl_fetch {
}
}
+# We need to separately cache requests originating via http and via https
+# since we are serving very slightly different content in each case
+
+# Varnish 2.x version of vcl_hash
+#sub vcl_hash {
+# set req.hash += req.url;
+# if (req.http.host) {
+# set req.hash += req.http.host;
+# } else {
+# set req.hash += server.ip;
+# }
+#
+# # Include the X-Forward-Proto header, since we want to treat HTTPS
+# # requests differently, and make sure this header is always passed
+# # properly to the backend server.
+# if (req.http.X-Forwarded-Proto) {
+# set req.hash += req.http.X-Forwarded-Proto;
+# }
+#
+# return (hash);
+#}
+
+# Varnish 3 version of vcl_hash
+sub vcl_hash {
+ hash_data(req.url);
+ if (req.http.host) {
+ hash_data(req.http.host);
+ } else {
+ hash_data(server.ip);
+ }
+
+ # Include the X-Forward-Proto header, since we want to treat HTTPS
+ # requests differently, and make sure this header is always passed
+ # properly to the backend server.
+ if (req.http.X-Forwarded-Proto) {
+ hash_data(req.http.X-Forwarded-Proto);
+ }
+
+ return (hash);
+}
diff --git a/db/.gitignore b/db/.gitignore
index f3aee50a1..846a7b9b3 100644
--- a/db/.gitignore
+++ b/db/.gitignore
@@ -1,2 +1 @@
schema.rb
-development_structure.sql
diff --git a/db/development_structure.sql b/db/development_structure.sql
new file mode 100644
index 000000000..bd4870948
--- /dev/null
+++ b/db/development_structure.sql
@@ -0,0 +1,2095 @@
+--
+-- PostgreSQL database dump
+--
+
+SET statement_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = on;
+SET check_function_bodies = false;
+SET client_min_messages = warning;
+
+--
+-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
+--
+
+CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
+
+
+--
+-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
+--
+
+COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
+
+
+SET search_path = public, pg_catalog;
+
+SET default_tablespace = '';
+
+SET default_with_oids = false;
+
+--
+-- Name: acts_as_xapian_jobs; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE acts_as_xapian_jobs (
+ id integer NOT NULL,
+ model character varying(255) NOT NULL,
+ model_id integer NOT NULL,
+ action character varying(255) NOT NULL
+);
+
+
+--
+-- Name: acts_as_xapian_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE acts_as_xapian_jobs_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: acts_as_xapian_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE acts_as_xapian_jobs_id_seq OWNED BY acts_as_xapian_jobs.id;
+
+
+--
+-- Name: censor_rules; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE censor_rules (
+ id integer NOT NULL,
+ info_request_id integer,
+ user_id integer,
+ public_body_id integer,
+ text text NOT NULL,
+ replacement text NOT NULL,
+ last_edit_editor character varying(255) NOT NULL,
+ last_edit_comment text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ regexp boolean
+);
+
+
+--
+-- Name: censor_rules_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE censor_rules_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: censor_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE censor_rules_id_seq OWNED BY censor_rules.id;
+
+
+--
+-- Name: comments; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE comments (
+ id integer NOT NULL,
+ user_id integer NOT NULL,
+ comment_type character varying(255) DEFAULT 'internal_error'::character varying NOT NULL,
+ info_request_id integer,
+ body text NOT NULL,
+ visible boolean DEFAULT true NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ locale text DEFAULT ''::text NOT NULL
+);
+
+
+--
+-- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE comments_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE comments_id_seq OWNED BY comments.id;
+
+
+--
+-- Name: mail_server_log_dones; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE mail_server_log_dones (
+ id integer NOT NULL,
+ filename text NOT NULL,
+ last_stat timestamp without time zone NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
+);
+
+
+--
+-- Name: exim_log_dones_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE exim_log_dones_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: exim_log_dones_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE exim_log_dones_id_seq OWNED BY mail_server_log_dones.id;
+
+
+--
+-- Name: mail_server_logs; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE mail_server_logs (
+ id integer NOT NULL,
+ mail_server_log_done_id integer,
+ info_request_id integer,
+ "order" integer NOT NULL,
+ line text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
+);
+
+
+--
+-- Name: exim_logs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE exim_logs_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: exim_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE exim_logs_id_seq OWNED BY mail_server_logs.id;
+
+
+--
+-- Name: foi_attachments; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE foi_attachments (
+ id integer NOT NULL,
+ content_type text,
+ filename text,
+ charset text,
+ display_size text,
+ url_part_number integer,
+ within_rfc822_subject text,
+ incoming_message_id integer,
+ hexdigest character varying(32)
+);
+
+
+--
+-- Name: foi_attachments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE foi_attachments_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: foi_attachments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE foi_attachments_id_seq OWNED BY foi_attachments.id;
+
+
+--
+-- Name: has_tag_string_tags; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE has_tag_string_tags (
+ id integer NOT NULL,
+ model_id integer NOT NULL,
+ name text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ value text,
+ model character varying(255) NOT NULL
+);
+
+
+--
+-- Name: holidays; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE holidays (
+ id integer NOT NULL,
+ day date,
+ description text
+);
+
+
+--
+-- Name: holidays_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE holidays_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: holidays_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE holidays_id_seq OWNED BY holidays.id;
+
+
+--
+-- Name: incoming_messages; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE incoming_messages (
+ id integer NOT NULL,
+ info_request_id integer NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ raw_email_id integer NOT NULL,
+ cached_attachment_text_clipped text,
+ cached_main_body_text_folded text,
+ cached_main_body_text_unfolded text,
+ subject text,
+ mail_from_domain text,
+ valid_to_reply_to boolean,
+ last_parsed timestamp without time zone,
+ mail_from text,
+ sent_at timestamp without time zone
+);
+
+
+--
+-- Name: incoming_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE incoming_messages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: incoming_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE incoming_messages_id_seq OWNED BY incoming_messages.id;
+
+
+--
+-- Name: info_request_events; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE info_request_events (
+ id integer NOT NULL,
+ info_request_id integer NOT NULL,
+ event_type text NOT NULL,
+ params_yaml text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ described_state character varying(255),
+ calculated_state character varying(255) DEFAULT NULL::character varying,
+ last_described_at timestamp without time zone,
+ incoming_message_id integer,
+ outgoing_message_id integer,
+ comment_id integer,
+ prominence character varying(255) DEFAULT 'normal'::character varying NOT NULL
+);
+
+
+--
+-- Name: info_request_events_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE info_request_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: info_request_events_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE info_request_events_id_seq OWNED BY info_request_events.id;
+
+
+--
+-- Name: info_requests; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE info_requests (
+ id integer NOT NULL,
+ title text NOT NULL,
+ user_id integer,
+ public_body_id integer NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ described_state character varying(255) NOT NULL,
+ awaiting_description boolean DEFAULT false NOT NULL,
+ prominence character varying(255) DEFAULT 'normal'::character varying NOT NULL,
+ url_title text NOT NULL,
+ law_used character varying(255) DEFAULT 'foi'::character varying NOT NULL,
+ allow_new_responses_from character varying(255) DEFAULT 'anybody'::character varying NOT NULL,
+ handle_rejected_responses character varying(255) DEFAULT 'bounce'::character varying NOT NULL,
+ idhash character varying(255) NOT NULL,
+ external_user_name character varying(255),
+ external_url character varying(255),
+ attention_requested boolean DEFAULT false,
+ comments_allowed boolean DEFAULT true NOT NULL,
+ CONSTRAINT info_requests_external_ck CHECK ((((user_id IS NULL) = (external_url IS NOT NULL)) AND ((external_url IS NOT NULL) OR (external_user_name IS NULL))))
+);
+
+
+--
+-- Name: info_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE info_requests_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: info_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE info_requests_id_seq OWNED BY info_requests.id;
+
+
+--
+-- Name: outgoing_messages; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE outgoing_messages (
+ id integer NOT NULL,
+ info_request_id integer NOT NULL,
+ body text NOT NULL,
+ status character varying(255) NOT NULL,
+ message_type character varying(255) NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ last_sent_at timestamp without time zone,
+ incoming_message_followup_id integer,
+ what_doing character varying(255) NOT NULL
+);
+
+
+--
+-- Name: outgoing_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE outgoing_messages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: outgoing_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE outgoing_messages_id_seq OWNED BY outgoing_messages.id;
+
+
+--
+-- Name: post_redirects; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE post_redirects (
+ id integer NOT NULL,
+ token text NOT NULL,
+ uri text NOT NULL,
+ post_params_yaml text,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ email_token text NOT NULL,
+ reason_params_yaml text,
+ user_id integer,
+ circumstance text DEFAULT 'normal'::text NOT NULL
+);
+
+
+--
+-- Name: post_redirects_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE post_redirects_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: post_redirects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE post_redirects_id_seq OWNED BY post_redirects.id;
+
+
+--
+-- Name: profile_photos; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE profile_photos (
+ id integer NOT NULL,
+ data bytea NOT NULL,
+ user_id integer,
+ draft boolean DEFAULT false NOT NULL
+);
+
+
+--
+-- Name: profile_photos_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE profile_photos_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: profile_photos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE profile_photos_id_seq OWNED BY profile_photos.id;
+
+
+--
+-- Name: public_bodies; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE public_bodies (
+ id integer NOT NULL,
+ name text NOT NULL,
+ short_name text NOT NULL,
+ request_email text NOT NULL,
+ version integer NOT NULL,
+ last_edit_editor character varying(255) NOT NULL,
+ last_edit_comment text NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ url_name text NOT NULL,
+ home_page text DEFAULT ''::text NOT NULL,
+ notes text DEFAULT ''::text NOT NULL,
+ first_letter character varying(255) NOT NULL,
+ publication_scheme text DEFAULT ''::text NOT NULL,
+ api_key character varying(255) NOT NULL,
+ info_requests_count integer DEFAULT 0 NOT NULL,
+ disclosure_log text DEFAULT ''::text NOT NULL
+);
+
+
+--
+-- Name: public_bodies_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public_bodies_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: public_bodies_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public_bodies_id_seq OWNED BY public_bodies.id;
+
+
+--
+-- Name: public_body_tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public_body_tags_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: public_body_tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public_body_tags_id_seq OWNED BY has_tag_string_tags.id;
+
+
+--
+-- Name: public_body_translations; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE public_body_translations (
+ id integer NOT NULL,
+ public_body_id integer,
+ locale character varying(255),
+ short_name text,
+ publication_scheme text,
+ url_name text,
+ first_letter character varying(255),
+ notes text,
+ name text,
+ request_email text,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone,
+ disclosure_log text
+);
+
+
+--
+-- Name: public_body_translations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public_body_translations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: public_body_translations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public_body_translations_id_seq OWNED BY public_body_translations.id;
+
+
+--
+-- Name: public_body_versions; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE public_body_versions (
+ id integer NOT NULL,
+ public_body_id integer,
+ version integer,
+ name text,
+ short_name text,
+ request_email text,
+ updated_at timestamp without time zone,
+ last_edit_editor character varying(255),
+ last_edit_comment text,
+ url_name text,
+ home_page text,
+ notes text,
+ publication_scheme text DEFAULT ''::text NOT NULL,
+ charity_number text DEFAULT ''::text NOT NULL,
+ disclosure_log text DEFAULT ''::text NOT NULL
+);
+
+
+--
+-- Name: public_body_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE public_body_versions_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: public_body_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE public_body_versions_id_seq OWNED BY public_body_versions.id;
+
+
+--
+-- Name: purge_requests; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE purge_requests (
+ id integer NOT NULL,
+ url character varying(255),
+ created_at timestamp without time zone NOT NULL,
+ model character varying(255) NOT NULL,
+ model_id integer NOT NULL
+);
+
+
+--
+-- Name: purge_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE purge_requests_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: purge_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE purge_requests_id_seq OWNED BY purge_requests.id;
+
+
+--
+-- Name: raw_emails; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE raw_emails (
+ id integer NOT NULL
+);
+
+
+--
+-- Name: raw_emails_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE raw_emails_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: raw_emails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE raw_emails_id_seq OWNED BY raw_emails.id;
+
+
+--
+-- Name: request_classifications; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE request_classifications (
+ id integer NOT NULL,
+ user_id integer,
+ info_request_event_id integer,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone
+);
+
+
+--
+-- Name: request_classifications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE request_classifications_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: request_classifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE request_classifications_id_seq OWNED BY request_classifications.id;
+
+
+--
+-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE schema_migrations (
+ version character varying(255) NOT NULL
+);
+
+
+--
+-- Name: track_things; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE track_things (
+ id integer NOT NULL,
+ tracking_user_id integer NOT NULL,
+ track_query character varying(255) NOT NULL,
+ info_request_id integer,
+ tracked_user_id integer,
+ public_body_id integer,
+ track_medium character varying(255) NOT NULL,
+ track_type character varying(255) DEFAULT 'internal_error'::character varying NOT NULL,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone
+);
+
+
+--
+-- Name: track_things_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE track_things_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: track_things_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE track_things_id_seq OWNED BY track_things.id;
+
+
+--
+-- Name: track_things_sent_emails; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE track_things_sent_emails (
+ id integer NOT NULL,
+ track_thing_id integer NOT NULL,
+ info_request_event_id integer,
+ user_id integer,
+ public_body_id integer,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone
+);
+
+
+--
+-- Name: track_things_sent_emails_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE track_things_sent_emails_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: track_things_sent_emails_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE track_things_sent_emails_id_seq OWNED BY track_things_sent_emails.id;
+
+
+--
+-- Name: user_info_request_sent_alerts; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE user_info_request_sent_alerts (
+ id integer NOT NULL,
+ user_id integer NOT NULL,
+ info_request_id integer NOT NULL,
+ alert_type character varying(255) NOT NULL,
+ info_request_event_id integer
+);
+
+
+--
+-- Name: user_info_request_sent_alerts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE user_info_request_sent_alerts_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: user_info_request_sent_alerts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE user_info_request_sent_alerts_id_seq OWNED BY user_info_request_sent_alerts.id;
+
+
+--
+-- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE users (
+ id integer NOT NULL,
+ email character varying(255) NOT NULL,
+ name character varying(255) NOT NULL,
+ hashed_password character varying(255) NOT NULL,
+ salt character varying(255) NOT NULL,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ email_confirmed boolean DEFAULT false NOT NULL,
+ url_name text NOT NULL,
+ last_daily_track_email timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone,
+ admin_level character varying(255) DEFAULT 'none'::character varying NOT NULL,
+ ban_text text DEFAULT ''::text NOT NULL,
+ about_me text DEFAULT ''::text NOT NULL,
+ locale character varying(255),
+ email_bounced_at timestamp without time zone,
+ email_bounce_message text DEFAULT ''::text NOT NULL,
+ no_limit boolean DEFAULT false NOT NULL,
+ receive_email_alerts boolean DEFAULT true NOT NULL
+);
+
+
+--
+-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE users_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE users_id_seq OWNED BY users.id;
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY acts_as_xapian_jobs ALTER COLUMN id SET DEFAULT nextval('acts_as_xapian_jobs_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY censor_rules ALTER COLUMN id SET DEFAULT nextval('censor_rules_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY comments ALTER COLUMN id SET DEFAULT nextval('comments_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY foi_attachments ALTER COLUMN id SET DEFAULT nextval('foi_attachments_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY has_tag_string_tags ALTER COLUMN id SET DEFAULT nextval('public_body_tags_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY holidays ALTER COLUMN id SET DEFAULT nextval('holidays_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY incoming_messages ALTER COLUMN id SET DEFAULT nextval('incoming_messages_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY info_request_events ALTER COLUMN id SET DEFAULT nextval('info_request_events_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY info_requests ALTER COLUMN id SET DEFAULT nextval('info_requests_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY mail_server_log_dones ALTER COLUMN id SET DEFAULT nextval('exim_log_dones_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY mail_server_logs ALTER COLUMN id SET DEFAULT nextval('exim_logs_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY outgoing_messages ALTER COLUMN id SET DEFAULT nextval('outgoing_messages_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY post_redirects ALTER COLUMN id SET DEFAULT nextval('post_redirects_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY profile_photos ALTER COLUMN id SET DEFAULT nextval('profile_photos_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public_bodies ALTER COLUMN id SET DEFAULT nextval('public_bodies_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public_body_translations ALTER COLUMN id SET DEFAULT nextval('public_body_translations_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public_body_versions ALTER COLUMN id SET DEFAULT nextval('public_body_versions_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY purge_requests ALTER COLUMN id SET DEFAULT nextval('purge_requests_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY raw_emails ALTER COLUMN id SET DEFAULT nextval('raw_emails_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY request_classifications ALTER COLUMN id SET DEFAULT nextval('request_classifications_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things ALTER COLUMN id SET DEFAULT nextval('track_things_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things_sent_emails ALTER COLUMN id SET DEFAULT nextval('track_things_sent_emails_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY user_info_request_sent_alerts ALTER COLUMN id SET DEFAULT nextval('user_info_request_sent_alerts_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
+
+
+--
+-- Name: acts_as_xapian_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY acts_as_xapian_jobs
+ ADD CONSTRAINT acts_as_xapian_jobs_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: censor_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY censor_rules
+ ADD CONSTRAINT censor_rules_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY comments
+ ADD CONSTRAINT comments_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: exim_log_dones_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY mail_server_log_dones
+ ADD CONSTRAINT exim_log_dones_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: exim_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY mail_server_logs
+ ADD CONSTRAINT exim_logs_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: foi_attachments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY foi_attachments
+ ADD CONSTRAINT foi_attachments_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: holidays_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY holidays
+ ADD CONSTRAINT holidays_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: incoming_messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY incoming_messages
+ ADD CONSTRAINT incoming_messages_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: info_request_events_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY info_request_events
+ ADD CONSTRAINT info_request_events_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: info_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY info_requests
+ ADD CONSTRAINT info_requests_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: outgoing_messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY outgoing_messages
+ ADD CONSTRAINT outgoing_messages_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: post_redirects_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY post_redirects
+ ADD CONSTRAINT post_redirects_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: profile_photos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY profile_photos
+ ADD CONSTRAINT profile_photos_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: public_bodies_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY public_bodies
+ ADD CONSTRAINT public_bodies_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: public_body_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY has_tag_string_tags
+ ADD CONSTRAINT public_body_tags_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: public_body_translations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY public_body_translations
+ ADD CONSTRAINT public_body_translations_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: public_body_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY public_body_versions
+ ADD CONSTRAINT public_body_versions_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: purge_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY purge_requests
+ ADD CONSTRAINT purge_requests_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: raw_emails_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY raw_emails
+ ADD CONSTRAINT raw_emails_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: request_classifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY request_classifications
+ ADD CONSTRAINT request_classifications_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: track_things_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY track_things
+ ADD CONSTRAINT track_things_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: track_things_sent_emails_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY track_things_sent_emails
+ ADD CONSTRAINT track_things_sent_emails_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: user_info_request_sent_alerts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY user_info_request_sent_alerts
+ ADD CONSTRAINT user_info_request_sent_alerts_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY users
+ ADD CONSTRAINT users_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: by_model_and_model_id_and_name_and_value; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX by_model_and_model_id_and_name_and_value ON has_tag_string_tags USING btree (model, model_id, name, value);
+
+
+--
+-- Name: index_acts_as_xapian_jobs_on_model_and_model_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX index_acts_as_xapian_jobs_on_model_and_model_id ON acts_as_xapian_jobs USING btree (model, model_id);
+
+
+--
+-- Name: index_censor_rules_on_info_request_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_censor_rules_on_info_request_id ON censor_rules USING btree (info_request_id);
+
+
+--
+-- Name: index_censor_rules_on_public_body_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_censor_rules_on_public_body_id ON censor_rules USING btree (public_body_id);
+
+
+--
+-- Name: index_censor_rules_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_censor_rules_on_user_id ON censor_rules USING btree (user_id);
+
+
+--
+-- Name: index_exim_log_dones_on_last_stat; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_exim_log_dones_on_last_stat ON mail_server_log_dones USING btree (last_stat);
+
+
+--
+-- Name: index_exim_logs_on_exim_log_done_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_exim_logs_on_exim_log_done_id ON mail_server_logs USING btree (mail_server_log_done_id);
+
+
+--
+-- Name: index_exim_logs_on_info_request_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_exim_logs_on_info_request_id ON mail_server_logs USING btree (info_request_id);
+
+
+--
+-- Name: index_foi_attachments_on_incoming_message_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_foi_attachments_on_incoming_message_id ON foi_attachments USING btree (incoming_message_id);
+
+
+--
+-- Name: index_has_tag_string_tags_on_model_and_model_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_has_tag_string_tags_on_model_and_model_id ON has_tag_string_tags USING btree (model, model_id);
+
+
+--
+-- Name: index_has_tag_string_tags_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_has_tag_string_tags_on_name ON has_tag_string_tags USING btree (name);
+
+
+--
+-- Name: index_holidays_on_day; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_holidays_on_day ON holidays USING btree (day);
+
+
+--
+-- Name: index_incoming_messages_on_info_request_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_incoming_messages_on_info_request_id ON incoming_messages USING btree (info_request_id);
+
+
+--
+-- Name: index_incoming_messages_on_raw_email_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_incoming_messages_on_raw_email_id ON incoming_messages USING btree (raw_email_id);
+
+
+--
+-- Name: index_info_request_events_on_comment_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_request_events_on_comment_id ON info_request_events USING btree (comment_id);
+
+
+--
+-- Name: index_info_request_events_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_request_events_on_created_at ON info_request_events USING btree (created_at);
+
+
+--
+-- Name: index_info_request_events_on_incoming_message_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_request_events_on_incoming_message_id ON info_request_events USING btree (incoming_message_id);
+
+
+--
+-- Name: index_info_request_events_on_info_request_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_request_events_on_info_request_id ON info_request_events USING btree (info_request_id);
+
+
+--
+-- Name: index_info_request_events_on_outgoing_message_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_request_events_on_outgoing_message_id ON info_request_events USING btree (outgoing_message_id);
+
+
+--
+-- Name: index_info_requests_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_requests_on_created_at ON info_requests USING btree (created_at);
+
+
+--
+-- Name: index_info_requests_on_public_body_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_requests_on_public_body_id ON info_requests USING btree (public_body_id);
+
+
+--
+-- Name: index_info_requests_on_title; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_requests_on_title ON info_requests USING btree (title);
+
+
+--
+-- Name: index_info_requests_on_url_title; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX index_info_requests_on_url_title ON info_requests USING btree (url_title);
+
+
+--
+-- Name: index_info_requests_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_info_requests_on_user_id ON info_requests USING btree (user_id);
+
+
+--
+-- Name: index_outgoing_messages_on_incoming_message_followup_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_outgoing_messages_on_incoming_message_followup_id ON outgoing_messages USING btree (incoming_message_followup_id);
+
+
+--
+-- Name: index_outgoing_messages_on_info_request_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_outgoing_messages_on_info_request_id ON outgoing_messages USING btree (info_request_id);
+
+
+--
+-- Name: index_outgoing_messages_on_what_doing; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_outgoing_messages_on_what_doing ON outgoing_messages USING btree (what_doing);
+
+
+--
+-- Name: index_post_redirects_on_email_token; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_post_redirects_on_email_token ON post_redirects USING btree (email_token);
+
+
+--
+-- Name: index_post_redirects_on_token; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_post_redirects_on_token ON post_redirects USING btree (token);
+
+
+--
+-- Name: index_post_redirects_on_updated_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_post_redirects_on_updated_at ON post_redirects USING btree (updated_at);
+
+
+--
+-- Name: index_post_redirects_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_post_redirects_on_user_id ON post_redirects USING btree (user_id);
+
+
+--
+-- Name: index_public_bodies_on_first_letter; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_public_bodies_on_first_letter ON public_bodies USING btree (first_letter);
+
+
+--
+-- Name: index_public_bodies_on_url_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX index_public_bodies_on_url_name ON public_bodies USING btree (url_name);
+
+
+--
+-- Name: index_public_body_translations_on_public_body_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_public_body_translations_on_public_body_id ON public_body_translations USING btree (public_body_id);
+
+
+--
+-- Name: index_public_body_versions_on_updated_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_public_body_versions_on_updated_at ON public_body_versions USING btree (updated_at);
+
+
+--
+-- Name: index_request_classifications_on_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_request_classifications_on_user_id ON request_classifications USING btree (user_id);
+
+
+--
+-- Name: index_track_things_on_tracking_user_id_and_track_query; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX index_track_things_on_tracking_user_id_and_track_query ON track_things USING btree (tracking_user_id, track_query);
+
+
+--
+-- Name: index_track_things_sent_emails_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_track_things_sent_emails_on_created_at ON track_things_sent_emails USING btree (created_at);
+
+
+--
+-- Name: index_track_things_sent_emails_on_info_request_event_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_track_things_sent_emails_on_info_request_event_id ON track_things_sent_emails USING btree (info_request_event_id);
+
+
+--
+-- Name: index_track_things_sent_emails_on_track_thing_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_track_things_sent_emails_on_track_thing_id ON track_things_sent_emails USING btree (track_thing_id);
+
+
+--
+-- Name: index_user_info_request_sent_alerts_on_info_request_event_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_user_info_request_sent_alerts_on_info_request_event_id ON user_info_request_sent_alerts USING btree (info_request_event_id);
+
+
+--
+-- Name: index_users_on_url_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX index_users_on_url_name ON users USING btree (url_name);
+
+
+--
+-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
+
+
+--
+-- Name: user_info_request_sent_alerts_unique_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX user_info_request_sent_alerts_unique_index ON user_info_request_sent_alerts USING btree (user_id, info_request_id, alert_type, (COALESCE(info_request_event_id, (-1))));
+
+
+--
+-- Name: users_email_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE UNIQUE INDEX users_email_index ON users USING btree (lower((email)::text));
+
+
+--
+-- Name: users_lower_email_index; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX users_lower_email_index ON users USING btree (lower((email)::text));
+
+
+--
+-- Name: fk_censor_rules_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY censor_rules
+ ADD CONSTRAINT fk_censor_rules_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id);
+
+
+--
+-- Name: fk_censor_rules_public_body; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY censor_rules
+ ADD CONSTRAINT fk_censor_rules_public_body FOREIGN KEY (public_body_id) REFERENCES public_bodies(id);
+
+
+--
+-- Name: fk_censor_rules_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY censor_rules
+ ADD CONSTRAINT fk_censor_rules_user FOREIGN KEY (user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_comments_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY comments
+ ADD CONSTRAINT fk_comments_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id);
+
+
+--
+-- Name: fk_comments_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY comments
+ ADD CONSTRAINT fk_comments_user FOREIGN KEY (user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_exim_log_done; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY mail_server_logs
+ ADD CONSTRAINT fk_exim_log_done FOREIGN KEY (mail_server_log_done_id) REFERENCES mail_server_log_dones(id);
+
+
+--
+-- Name: fk_exim_log_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY mail_server_logs
+ ADD CONSTRAINT fk_exim_log_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id);
+
+
+--
+-- Name: fk_incoming_message_followup_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY outgoing_messages
+ ADD CONSTRAINT fk_incoming_message_followup_info_request FOREIGN KEY (incoming_message_followup_id) REFERENCES incoming_messages(id);
+
+
+--
+-- Name: fk_incoming_messages_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY incoming_messages
+ ADD CONSTRAINT fk_incoming_messages_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id);
+
+
+--
+-- Name: fk_incoming_messages_raw_email; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY incoming_messages
+ ADD CONSTRAINT fk_incoming_messages_raw_email FOREIGN KEY (raw_email_id) REFERENCES raw_emails(id);
+
+
+--
+-- Name: fk_info_request_events_comment_id; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY info_request_events
+ ADD CONSTRAINT fk_info_request_events_comment_id FOREIGN KEY (comment_id) REFERENCES comments(id);
+
+
+--
+-- Name: fk_info_request_events_incoming_message_id; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY info_request_events
+ ADD CONSTRAINT fk_info_request_events_incoming_message_id FOREIGN KEY (incoming_message_id) REFERENCES incoming_messages(id);
+
+
+--
+-- Name: fk_info_request_events_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY info_request_events
+ ADD CONSTRAINT fk_info_request_events_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id);
+
+
+--
+-- Name: fk_info_request_events_outgoing_message_id; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY info_request_events
+ ADD CONSTRAINT fk_info_request_events_outgoing_message_id FOREIGN KEY (outgoing_message_id) REFERENCES outgoing_messages(id);
+
+
+--
+-- Name: fk_info_request_sent_alerts_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY user_info_request_sent_alerts
+ ADD CONSTRAINT fk_info_request_sent_alerts_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id);
+
+
+--
+-- Name: fk_info_request_sent_alerts_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY user_info_request_sent_alerts
+ ADD CONSTRAINT fk_info_request_sent_alerts_user FOREIGN KEY (user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_info_requests_public_body; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY info_requests
+ ADD CONSTRAINT fk_info_requests_public_body FOREIGN KEY (public_body_id) REFERENCES public_bodies(id);
+
+
+--
+-- Name: fk_info_requests_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY info_requests
+ ADD CONSTRAINT fk_info_requests_user FOREIGN KEY (user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_outgoing_messages_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY outgoing_messages
+ ADD CONSTRAINT fk_outgoing_messages_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id);
+
+
+--
+-- Name: fk_post_redirects_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY post_redirects
+ ADD CONSTRAINT fk_post_redirects_user FOREIGN KEY (user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_profile_photos_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY profile_photos
+ ADD CONSTRAINT fk_profile_photos_user FOREIGN KEY (user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_public_body_versions_public_body; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public_body_versions
+ ADD CONSTRAINT fk_public_body_versions_public_body FOREIGN KEY (public_body_id) REFERENCES public_bodies(id);
+
+
+--
+-- Name: fk_track_request_info_request; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things
+ ADD CONSTRAINT fk_track_request_info_request FOREIGN KEY (info_request_id) REFERENCES info_requests(id);
+
+
+--
+-- Name: fk_track_request_info_request_event; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things_sent_emails
+ ADD CONSTRAINT fk_track_request_info_request_event FOREIGN KEY (info_request_event_id) REFERENCES info_request_events(id);
+
+
+--
+-- Name: fk_track_request_public_body; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things
+ ADD CONSTRAINT fk_track_request_public_body FOREIGN KEY (public_body_id) REFERENCES public_bodies(id);
+
+
+--
+-- Name: fk_track_request_public_body; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things_sent_emails
+ ADD CONSTRAINT fk_track_request_public_body FOREIGN KEY (user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_track_request_tracked_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things
+ ADD CONSTRAINT fk_track_request_tracked_user FOREIGN KEY (tracked_user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_track_request_tracking_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things
+ ADD CONSTRAINT fk_track_request_tracking_user FOREIGN KEY (tracking_user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_track_request_user; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY track_things_sent_emails
+ ADD CONSTRAINT fk_track_request_user FOREIGN KEY (user_id) REFERENCES users(id);
+
+
+--
+-- Name: fk_user_info_request_sent_alert_info_request_event; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY user_info_request_sent_alerts
+ ADD CONSTRAINT fk_user_info_request_sent_alert_info_request_event FOREIGN KEY (info_request_event_id) REFERENCES info_request_events(id);
+
+
+--
+-- PostgreSQL database dump complete
+--
+
+INSERT INTO schema_migrations (version) VALUES ('1');
+
+INSERT INTO schema_migrations (version) VALUES ('2');
+
+INSERT INTO schema_migrations (version) VALUES ('4');
+
+INSERT INTO schema_migrations (version) VALUES ('5');
+
+INSERT INTO schema_migrations (version) VALUES ('6');
+
+INSERT INTO schema_migrations (version) VALUES ('7');
+
+INSERT INTO schema_migrations (version) VALUES ('8');
+
+INSERT INTO schema_migrations (version) VALUES ('9');
+
+INSERT INTO schema_migrations (version) VALUES ('10');
+
+INSERT INTO schema_migrations (version) VALUES ('11');
+
+INSERT INTO schema_migrations (version) VALUES ('12');
+
+INSERT INTO schema_migrations (version) VALUES ('13');
+
+INSERT INTO schema_migrations (version) VALUES ('14');
+
+INSERT INTO schema_migrations (version) VALUES ('15');
+
+INSERT INTO schema_migrations (version) VALUES ('16');
+
+INSERT INTO schema_migrations (version) VALUES ('17');
+
+INSERT INTO schema_migrations (version) VALUES ('18');
+
+INSERT INTO schema_migrations (version) VALUES ('21');
+
+INSERT INTO schema_migrations (version) VALUES ('22');
+
+INSERT INTO schema_migrations (version) VALUES ('23');
+
+INSERT INTO schema_migrations (version) VALUES ('24');
+
+INSERT INTO schema_migrations (version) VALUES ('25');
+
+INSERT INTO schema_migrations (version) VALUES ('26');
+
+INSERT INTO schema_migrations (version) VALUES ('27');
+
+INSERT INTO schema_migrations (version) VALUES ('28');
+
+INSERT INTO schema_migrations (version) VALUES ('29');
+
+INSERT INTO schema_migrations (version) VALUES ('30');
+
+INSERT INTO schema_migrations (version) VALUES ('31');
+
+INSERT INTO schema_migrations (version) VALUES ('32');
+
+INSERT INTO schema_migrations (version) VALUES ('33');
+
+INSERT INTO schema_migrations (version) VALUES ('34');
+
+INSERT INTO schema_migrations (version) VALUES ('35');
+
+INSERT INTO schema_migrations (version) VALUES ('36');
+
+INSERT INTO schema_migrations (version) VALUES ('37');
+
+INSERT INTO schema_migrations (version) VALUES ('38');
+
+INSERT INTO schema_migrations (version) VALUES ('39');
+
+INSERT INTO schema_migrations (version) VALUES ('40');
+
+INSERT INTO schema_migrations (version) VALUES ('41');
+
+INSERT INTO schema_migrations (version) VALUES ('42');
+
+INSERT INTO schema_migrations (version) VALUES ('43');
+
+INSERT INTO schema_migrations (version) VALUES ('44');
+
+INSERT INTO schema_migrations (version) VALUES ('45');
+
+INSERT INTO schema_migrations (version) VALUES ('46');
+
+INSERT INTO schema_migrations (version) VALUES ('47');
+
+INSERT INTO schema_migrations (version) VALUES ('48');
+
+INSERT INTO schema_migrations (version) VALUES ('49');
+
+INSERT INTO schema_migrations (version) VALUES ('50');
+
+INSERT INTO schema_migrations (version) VALUES ('51');
+
+INSERT INTO schema_migrations (version) VALUES ('52');
+
+INSERT INTO schema_migrations (version) VALUES ('53');
+
+INSERT INTO schema_migrations (version) VALUES ('54');
+
+INSERT INTO schema_migrations (version) VALUES ('55');
+
+INSERT INTO schema_migrations (version) VALUES ('56');
+
+INSERT INTO schema_migrations (version) VALUES ('57');
+
+INSERT INTO schema_migrations (version) VALUES ('58');
+
+INSERT INTO schema_migrations (version) VALUES ('59');
+
+INSERT INTO schema_migrations (version) VALUES ('60');
+
+INSERT INTO schema_migrations (version) VALUES ('61');
+
+INSERT INTO schema_migrations (version) VALUES ('62');
+
+INSERT INTO schema_migrations (version) VALUES ('63');
+
+INSERT INTO schema_migrations (version) VALUES ('64');
+
+INSERT INTO schema_migrations (version) VALUES ('65');
+
+INSERT INTO schema_migrations (version) VALUES ('66');
+
+INSERT INTO schema_migrations (version) VALUES ('67');
+
+INSERT INTO schema_migrations (version) VALUES ('68');
+
+INSERT INTO schema_migrations (version) VALUES ('69');
+
+INSERT INTO schema_migrations (version) VALUES ('70');
+
+INSERT INTO schema_migrations (version) VALUES ('71');
+
+INSERT INTO schema_migrations (version) VALUES ('72');
+
+INSERT INTO schema_migrations (version) VALUES ('73');
+
+INSERT INTO schema_migrations (version) VALUES ('74');
+
+INSERT INTO schema_migrations (version) VALUES ('75');
+
+INSERT INTO schema_migrations (version) VALUES ('76');
+
+INSERT INTO schema_migrations (version) VALUES ('77');
+
+INSERT INTO schema_migrations (version) VALUES ('78');
+
+INSERT INTO schema_migrations (version) VALUES ('79');
+
+INSERT INTO schema_migrations (version) VALUES ('80');
+
+INSERT INTO schema_migrations (version) VALUES ('81');
+
+INSERT INTO schema_migrations (version) VALUES ('82');
+
+INSERT INTO schema_migrations (version) VALUES ('83');
+
+INSERT INTO schema_migrations (version) VALUES ('84');
+
+INSERT INTO schema_migrations (version) VALUES ('85');
+
+INSERT INTO schema_migrations (version) VALUES ('86');
+
+INSERT INTO schema_migrations (version) VALUES ('87');
+
+INSERT INTO schema_migrations (version) VALUES ('88');
+
+INSERT INTO schema_migrations (version) VALUES ('89');
+
+INSERT INTO schema_migrations (version) VALUES ('90');
+
+INSERT INTO schema_migrations (version) VALUES ('91');
+
+INSERT INTO schema_migrations (version) VALUES ('92');
+
+INSERT INTO schema_migrations (version) VALUES ('93');
+
+INSERT INTO schema_migrations (version) VALUES ('94');
+
+INSERT INTO schema_migrations (version) VALUES ('95');
+
+INSERT INTO schema_migrations (version) VALUES ('96');
+
+INSERT INTO schema_migrations (version) VALUES ('97');
+
+INSERT INTO schema_migrations (version) VALUES ('98');
+
+INSERT INTO schema_migrations (version) VALUES ('99');
+
+INSERT INTO schema_migrations (version) VALUES ('100');
+
+INSERT INTO schema_migrations (version) VALUES ('101');
+
+INSERT INTO schema_migrations (version) VALUES ('102');
+
+INSERT INTO schema_migrations (version) VALUES ('103');
+
+INSERT INTO schema_migrations (version) VALUES ('104');
+
+INSERT INTO schema_migrations (version) VALUES ('105');
+
+INSERT INTO schema_migrations (version) VALUES ('106');
+
+INSERT INTO schema_migrations (version) VALUES ('107');
+
+INSERT INTO schema_migrations (version) VALUES ('108');
+
+INSERT INTO schema_migrations (version) VALUES ('109');
+
+INSERT INTO schema_migrations (version) VALUES ('110');
+
+INSERT INTO schema_migrations (version) VALUES ('111');
+
+INSERT INTO schema_migrations (version) VALUES ('112');
+
+INSERT INTO schema_migrations (version) VALUES ('113');
+
+INSERT INTO schema_migrations (version) VALUES ('114');
+
+INSERT INTO schema_migrations (version) VALUES ('115');
+
+INSERT INTO schema_migrations (version) VALUES ('116');
+
+INSERT INTO schema_migrations (version) VALUES ('117');
+
+INSERT INTO schema_migrations (version) VALUES ('118');
+
+INSERT INTO schema_migrations (version) VALUES ('20120822145640');
+
+INSERT INTO schema_migrations (version) VALUES ('20120910153022');
+
+INSERT INTO schema_migrations (version) VALUES ('20120912111713');
+
+INSERT INTO schema_migrations (version) VALUES ('20120912112036');
+
+INSERT INTO schema_migrations (version) VALUES ('20120912112312');
+
+INSERT INTO schema_migrations (version) VALUES ('20120912112655');
+
+INSERT INTO schema_migrations (version) VALUES ('20120912113004');
+
+INSERT INTO schema_migrations (version) VALUES ('20120912113720');
+
+INSERT INTO schema_migrations (version) VALUES ('20120912114022');
+
+INSERT INTO schema_migrations (version) VALUES ('20120912170035');
+
+INSERT INTO schema_migrations (version) VALUES ('20120913074940');
+
+INSERT INTO schema_migrations (version) VALUES ('20120913080807');
+
+INSERT INTO schema_migrations (version) VALUES ('20120913081136');
+
+INSERT INTO schema_migrations (version) VALUES ('20120913135745');
+
+INSERT INTO schema_migrations (version) VALUES ('20120919140404');
+
+INSERT INTO schema_migrations (version) VALUES ('20121010214348');
+
+INSERT INTO schema_migrations (version) VALUES ('20121022031914'); \ No newline at end of file
diff --git a/doc/ADMIN.md b/doc/ADMIN.md
new file mode 100644
index 000000000..059010e68
--- /dev/null
+++ b/doc/ADMIN.md
@@ -0,0 +1,21 @@
+Doing development work on the administration interface
+======================================================
+
+The Alaveteli admin interface uses Twitter's Bootstrap project to prettify it.
+
+If you want to work on the CSS, you'll want to use
+[bootstrap-sass](https://github.com/thomas-mcdonald/bootstrap-sass). Do something like:
+
+
+ $ gem install bootstrap-sass
+ $ gem install compass
+ $ compass compile --config .compass/config.rb
+
+The javascript is included in a funky way
+[for reasons explained in this commit](https://github.com/sebbacon/adminbootstraptheme/commit/45a73d53fc9e8f0b728933ff58764bd8d0612dab).
+To change it, edit the coffeescript at
+`lib/view/general/admin.coffee`, and then do something like:
+
+ $ coffee -o /tmp/ -c lib/views/general/admin.coffee
+ $ mv /tmp/admin.js lib/views/general/admin_js.erb
+
diff --git a/doc/CHANGES.md b/doc/CHANGES.md
index 2c8692bb5..59c2d3f37 100644
--- a/doc/CHANGES.md
+++ b/doc/CHANGES.md
@@ -1,11 +1,24 @@
+# Version 0.7
+## Highlighted features
+* [Security] Upgrades the Rails version from 2.3.15 to 2.3.16 to get fix for a critical security flaw in Rails (CVE-2013-0333).
+* Adds rails_xss gem to make HTML escaping the default behaviour in views.
+* Allows cap rake:themes:install to be run standalone and in the context of a deploy.
+* Gem bundle is always installed in the vendor directory, even in development mode.
+* Interlock plugin removed.
+* Models have named validation methods, and don't overwrite validate anymore.
+
+## Upgrade notes
+* Check out this version and run `rails-post-deploy` as usual.
+* Check your themes for any strings that are now being escaped but shouldn't be and either use raw or .html_safe to resolve them. Don't do this with strings from user input!
+
# Version 0.6.9
## Highlighted features
* [Security] Fix for security issue where image files from HTML conversion on hidden/requester-only requests were accessible without authentication [issue #739](https://github.com/mysociety/alaveteli/issues/739).
* [Security] Fix for issue where the zip file download function was available for logged-in users even on hidden/requester-only requests [issue #743](https://github.com/mysociety/alaveteli/issues/743)
* [Security] Upgrades to Rails 2.3.15 to get fixes for Rails security flaws CVE-2012-5664 and CVE-2013-0156. In addition, switches to use Rails pulled from a clone in the mySociety github account, which has had the CVE-2013-0155 2.3 series patch applied to it.
-* Isolation of mail handling code in the MailHandler module in lib/mail_handler
-* Tests run under Ruby 1.9.3 - *running the app under 1.9 not yet advised*.
-* Routes without a locale part can be enabled for the default locale - see upgrade notes
+* Isolation of mail handling code in the MailHandler module in lib/mail_handler
+* Tests run under Ruby 1.9.3 - *running the app under 1.9 not yet advised*.
+* Routes without a locale part can be enabled for the default locale - see upgrade notes
* Fixes to support themed error pages, and allow responsive themes (Matthew Landauer, Brendan Molloy)
* Migrations run under sqlite (Stefan Langenmaier)
* Time zone fixes (Henare Degan)
@@ -15,7 +28,7 @@
## Upgrade notes
* Note the new config variable INCLUDE_DEFAULT_LOCALE_IN_URLS (if not set defaults to true, which should replicate existing behaviour)
-* Check out this version and run `rails-post-deploy` as usual.
+* Check out this version and run `rails-post-deploy` as usual.
# Version 0.6.8
## Highlighted features
@@ -36,10 +49,10 @@
* TIME_ZONE (if not set, defaults to UTC)
* TWITTER_WIDGET_ID (no Twitter widget is displayed if not set)
* THEME_BRANCH (defaults to tagged version specific to your version of alaveteli or, failing that, to master)
- * MTA_LOG_PATH
+ * MTA_LOG_PATH
* MTA_LOG_TYPE (defaults to Exim)
* IMPORTANT - Copy config/newrelic.yml-example to config/newrelic.yml - by default monitoring is switched off, see https://github.com/newrelic/rpm for instructions on switching on local and remote performance analysis.
-* Check out this version and run `rails-post-deploy` as usual.
+* Check out this version and run `rails-post-deploy` as usual.
* Note that mailcatcher is now used in development - see http://mailcatcher.me/ for details
# Version 0.6.7
@@ -56,7 +69,7 @@
## Upgrade notes
* Themes created for 0.6.6 and below should be updated to use the new Configuration module wherever they used Config.get directly previously.
-* Check out this version and run `rails-post-deploy` as usual.
+* Check out this version and run `rails-post-deploy` as usual.
# Version 0.6.6
@@ -68,13 +81,13 @@
## Upgrade notes
-* Check out this version and run `rails-post-deploy` as usual.
-* Run `rake temp:populate_request_classifications` to populate the new request_classifications table which is used in generating the request categorisation game league tables and progress widget.
+* Check out this version and run `rails-post-deploy` as usual.
+* Run `rake temp:populate_request_classifications` to populate the new request_classifications table which is used in generating the request categorisation game league tables and progress widget.
# Version 0.6.5
-* This is a minor release, to update all documentation and example files to reflect the move of the official repository to http://github.com/mysociety/alaveteli and the alavetelitheme and adminbootstraptheme themes to http://github.com/mysociety/alavetelitheme and http://github.com/mysociety/adminbootstraptheme respectively.
-* Some basic versioning has been added for themes. An ALAVETELI_VERSION constant has been added in config/environment.rb. When loading themes, `rails-post-deploy` now looks for a tag on the theme repository in the form 'use-with-alaveteli-0.6.5' that matches the ALAVETELI_VERSION being deployed - if it finds such a tag, the theme will be checked out from that tag, rather than from the HEAD of the theme repository. If no such tag is found, HEAD is used, as before [issue #573](https://github.com/mysociety/alaveteli/issues/573).
-* Apache has been configured to serve cached HTML versions of attached files (and associated images) directly from the file cache, as well as the original versions [issue #580](https://github.com/mysociety/alaveteli/issues/580).
+* This is a minor release, to update all documentation and example files to reflect the move of the official repository to http://github.com/mysociety/alaveteli and the alavetelitheme and adminbootstraptheme themes to http://github.com/mysociety/alavetelitheme and http://github.com/mysociety/adminbootstraptheme respectively.
+* Some basic versioning has been added for themes. An ALAVETELI_VERSION constant has been added in config/environment.rb. When loading themes, `rails-post-deploy` now looks for a tag on the theme repository in the form 'use-with-alaveteli-0.6.5' that matches the ALAVETELI_VERSION being deployed - if it finds such a tag, the theme will be checked out from that tag, rather than from the HEAD of the theme repository. If no such tag is found, HEAD is used, as before [issue #573](https://github.com/mysociety/alaveteli/issues/573).
+* Apache has been configured to serve cached HTML versions of attached files (and associated images) directly from the file cache, as well as the original versions [issue #580](https://github.com/mysociety/alaveteli/issues/580).
* PublicBodyCategories have a couple of new methods for more easily working with headings [issue #575](https://github.com/mysociety/alaveteli/issues/575).
* [List of issues on github](https://github.com/mysociety/alaveteli/issues?milestone=21&state=closed)
@@ -84,10 +97,10 @@
* Please update your `THEME_URLS` to point to http://github.com/mysociety/alavetelitheme and http://github.com/mysociety/adminbootstraptheme if you are using the alavetelitheme or adminbootstraptheme themes.
* Check out this version and run `rails-post-deploy` as usual.
-
+
# Version 0.6.4
## Highlighted features
-* This is a minor bugfix release, mainly to fix bugs related to external request handling.
+* This is a minor bugfix release, mainly to fix bugs related to external request handling.
* [List of issues on github](https://github.com/mysociety/alaveteli/issues?milestone=18&state=closed)
* [List of commits since last release](https://github.com/mysociety/alaveteli/compare/master...release/0.6.4)
@@ -152,7 +165,7 @@
* Support for invalidating accelerator cache -- this makes it much
less likely, when using Varnish, that users will be presented with
stale content. Fixes
-
+
* Adding a `GA_CODE` to `general.yml` will cause the relevant Google
Analytics code to be added to your rendered pages
* It is now possible to have more than one theme installed. The
@@ -184,7 +197,7 @@
should be installed has changed. On Debian, you can run:
sudo apt-get install `cut -d " " -f 1 config/packages | grep -v "^#"`
-
+
[This gist](https://gist.github.com/2584766) shows the changes to
`config/packages` since the previous release.
@@ -217,7 +230,7 @@
`general.yml`) is now known as the "emergency user". Deployments
that previously bypassed admin authentication should set the new
`SKIP_ADMIN_AUTH` config variable to `true`.
-
+
* If you want to try out the new administrator theme, copy the sample
`THEME_URLS` config from `general.yml-example` and run
`./script/rails-post-deploy`. If you don't like it, turn it off
@@ -225,7 +238,7 @@
(`adminbootstraptheme`) -- but email the mailing list first,
explaining why! The intention is to merge this theme into the
Alaveteli core in a future release.
-
+
* If you are already using Google Analytics, you are probably
including the tracking code manually in your theme. If you'd like
to use Alaveteli's support for Google Analytics, set the `GA_CODE`
@@ -254,7 +267,7 @@ in 0.5, which was causing deployment problems:
production environments
* It should now be safe to run `rake spec` on a production server
-There is one minor new feature in this release:
+There is one minor new feature in this release:
* Administrators can follow the auto-login URLs forwarded in emails
from users who want support, and they will remain logged in as
@@ -275,9 +288,9 @@ As usual, there is a [full list of changes on github](https://github.com/mysocie
# Version 0.5
## Highlighted features
-* It should now be possible to develop the software on OSX
+* It should now be possible to develop the software on OSX
* Base design refactored: CSS simplified and reduced, base design colours removed, now provided in example Alaveteli theme override
-* It is now possible to rebuild the xapian index for specific terms, rather than having to drop and rebuild the entire database every time (as previously). See rake xapian:rebuild_index for more info.
+* It is now possible to rebuild the xapian index for specific terms, rather than having to drop and rebuild the entire database every time (as previously). See rake xapian:rebuild_index for more info.
* When listing authorities, show all authorities in default locale, rather than only those in the currently selected locale.
* Ensure incoming emails are only ever parsed once (should give a performance boost)
* Added a simple rate-limiting feature: restrict the number of requests users can make per day, except if explicitly unrestricted in the admin interface
diff --git a/doc/INSTALL.md b/doc/INSTALL.md
index fc571b990..b9e2c6cb1 100644
--- a/doc/INSTALL.md
+++ b/doc/INSTALL.md
@@ -370,6 +370,34 @@ Under all but light loads, it is strongly recommended to run the
server behind an http accelerator like Varnish. A sample varnish VCL
is supplied in `../conf/varnish-alaveteli.vcl`.
+It's strongly recommended that you run the site over SSL. (Set FORCE_SSL to true in
+config/general.yml). For this you will need an SSL certificate for your domain and you will
+need to configure an SSL terminator to sit in front of Varnish. If you're already using Apache
+as a web server you could simply use Apache as the SSL terminator. A minimal configuration
+would look something like this:
+
+<VirtualHost *:443>
+ ServerName www.yourdomain
+
+ ProxyRequests Off
+ ProxyPreserveHost On
+ ProxyPass / http://localhost:80/
+ ProxyPassReverse / http://localhost:80/
+ RequestHeader set X-Forwarded-Proto 'https'
+
+ SSLEngine on
+ SSLProtocol all -SSLv2
+ SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
+
+ SSLCertificateFile /etc/apache2/ssl/ssl.crt
+ SSLCertificateKeyFile /etc/apache2/ssl/ssl.key
+ SSLCertificateChainFile /etc/apache2/ssl/sub.class2.server.ca.pem
+ SSLCACertificateFile /etc/apache2/ssl/ca.pem
+ SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
+</VirtualHost>
+
+Notice the line "RequestHeader" that sets the X_FORWARDED_PROTO header. This is important. This ultimately tells Rails that it's serving a page over https and so it knows to include that in any absolute urls it serves.
+
Some
[production server best practice notes](https://github.com/mysociety/alaveteli/wiki/Production-Server-Best-Practices)
are evolving on the wiki.
diff --git a/lib/ability.rb b/lib/ability.rb
new file mode 100644
index 000000000..2865ccb1c
--- /dev/null
+++ b/lib/ability.rb
@@ -0,0 +1,5 @@
+module Ability
+ def self.can_update_request_state?(user, request)
+ (user && request.is_old_unclassified?) || request.is_owning_user?(user)
+ end
+end \ No newline at end of file
diff --git a/lib/configuration.rb b/lib/configuration.rb
index 6d2bed66d..f76a1f533 100644
--- a/lib/configuration.rb
+++ b/lib/configuration.rb
@@ -14,9 +14,7 @@ MySociety::Config.load_default
module AlaveteliConfiguration
DEFAULTS = {
- :ADMIN_BASE_URL => '',
:ADMIN_PASSWORD => '',
- :ADMIN_PUBLIC_URL => '',
:ADMIN_USERNAME => '',
:AVAILABLE_LOCALES => '',
:BLACKHOLE_PREFIX => 'do-not-reply-to-this-address',
@@ -30,6 +28,7 @@ module AlaveteliConfiguration
:EXCEPTION_NOTIFICATIONS_FROM => '',
:EXCEPTION_NOTIFICATIONS_TO => '',
:FORCE_REGISTRATION_ON_NEW_REQUEST => false,
+ :FORCE_SSL => true,
:FORWARD_NONBOUNCE_RESPONSES_TO => 'user-support@localhost',
:FRONTPAGE_PUBLICBODY_EXAMPLES => '',
:GA_CODE => '',
diff --git a/lib/cookie_store_with_line_break_fix.rb b/lib/cookie_store_with_line_break_fix.rb
new file mode 100644
index 000000000..dc623fbd0
--- /dev/null
+++ b/lib/cookie_store_with_line_break_fix.rb
@@ -0,0 +1,19 @@
+# See https://makandracards.com/makandra/9443-rails-2-s-cookiestore-produces-invalid-cookie-data-causing-tests-to-break
+
+# Should be able to remove this when we upgrade to Rails 3
+
+module ActionController
+ module Session
+ CookieStore.class_eval do
+
+ def call_with_line_break_fix(*args)
+ status, headers, body = call_without_line_break_fix(*args)
+ headers['Set-Cookie'].gsub! "\n\n", "\n" if headers['Set-Cookie'].present?
+ [ status, headers, body ]
+ end
+
+ alias_method_chain :call, :line_break_fix
+
+ end
+ end
+end \ No newline at end of file
diff --git a/lib/make_html_4_compliant.rb b/lib/make_html_4_compliant.rb
deleted file mode 100644
index 8926d5873..000000000
--- a/lib/make_html_4_compliant.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# Monkeypatch! Output HTML 4.0 compliant code, using method described in this
-# ticket: http://dev.rubyonrails.org/ticket/6009
-
-ActionView::Helpers::TagHelper.module_eval do
- def tag(name, options = nil, open = false, escape = true)
- "<#{name}#{tag_options(options, escape) if options}#{open ? ">" : ">"}".html_safe
- end
-end
diff --git a/locale/he_IL/app.po b/locale/he_IL/app.po
index 1334294f3..88ecdb4c6 100644
--- a/locale/he_IL/app.po
+++ b/locale/he_IL/app.po
@@ -3,13 +3,16 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# Nir Hirshman <nirshman99@gmail.com>, 2013.
# Ram Ezrach <ram.ezrach@gmail.com>, 2013.
+# <r@roishlomi.com>, 2013.
+# Yair Uziel <yair.uziel@gmail.com>, 2013.
msgid ""
msgstr ""
"Project-Id-Version: alaveteli\n"
"Report-Msgid-Bugs-To: http://github.com/sebbacon/alaveteli/issues\n"
"POT-Creation-Date: 2012-12-18 10:11+0000\n"
-"PO-Revision-Date: 2013-02-08 16:17+0000\n"
+"PO-Revision-Date: 2013-02-13 19:08+0000\n"
"Last-Translator: Ram Ezrach <ram.ezrach@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: he_IL\n"
@@ -34,10 +37,10 @@ msgid " - view and make Freedom of Information requests"
msgstr "- צפו ומלאו בקשות על-פי חוק חופש המידע"
msgid " - wall"
-msgstr ""
+msgstr " - קיר"
msgid " <strong>Note:</strong>\\n We will send you an email. Follow the instructions in it to change\\n your password."
-msgstr ""
+msgstr " <strong>הערה:<strong/>/n בקרוב יישלח אליך מייל. עקוב אחר ההוראות המצויות בו על מנת לשנות n\\את הסיסמא שלך."
msgid " <strong>Privacy note:</strong> Your email address will be given to"
msgstr " <strong>הערה לגבי פרטיות:</strong> כתובת הדוא\"ל שלכם תועבר"
@@ -61,85 +64,85 @@ msgid " Link to the information requested, if it is <strong>already available</s
msgstr " קישור לבקשת מידע אם <strong>היא כבר קיימת</strong> באינטרנט. "
msgid " Offer better ways of <strong>wording the request</strong> to get the information. "
-msgstr ""
+msgstr " מציע דרכים טובות יותר<strong>לניסוח הבקשה</strong> לקבלת המידע. "
msgid " Say how you've <strong>used the information</strong>, with links if possible."
-msgstr ""
+msgstr " ספרו איך <strong>השתמשתם במידע, </strong>עם קישורים, אם אפשר."
msgid " Suggest <strong>where else</strong> the requester might find the information. "
-msgstr ""
+msgstr " הציעו <strong>איפה עוד</strong> מגיש הבקשה יוכל למצוא עוד מידע. "
msgid " What are you investigating using Freedom of Information? "
-msgstr ""
+msgstr "מה אתה מבקש לחקור, באמצעות הבקשה תחת חוק חופש המידע?"
msgid " You are already being emailed updates about the request."
-msgstr ""
+msgstr "כתובת הדוא\"ל שלך כבר רשומה לקבלת עדכונים על הבקשה"
msgid " You will also be emailed updates about the request."
-msgstr ""
+msgstr "תקבל גם עדכונים בדוא\"ל על הבקשה"
msgid " made by "
-msgstr ""
+msgstr "נוצר על-ידי"
msgid " or "
-msgstr ""
+msgstr "או "
msgid " when you send this message."
-msgstr ""
+msgstr "כאשר אתם שולחים הודעה זו"
msgid "\"Hello! We have an <a href=\\\"/help/alaveteli?country_name=#{CGI.escape(current_country)}\\\">important message</a> for visitors outside {{country_name}}\""
msgstr ""
msgid "%d Freedom of Information request to %s"
msgid_plural "%d Freedom of Information requests to %s"
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "%d בקשת תחת חוק חופש המידע עבור %s"
+msgstr[1] "%d בקשות תחת חוק חופש המידע עבור %s"
msgid "%d request"
msgid_plural "%d requests"
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "%d בקשה"
+msgstr[1] "%d בקשות"
msgid "%d request made."
msgid_plural "%d requests made."
-msgstr[0] ""
-msgstr[1] ""
+msgstr[0] "%d הבקשה נמסרה."
+msgstr[1] "%d הבקשות נמסרו."
msgid "'Crime statistics by ward level for Wales'"
-msgstr ""
+msgstr "'סטטיסטיקות פשע ברמה מילולית על וויילס'"
msgid "'Pollution levels over time for the River Tyne'"
-msgstr ""
+msgstr "'רמות זיהום לאורך זמן לנהר Tyne'"
msgid "'{{link_to_authority}}', a public authority"
-msgstr ""
+msgstr "'{{link_to_authority}}', רשות ציבורית"
msgid "'{{link_to_request}}', a request"
-msgstr ""
+msgstr "'{{link_to_request}}', בקשה"
msgid "'{{link_to_user}}', a person"
-msgstr ""
+msgstr "'{{link_to_user}}', אדם"
msgid ",\\n\\n\\n\\nYours,\\n\\n{{user_name}}"
msgstr ""
msgid "- or -"
-msgstr ""
+msgstr "- או -"
msgid "1. Select an authority"
-msgstr ""
+msgstr "1. בחר רשות"
msgid "2. Ask for Information"
-msgstr ""
+msgstr "2. בקש מידע"
msgid "3. Now check your request"
-msgstr ""
+msgstr "3. עתה בדוק את בקשתך"
msgid "<a class=\"link_button_green\" href=\"{{url}}\">{{text}}</a>"
-msgstr ""
+msgstr "<a class=\"link_button_green\" href=\"{{url}}\">{{text}}</a>"
msgid "<a href=\"%s\">Add an annotation</a> (to help the requester or others)"
-msgstr ""
+msgstr "<a href=\"%s\">הוסף הסברים</a> (כדי לסייע למגיש הבקשה או אחרים)"
msgid "<a href=\"%s\">Are we missing a public authority?</a>"
msgstr ""
@@ -148,40 +151,40 @@ msgid "<a href=\"%s\">Are you the owner of\\n any commercial copyrigh
msgstr ""
msgid "<a href=\"%s\">Browse all</a> or <a href=\"%s\">ask us to add one</a>."
-msgstr ""
+msgstr "<a href=\"%s\">גלוש לכולם</a> או <a href=\"%s\">בקש מאיתנו להוסיף אחד</a>."
msgid "<a href=\"%s\">Can't find the one you want?</a>"
-msgstr ""
+msgstr "<a href=\"%s\">לא מוצאים את מה שאתם מחפשים?</a>"
msgid "<a href=\"%s\">Sign in</a> to change password, subscriptions and more ({{user_name}} only)"
-msgstr ""
+msgstr "<a href=\"%s\">היכנסו</a> לשנות סיסמה, מנוי, ועוד. ({{user_name}} only)"
msgid "<a href=\"%s\">details</a>"
-msgstr ""
+msgstr "<a href=\"%s\">פרטים</a>"
msgid "<a href=\"%s\">what's that?</a>"
-msgstr ""
+msgstr "<a href=\"%s\">מה זה?</a>"
msgid "<p>All done! Thank you very much for your help.</p><p>There are <a href=\"{{helpus_url}}\">more things you can do</a> to help {{site_name}}.</p>"
-msgstr ""
+msgstr "<p>הסתיים! תודה על הסיוע שלכם</p><p>ישנם <a href=\"{{helpus_url}}\">עוד דברים שתוכלו לעשות</a> כדי לעזור {{site_name}}.</p>"
msgid "<p>Thank you! Here are some ideas on what to do next:</p>\\n <ul>\\n <li>To send your request to another authority, first copy the text of your request below, then <a href=\"{{find_authority_url}}\">find the other authority</a>.</li>\\n <li>If you would like to contest the authority's claim that they do not hold the information, here is\\n <a href=\"{{complain_url}}\">how to complain</a>.\\n </li>\\n <li>We have <a href=\"{{other_means_url}}\">suggestions</a>\\n on other means to answer your question.\\n </li>\\n </ul>"
msgstr ""
msgid "<p>Thank you! Hope you don't have to wait much longer.</p> <p>By law, you should have got a response promptly, and normally before the end of <strong>{{date_response_required_by}}</strong>.</p>"
-msgstr ""
+msgstr "<p>תודה רבה! אנו מקווים שהממתנה תהיה קצרה.</p> <p>על-פי החוק, הייתם אמורים לקבל תגובה מייד, לרוב לפני ה- <strong>{{date_response_required_by}}</strong>.</p>"
msgid "<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response promptly, and normally before the end of <strong>\\n{{date_response_required_by}}</strong>.</p>"
msgstr ""
msgid "<p>Thank you! Hopefully your wait isn't too long.</p><p>You should get a response within {{late_number_of_days}} days, or be told if it will take longer (<a href=\"{{review_url}}\">details</a>).</p>"
-msgstr ""
+msgstr "<p>תודה לכם! אנו מקווים שלא המתנתם זמן רב. </p><p>התגובה אמורה להגיע תוך {{late_number_of_days}} ימים, או שתקבלו הודעה על דחיית מועד קבלת התשובה (<a href=\"{{review_url}}\">פרטים</a>).</p>"
msgid "<p>Thank you! We'll look into what happened and try and fix it up.</p><p>If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.</p>"
-msgstr ""
+msgstr "<p>תודה לכם! נבדוק מה קרה וננסה לטפל בכך. </p><p>אם היתה תקלה במסירה ואתם יכולים למצוא כתובת דוא\"ל FOI עדכנית לרשות, נא הודיעו לנו באמצעות הטופס למטה.</p>"
msgid "<p>Thank you! Your request is long overdue, by more than {{very_late_number_of_days}} working days. Most requests should be answered within {{late_number_of_days}} working days. You might like to complain about this, see below.</p>"
-msgstr ""
+msgstr "<p>תודה לכם! בקשתכם היתה צריכה להענותת כבר לפני {{very_late_number_of_days}} ימי עבודה. רוב הבקשות נענות תוך {{late_number_of_days}} ימי עבודה. ייתכן ותרצו להגיש תלונה באמצעות הטופס למטה.</p>"
msgid "<p>Thanks for changing the text about you on your profile.</p>\\n <p><strong>Next...</strong> You can upload a profile photograph too.</p>"
msgstr ""
@@ -193,25 +196,25 @@ msgid "<p>We recommend that you edit your request and remove the email address.\
msgstr ""
msgid "<p>We're glad you got all the information that you wanted. If you write about or make use of the information, please come back and add an annotation below saying what you did.</p><p>If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p>"
-msgstr ""
+msgstr "<p>אנו שמחים שקיבלתם את המידע שביקשתם. אם אתם כותבים על המידע או משתמשים בו, נא חזרו לדף זה והוסיפו למטה הערה על מה שעשיתם. </p><p>אם מצאתם את {{site_name}}שימושי, <a href=\"{{donation_url}}\">הרימו תרומה</a> לגוף שמפעיל אותו.</p>"
msgid "<p>We're glad you got some of the information that you wanted. If you found {{site_name}} useful, <a href=\"{{donation_url}}\">make a donation</a> to the charity which runs it.</p><p>If you want to try and get the rest of the information, here's what to do now.</p>"
-msgstr ""
+msgstr "<p>אנו שמחים שקיבלתם חלק מהמידע שביקשתם. אם מצאתם את {{site_name}} שימושי, <a href=\"{{donation_url}}\">הרימו תרומה</a> לגוף שמפעיל אותו.</p><p>אם אתם רוצים לנסות לקבל את שאר המידע, הנה מה שעליכם לעשות כעת.</p>"
msgid "<p>You do not need to include your email in the request in order to get a reply (<a href=\"%s\">details</a>).</p>"
-msgstr ""
+msgstr "<p>אין צורך לכלול את כתובת הדוא\"ל שלכם בבקשה, כדי לקבל מענה. (<a href=\"%s\">details</a>).</p>"
msgid "<p>You do not need to include your email in the request in order to get a reply, as we will ask for it on the next screen (<a href=\"%s\">details</a>).</p>"
-msgstr ""
+msgstr "<p>אין צורך לכלול את כתובת הדוא\"ל שלכם בבקשה, כדי לקבל מענה, כי בדף הבא תמסרו אותה. (<a href=\"%s\">details</a>).</p>"
msgid "<p>Your request contains a <strong>postcode</strong>. Unless it directly relates to the subject of your request, please remove any address as it will <strong>appear publicly on the Internet</strong>.</p>"
-msgstr ""
+msgstr "<p>הבקשה שלכם מכילה <strong>מספר מיקוד</strong>. אם המיקוד אינו קשור ישירות לנושא הבקשה, נא מיחקו אותו, כי הוא יופיע<strong>בצורה גלויה באינטרנט</strong>.</p>"
msgid "<p>Your {{law_used_full}} request has been <strong>sent on its way</strong>!</p>\\n <p><strong>We will email you</strong> when there is a response, or after {{late_number_of_days}} working days if the authority still hasn't\\n replied by then.</p>\\n <p>If you write about this request (for example in a forum or a blog) please link to this page, and add an\\n annotation below telling people about your writing.</p>"
msgstr ""
msgid "<p>{{site_name}} is currently in maintenance. You can only view existing requests. You cannot make new ones, add followups or annotations, or otherwise change the database.</p> <p>{{read_only}}</p>"
-msgstr ""
+msgstr "<p>{{site_name}} נמצא כעת בתחזוקה. ניתן לצפות בבקשות בלבד. לא ניתן להגיש בקשות חדשות, לעקוב או להעיר, או לעשות כל שינוי במידע באתר.</p> <p>{{read_only}}</p>"
msgid "<small>If you use web-based email or have \"junk mail\" filters, also check your\\nbulk/spam mail folders. Sometimes, our messages are marked that way.</small>\\n</p>"
msgstr ""
@@ -225,43 +228,43 @@ msgid "<strong> Can I request information about myself?</strong>\\n\t\t\t<a href
msgstr ""
msgid "<strong><code>commented_by:tony_bowden</code></strong> to search annotations made by Tony Bowden, typing the name as in the URL."
-msgstr ""
+msgstr "<strong><code>הערה_על-ידי:גיל_ללוש</code></strong>כדי לחפש הערות של גיל ללוש, הכניסו את השם כמו בכתובת אינטרנט."
msgid "<strong><code>filetype:pdf</code></strong> to find all responses with PDF attachments. Or try these: <code>{{list_of_file_extensions}}</code>"
-msgstr ""
+msgstr "<strong><code>filetype:pdf</code></strong>כדי למצוא את כל התגובות שמצורף אליהן קובץ PDF, או נסו את אלה: <code>{{list_of_file_extensions}}</code>"
msgid "<strong><code>request:</code></strong> to restrict to a specific request, typing the title as in the URL."
-msgstr ""
+msgstr "<strong><code>בקשה:</code></strong>להגביל לבקשה מסויימת, מכניסים את הכותרת ככתובת אינטרנט."
msgid "<strong><code>requested_by:julian_todd</code></strong> to search requests made by Julian Todd, typing the name as in the URL."
-msgstr ""
+msgstr "<strong><code>התבקש_על-ידי: XXX_YYY</code></strong>לחיפוש בקשות שהגיש ,XXX_YYY יש להכניס את השם ככתובת אינטרנט."
msgid "<strong><code>requested_from:home_office</code></strong> to search requests from the Home Office, typing the name as in the URL."
-msgstr ""
+msgstr "<strong><code>בקשה_על-ידי: משרד_הפנים</code></strong> לחיפוש בקשות שהוגשו על-ידי משרד הפנים, יש להכניס את השם ככתובת אינטרנט."
msgid "<strong><code>status:</code></strong> to select based on the status or historical status of the request, see the <a href=\"{{statuses_url}}\">table of statuses</a> below."
-msgstr ""
+msgstr "<strong><code>מצב:</code></strong> לחיפוש המבוסס על מצב (סטטוס) הבקשה או הסטוריית המצבים שלה, ראו <a href=\"{{statuses_url}}\">את טבלת המצבים</a> למטה."
msgid "<strong><code>tag:charity</code></strong> to find all public authorities or requests with a given tag. You can include multiple tags, \\n and tag values, e.g. <code>tag:openlylocal AND tag:financial_transaction:335633</code>. Note that by default any of the tags\\n can be present, you have to put <code>AND</code> explicitly if you only want results them all present."
msgstr ""
msgid "<strong><code>variety:</code></strong> to select type of thing to search for, see the <a href=\"{{varieties_url}}\">table of varieties</a> below."
-msgstr ""
+msgstr "<strong><code>סוגים:</code></strong> לבחירת סוג החיפוש, ראו <a href=\"{{varieties_url}}\">את טבלת סוגי החיפוש</a> below."
msgid "<strong>Advice</strong> on how to get a response that will satisfy the requester. </li>"
-msgstr ""
+msgstr "<strong>עצה</strong> כיצד לקבל תגובה שתספק את המבקש. </li>"
msgid "<strong>All the information</strong> has been sent"
-msgstr ""
+msgstr "<strong>כל המידע</strong> נשלח"
msgid "<strong>Anything else</strong>, such as clarifying, prompting, thanking"
-msgstr ""
+msgstr "<strong>כל דבר אחר,</strong>, כמו להבהיר, לעודד, להודות"
msgid "<strong>Caveat emptor!</strong> To use this data in an honourable way, you will need \\na good internal knowledge of user behaviour on {{site_name}}. How, \\nwhy and by whom requests are categorised is not straightforward, and there will\\nbe user error and ambiguity. You will also need to understand FOI law, and the\\nway authorities use it. Plus you'll need to be an elite statistician. Please\\n<a href=\"{{contact_path}}\">contact us</a> with questions."
msgstr ""
msgid "<strong>Clarification</strong> has been requested"
-msgstr ""
+msgstr "הוגשה בקשה <strong>להבהרה</strong> "
msgid "<strong>No response</strong> has been received\\n <small>(maybe there's just an acknowledgement)</small>"
msgstr ""
@@ -285,13 +288,13 @@ msgid "<strong>Privacy warning:</strong> Your message, and any response\\n
msgstr ""
msgid "<strong>Some of the information</strong> has been sent "
-msgstr ""
+msgstr "<strong>חלק מהמידע</strong> נשלח "
msgid "<strong>Thank</strong> the public authority or "
-msgstr ""
+msgstr "<strong>מסרו תודה</strong> לרשות הציבורית או "
msgid "<strong>did not have</strong> the information requested."
-msgstr ""
+msgstr "<strong>לא היה</strong>את המידע המבוקש."
msgid "A <a href=\"{{request_url}}\">follow up</a> to <em>{{request_title}}</em> was sent to {{public_body_name}} by {{info_request_user}} on {{date}}."
msgstr ""
@@ -300,52 +303,52 @@ msgid "A <a href=\"{{request_url}}\">response</a> to <em>{{request_title}}</em>
msgstr ""
msgid "A <strong>summary</strong> of the response if you have received it by post. "
-msgstr ""
+msgstr "<strong>סיכום</strong> התגובה, לו הייתם מקבלים אותה בפוסט. "
msgid "A Freedom of Information request"
-msgstr ""
+msgstr "בקשת חופש מידע"
msgid "A new request, <em><a href=\"{{request_url}}\">{{request_title}}</a></em>, was sent to {{public_body_name}} by {{info_request_user}} on {{date}}."
msgstr ""
msgid "A public authority"
-msgstr ""
+msgstr "רשות ציבורית"
msgid "A response will be sent <strong>by post</strong>"
-msgstr ""
+msgstr "תשובה תשלח <strong>ע\"י רשומה</strong>"
msgid "A strange reponse, required attention by the {{site_name}} team"
-msgstr ""
+msgstr "תגובה מוזרה, נדרשת תשומת לב של צוות {{site_name}}"
msgid "A {{site_name}} user"
-msgstr ""
+msgstr "משתמש {{site_name}} "
msgid "About you:"
-msgstr ""
+msgstr "אודותיך:"
msgid "Act on what you've learnt"
-msgstr ""
+msgstr "פעל לפי מה שלמדת"
msgid "Add an annotation"
-msgstr ""
+msgstr "הוסיפו הערה"
msgid "Add an annotation to your request with choice quotes, or\\n a <strong>summary of the response</strong>."
msgstr ""
msgid "Added on {{date}}"
-msgstr ""
+msgstr "התווסף בתאריך {{date}}"
msgid "Admin level is not included in list"
-msgstr ""
+msgstr "הרשאת ניהול אינה כלולה ברשימה"
msgid "Administration URL:"
-msgstr ""
+msgstr "כתובת ניהול:"
msgid "Advanced search"
-msgstr ""
+msgstr "חיפוש מתקדם"
msgid "Advanced search tips"
-msgstr ""
+msgstr "טיפים לחיפוש מתקדם"
msgid "Advise on whether the <strong>refusal is legal</strong>, and how to complain about it if not."
msgstr ""
@@ -354,7 +357,7 @@ msgid "Air, water, soil, land, flora and fauna (including how these effect\\n
msgstr ""
msgid "All of the information requested has been received"
-msgstr ""
+msgstr "התקבל המידע הנדרש"
msgid "All the options below can use <strong>status</strong> or <strong>latest_status</strong> before the colon. For example, <strong>status:not_held</strong> will match requests which have <em>ever</em> been marked as not held; <strong>latest_status:not_held</strong> will match only requests that are <em>currently</em> marked as not held."
msgstr ""
@@ -363,13 +366,13 @@ msgid "All the options below can use <strong>variety</strong> or <strong>latest_
msgstr ""
msgid "Also called {{other_name}}."
-msgstr ""
+msgstr "גם נקרא {{other_name}}"
msgid "Also send me alerts by email"
msgstr ""
msgid "Alter your subscription"
-msgstr ""
+msgstr "לאחר ההרשמה שלכם"
msgid "Although all responses are automatically published, we depend on\\nyou, the original requester, to evaluate them."
msgstr ""
@@ -378,19 +381,19 @@ msgid "An <a href=\"{{request_url}}\">annotation</a> to <em>{{request_title}}</e
msgstr ""
msgid "An <strong>error message</strong> has been received"
-msgstr ""
+msgstr "התקבלה <strong>הודעת שגיאה</strong>"
msgid "An Environmental Information Regulations request"
msgstr ""
msgid "An anonymous user"
-msgstr ""
+msgstr "משתמש אנונימי"
msgid "Annotation added to request"
-msgstr ""
+msgstr "ההערה התווספה לדרישה"
msgid "Annotations"
-msgstr ""
+msgstr "הערות"
msgid "Annotations are so anyone, including you, can help the requester with their request. For example:"
msgstr ""
@@ -399,10 +402,10 @@ msgid "Annotations will be posted publicly here, and are\\n <strong>not</
msgstr ""
msgid "Anonymous user"
-msgstr ""
+msgstr "משתמש אנונימי"
msgid "Anyone:"
-msgstr ""
+msgstr "כל אחד:"
msgid "Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries."
msgstr ""
@@ -411,22 +414,22 @@ msgid "At the bottom of this page, write a reply to them trying to persuade them
msgstr ""
msgid "Attachment (optional):"
-msgstr ""
+msgstr "קובץ מצורף (לא חובה):"
msgid "Attachment:"
-msgstr ""
+msgstr "קובץ מצורף: "
msgid "Awaiting classification."
-msgstr ""
+msgstr "ממתין לסיווג."
msgid "Awaiting internal review."
-msgstr ""
+msgstr "ממתין לביקורת פנימית."
msgid "Awaiting response."
-msgstr ""
+msgstr "ממתין לתשובה."
msgid "Beginning with"
-msgstr ""
+msgstr "מתחיל עם"
msgid "Browse <a href='{{url}}'>other requests</a> for examples of how to word your request."
msgstr ""
@@ -435,25 +438,25 @@ msgid "Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for
msgstr ""
msgid "Browse all authorities..."
-msgstr ""
+msgstr "עיון בכל הרשויות..."
msgid "By law, under all circumstances, {{public_body_link}} should have responded by now"
-msgstr ""
+msgstr "לפי החוק, בכפוף לנסיבות, {{public_body_link}} היה צריך להשיב עד עתה"
msgid "By law, {{public_body_link}} should normally have responded <strong>promptly</strong> and"
msgstr ""
msgid "Cancel a {{site_name}} alert"
-msgstr ""
+msgstr "ביטול התראה מאתר {{site_name}}"
msgid "Cancel some {{site_name}} alerts"
-msgstr ""
+msgstr "בטלו חלק מהתראות האתר {{site_name}}"
msgid "Cancel, return to your profile page"
-msgstr ""
+msgstr "בטלו וחיזרו לעמוד הפרופיל שלכם"
msgid "Censor rule"
-msgstr ""
+msgstr "הוראת צנזורה"
msgid "CensorRule|Last edit comment"
msgstr ""
@@ -471,52 +474,52 @@ msgid "CensorRule|Text"
msgstr ""
msgid "Change email on {{site_name}}"
-msgstr ""
+msgstr "שנו דואר אלקטרוני לאתר {{site_name}}"
msgid "Change password on {{site_name}}"
-msgstr ""
+msgstr "שנו סיסמה לאתר {{site_name}}"
msgid "Change profile photo"
-msgstr ""
+msgstr "שנה תמונת פרופיל"
msgid "Change the text about you on your profile at {{site_name}}"
msgstr ""
msgid "Change your email"
-msgstr ""
+msgstr "בדקו את הדואר שלכם"
msgid "Change your email address used on {{site_name}}"
-msgstr ""
+msgstr "שנה את כתובת האימייל ב {{site_name}}"
msgid "Change your password"
-msgstr ""
+msgstr "שנה סיסמתך"
msgid "Change your password on {{site_name}}"
-msgstr ""
+msgstr "שנה סיסמתך ב {{site_name}}"
msgid "Change your password {{site_name}}"
-msgstr ""
+msgstr "שנה סיסמתך {{site_name}}"
msgid "Charity registration"
-msgstr ""
+msgstr "רישום צדקה"
msgid "Check for mistakes if you typed or copied the address."
-msgstr ""
+msgstr "אם הקלדתם או העתקתם את הכתובת תוכלו לבדוק טעויות"
msgid "Check you haven't included any <strong>personal information</strong>."
-msgstr ""
+msgstr "בדקו שלא כללתם כל <strong>מידע אישי</strong>."
msgid "Choose your profile photo"
-msgstr ""
+msgstr "בחרו את תמונת הפרופיל שלכם"
msgid "Clarification"
-msgstr ""
+msgstr "הבהרה"
msgid "Clarify your FOI request - "
msgstr ""
msgid "Classify an FOI response from "
-msgstr ""
+msgstr "קטלג בקשה לחוק חופש המידע מאת"
msgid "Clear photo"
msgstr ""
@@ -525,58 +528,58 @@ msgid "Click on the link below to send a message to {{public_body_name}} telling
msgstr ""
msgid "Click on the link below to send a message to {{public_body}} reminding them to reply to your request."
-msgstr ""
+msgstr "הקליקו על הלינק כדי לשלוח הודעה אל {{public_body}} כדי להזכיר לכם שהם צריכים להשיב לבקשה שלכם."
msgid "Close"
-msgstr ""
+msgstr "סגור"
msgid "Comment"
-msgstr ""
+msgstr "הערות"
msgid "Comment|Body"
-msgstr ""
+msgstr "הערה|גוף"
msgid "Comment|Comment type"
-msgstr ""
+msgstr "הערה|סוג הערה"
msgid "Comment|Locale"
-msgstr ""
+msgstr "הערה|התרחשות"
msgid "Comment|Visible"
-msgstr ""
+msgstr "הערה|גלוי"
msgid "Confirm you want to follow all successful FOI requests"
msgstr ""
msgid "Confirm you want to follow new requests"
-msgstr ""
+msgstr "אשרו שאתם רוצים לעקוב אחר בקשות חדשות"
msgid "Confirm you want to follow new requests or responses matching your search"
-msgstr ""
+msgstr "אשרו שאתם רוצים לעקוב אחר בקשות או תגובות חדשות שמתאימות לחיפוש שלכם"
msgid "Confirm you want to follow requests by '{{user_name}}'"
-msgstr ""
+msgstr "אשרו שאתם רוצים לעקוב אחר בקשות מאת '{{user_name}}'"
msgid "Confirm you want to follow requests to '{{public_body_name}}'"
msgstr ""
msgid "Confirm you want to follow the request '{{request_title}}'"
-msgstr ""
+msgstr "אשרו שאתם רוצים לעקוב אחר הבקשות '{{request_title}}'"
msgid "Confirm your FOI request to "
-msgstr ""
+msgstr "אשרו את הבקשה שלך לפי חוק חופש המידע"
msgid "Confirm your account on {{site_name}}"
-msgstr ""
+msgstr "אשרו את החשבון שלכם באתר {{site_name}}"
msgid "Confirm your annotation to {{info_request_title}}"
-msgstr ""
+msgstr "אשרו את ההערה שלכם אל {{info_request_title}}"
msgid "Confirm your email address"
-msgstr ""
+msgstr "אשרו את אימייל הדואר האלקטרוני שלכם"
msgid "Confirm your new email address on {{site_name}}"
-msgstr ""
+msgstr "אשרו את כתובת הדואר האלקטרוני שלכם באתר {{site_name}}"
msgid "Considered by administrators as not an FOI request and hidden from site."
msgstr ""
@@ -588,43 +591,43 @@ msgid "Contact {{recipient}}"
msgstr ""
msgid "Contact {{site_name}}"
-msgstr ""
+msgstr "צור קשר {{site_name}}"
msgid "Could not identify the request from the email address"
-msgstr ""
+msgstr "לא ניתן היה לזהות את הבקשה מכתובת הדואר האלקטרוני"
msgid "Couldn't understand the image file that you uploaded. PNG, JPEG, GIF and many other common image file formats are supported."
-msgstr ""
+msgstr "קובץ התמונה שהעלתם לא נתמך. ניתן להעלות קבצים בפורמט PNG, JPEG, GIF ועוד."
msgid "Crop your profile photo"
-msgstr ""
+msgstr "חתכו את תמונת הפרופיל שלכם"
msgid "Cultural sites and built structures (as they may be affected by the\\n environmental factors listed above)"
msgstr ""
msgid "Currently <strong>waiting for a response</strong> from {{public_body_link}}, they must respond promptly and"
-msgstr ""
+msgstr "ממתין <strong>לתגובה</strong>מ- {{public_body_link}}, הם חייבים להגיב מייד ו- promptly and"
msgid "Date:"
-msgstr ""
+msgstr "תאריך:"
msgid "Dear {{public_body_name}},"
-msgstr ""
+msgstr "{{public_body_name}} נכבד, "
msgid "Delayed response to your FOI request - "
msgstr ""
msgid "Delayed."
-msgstr ""
+msgstr "מעוכב."
msgid "Delivery error"
-msgstr ""
+msgstr "שגיאה בשליחה"
msgid "Details of request '"
-msgstr ""
+msgstr "פרטי הבקשה '"
msgid "Did you mean: {{correction}}"
-msgstr ""
+msgstr "האם התכוונתם: {{correction}}"
msgid "Disclaimer: This message and any reply that you make will be published on the internet. Our privacy and copyright policies:"
msgstr ""
@@ -636,43 +639,43 @@ msgid "Don't want to address your message to {{person_or_body}}? You can also w
msgstr ""
msgid "Done"
-msgstr ""
+msgstr "הסתיים"
msgid "Done &gt;&gt;"
-msgstr ""
+msgstr "בוצע &gt;&gt;"
msgid "Download a zip file of all correspondence"
-msgstr ""
+msgstr "הורידו "
msgid "Download original attachment"
-msgstr ""
+msgstr "הורד את המסמך המצורף המקורי"
msgid "EIR"
-msgstr ""
+msgstr "דוח מידע תקנות סביבתיות"
msgid "Edit and add <strong>more details</strong> to the message above,\\n explaining why you are dissatisfied with their response."
msgstr ""
msgid "Edit language version:"
-msgstr ""
+msgstr "ערוך גרסת שפה:"
msgid "Edit text about you"
-msgstr ""
+msgstr "ערוך את הטקסט אודותיך"
msgid "Edit this request"
-msgstr ""
+msgstr "ערוך את הבקשה"
msgid "Either the email or password was not recognised, please try again."
-msgstr ""
+msgstr "כתובת המייל או הסיסמא לא זוהו, אנא נסו שנית."
msgid "Either the email or password was not recognised, please try again. Or create a new account using the form on the right."
msgstr ""
msgid "Email doesn't look like a valid address"
-msgstr ""
+msgstr "כתובת הדואר האלקטרוני היא לא כתובת חוקית"
msgid "Email me future updates to this request"
-msgstr ""
+msgstr "שלחו לי עדכונים בדואר אלקטרוני לגבי הבקשה"
msgid "Enter words that you want to find separated by spaces, e.g. <strong>climbing lane</strong>"
msgstr ""
@@ -681,19 +684,19 @@ msgid "Enter your response below. You may attach one file (use email, or\\n <a
msgstr ""
msgid "Environmental Information Regulations"
-msgstr ""
+msgstr "מידע תקנות סביבתיות"
msgid "Environmental Information Regulations requests made"
-msgstr ""
+msgstr "בקשות לגבי מידע תקנות סביבתיות"
msgid "Environmental Information Regulations requests made using this site"
msgstr ""
msgid "Event history"
-msgstr ""
+msgstr "היסטוריית אירועים"
msgid "Event history details"
-msgstr ""
+msgstr "פרטי אירוע היסטורי:"
msgid "Everything that you enter on this page \\n will be <strong>displayed publicly</strong> on\\n this website forever (<a href=\"%s\">why?</a>)."
msgstr ""
@@ -702,13 +705,13 @@ msgid "Everything that you enter on this page, including <strong>your name</stro
msgstr ""
msgid "FOI"
-msgstr ""
+msgstr "חוק חופש המידע"
msgid "FOI email address for {{public_body}}"
-msgstr ""
+msgstr "כתובת לפניות לפי חוק חופש המידע עבור {{public_body}}"
msgid "FOI requests"
-msgstr ""
+msgstr "בקשות לפי חוק חופש המידע"
msgid "FOI requests by '{{user_name}}'"
msgstr ""
@@ -726,7 +729,7 @@ msgid "Failed to convert image to the correct size: at %{cols}x%{rows}, need %{w
msgstr ""
msgid "Filter"
-msgstr ""
+msgstr "סינון"
msgid "First, type in the <strong>name of the UK public authority</strong> you'd \\n like information from. <strong>By law, they have to respond</strong>\\n (<a href=\"%s#%s\">why?</a>)."
msgstr ""
@@ -756,10 +759,10 @@ msgid "FoiAttachment|Within rfc822 subject"
msgstr ""
msgid "Follow"
-msgstr ""
+msgstr "עקוב"
msgid "Follow all new requests"
-msgstr ""
+msgstr "עקבו אחר הבקשות החדשות"
msgid "Follow new successful responses"
msgstr ""
@@ -768,28 +771,28 @@ msgid "Follow requests to {{public_body_name}}"
msgstr ""
msgid "Follow these requests"
-msgstr ""
+msgstr "עקבו אחר הבקשות הללו"
msgid "Follow things matching this search"
msgstr ""
msgid "Follow this authority"
-msgstr ""
+msgstr "עקבו אחר הרשות הזו"
msgid "Follow this link to see the request:"
-msgstr ""
+msgstr "עקבו אחר הקישור הזה בשביל לראות את הבקשה:"
msgid "Follow this person"
-msgstr ""
+msgstr "עקוב אחר האדם הזה"
msgid "Follow this request"
-msgstr ""
+msgstr "עקבו אחר הבקשה"
msgid "Follow up"
-msgstr ""
+msgstr "הודעת עדכון"
msgid "Follow up message sent by requester"
-msgstr ""
+msgstr "הודעת עדכון נשלחה על ידי המבקש"
msgid "Follow up messages to existing requests are sent to "
msgstr ""
@@ -798,7 +801,7 @@ msgid "Follow ups and new responses to this request have been stopped to prevent
msgstr ""
msgid "Follow us on twitter"
-msgstr ""
+msgstr "עקוב אחרינו בטוויטר"
msgid "Followups cannot be sent for this request, as it was made externally, and published here by {{public_body_name}} on the requester's behalf."
msgstr ""
@@ -807,7 +810,7 @@ msgid "For an unknown reason, it is not possible to make a request to this autho
msgstr ""
msgid "Forgotten your password?"
-msgstr ""
+msgstr "שכחתם את הסיסמה?"
msgid "Found %d public authority %s"
msgid_plural "Found %d public authorities %s"
@@ -815,13 +818,13 @@ msgstr[0] ""
msgstr[1] ""
msgid "Freedom of Information"
-msgstr ""
+msgstr "חופש המידע"
msgid "Freedom of Information Act"
-msgstr ""
+msgstr "חוק חופש המידע "
msgid "Freedom of Information law does not apply to this authority, so you cannot make\\n a request to it."
-msgstr ""
+msgstr "חוק החופש המידע אינו חל על הרשות הזאת, אז אתה לא יכול לבצעn/ בקשה למידע ממנה."
msgid "Freedom of Information law no longer applies to"
msgstr ""
@@ -830,13 +833,13 @@ msgid "Freedom of Information law no longer applies to this authority.Follow up
msgstr ""
msgid "Freedom of Information requests made"
-msgstr ""
+msgstr "בקשות לפי חוק חופש המידע שהתבצעו"
msgid "Freedom of Information requests made by this person"
msgstr ""
msgid "Freedom of Information requests made by you"
-msgstr ""
+msgstr "בקשות לחופש המידע שנעשו על ידכם"
msgid "Freedom of Information requests made using this site"
msgstr ""
@@ -845,16 +848,16 @@ msgid "Freedom of information requests to"
msgstr ""
msgid "From"
-msgstr ""
+msgstr "מאת"
msgid "From the request page, try replying to a particular message, rather than sending\\n a general followup. If you need to make a general followup, and know\\n an email which will go to the right place, please <a href=\"%s\">send it to us</a>."
msgstr ""
msgid "From:"
-msgstr ""
+msgstr "מאת:"
msgid "GIVE DETAILS ABOUT YOUR COMPLAINT HERE"
-msgstr ""
+msgstr "ספקו פרטים על התלונה שלכם כאן"
msgid "Handled by post."
msgstr ""
@@ -863,22 +866,22 @@ msgid "Hello! You can make Freedom of Information requests within {{country_name
msgstr ""
msgid "Hello, {{username}}!"
-msgstr ""
+msgstr "שלום, {{username}}!"
msgid "Help"
-msgstr ""
+msgstr "עזרה"
msgid "Here <strong>described</strong> means when a user selected a status for the request, and\\nthe most recent event had its status updated to that value. <strong>calculated</strong> is then inferred by\\n{{site_name}} for intermediate events, which weren't given an explicit\\ndescription by a user. See the <a href=\"{{search_path}}\">search tips</a> for description of the states."
msgstr ""
msgid "Here is the message you wrote, in case you would like to copy the text and save it for later."
-msgstr ""
+msgstr "הנה ההודעה שכתבתם, במקרה שאתם רוצים להעתיק את הטקסט ולשמור אותו."
msgid "Hi! We need your help. The person who made the following request\\n hasn't told us whether or not it was successful. Would you mind taking\\n a moment to read it and help us keep the place tidy for everyone?\\n Thanks."
msgstr ""
msgid "Holiday"
-msgstr ""
+msgstr "חגים"
msgid "Holiday|Day"
msgstr ""
@@ -887,19 +890,19 @@ msgid "Holiday|Description"
msgstr ""
msgid "Home"
-msgstr ""
+msgstr "בית"
msgid "Home page of authority"
-msgstr ""
+msgstr "עמוד הבית של הרשות"
msgid "However, you have the right to request environmental\\n information under a different law"
msgstr ""
msgid "Human health and safety"
-msgstr ""
+msgstr "בריאות ובטחון הציבור"
msgid "I am asking for <strong>new information</strong>"
-msgstr ""
+msgstr "אני מבקש <strong>מידע חדש</strong>"
msgid "I am requesting an <strong>internal review</strong>"
msgstr ""
@@ -908,13 +911,13 @@ msgid "I don't like these ones &mdash; give me some more!"
msgstr ""
msgid "I don't want to do any more tidying now!"
-msgstr ""
+msgstr "אני לא רוצה לבצע עוד ניקיונות עכשיו!"
msgid "I like this request"
-msgstr ""
+msgstr "הצבע לדרישה"
msgid "I would like to <strong>withdraw this request</strong>"
-msgstr ""
+msgstr " אני מעוניין <strong>למשוך את הבקשה</strong>"
msgid "I'm still <strong>waiting</strong> for my information\\n <small>(maybe you got an acknowledgement)</small>"
msgstr ""
@@ -929,7 +932,7 @@ msgid "I've been asked to <strong>clarify</strong> my request"
msgstr ""
msgid "I've received <strong>all the information"
-msgstr ""
+msgstr "קיבלתי <strong>את כל המידע"
msgid "I've received <strong>some of the information</strong>"
msgstr ""
@@ -947,7 +950,7 @@ msgid "If you are dissatisfied by the response you got from\\n the pu
msgstr ""
msgid "If you are still having trouble, please <a href=\"%s\">contact us</a>."
-msgstr ""
+msgstr "אם עדיין נתקלתם בבעיה אנא <a href=\"%s\">צרו איתנו קשר</a>."
msgid "If you are the requester, then you may <a href=\"%s\">sign in</a> to view the request."
msgstr ""
@@ -956,7 +959,7 @@ msgid "If you are thinking of using a pseudonym,\\n please <a hre
msgstr ""
msgid "If you are {{user_link}}, please"
-msgstr ""
+msgstr "אם אתה המשתמש {{user_link}}, בבקשה"
msgid "If you believe this request is not suitable, you can report it for attention by the site administrators"
msgstr ""
@@ -986,16 +989,16 @@ msgid "If you would like us to lift this ban, then you may politely\\n<a href=\"
msgstr ""
msgid "If you're new to {{site_name}}"
-msgstr ""
+msgstr "אם אתם חדשים באתר {{site_name}}"
msgid "If you've used {{site_name}} before"
-msgstr ""
+msgstr "אם השתמשתם באתר {{site_name}} before לפני"
msgid "If your browser is set to accept cookies and you are seeing this message,\\nthen there is probably a fault with our server."
msgstr ""
msgid "Incoming message"
-msgstr ""
+msgstr "הודעה נכנסת"
msgid "IncomingMessage|Cached attachment text clipped"
msgstr ""
@@ -1025,7 +1028,7 @@ msgid "IncomingMessage|Valid to reply to"
msgstr ""
msgid "Individual requests"
-msgstr ""
+msgstr "דרישות נפרדות"
msgid "Info request"
msgstr ""
@@ -1118,13 +1121,13 @@ msgid "Keep it <strong>focused</strong>, you'll be more likely to get what you w
msgstr ""
msgid "Keywords"
-msgstr ""
+msgstr "מילות מפתח"
msgid "Last authority viewed: "
msgstr ""
msgid "Last request viewed: "
-msgstr ""
+msgstr "בקשה אחרונה שנצפתה:"
msgid "Let us know what you were doing when this message\\nappeared and your browser and operating system type and version."
msgstr ""
@@ -1142,16 +1145,16 @@ msgid "Log into the admin interface"
msgstr ""
msgid "Long overdue."
-msgstr ""
+msgstr "עברה ממזמן."
msgid "Made between"
-msgstr ""
+msgstr "נעשתה בין"
msgid "Mail server log"
-msgstr ""
+msgstr "יומן אירועים שרת דואר"
msgid "Mail server log done"
-msgstr ""
+msgstr "התבצע רישום אירועים של שרת הדואר"
msgid "MailServerLogDone|Filename"
msgstr ""
@@ -1175,7 +1178,7 @@ msgid "Make a new<br/>\\n <strong>Freedom <span>of</span><br/>\\n Information<
msgstr ""
msgid "Make a request"
-msgstr ""
+msgstr "בצעו בקשה"
msgid "Make an {{law_used_short}} request to '{{public_body_name}}'"
msgstr ""
@@ -1187,10 +1190,10 @@ msgid "Make your own request"
msgstr ""
msgid "Many requests"
-msgstr ""
+msgstr "דרישות שונות"
msgid "Message"
-msgstr ""
+msgstr "הודעה"
msgid "Message sent using {{site_name}} contact form, "
msgstr ""
@@ -1202,7 +1205,7 @@ msgid "More about this authority"
msgstr ""
msgid "More requests..."
-msgstr ""
+msgstr "דרישות נוספות"
msgid "More similar requests"
msgstr ""
@@ -1211,37 +1214,37 @@ msgid "More successful requests..."
msgstr ""
msgid "My profile"
-msgstr ""
+msgstr "הפרופיל שלי"
msgid "My request has been <strong>refused</strong>"
msgstr ""
msgid "My requests"
-msgstr ""
+msgstr "הבקשות שלי"
msgid "My wall"
-msgstr ""
+msgstr "הקיר שלי"
msgid "Name can't be blank"
msgstr ""
msgid "Name is already taken"
-msgstr ""
+msgstr "השם כבר תפוס"
msgid "New Freedom of Information requests"
-msgstr ""
+msgstr "בקשות חדשות לחופש המידע"
msgid "New e-mail:"
-msgstr ""
+msgstr "דואר אלקטרוני חדש:"
msgid "New email doesn't look like a valid address"
-msgstr ""
+msgstr "הדואר האלקטרוני החדש לא נראה תקין"
msgid "New password:"
-msgstr ""
+msgstr "סיסמה חדשה:"
msgid "New password: (again)"
-msgstr ""
+msgstr "סיסמה חדשה (שוב):"
msgid "New response to '{{title}}'"
msgstr ""
@@ -1262,25 +1265,25 @@ msgid "Newest results first"
msgstr ""
msgid "Next"
-msgstr ""
+msgstr "הבא"
msgid "Next, crop your photo &gt;&gt;"
-msgstr ""
+msgstr "הבא, חיתכו את התמונה &gt;&gt;"
msgid "No requests of this sort yet."
-msgstr ""
+msgstr "אין בקשות מהסוג הזה עדיין."
msgid "No results found."
-msgstr ""
+msgstr "אין תוצאות."
msgid "No similar requests found."
-msgstr ""
+msgstr "לא נמצאות בקשות דומות."
msgid "Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet."
msgstr ""
msgid "None found."
-msgstr ""
+msgstr "לא נמצאו."
msgid "None made."
msgstr ""
@@ -1289,7 +1292,7 @@ msgid "Note that the requester will not be notified about your annotation, becau
msgstr ""
msgid "Now check your email!"
-msgstr ""
+msgstr "עכשיו בידקו את האימייל שלכם!"
msgid "Now preview your annotation"
msgstr ""
@@ -1304,13 +1307,13 @@ msgid "OR remove the existing photo"
msgstr ""
msgid "Offensive? Unsuitable?"
-msgstr ""
+msgstr "תוקפני? לא מתאים?"
msgid "Oh no! Sorry to hear that your request was refused. Here is what to do now."
msgstr ""
msgid "Old e-mail:"
-msgstr ""
+msgstr "אימייל ישן:"
msgid "Old email address isn't the same as the address of the account you are logged in with"
msgstr ""
@@ -1319,13 +1322,13 @@ msgid "Old email doesn't look like a valid address"
msgstr ""
msgid "On this page"
-msgstr ""
+msgstr "בעמוד הזה"
msgid "One FOI request found"
-msgstr ""
+msgstr "בקשה אחת לחופש המידע נמצאה"
msgid "One person found"
-msgstr ""
+msgstr "אדם אחד נמצא"
msgid "One public authority found"
msgstr ""
@@ -1340,13 +1343,13 @@ msgid "Only the authority can reply to this request, but there is no \"From\" ad
msgstr ""
msgid "Or search in their website for this information."
-msgstr ""
+msgstr "או חפשו באתר שלהם למידע הזה."
msgid "Original request sent"
-msgstr ""
+msgstr "בקשה מקורית נשלחה"
msgid "Other:"
-msgstr ""
+msgstr "אחר:"
msgid "Outgoing message"
msgstr ""
@@ -1367,28 +1370,28 @@ msgid "OutgoingMessage|What doing"
msgstr ""
msgid "Partially successful."
-msgstr ""
+msgstr "נכון חלקית."
msgid "Password is not correct"
-msgstr ""
+msgstr "הסיסמה אינה נכונה"
msgid "Password:"
-msgstr ""
+msgstr "סיסמה:"
msgid "Password: (again)"
-msgstr ""
+msgstr "סיסמה (שוב):"
msgid "Paste this link into emails, tweets, and anywhere else:"
-msgstr ""
+msgstr "תוכלו להעתיק את הקישור הזה לאימיילים, טוויטים ולכל מקום אחר:"
msgid "People"
-msgstr ""
+msgstr "אנשים"
msgid "People {{start_count}} to {{end_count}} of {{total_count}}"
msgstr ""
msgid "Photo of you:"
-msgstr ""
+msgstr "תמונה שלך:"
msgid "Plans and administrative measures that affect these matters"
msgstr ""
@@ -1400,7 +1403,7 @@ msgid "Play the request categorisation game!"
msgstr ""
msgid "Please"
-msgstr ""
+msgstr "בבקשה"
msgid "Please <a href=\"%s\">get in touch</a> with us so we can fix it."
msgstr ""
@@ -1430,7 +1433,7 @@ msgid "Please choose whether or not you got some of the information that you wan
msgstr ""
msgid "Please click on the link below to cancel or alter these emails."
-msgstr ""
+msgstr "בבקשה הקליקו או "
msgid "Please click on the link below to confirm that you want to \\nchange the email address that you use for {{site_name}}\\nfrom {{old_email}} to {{new_email}}"
msgstr ""
@@ -1445,31 +1448,31 @@ msgid "Please don't upload offensive pictures. We will take down images\\n th
msgstr ""
msgid "Please enable \"cookies\" to carry on"
-msgstr ""
+msgstr "אנא אשרו שימוש ב\"עוגיות\" כדי להמשיך"
msgid "Please enter a password"
-msgstr ""
+msgstr "אנא הקלד סיסמה"
msgid "Please enter a subject"
-msgstr ""
+msgstr "בבקשה הקלד נושא"
msgid "Please enter a summary of your request"
-msgstr ""
+msgstr "בבקשה הקלד תקציר של הבקשה שלך"
msgid "Please enter a valid email address"
-msgstr ""
+msgstr "בבקשה הקלד כתובת דואר אלקטרוני נכונה"
msgid "Please enter the message you want to send"
msgstr ""
msgid "Please enter the same password twice"
-msgstr ""
+msgstr "בבקשה הקלידו את הסיסמה שוב"
msgid "Please enter your annotation"
-msgstr ""
+msgstr "בבקשה הקלד את ההערה שלך"
msgid "Please enter your email address"
-msgstr ""
+msgstr "בבקשה הקלד את הדואר האלקטרוני שלך"
msgid "Please enter your follow up message"
msgstr ""
@@ -1478,25 +1481,25 @@ msgid "Please enter your letter requesting information"
msgstr ""
msgid "Please enter your name"
-msgstr ""
+msgstr "בבקשה הקלידו את שמכם"
msgid "Please enter your name, not your email address, in the name field."
msgstr ""
msgid "Please enter your new email address"
-msgstr ""
+msgstr "אנא הקלד את כתובת הדואר האלקטרוני החדשה שלך"
msgid "Please enter your old email address"
-msgstr ""
+msgstr "אנא הקלד את כתובת הדואר האלקטרוני שלך"
msgid "Please enter your password"
-msgstr ""
+msgstr "אנא הקלד את הסיסמה שלך"
msgid "Please give details explaining why you want a review"
msgstr ""
msgid "Please keep it shorter than 500 characters"
-msgstr ""
+msgstr "בבקשה הקפד על תקציר של פחות מ-500 תווים"
msgid "Please keep the summary short, like in the subject of an email. You can use a phrase, rather than a full sentence."
msgstr ""
@@ -1511,22 +1514,22 @@ msgid "Please sign at the bottom with your name, or alter the \"%{signoff}\" sig
msgstr ""
msgid "Please sign in as "
-msgstr ""
+msgstr "בבקשה התחברו כ"
msgid "Please sign in or make a new account."
-msgstr ""
+msgstr "תוכלו להתחבר או ליצור חשבון חדש."
msgid "Please type a message and/or choose a file containing your response."
msgstr ""
msgid "Please use the form below to tell us more."
-msgstr ""
+msgstr "בבקשה השתמש בטופס מתחת כדי לספר לנו עוד:"
msgid "Please use this email address for all replies to this request:"
-msgstr ""
+msgstr "בבקשה השתמשו בכתובת המייל הבאה לתשובות עבור הבקשה הזו:"
msgid "Please write a summary with some text in it"
-msgstr ""
+msgstr "אנא הקלידו תקציר עם טקסט כלשהוא"
msgid "Please write the summary using a mixture of capital and lower case letters. This makes it easier for others to read."
msgstr ""
@@ -1547,7 +1550,7 @@ msgid "Possibly related requests:"
msgstr ""
msgid "Post annotation"
-msgstr ""
+msgstr "פרסם הערה"
msgid "Post redirect"
msgstr ""
@@ -1577,7 +1580,7 @@ msgid "Powered by <a href=\"http://www.alaveteli.org/\">Alaveteli</a>"
msgstr ""
msgid "Prev"
-msgstr ""
+msgstr "הקודם"
msgid "Preview follow up to '"
msgstr ""
@@ -1586,16 +1589,16 @@ msgid "Preview new annotation on '{{info_request_title}}'"
msgstr ""
msgid "Preview your annotation"
-msgstr ""
+msgstr "תצוגה מקדימה של ההערה"
msgid "Preview your message"
-msgstr ""
+msgstr "תצוגה מקדימה של ההודעה שלך"
msgid "Preview your public request"
msgstr ""
msgid "Profile photo"
-msgstr ""
+msgstr "תמונת פרופיל"
msgid "ProfilePhoto|Data"
msgstr ""
@@ -1700,7 +1703,7 @@ msgid "PurgeRequest|Url"
msgstr ""
msgid "RSS feed"
-msgstr ""
+msgstr "ערוץ RSS"
msgid "RSS feed of updates"
msgstr ""
@@ -1709,13 +1712,13 @@ msgid "Re-edit this annotation"
msgstr ""
msgid "Re-edit this message"
-msgstr ""
+msgstr "ערכו מחדש "
msgid "Read about <a href=\"{{advanced_search_url}}\">advanced search operators</a>, such as proximity and wildcards."
msgstr ""
msgid "Read blog"
-msgstr ""
+msgstr "קראו את הבלוג"
msgid "Received an error message, such as delivery failure."
msgstr ""
@@ -1796,10 +1799,10 @@ msgid "Response to this request is <strong>long overdue</strong>."
msgstr ""
msgid "Response to your request"
-msgstr ""
+msgstr "תגובה לבקשה שלך"
msgid "Response:"
-msgstr ""
+msgstr "תגובה:"
msgid "Restrict to"
msgstr ""
@@ -1808,10 +1811,10 @@ msgid "Results page {{page_number}}"
msgstr ""
msgid "Save"
-msgstr ""
+msgstr "שמירה"
msgid "Search"
-msgstr ""
+msgstr "חיפוש"
msgid "Search Freedom of Information requests, public authorities and users"
msgstr ""
@@ -1820,7 +1823,7 @@ msgid "Search contributions by this person"
msgstr ""
msgid "Search for words in:"
-msgstr ""
+msgstr "חיפוש אחר המילים ב:"
msgid "Search in"
msgstr ""
@@ -1829,7 +1832,7 @@ msgid "Search over<br/>\\n <strong>{{number_of_requests}} requests</strong> <sp
msgstr ""
msgid "Search queries"
-msgstr ""
+msgstr "שאילתות חיפוש"
msgid "Search results"
msgstr ""
@@ -1855,7 +1858,7 @@ msgid "Send a followup"
msgstr ""
msgid "Send a message to "
-msgstr ""
+msgstr "שלחו הודעה אל"
msgid "Send a public follow up message to {{person_or_body}}"
msgstr ""
@@ -1867,10 +1870,10 @@ msgid "Send follow up to '{{title}}'"
msgstr ""
msgid "Send message"
-msgstr ""
+msgstr "שלחו הודעה"
msgid "Send message to "
-msgstr ""
+msgstr "שלחו הודעה"
msgid "Send request"
msgstr ""
@@ -1879,37 +1882,37 @@ msgid "Set your profile photo"
msgstr ""
msgid "Short name is already taken"
-msgstr ""
+msgstr "השם הקצר כבר תפוס"
msgid "Show most relevant results first"
msgstr ""
msgid "Show only..."
-msgstr ""
+msgstr "הצג רק..."
msgid "Showing"
msgstr ""
msgid "Sign in"
-msgstr ""
+msgstr "התחבר"
msgid "Sign in or make a new account"
-msgstr ""
+msgstr "התחבר או צור חשבון חדש"
msgid "Sign in or sign up"
-msgstr ""
+msgstr "התחבר או הירשם"
msgid "Sign out"
-msgstr ""
+msgstr "התנתק"
msgid "Sign up"
-msgstr ""
+msgstr "התחבר"
msgid "Similar requests"
-msgstr ""
+msgstr "בקשות דומות"
msgid "Simple search"
-msgstr ""
+msgstr "חיפוש פשוט"
msgid "Some notes have been added to your FOI request - "
msgstr ""
@@ -1921,10 +1924,10 @@ msgid "Some people who've made requests haven't let us know whether they were\\n
msgstr ""
msgid "Somebody added a note to your FOI request - "
-msgstr ""
+msgstr "התווספה הערה לבקשת חוק חופש המידע שלך"
msgid "Someone has updated the status of your request"
-msgstr ""
+msgstr "מישהו עדכן את הססטוס של הדרישה שלך"
msgid "Someone, perhaps you, just tried to change their email address on\\n{{site_name}} from {{old_email}} to {{new_email}}."
msgstr ""
@@ -1936,58 +1939,58 @@ msgid "Sorry, but only {{user_name}} is allowed to do that."
msgstr ""
msgid "Sorry, there was a problem processing this page"
-msgstr ""
+msgstr "מצטערים, היתה בעיה בהצעת הדף הזה"
msgid "Sorry, we couldn't find that page"
-msgstr ""
+msgstr "מצטערים, אנחנו לא יכולים למצוא את הדף המבוקש"
msgid "Special note for this authority!"
msgstr ""
msgid "Start"
-msgstr ""
+msgstr "התחל"
msgid "Start now &raquo;"
-msgstr ""
+msgstr "התחל עכשיו &raquo;"
msgid "Start your own blog"
-msgstr ""
+msgstr "התחל את הבלוג שלך"
msgid "Stay up to date"
-msgstr ""
+msgstr "הישאר מעודכן"
msgid "Still awaiting an <strong>internal review</strong>"
msgstr ""
msgid "Subject"
-msgstr ""
+msgstr "נושא"
msgid "Subject:"
-msgstr ""
+msgstr "נושא:"
msgid "Submit"
-msgstr ""
+msgstr "שלח"
msgid "Submit status"
-msgstr ""
+msgstr "הצג סטטוס"
msgid "Subscribe to blog"
-msgstr ""
+msgstr "הירשם לבלוג"
msgid "Successful Freedom of Information requests"
msgstr ""
msgid "Successful."
-msgstr ""
+msgstr "עבר בהצלחה."
msgid "Suggest how the requester can find the <strong>rest of the information</strong>."
msgstr ""
msgid "Summary:"
-msgstr ""
+msgstr "תקציר:"
msgid "Table of statuses"
-msgstr ""
+msgstr "טבלת סטטוסים"
msgid "Table of varieties"
msgstr ""
@@ -1996,16 +1999,16 @@ msgid "Tags (separated by a space):"
msgstr ""
msgid "Tags:"
-msgstr ""
+msgstr "תגיות:"
msgid "Technical details"
-msgstr ""
+msgstr "פרטים טכניים"
msgid "Thank you for helping us keep the site tidy!"
msgstr ""
msgid "Thank you for making an annotation!"
-msgstr ""
+msgstr "תודה על ההערה שהוספתם!"
msgid "Thank you for responding to this FOI request! Your response has been published below, and a link to your response has been emailed to "
msgstr ""
@@ -2014,10 +2017,10 @@ msgid "Thank you for updating the status of the request '<a href=\"{{url}}\">{{i
msgstr ""
msgid "Thank you for updating this request!"
-msgstr ""
+msgstr "תודה על עדכון הבקשה!"
msgid "Thank you for updating your profile photo"
-msgstr ""
+msgstr "תודה על עדכון תמונת הפרופיל"
msgid "Thanks for helping - your work will make it easier for everyone to find successful\\nresponses, and maybe even let us make league tables..."
msgstr ""
@@ -2202,7 +2205,7 @@ msgid "There were no requests matching your query."
msgstr ""
msgid "There were no results matching your query."
-msgstr ""
+msgstr "אין תוצאות שמתאימות לחיפוש שלך."
msgid "They are going to reply <strong>by post</strong>"
msgstr ""
@@ -2323,22 +2326,22 @@ msgid "This table shows the technical details of the internal events that happen
msgstr ""
msgid "This user has been banned from {{site_name}} "
-msgstr ""
+msgstr "המשתמש הזה נחסם מהאתר {{site_name}}"
msgid "This was not possible because there is already an account using \\nthe email address {{email}}."
msgstr ""
msgid "To cancel these alerts"
-msgstr ""
+msgstr "לבטל את ההתראות הללו"
msgid "To cancel this alert"
-msgstr ""
+msgstr "לבטל את ההתראה"
msgid "To carry on, you need to sign in or make an account. Unfortunately, there\\nwas a technical problem trying to do this."
msgstr ""
msgid "To change your email address used on {{site_name}}"
-msgstr ""
+msgstr "לשנות את כתובת הדואר האלקטרוני שבה משתמשים באתר {{site_name}}"
msgid "To classify the response to this FOI request"
msgstr ""
@@ -2350,7 +2353,7 @@ msgid "To do this, first click on the link below."
msgstr ""
msgid "To download the zip file"
-msgstr ""
+msgstr "להורדת הקובץ המכווץ"
msgid "To follow all successful requests"
msgstr ""
@@ -2383,19 +2386,19 @@ msgid "To play the request categorisation game"
msgstr ""
msgid "To post your annotation"
-msgstr ""
+msgstr "כדי לפרסם את ההערה שלך"
msgid "To reply to "
-msgstr ""
+msgstr "בתשובה אל"
msgid "To report this FOI request"
msgstr ""
msgid "To send a follow up message to "
-msgstr ""
+msgstr "לשלוח הודעת מעקב אל"
msgid "To send a message to "
-msgstr ""
+msgstr "לשלוח הודעה אל"
msgid "To send your FOI request"
msgstr ""
@@ -2419,25 +2422,25 @@ msgid "To {{public_body_link_absolute}}"
msgstr ""
msgid "To:"
-msgstr ""
+msgstr "אל:"
msgid "Today"
-msgstr ""
+msgstr "היום"
msgid "Too many requests"
msgstr ""
msgid "Top search results:"
-msgstr ""
+msgstr "תוצאות החיפוש המובילות:"
msgid "Track thing"
msgstr ""
msgid "Track this person"
-msgstr ""
+msgstr "עקבו אחר האדם הזה"
msgid "Track this search"
-msgstr ""
+msgstr "עקבו אחר החיפוש הזה"
msgid "TrackThing|Track medium"
msgstr ""
@@ -2452,7 +2455,7 @@ msgid "Turn off email alerts"
msgstr ""
msgid "Tweet this request"
-msgstr ""
+msgstr "צייצו את הבקשה"
msgid "Type <strong><code>01/01/2008..14/01/2008</code></strong> to only show things that happened in the first two weeks of January."
msgstr ""
@@ -2482,22 +2485,22 @@ msgid "Unfortunately, we do not have a working {{info_request_law_used_full}}\\n
msgstr ""
msgid "Unknown"
-msgstr ""
+msgstr "לא ידוע"
msgid "Unsubscribe"
-msgstr ""
+msgstr "בטל הרשמה"
msgid "Unusual response."
-msgstr ""
+msgstr "תגובה מוזרה"
msgid "Update the status of this request"
-msgstr ""
+msgstr "עדכון על הסטטוס של הבקשה הזאת"
msgid "Update the status of your request to "
msgstr ""
msgid "Upload FOI response"
-msgstr ""
+msgstr "בקשת לחוק חופש המידע הועלתה"
msgid "Use OR (in capital letters) where you don't mind which word, e.g. <strong><code>commons OR lords</code></strong>"
msgstr ""
@@ -2584,13 +2587,13 @@ msgid "View authorities"
msgstr ""
msgid "View email"
-msgstr ""
+msgstr "צפו בדואר האלקטרוני"
msgid "View requests"
-msgstr ""
+msgstr "צפה בבקשות"
msgid "Waiting clarification."
-msgstr ""
+msgstr "ממתין להבהרות"
msgid "Waiting for an <strong>internal review</strong> by {{public_body_link}} of their handling of this request."
msgstr ""
@@ -2599,7 +2602,7 @@ msgid "Waiting for the public authority to complete an internal review of their
msgstr ""
msgid "Waiting for the public authority to reply"
-msgstr ""
+msgstr "בהמתנה לתשובה של רשות ציבורית"
msgid "Was the response you got to your FOI request any good?"
msgstr ""
@@ -2623,7 +2626,7 @@ msgid "We will not reveal your email addresses to anybody unless you\\nor the la
msgstr ""
msgid "We're waiting for"
-msgstr ""
+msgstr "אנחנו ממתינים עבור"
msgid "We're waiting for someone to read"
msgstr ""
@@ -2632,22 +2635,22 @@ msgid "We've sent an email to your new email address. You'll need to click the l
msgstr ""
msgid "We've sent you an email, and you'll need to click the link in it before you can\\ncontinue."
-msgstr ""
+msgstr "שלחנו לכם אימייל ואתם צריכים להקליק על הקישור בהודעה לפני שתוכלוn/ להמשיך"
msgid "We've sent you an email, click the link in it, then you can change your password."
msgstr ""
msgid "What are you doing?"
-msgstr ""
+msgstr "מה אתם עושים?"
msgid "What best describes the status of this request now?"
-msgstr ""
+msgstr "מה בדיוק מתאר את הבקשה הזאת כעת?"
msgid "What information has been released?"
-msgstr ""
+msgstr "איזה מידע הוצג?"
msgid "What information has been requested?"
-msgstr ""
+msgstr "מה המידע שנדרש?"
msgid "When you get there, please update the status to say if the response \\ncontains any useful information."
msgstr ""
@@ -2674,10 +2677,10 @@ msgid "Would you like to see a website like this in your country?"
msgstr ""
msgid "Write a reply"
-msgstr ""
+msgstr "כתבו תשובה"
msgid "Write a reply to "
-msgstr ""
+msgstr "כתבו תשובה אל"
msgid "Write your FOI follow up message to "
msgstr ""
@@ -2713,7 +2716,7 @@ msgid "You are following all new successful responses"
msgstr ""
msgid "You are no longer following {{track_description}}."
-msgstr ""
+msgstr "אתה לא עוקב יותר אחרי {{track_description}}"
msgid "You are now <a href=\"{{wall_url_user}}\">following</a> updates about {{track_description}}"
msgstr ""
@@ -2731,7 +2734,7 @@ msgid "You can only request information about the environment from this authorit
msgstr ""
msgid "You have a new response to the {{law_used_full}} request "
-msgstr ""
+msgstr "יש לך תשובה חדשה לחוק {{law_used_full}} "
msgid "You have found a bug. Please <a href=\"{{contact_url}}\">contact us</a> to tell us about the problem"
msgstr ""
@@ -2879,7 +2882,7 @@ msgid "Your request:"
msgstr ""
msgid "Your response to an FOI request was not delivered"
-msgstr ""
+msgstr "התגובה שלך לבקשה לפי חוק חופש המידע לא נשלחה"
msgid "Your response will <strong>appear on the Internet</strong>, <a href=\"%s\">read why</a> and answers to other questions."
msgstr ""
@@ -2912,16 +2915,16 @@ msgid "a one line summary of the information you are requesting, \\n\t\t\te.g."
msgstr ""
msgid "admin"
-msgstr ""
+msgstr "מנהל"
msgid "all requests"
-msgstr ""
+msgstr "כל הבקשות"
msgid "also called {{public_body_short_name}}"
msgstr ""
msgid "an anonymous user"
-msgstr ""
+msgstr "משתמש אנונימי"
msgid "and"
msgstr ""
@@ -2942,25 +2945,25 @@ msgid "any <a href=\"/list/successful\">successful requests</a>"
msgstr ""
msgid "anything"
-msgstr ""
+msgstr "הכל"
msgid "are long overdue."
-msgstr ""
+msgstr "עברו את תאריך היעד."
msgid "authorities"
-msgstr ""
+msgstr "רשויות"
msgid "awaiting a response"
-msgstr ""
+msgstr "ממתין לבקשה"
msgid "beginning with ‘{{first_letter}}’"
msgstr ""
msgid "between two dates"
-msgstr ""
+msgstr "בין שני תאריכים"
msgid "by"
-msgstr ""
+msgstr "מאת"
msgid "by <strong>{{date}}</strong>"
msgstr ""
@@ -2978,7 +2981,7 @@ msgid "containing your postal address, and asking them to reply to this request.
msgstr ""
msgid "details"
-msgstr ""
+msgstr "פרטים"
msgid "display_status only works for incoming and outgoing messages right now"
msgstr ""
@@ -2993,10 +2996,10 @@ msgid "even during holidays"
msgstr ""
msgid "everything"
-msgstr ""
+msgstr "הכל"
msgid "external"
-msgstr ""
+msgstr "חיצוני"
msgid "has reported an"
msgstr ""
@@ -3017,7 +3020,7 @@ msgid "internal error"
msgstr ""
msgid "internal reviews"
-msgstr ""
+msgstr "ביקורות פנימיות"
msgid "is <strong>waiting for your clarification</strong>."
msgstr ""
@@ -3026,7 +3029,7 @@ msgid "just to see how it works"
msgstr ""
msgid "left an annotation"
-msgstr ""
+msgstr "השאיר הודעה"
msgid "made."
msgstr ""
@@ -3038,25 +3041,25 @@ msgid "messages from authorities"
msgstr ""
msgid "messages from users"
-msgstr ""
+msgstr "הודעות ממשתמשים"
msgid "no later than"
-msgstr ""
+msgstr "לא יאוחר מ"
msgid "no longer exists. If you are trying to make\\n From the request page, try replying to a particular message, rather than sending\\n a general followup. If you need to make a general followup, and know\\n an email which will go to the right place, please <a href=\"%s\">send it to us</a>."
msgstr ""
msgid "normally"
-msgstr ""
+msgstr "באופן כללי"
msgid "please sign in as "
-msgstr ""
+msgstr "בבקשה התחבר כ"
msgid "requesting an internal review"
msgstr ""
msgid "requests"
-msgstr ""
+msgstr "בקשות"
msgid "requests which are {{list_of_statuses}}"
msgstr ""
@@ -3065,7 +3068,7 @@ msgid "response as needing administrator attention. Take a look, and reply to th
msgstr ""
msgid "send a follow up message"
-msgstr ""
+msgstr "שלח הודעת מעקב"
msgid "sent to {{public_body_name}} by {{info_request_user}} on {{date}}."
msgstr ""
@@ -3074,16 +3077,16 @@ msgid "show quoted sections"
msgstr ""
msgid "sign in"
-msgstr ""
+msgstr "התחבר"
msgid "simple_date_format"
-msgstr ""
+msgstr "simple_date_format"
msgid "successful"
-msgstr ""
+msgstr "עבר בהצלחה"
msgid "successful requests"
-msgstr ""
+msgstr "בקשות מוצלחות"
msgid "that you made to"
msgstr ""
@@ -3095,16 +3098,16 @@ msgid "the main FOI contact at {{public_body}}"
msgstr ""
msgid "the requester"
-msgstr ""
+msgstr "המבקש"
msgid "the {{site_name}} team"
msgstr ""
msgid "to read"
-msgstr ""
+msgstr "לקריאה"
msgid "to send a follow up message."
-msgstr ""
+msgstr "לשלוח הודעת מעקב."
msgid "to {{public_body}}"
msgstr ""
@@ -3113,31 +3116,31 @@ msgid "unexpected prominence on request event"
msgstr ""
msgid "unknown reason "
-msgstr ""
+msgstr "סיבה לא ידוע"
msgid "unknown status "
-msgstr ""
+msgstr "ססטוס לא ידוע"
msgid "unresolved requests"
-msgstr ""
+msgstr "בקשות שלא נענו"
msgid "unsubscribe"
-msgstr ""
+msgstr "בטל הרשמה"
msgid "unsubscribe all"
-msgstr ""
+msgstr "בטל הרשמה מהכל"
msgid "unsuccessful"
-msgstr ""
+msgstr "לא הצליח"
msgid "unsuccessful requests"
msgstr ""
msgid "useful information."
-msgstr ""
+msgstr "מידע שימושי."
msgid "users"
-msgstr ""
+msgstr "משתמשים"
msgid "{{count}} FOI requests found"
msgstr ""
@@ -3155,7 +3158,7 @@ msgid "{{law_used_full}} request GQ - {{title}}"
msgstr ""
msgid "{{law_used}} requests at {{public_body}}"
-msgstr ""
+msgstr "{{law_used}} בקשות ב{{public_body}}"
msgid "{{length_of_time}} ago"
msgstr ""
@@ -3176,19 +3179,19 @@ msgid "{{public_body_name}} only:"
msgstr ""
msgid "{{public_body}} has asked you to explain part of your {{law_used}} request."
-msgstr ""
+msgstr "{{public_body}} ביקש מכם להסביר חלק מה{{law_used}} בבקשה."
msgid "{{public_body}} sent a response to {{user_name}}"
msgstr ""
msgid "{{reason}}, please sign in or make a new account."
-msgstr ""
+msgstr "{{reason}}, בבקשה התחברו או צרו חשבון חדש."
msgid "{{search_results}} matching '{{query}}'"
msgstr ""
msgid "{{site_name}} blog and tweets"
-msgstr ""
+msgstr "{{site_name}} בלוג וציוצים"
msgid "{{site_name}} covers requests to {{number_of_authorities}} authorities, including:"
msgstr ""
@@ -3203,7 +3206,7 @@ msgid "{{title}} - a Freedom of Information request to {{public_body}}"
msgstr ""
msgid "{{user_name}} (Account suspended)"
-msgstr ""
+msgstr "{{user_name}} (חשבון הושעה)"
msgid "{{user_name}} - Freedom of Information requests"
msgstr ""
@@ -3212,7 +3215,7 @@ msgid "{{user_name}} - user profile"
msgstr ""
msgid "{{user_name}} added an annotation"
-msgstr ""
+msgstr "{{user_name}} הוסיף הערה"
msgid "{{user_name}} has annotated your {{law_used_short}} \\nrequest. Follow this link to see what they wrote."
msgstr ""
@@ -3227,7 +3230,7 @@ msgid "{{user_name}} sent a request to {{public_body}}"
msgstr ""
msgid "{{username}} left an annotation:"
-msgstr ""
+msgstr "{{username}} הוסיף הערה:"
msgid "{{user}} ({{user_admin_link}}) made this {{law_used_full}} request (<a href=\"{{request_admin_url}}\">admin</a>) to {{public_body_link}} (<a href=\"{{public_body_admin_url}}\">admin</a>)"
msgstr ""
diff --git a/public/admin/images/glyphicons-halflings-white.png b/public/admin/images/glyphicons-halflings-white.png
new file mode 100644
index 000000000..3bf6484a2
--- /dev/null
+++ b/public/admin/images/glyphicons-halflings-white.png
Binary files differ
diff --git a/public/admin/images/glyphicons-halflings.png b/public/admin/images/glyphicons-halflings.png
new file mode 100644
index 000000000..79bc568c2
--- /dev/null
+++ b/public/admin/images/glyphicons-halflings.png
Binary files differ
diff --git a/public/admin/javascripts/bootstrap-collapse.js b/public/admin/javascripts/bootstrap-collapse.js
new file mode 100644
index 000000000..9a364468b
--- /dev/null
+++ b/public/admin/javascripts/bootstrap-collapse.js
@@ -0,0 +1,138 @@
+/* =============================================================
+ * 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/public/admin/javascripts/bootstrap-tab.js b/public/admin/javascripts/bootstrap-tab.js
new file mode 100644
index 000000000..26c9ece75
--- /dev/null
+++ b/public/admin/javascripts/bootstrap-tab.js
@@ -0,0 +1,130 @@
+/* ========================================================
+ * 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/public/admin/javascripts/jquery-ui.min.js b/public/admin/javascripts/jquery-ui.min.js
new file mode 100644
index 000000000..f00a62f13
--- /dev/null
+++ b/public/admin/javascripts/jquery-ui.min.js
@@ -0,0 +1,356 @@
+/*!
+ * jQuery UI 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI
+ */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*!
+ * jQuery UI Widget 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Widget
+ */(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e;if(f&&e.charAt(0)==="_")return h;f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return!1}}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))});return h}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);this.element.trigger(c,d);return!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);/*!
+ * jQuery UI Mouse 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Mouse
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ */(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation();return!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(!c){this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted){b.preventDefault();return!0}}!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0;return!0}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/*
+ * jQuery UI Position 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Position
+ */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/*
+ * jQuery UI Draggable 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.18"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!!e.length){var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);/*
+ * jQuery UI Droppable 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.mouse.js
+ * jquery.ui.draggable.js
+ */(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){e=!0;return!1}});if(e)return!1;if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d));return this.element}return!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.18"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g<d.length;g++){if(d[g].options.disabled||b&&!d[g].accept.call(d[g].element[0],b.currentItem||b.element))continue;for(var h=0;h<f.length;h++)if(f[h]==d[g].element[0]){d[g].proportions.height=0;continue droppablesLoop}d[g].visible=d[g].element.css("display")!="none";if(!d[g].visible)continue;e=="mousedown"&&d[g]._activate.call(d[g],c),d[g].offset=d[g].element.offset(),d[g].proportions={width:d[g].element[0].offsetWidth,height:d[g].element[0].offsetHeight}}},drop:function(b,c){var d=!1;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){!this.options||(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c)))});return d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))}})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);/*
+ * jQuery UI Resizable 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width));return a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(a.browser.msie&&(!!a(c).is(":hidden")||!!a(c).parents(":hidden").length))continue;e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/*
+ * jQuery UI Selectable 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}});return!1}},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove();return!1}}),a.extend(a.ui.selectable,{version:"1.8.18"})})(jQuery);/*
+ * jQuery UI Sortable 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Sortables
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!e)return!1;return this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1)},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i])}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.18"})})(jQuery);/*
+ * jQuery UI Accordion 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/*
+ * jQuery UI Autocomplete 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.position.js
+ */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==!1)return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this.response)},_response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close(),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){if(b.length&&b[0].label&&b[0].value)return b;return a.map(b,function(b){if(typeof b=="string")return{label:b,value:b};return a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);/*
+ * jQuery UI Button 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form}));return e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){h.disabled||(a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){f||b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){h.disabled||(f=!1,d=a.pageX,e=a.pageY)}).bind("mouseup.button",function(a){!h.disabled&&(d!==a.pageX||e!==a.pageY)&&(f=!0)})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b==="disabled"?c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass(i),c=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/*
+ * jQuery UI Dialog 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.button.js
+ * jquery.ui.draggable.js
+ * jquery.ui.mouse.js
+ * jquery.ui.position.js
+ * jquery.ui.resizable.js
+ */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||"&#160;",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||"&#160;"))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b<c?a(window).height()+"px":b+"px"}return a(document).height()+"px"},width:function(){var b,c;if(a.browser.msie){b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return b<c?a(window).width()+"px":b+"px"}return a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);/*
+ * jQuery UI Slider 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
+ */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=a(this).data("index.ui-slider-handle"),f,g,h,i;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:d.preventDefault();if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),f=b._start(d,e);if(f===!1)return}}i=b.options.step,b.options.values&&b.options.values.length?g=h=b.values(e):g=h=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===b._valueMax())return;h=b._trimAlignValue(g+i);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-i)}b._slide(d,e,h)}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/*
+ * jQuery UI Tabs 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){t=d.selected,e()}:function(a){a.clientX&&c.rotate(null)});a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate);return this}})})(jQuery);/*
+ * jQuery UI Datepicker 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker
+ *
+ * Depends:
+ * jquery.ui.core.js
+ */(function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;c&&s++;return c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0],r+=d.length;return!1}});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;c&&m++;return c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;c&&e++;return c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0));return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),
+a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/*
+ * jQuery UI Progressbar 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/*
+ * jQuery UI Effects 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/
+ */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){b=="toggle"&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);if((c/=f/2)<1)return e/2*c*c*(((g*=1.525)+1)*c-g)+d;return e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){if(c<f/2)return a.easing.easeInBounce(b,c*2,0,e,f)*.5+d;return a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery);/*
+ * jQuery UI Effects Blind 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Blind
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/*
+ * jQuery UI Effects Bounce 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Bounce
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/*
+ * jQuery UI Effects Clip 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Clip
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}})(jQuery);/*
+ * jQuery UI Effects Drop 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Drop
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0})/2:c.outerWidth({margin:!0})/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
+ * jQuery UI Effects Explode 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Explode
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/*
+ * jQuery UI Effects Fade 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Fade
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
+ * jQuery UI Effects Fold 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Fold
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/*
+ * jQuery UI Effects Highlight 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Highlight
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
+ * jQuery UI Effects Pulsate 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Pulsate
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&&times--;for(var e=0;e<times;e++)c.animate({opacity:animateTo},duration,b.options.easing),animateTo=(animateTo+1)%2;c.animate({opacity:animateTo},duration,b.options.easing,function(){animateTo==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);/*
+ * jQuery UI Effects Scale 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Scale
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){child=a(this),k&&a.effects.save(child,f);var c={height:child.height(),width:child.width()};child.from={height:c.height*q.from.y,width:c.width*q.from.x},child.to={height:c.height*q.to.y,width:c.width*q.to.x},q.from.y!=q.to.y&&(child.from=a.effects.setTransition(child,h,q.from.y,child.from),child.to=a.effects.setTransition(child,h,q.to.y,child.to)),q.from.x!=q.to.x&&(child.from=a.effects.setTransition(child,i,q.from.x,child.from),child.to=a.effects.setTransition(child,i,q.to.x,child.to)),child.css(child.from),child.animate(child.to,b.duration,b.options.easing,function(){k&&a.effects.restore(child,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
+ * jQuery UI Effects Shake 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Shake
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/*
+ * jQuery UI Effects Slide 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Slide
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0}):c.outerWidth({margin:!0}));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
+ * jQuery UI Effects Transfer 1.8.18
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Effects/Transfer
+ *
+ * Depends:
+ * jquery.effects.core.js
+ */(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file
diff --git a/public/admin/stylesheets/admin.css b/public/admin/stylesheets/admin.css
new file mode 100644
index 000000000..9c98ac432
--- /dev/null
+++ b/public/admin/stylesheets/admin.css
@@ -0,0 +1,1005 @@
+/* $iconSpritePath: image-url('glyphicons-halflings.png');
+$iconWhiteSpritePath: image-url('glyphicons-halflings-white.png'); */
+/* As we're namespacing bootstrap to class admin, which is applied to the body element in the admin interface (no id or class allowed on the HTML element in HTML 4.01) and to the navbar also, so it can be styled with bootstrap when showing for admin users on the front end, re-apply the bootstrap html and body styles here.
+*/
+html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
+
+body.admin { margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px; color: #333333; background-color: white; }
+
+/* When the admin stylesheet is loaded (and so the user is seeing the admin navbar), pad the banner of the front end interface so that it isn't hidden, and move any special notice down too.
+*/
+.entirebody, #banner { padding-top: 50px; }
+
+#special-notice { margin-top: 50px; }
+
+.admin { /*
+ * Bootstrap v2.2.2
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */ /* Allow for input prepend/append in search forms */ /* White icons with optional class, or on hover/active states of certain elements */ /* move down carets for tabs */ @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; }
+ to { background-position: 0 0; } }
+ @-moz-keyframes progress-bar-stripes { from { background-position: 40px 0; }
+ to { background-position: 0 0; } }
+ @-ms-keyframes progress-bar-stripes { from { background-position: 40px 0; }
+ to { background-position: 0 0; } }
+ @-o-keyframes progress-bar-stripes { from { background-position: 0 0; }
+ to { background-position: 40px 0; } }
+ @keyframes progress-bar-stripes { from { background-position: 40px 0; }
+ to { background-position: 0 0; } }
+ }
+.admin article, .admin aside, .admin details, .admin figcaption, .admin figure, .admin footer, .admin header, .admin hgroup, .admin nav, .admin section { display: block; }
+.admin audio, .admin canvas, .admin video { display: inline-block; *display: inline; *zoom: 1; }
+.admin audio:not([controls]) { display: none; }
+.admin html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
+.admin a:focus { outline: thin dotted #333333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; }
+.admin a:hover, .admin a:active { outline: 0; }
+.admin sub, .admin sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; }
+.admin sup { top: -0.5em; }
+.admin sub { bottom: -0.25em; }
+.admin img { /* Responsive images (ensure images don't scale beyond their parents) */ max-width: 100%; /* Part 1: Set a maxium relative to the parent */ width: auto\9; /* IE7-8 need help adjusting responsive images */ height: auto; /* Part 2: Scale the height according to the width, otherwise you get stretching */ vertical-align: middle; border: 0; -ms-interpolation-mode: bicubic; }
+.admin #map_canvas img, .admin .google-maps img { max-width: none; }
+.admin button, .admin input, .admin select, .admin textarea { margin: 0; font-size: 100%; vertical-align: middle; }
+.admin button, .admin input { *overflow: visible; line-height: normal; }
+.admin button::-moz-focus-inner, .admin input::-moz-focus-inner { padding: 0; border: 0; }
+.admin button, .admin html input[type="button"], .admin input[type="reset"], .admin input[type="submit"] { -webkit-appearance: button; cursor: pointer; }
+.admin label, .admin select, .admin button, .admin input[type="button"], .admin input[type="reset"], .admin input[type="submit"], .admin input[type="radio"], .admin input[type="checkbox"] { cursor: pointer; }
+.admin input[type="search"] { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-appearance: textfield; }
+.admin input[type="search"]::-webkit-search-decoration, .admin input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
+.admin textarea { overflow: auto; vertical-align: top; }
+@media print { .admin { @page { margin: 0.5cm; }
+ }
+ .admin * { text-shadow: none !important; color: black !important; background: transparent !important; box-shadow: none !important; }
+ .admin a, .admin a:visited { text-decoration: underline; }
+ .admin a[href]:after { content: " (" attr(href) ")"; }
+ .admin abbr[title]:after { content: " (" attr(title) ")"; }
+ .admin .ir a:after, .admin a[href^="javascript:"]:after, .admin a[href^="#"]:after { content: ""; }
+ .admin pre, .admin blockquote { border: 1px solid #999999; page-break-inside: avoid; }
+ .admin thead { display: table-header-group; }
+ .admin tr, .admin img { page-break-inside: avoid; }
+ .admin img { max-width: 100% !important; }
+ .admin p, .admin h2, .admin h3 { orphans: 3; widows: 3; }
+ .admin h2, .admin h3 { page-break-after: avoid; } }
+.admin body { margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 20px; color: #333333; background-color: white; }
+.admin a { color: #0088cc; text-decoration: none; }
+.admin a:hover { color: #005580; text-decoration: underline; }
+.admin .img-rounded { -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; }
+.admin .img-polaroid { padding: 4px; background-color: #fff; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
+.admin .img-circle { -webkit-border-radius: 500px; -moz-border-radius: 500px; border-radius: 500px; }
+.admin .row { margin-left: -20px; *zoom: 1; }
+.admin .row:before, .admin .row:after { display: table; content: ""; line-height: 0; }
+.admin .row:after { clear: both; }
+.admin [class*="span"] { float: left; min-height: 1px; margin-left: 20px; }
+.admin .container, .admin .navbar-static-top .container, .admin .navbar-fixed-top .container, .admin .navbar-fixed-bottom .container { width: 940px; }
+.admin .span12 { width: 940px; }
+.admin .span11 { width: 860px; }
+.admin .span10 { width: 780px; }
+.admin .span9 { width: 700px; }
+.admin .span8 { width: 620px; }
+.admin .span7 { width: 540px; }
+.admin .span6 { width: 460px; }
+.admin .span5 { width: 380px; }
+.admin .span4 { width: 300px; }
+.admin .span3 { width: 220px; }
+.admin .span2 { width: 140px; }
+.admin .span1 { width: 60px; }
+.admin .offset12 { margin-left: 980px; }
+.admin .offset11 { margin-left: 900px; }
+.admin .offset10 { margin-left: 820px; }
+.admin .offset9 { margin-left: 740px; }
+.admin .offset8 { margin-left: 660px; }
+.admin .offset7 { margin-left: 580px; }
+.admin .offset6 { margin-left: 500px; }
+.admin .offset5 { margin-left: 420px; }
+.admin .offset4 { margin-left: 340px; }
+.admin .offset3 { margin-left: 260px; }
+.admin .offset2 { margin-left: 180px; }
+.admin .offset1 { margin-left: 100px; }
+.admin .row-fluid { width: 100%; *zoom: 1; }
+.admin .row-fluid:before, .admin .row-fluid:after { display: table; content: ""; line-height: 0; }
+.admin .row-fluid:after { clear: both; }
+.admin .row-fluid [class*="span"] { display: block; width: 100%; min-height: 30px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.12766%; *margin-left: 2.07447%; }
+.admin .row-fluid [class*="span"]:first-child { margin-left: 0; }
+.admin .row-fluid .controls-row [class*="span"] + [class*="span"] { margin-left: 2.12766%; }
+.admin .row-fluid .span12 { width: 100%; *width: 99.94681%; }
+.admin .row-fluid .span11 { width: 91.48936%; *width: 91.43617%; }
+.admin .row-fluid .span10 { width: 82.97872%; *width: 82.92553%; }
+.admin .row-fluid .span9 { width: 74.46809%; *width: 74.41489%; }
+.admin .row-fluid .span8 { width: 65.95745%; *width: 65.90426%; }
+.admin .row-fluid .span7 { width: 57.44681%; *width: 57.39362%; }
+.admin .row-fluid .span6 { width: 48.93617%; *width: 48.88298%; }
+.admin .row-fluid .span5 { width: 40.42553%; *width: 40.37234%; }
+.admin .row-fluid .span4 { width: 31.91489%; *width: 31.8617%; }
+.admin .row-fluid .span3 { width: 23.40426%; *width: 23.35106%; }
+.admin .row-fluid .span2 { width: 14.89362%; *width: 14.84043%; }
+.admin .row-fluid .span1 { width: 6.38298%; *width: 6.32979%; }
+.admin .row-fluid .offset12 { margin-left: 104.25532%; *margin-left: 104.14894%; }
+.admin .row-fluid .offset12:first-child { margin-left: 102.12766%; *margin-left: 102.02128%; }
+.admin .row-fluid .offset11 { margin-left: 95.74468%; *margin-left: 95.6383%; }
+.admin .row-fluid .offset11:first-child { margin-left: 93.61702%; *margin-left: 93.51064%; }
+.admin .row-fluid .offset10 { margin-left: 87.23404%; *margin-left: 87.12766%; }
+.admin .row-fluid .offset10:first-child { margin-left: 85.10638%; *margin-left: 85.0%; }
+.admin .row-fluid .offset9 { margin-left: 78.7234%; *margin-left: 78.61702%; }
+.admin .row-fluid .offset9:first-child { margin-left: 76.59574%; *margin-left: 76.48936%; }
+.admin .row-fluid .offset8 { margin-left: 70.21277%; *margin-left: 70.10638%; }
+.admin .row-fluid .offset8:first-child { margin-left: 68.08511%; *margin-left: 67.97872%; }
+.admin .row-fluid .offset7 { margin-left: 61.70213%; *margin-left: 61.59574%; }
+.admin .row-fluid .offset7:first-child { margin-left: 59.57447%; *margin-left: 59.46809%; }
+.admin .row-fluid .offset6 { margin-left: 53.19149%; *margin-left: 53.08511%; }
+.admin .row-fluid .offset6:first-child { margin-left: 51.06383%; *margin-left: 50.95745%; }
+.admin .row-fluid .offset5 { margin-left: 44.68085%; *margin-left: 44.57447%; }
+.admin .row-fluid .offset5:first-child { margin-left: 42.55319%; *margin-left: 42.44681%; }
+.admin .row-fluid .offset4 { margin-left: 36.17021%; *margin-left: 36.06383%; }
+.admin .row-fluid .offset4:first-child { margin-left: 34.04255%; *margin-left: 33.93617%; }
+.admin .row-fluid .offset3 { margin-left: 27.65957%; *margin-left: 27.55319%; }
+.admin .row-fluid .offset3:first-child { margin-left: 25.53191%; *margin-left: 25.42553%; }
+.admin .row-fluid .offset2 { margin-left: 19.14894%; *margin-left: 19.04255%; }
+.admin .row-fluid .offset2:first-child { margin-left: 17.02128%; *margin-left: 16.91489%; }
+.admin .row-fluid .offset1 { margin-left: 10.6383%; *margin-left: 10.53191%; }
+.admin .row-fluid .offset1:first-child { margin-left: 8.51064%; *margin-left: 8.40426%; }
+.admin [class*="span"].hide, .admin .row-fluid [class*="span"].hide { display: none; }
+.admin [class*="span"].pull-right, .admin .row-fluid [class*="span"].pull-right { float: right; }
+.admin .container { margin-right: auto; margin-left: auto; *zoom: 1; }
+.admin .container:before, .admin .container:after { display: table; content: ""; line-height: 0; }
+.admin .container:after { clear: both; }
+.admin .container-fluid { padding-right: 20px; padding-left: 20px; *zoom: 1; }
+.admin .container-fluid:before, .admin .container-fluid:after { display: table; content: ""; line-height: 0; }
+.admin .container-fluid:after { clear: both; }
+.admin p { margin: 0 0 10px; }
+.admin .lead { margin-bottom: 20px; font-size: 21px; font-weight: 200; line-height: 30px; }
+.admin small { font-size: 85%; }
+.admin strong { font-weight: bold; }
+.admin em { font-style: italic; }
+.admin cite { font-style: normal; }
+.admin .muted { color: #999999; }
+.admin a.muted:hover { color: gray; }
+.admin .text-warning { color: #c09853; }
+.admin a.text-warning:hover { color: #a47e3c; }
+.admin .text-error { color: #b94a48; }
+.admin a.text-error:hover { color: #953b39; }
+.admin .text-info { color: #3a87ad; }
+.admin a.text-info:hover { color: #2d6987; }
+.admin .text-success { color: #468847; }
+.admin a.text-success:hover { color: #356635; }
+.admin h1, .admin h2, .admin h3, .admin h4, .admin h5, .admin h6 { margin: 10px 0; font-family: inherit; font-weight: bold; line-height: 20px; color: inherit; text-rendering: optimizelegibility; }
+.admin h1 small, .admin h2 small, .admin h3 small, .admin h4 small, .admin h5 small, .admin h6 small { font-weight: normal; line-height: 1; color: #999999; }
+.admin h1, .admin h2, .admin h3 { line-height: 40px; }
+.admin h1 { font-size: 38.5px; }
+.admin h2 { font-size: 31.5px; }
+.admin h3 { font-size: 24.5px; }
+.admin h4 { font-size: 17.5px; }
+.admin h5 { font-size: 14px; }
+.admin h6 { font-size: 11.9px; }
+.admin h1 small { font-size: 24.5px; }
+.admin h2 small { font-size: 17.5px; }
+.admin h3 small { font-size: 14px; }
+.admin h4 small { font-size: 14px; }
+.admin .page-header { padding-bottom: 9px; margin: 20px 0 30px; border-bottom: 1px solid #eeeeee; }
+.admin ul, .admin ol { padding: 0; margin: 0 0 10px 25px; }
+.admin ul ul, .admin ul ol, .admin ol ol, .admin ol ul { margin-bottom: 0; }
+.admin li { line-height: 20px; }
+.admin ul.unstyled, .admin ol.unstyled { margin-left: 0; list-style: none; }
+.admin ul.inline, .admin ol.inline { margin-left: 0; list-style: none; }
+.admin ul.inline > li, .admin ol.inline > li { display: inline-block; padding-left: 5px; padding-right: 5px; }
+.admin dl { margin-bottom: 20px; }
+.admin dt, .admin dd { line-height: 20px; }
+.admin dt { font-weight: bold; }
+.admin dd { margin-left: 10px; }
+.admin .dl-horizontal { *zoom: 1; }
+.admin .dl-horizontal:before, .admin .dl-horizontal:after { display: table; content: ""; line-height: 0; }
+.admin .dl-horizontal:after { clear: both; }
+.admin .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.admin .dl-horizontal dd { margin-left: 180px; }
+.admin hr { margin: 20px 0; border: 0; border-top: 1px solid #eeeeee; border-bottom: 1px solid white; }
+.admin abbr[title], .admin abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #999999; }
+.admin abbr.initialism { font-size: 90%; text-transform: uppercase; }
+.admin blockquote { padding: 0 0 0 15px; margin: 0 0 20px; border-left: 5px solid #eeeeee; }
+.admin blockquote p { margin-bottom: 0; font-size: 16px; font-weight: 300; line-height: 25px; }
+.admin blockquote small { display: block; line-height: 20px; color: #999999; }
+.admin blockquote small:before { content: '\2014 \00A0'; }
+.admin blockquote.pull-right { float: right; padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; }
+.admin blockquote.pull-right p, .admin blockquote.pull-right small { text-align: right; }
+.admin blockquote.pull-right small:before { content: ''; }
+.admin blockquote.pull-right small:after { content: '\00A0 \2014'; }
+.admin q:before, .admin q:after, .admin blockquote:before, .admin blockquote:after { content: ""; }
+.admin address { display: block; margin-bottom: 20px; font-style: normal; line-height: 20px; }
+.admin code, .admin pre { padding: 0 3px 2px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: #333333; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
+.admin code { padding: 2px 4px; color: #d14; background-color: #f7f7f9; border: 1px solid #e1e1e8; white-space: nowrap; }
+.admin pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 20px; word-break: break-all; word-wrap: break-word; white-space: pre; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
+.admin pre.prettyprint { margin-bottom: 20px; }
+.admin pre code { padding: 0; color: inherit; white-space: pre; white-space: pre-wrap; background-color: transparent; border: 0; }
+.admin .pre-scrollable { max-height: 340px; overflow-y: scroll; }
+.admin form { margin: 0 0 20px; }
+.admin fieldset { padding: 0; margin: 0; border: 0; }
+.admin legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: 40px; color: #333333; border: 0; border-bottom: 1px solid #e5e5e5; }
+.admin legend small { font-size: 15px; color: #999999; }
+.admin label, .admin input, .admin button, .admin select, .admin textarea { font-size: 14px; font-weight: normal; line-height: 20px; }
+.admin input, .admin button, .admin select, .admin textarea { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
+.admin label { display: block; margin-bottom: 5px; }
+.admin select, .admin textarea, .admin input[type="text"], .admin input[type="password"], .admin input[type="datetime"], .admin input[type="datetime-local"], .admin input[type="date"], .admin input[type="month"], .admin input[type="time"], .admin input[type="week"], .admin input[type="number"], .admin input[type="email"], .admin input[type="url"], .admin input[type="search"], .admin input[type="tel"], .admin input[type="color"], .admin .uneditable-input { display: inline-block; height: 20px; padding: 4px 6px; margin-bottom: 10px; font-size: 14px; line-height: 20px; color: #555555; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; vertical-align: middle; }
+.admin input, .admin textarea, .admin .uneditable-input { width: 206px; }
+.admin textarea { height: auto; }
+.admin textarea, .admin input[type="text"], .admin input[type="password"], .admin input[type="datetime"], .admin input[type="datetime-local"], .admin input[type="date"], .admin input[type="month"], .admin input[type="time"], .admin input[type="week"], .admin input[type="number"], .admin input[type="email"], .admin input[type="url"], .admin input[type="search"], .admin input[type="tel"], .admin input[type="color"], .admin .uneditable-input { background-color: white; border: 1px solid #cccccc; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; -moz-transition: border linear 0.2s, box-shadow linear 0.2s; -o-transition: border linear 0.2s, box-shadow linear 0.2s; transition: border linear 0.2s, box-shadow linear 0.2s; }
+.admin textarea:focus, .admin input[type="text"]:focus, .admin input[type="password"]:focus, .admin input[type="datetime"]:focus, .admin input[type="datetime-local"]:focus, .admin input[type="date"]:focus, .admin input[type="month"]:focus, .admin input[type="time"]:focus, .admin input[type="week"]:focus, .admin input[type="number"]:focus, .admin input[type="email"]:focus, .admin input[type="url"]:focus, .admin input[type="search"]:focus, .admin input[type="tel"]:focus, .admin input[type="color"]:focus, .admin .uneditable-input:focus { border-color: rgba(82, 168, 236, 0.8); outline: 0; outline: thin dotted \9; /* IE6-9 */ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); }
+.admin input[type="radio"], .admin input[type="checkbox"] { margin: 4px 0 0; *margin-top: 0; /* IE7 */ margin-top: 1px \9; /* IE8-9 */ line-height: normal; }
+.admin input[type="file"], .admin input[type="image"], .admin input[type="submit"], .admin input[type="reset"], .admin input[type="button"], .admin input[type="radio"], .admin input[type="checkbox"] { width: auto; }
+.admin select, .admin input[type="file"] { height: 30px; /* In IE7, the height of the select element cannot be changed by height, only font-size */ *margin-top: 4px; /* For IE7, add top margin to align select with labels */ line-height: 30px; }
+.admin select { width: 220px; border: 1px solid #cccccc; background-color: white; }
+.admin select[multiple], .admin select[size] { height: auto; }
+.admin select:focus, .admin input[type="file"]:focus, .admin input[type="radio"]:focus, .admin input[type="checkbox"]:focus { outline: thin dotted #333333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; }
+.admin .uneditable-input, .admin .uneditable-textarea { color: #999999; background-color: #fcfcfc; border-color: #cccccc; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); cursor: not-allowed; }
+.admin .uneditable-input { overflow: hidden; white-space: nowrap; }
+.admin .uneditable-textarea { width: auto; height: auto; }
+.admin input:-moz-placeholder, .admin textarea:-moz-placeholder { color: #999999; }
+.admin input:-ms-input-placeholder, .admin textarea:-ms-input-placeholder { color: #999999; }
+.admin input::-webkit-input-placeholder, .admin textarea::-webkit-input-placeholder { color: #999999; }
+.admin .radio, .admin .checkbox { min-height: 20px; padding-left: 20px; }
+.admin .radio input[type="radio"], .admin .checkbox input[type="checkbox"] { float: left; margin-left: -20px; }
+.admin .controls > .radio:first-child, .admin .controls > .checkbox:first-child { padding-top: 5px; }
+.admin .radio.inline, .admin .checkbox.inline { display: inline-block; padding-top: 5px; margin-bottom: 0; vertical-align: middle; }
+.admin .radio.inline + .radio.inline, .admin .checkbox.inline + .checkbox.inline { margin-left: 10px; }
+.admin .input-mini { width: 60px; }
+.admin .input-small { width: 90px; }
+.admin .input-medium { width: 150px; }
+.admin .input-large { width: 210px; }
+.admin .input-xlarge { width: 270px; }
+.admin .input-xxlarge { width: 530px; }
+.admin input[class*="span"], .admin select[class*="span"], .admin textarea[class*="span"], .admin .uneditable-input[class*="span"], .admin .row-fluid input[class*="span"], .admin .row-fluid select[class*="span"], .admin .row-fluid textarea[class*="span"], .admin .row-fluid .uneditable-input[class*="span"] { float: none; margin-left: 0; }
+.admin .input-append input[class*="span"], .admin .input-append .uneditable-input[class*="span"], .admin .input-prepend input[class*="span"], .admin .input-prepend .uneditable-input[class*="span"], .admin .row-fluid input[class*="span"], .admin .row-fluid select[class*="span"], .admin .row-fluid textarea[class*="span"], .admin .row-fluid .uneditable-input[class*="span"], .admin .row-fluid .input-prepend [class*="span"], .admin .row-fluid .input-append [class*="span"] { display: inline-block; }
+.admin input, .admin textarea, .admin .uneditable-input { margin-left: 0; }
+.admin .controls-row [class*="span"] + [class*="span"] { margin-left: 20px; }
+.admin input.span12, .admin textarea.span12, .admin .uneditable-input.span12 { width: 926px; }
+.admin input.span11, .admin textarea.span11, .admin .uneditable-input.span11 { width: 846px; }
+.admin input.span10, .admin textarea.span10, .admin .uneditable-input.span10 { width: 766px; }
+.admin input.span9, .admin textarea.span9, .admin .uneditable-input.span9 { width: 686px; }
+.admin input.span8, .admin textarea.span8, .admin .uneditable-input.span8 { width: 606px; }
+.admin input.span7, .admin textarea.span7, .admin .uneditable-input.span7 { width: 526px; }
+.admin input.span6, .admin textarea.span6, .admin .uneditable-input.span6 { width: 446px; }
+.admin input.span5, .admin textarea.span5, .admin .uneditable-input.span5 { width: 366px; }
+.admin input.span4, .admin textarea.span4, .admin .uneditable-input.span4 { width: 286px; }
+.admin input.span3, .admin textarea.span3, .admin .uneditable-input.span3 { width: 206px; }
+.admin input.span2, .admin textarea.span2, .admin .uneditable-input.span2 { width: 126px; }
+.admin input.span1, .admin textarea.span1, .admin .uneditable-input.span1 { width: 46px; }
+.admin .controls-row { *zoom: 1; }
+.admin .controls-row:before, .admin .controls-row:after { display: table; content: ""; line-height: 0; }
+.admin .controls-row:after { clear: both; }
+.admin .controls-row [class*="span"], .admin .row-fluid .controls-row [class*="span"] { float: left; }
+.admin .controls-row .checkbox[class*="span"], .admin .controls-row .radio[class*="span"] { padding-top: 5px; }
+.admin input[disabled], .admin select[disabled], .admin textarea[disabled], .admin input[readonly], .admin select[readonly], .admin textarea[readonly] { cursor: not-allowed; background-color: #eeeeee; }
+.admin input[type="radio"][disabled], .admin input[type="checkbox"][disabled], .admin input[type="radio"][readonly], .admin input[type="checkbox"][readonly] { background-color: transparent; }
+.admin .control-group.warning .control-label, .admin .control-group.warning .help-block, .admin .control-group.warning .help-inline { color: #c09853; }
+.admin .control-group.warning .checkbox, .admin .control-group.warning .radio, .admin .control-group.warning input, .admin .control-group.warning select, .admin .control-group.warning textarea { color: #c09853; }
+.admin .control-group.warning input, .admin .control-group.warning select, .admin .control-group.warning textarea { border-color: #c09853; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
+.admin .control-group.warning input:focus, .admin .control-group.warning select:focus, .admin .control-group.warning textarea:focus { border-color: #a47e3c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; }
+.admin .control-group.warning .input-prepend .add-on, .admin .control-group.warning .input-append .add-on { color: #c09853; background-color: #fcf8e3; border-color: #c09853; }
+.admin .control-group.error .control-label, .admin .control-group.error .help-block, .admin .control-group.error .help-inline { color: #b94a48; }
+.admin .control-group.error .checkbox, .admin .control-group.error .radio, .admin .control-group.error input, .admin .control-group.error select, .admin .control-group.error textarea { color: #b94a48; }
+.admin .control-group.error input, .admin .control-group.error select, .admin .control-group.error textarea { border-color: #b94a48; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
+.admin .control-group.error input:focus, .admin .control-group.error select:focus, .admin .control-group.error textarea:focus { border-color: #953b39; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; }
+.admin .control-group.error .input-prepend .add-on, .admin .control-group.error .input-append .add-on { color: #b94a48; background-color: #f2dede; border-color: #b94a48; }
+.admin .control-group.success .control-label, .admin .control-group.success .help-block, .admin .control-group.success .help-inline { color: #468847; }
+.admin .control-group.success .checkbox, .admin .control-group.success .radio, .admin .control-group.success input, .admin .control-group.success select, .admin .control-group.success textarea { color: #468847; }
+.admin .control-group.success input, .admin .control-group.success select, .admin .control-group.success textarea { border-color: #468847; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
+.admin .control-group.success input:focus, .admin .control-group.success select:focus, .admin .control-group.success textarea:focus { border-color: #356635; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; }
+.admin .control-group.success .input-prepend .add-on, .admin .control-group.success .input-append .add-on { color: #468847; background-color: #dff0d8; border-color: #468847; }
+.admin .control-group.info .control-label, .admin .control-group.info .help-block, .admin .control-group.info .help-inline { color: #3a87ad; }
+.admin .control-group.info .checkbox, .admin .control-group.info .radio, .admin .control-group.info input, .admin .control-group.info select, .admin .control-group.info textarea { color: #3a87ad; }
+.admin .control-group.info input, .admin .control-group.info select, .admin .control-group.info textarea { border-color: #3a87ad; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); }
+.admin .control-group.info input:focus, .admin .control-group.info select:focus, .admin .control-group.info textarea:focus { border-color: #2d6987; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; }
+.admin .control-group.info .input-prepend .add-on, .admin .control-group.info .input-append .add-on { color: #3a87ad; background-color: #d9edf7; border-color: #3a87ad; }
+.admin input:focus:invalid, .admin textarea:focus:invalid, .admin select:focus:invalid { color: #b94a48; border-color: #ee5f5b; }
+.admin input:focus:invalid:focus, .admin textarea:focus:invalid:focus, .admin select:focus:invalid:focus { border-color: #e9322d; -webkit-box-shadow: 0 0 6px #f8b9b7; -moz-box-shadow: 0 0 6px #f8b9b7; box-shadow: 0 0 6px #f8b9b7; }
+.admin .form-actions { padding: 19px 20px 20px; margin-top: 20px; margin-bottom: 20px; background-color: whitesmoke; border-top: 1px solid #e5e5e5; *zoom: 1; }
+.admin .form-actions:before, .admin .form-actions:after { display: table; content: ""; line-height: 0; }
+.admin .form-actions:after { clear: both; }
+.admin .help-block, .admin .help-inline { color: #595959; }
+.admin .help-block { display: block; margin-bottom: 10px; }
+.admin .help-inline { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; vertical-align: middle; padding-left: 5px; }
+.admin .input-append, .admin .input-prepend { margin-bottom: 5px; font-size: 0; white-space: nowrap; }
+.admin .input-append input, .admin .input-append select, .admin .input-append .uneditable-input, .admin .input-append .dropdown-menu, .admin .input-prepend input, .admin .input-prepend select, .admin .input-prepend .uneditable-input, .admin .input-prepend .dropdown-menu { font-size: 14px; }
+.admin .input-append input, .admin .input-append select, .admin .input-append .uneditable-input, .admin .input-prepend input, .admin .input-prepend select, .admin .input-prepend .uneditable-input { position: relative; margin-bottom: 0; *margin-left: 0; vertical-align: top; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; }
+.admin .input-append input:focus, .admin .input-append select:focus, .admin .input-append .uneditable-input:focus, .admin .input-prepend input:focus, .admin .input-prepend select:focus, .admin .input-prepend .uneditable-input:focus { z-index: 2; }
+.admin .input-append .add-on, .admin .input-prepend .add-on { display: inline-block; width: auto; height: 20px; min-width: 16px; padding: 4px 5px; font-size: 14px; font-weight: normal; line-height: 20px; text-align: center; text-shadow: 0 1px 0 white; background-color: #eeeeee; border: 1px solid #cccccc; }
+.admin .input-append .add-on, .admin .input-append .btn, .admin .input-append .btn-group > .dropdown-toggle, .admin .input-prepend .add-on, .admin .input-prepend .btn, .admin .input-prepend .btn-group > .dropdown-toggle { vertical-align: top; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .input-append .active, .admin .input-prepend .active { background-color: #a9dba9; border-color: #46a546; }
+.admin .input-prepend .add-on, .admin .input-prepend .btn { margin-right: -1px; }
+.admin .input-prepend .add-on:first-child, .admin .input-prepend .btn:first-child { -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; }
+.admin .input-append input, .admin .input-append select, .admin .input-append .uneditable-input { -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; }
+.admin .input-append input + .btn-group .btn:last-child, .admin .input-append select + .btn-group .btn:last-child, .admin .input-append .uneditable-input + .btn-group .btn:last-child { -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; }
+.admin .input-append .add-on, .admin .input-append .btn, .admin .input-append .btn-group { margin-left: -1px; }
+.admin .input-append .add-on:last-child, .admin .input-append .btn:last-child, .admin .input-append .btn-group:last-child > .dropdown-toggle { -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; }
+.admin .input-prepend.input-append input, .admin .input-prepend.input-append select, .admin .input-prepend.input-append .uneditable-input { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .input-prepend.input-append input + .btn-group .btn, .admin .input-prepend.input-append select + .btn-group .btn, .admin .input-prepend.input-append .uneditable-input + .btn-group .btn { -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; }
+.admin .input-prepend.input-append .add-on:first-child, .admin .input-prepend.input-append .btn:first-child { margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; }
+.admin .input-prepend.input-append .add-on:last-child, .admin .input-prepend.input-append .btn:last-child { margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; }
+.admin .input-prepend.input-append .btn-group:first-child { margin-left: 0; }
+.admin input.search-query { padding-right: 14px; padding-right: 4px \9; padding-left: 14px; padding-left: 4px \9; /* IE7-8 doesn't have border-radius, so don't indent the padding */ margin-bottom: 0; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; }
+.admin .form-search .input-append .search-query, .admin .form-search .input-prepend .search-query { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .form-search .input-append .search-query { -webkit-border-radius: 14px 0 0 14px; -moz-border-radius: 14px 0 0 14px; border-radius: 14px 0 0 14px; }
+.admin .form-search .input-append .btn { -webkit-border-radius: 0 14px 14px 0; -moz-border-radius: 0 14px 14px 0; border-radius: 0 14px 14px 0; }
+.admin .form-search .input-prepend .search-query { -webkit-border-radius: 0 14px 14px 0; -moz-border-radius: 0 14px 14px 0; border-radius: 0 14px 14px 0; }
+.admin .form-search .input-prepend .btn { -webkit-border-radius: 14px 0 0 14px; -moz-border-radius: 14px 0 0 14px; border-radius: 14px 0 0 14px; }
+.admin .form-search input, .admin .form-search textarea, .admin .form-search select, .admin .form-search .help-inline, .admin .form-search .uneditable-input, .admin .form-search .input-prepend, .admin .form-search .input-append, .admin .form-inline input, .admin .form-inline textarea, .admin .form-inline select, .admin .form-inline .help-inline, .admin .form-inline .uneditable-input, .admin .form-inline .input-prepend, .admin .form-inline .input-append, .admin .form-horizontal input, .admin .form-horizontal textarea, .admin .form-horizontal select, .admin .form-horizontal .help-inline, .admin .form-horizontal .uneditable-input, .admin .form-horizontal .input-prepend, .admin .form-horizontal .input-append { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; margin-bottom: 0; vertical-align: middle; }
+.admin .form-search .hide, .admin .form-inline .hide, .admin .form-horizontal .hide { display: none; }
+.admin .form-search label, .admin .form-inline label, .admin .form-search .btn-group, .admin .form-inline .btn-group { display: inline-block; }
+.admin .form-search .input-append, .admin .form-inline .input-append, .admin .form-search .input-prepend, .admin .form-inline .input-prepend { margin-bottom: 0; }
+.admin .form-search .radio, .admin .form-search .checkbox, .admin .form-inline .radio, .admin .form-inline .checkbox { padding-left: 0; margin-bottom: 0; vertical-align: middle; }
+.admin .form-search .radio input[type="radio"], .admin .form-search .checkbox input[type="checkbox"], .admin .form-inline .radio input[type="radio"], .admin .form-inline .checkbox input[type="checkbox"] { float: left; margin-right: 3px; margin-left: 0; }
+.admin .control-group { margin-bottom: 10px; }
+.admin legend + .control-group { margin-top: 20px; -webkit-margin-top-collapse: separate; }
+.admin .form-horizontal .control-group { margin-bottom: 20px; *zoom: 1; }
+.admin .form-horizontal .control-group:before, .admin .form-horizontal .control-group:after { display: table; content: ""; line-height: 0; }
+.admin .form-horizontal .control-group:after { clear: both; }
+.admin .form-horizontal .control-label { float: left; width: 160px; padding-top: 5px; text-align: right; }
+.admin .form-horizontal .controls { *display: inline-block; *padding-left: 20px; margin-left: 180px; *margin-left: 0; }
+.admin .form-horizontal .controls:first-child { *padding-left: 180px; }
+.admin .form-horizontal .help-block { margin-bottom: 0; }
+.admin .form-horizontal input + .help-block, .admin .form-horizontal select + .help-block, .admin .form-horizontal textarea + .help-block, .admin .form-horizontal .uneditable-input + .help-block, .admin .form-horizontal .input-prepend + .help-block, .admin .form-horizontal .input-append + .help-block { margin-top: 10px; }
+.admin .form-horizontal .form-actions { padding-left: 180px; }
+.admin table { max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0; }
+.admin .table { width: 100%; margin-bottom: 20px; }
+.admin .table th, .admin .table td { padding: 8px; line-height: 20px; text-align: left; vertical-align: top; border-top: 1px solid #dddddd; }
+.admin .table th { font-weight: bold; }
+.admin .table thead th { vertical-align: bottom; }
+.admin .table caption + thead tr:first-child th, .admin .table caption + thead tr:first-child td, .admin .table colgroup + thead tr:first-child th, .admin .table colgroup + thead tr:first-child td, .admin .table thead:first-child tr:first-child th, .admin .table thead:first-child tr:first-child td { border-top: 0; }
+.admin .table tbody + tbody { border-top: 2px solid #dddddd; }
+.admin .table .table { background-color: white; }
+.admin .table-condensed th, .admin .table-condensed td { padding: 4px 5px; }
+.admin .table-bordered { border: 1px solid #dddddd; border-collapse: separate; *border-collapse: collapse; border-left: 0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
+.admin .table-bordered th, .admin .table-bordered td { border-left: 1px solid #dddddd; }
+.admin .table-bordered caption + thead tr:first-child th, .admin .table-bordered caption + tbody tr:first-child th, .admin .table-bordered caption + tbody tr:first-child td, .admin .table-bordered colgroup + thead tr:first-child th, .admin .table-bordered colgroup + tbody tr:first-child th, .admin .table-bordered colgroup + tbody tr:first-child td, .admin .table-bordered thead:first-child tr:first-child th, .admin .table-bordered tbody:first-child tr:first-child th, .admin .table-bordered tbody:first-child tr:first-child td { border-top: 0; }
+.admin .table-bordered thead:first-child tr:first-child > th:first-child, .admin .table-bordered tbody:first-child tr:first-child > td:first-child { -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; }
+.admin .table-bordered thead:first-child tr:first-child > th:last-child, .admin .table-bordered tbody:first-child tr:first-child > td:last-child { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; }
+.admin .table-bordered thead:last-child tr:last-child > th:first-child, .admin .table-bordered tbody:last-child tr:last-child > td:first-child, .admin .table-bordered tfoot:last-child tr:last-child > td:first-child { -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; }
+.admin .table-bordered thead:last-child tr:last-child > th:last-child, .admin .table-bordered tbody:last-child tr:last-child > td:last-child, .admin .table-bordered tfoot:last-child tr:last-child > td:last-child { -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; }
+.admin .table-bordered tfoot + tbody:last-child tr:last-child td:first-child { -webkit-border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; border-bottom-left-radius: 0; }
+.admin .table-bordered tfoot + tbody:last-child tr:last-child td:last-child { -webkit-border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; border-bottom-right-radius: 0; }
+.admin .table-bordered caption + thead tr:first-child th:first-child, .admin .table-bordered caption + tbody tr:first-child td:first-child, .admin .table-bordered colgroup + thead tr:first-child th:first-child, .admin .table-bordered colgroup + tbody tr:first-child td:first-child { -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; }
+.admin .table-bordered caption + thead tr:first-child th:last-child, .admin .table-bordered caption + tbody tr:first-child td:last-child, .admin .table-bordered colgroup + thead tr:first-child th:last-child, .admin .table-bordered colgroup + tbody tr:first-child td:last-child { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; }
+.admin .table-striped tbody > tr:nth-child(odd) > td, .admin .table-striped tbody > tr:nth-child(odd) > th { background-color: #f9f9f9; }
+.admin .table-hover tbody tr:hover td, .admin .table-hover tbody tr:hover th { background-color: whitesmoke; }
+.admin table td[class*="span"], .admin table th[class*="span"], .admin .row-fluid table td[class*="span"], .admin .row-fluid table th[class*="span"] { display: table-cell; float: none; margin-left: 0; }
+.admin .table td.span1, .admin .table th.span1 { float: none; width: 44px; margin-left: 0; }
+.admin .table td.span2, .admin .table th.span2 { float: none; width: 124px; margin-left: 0; }
+.admin .table td.span3, .admin .table th.span3 { float: none; width: 204px; margin-left: 0; }
+.admin .table td.span4, .admin .table th.span4 { float: none; width: 284px; margin-left: 0; }
+.admin .table td.span5, .admin .table th.span5 { float: none; width: 364px; margin-left: 0; }
+.admin .table td.span6, .admin .table th.span6 { float: none; width: 444px; margin-left: 0; }
+.admin .table td.span7, .admin .table th.span7 { float: none; width: 524px; margin-left: 0; }
+.admin .table td.span8, .admin .table th.span8 { float: none; width: 604px; margin-left: 0; }
+.admin .table td.span9, .admin .table th.span9 { float: none; width: 684px; margin-left: 0; }
+.admin .table td.span10, .admin .table th.span10 { float: none; width: 764px; margin-left: 0; }
+.admin .table td.span11, .admin .table th.span11 { float: none; width: 844px; margin-left: 0; }
+.admin .table td.span12, .admin .table th.span12 { float: none; width: 924px; margin-left: 0; }
+.admin .table tbody tr.success td { background-color: #dff0d8; }
+.admin .table tbody tr.error td { background-color: #f2dede; }
+.admin .table tbody tr.warning td { background-color: #fcf8e3; }
+.admin .table tbody tr.info td { background-color: #d9edf7; }
+.admin .table-hover tbody tr.success:hover td { background-color: #d0e9c6; }
+.admin .table-hover tbody tr.error:hover td { background-color: #ebcccc; }
+.admin .table-hover tbody tr.warning:hover td { background-color: #faf2cc; }
+.admin .table-hover tbody tr.info:hover td { background-color: #c4e3f3; }
+.admin [class^="icon-"], .admin [class*=" icon-"] { display: inline-block; width: 14px; height: 14px; *margin-right: .3em; line-height: 14px; vertical-align: text-top; background-image: url(../images/glyphicons-halflings.png?1361243119); background-position: 14px 14px; background-repeat: no-repeat; margin-top: 1px; }
+.admin .icon-white, .admin .nav-pills > .active > a > [class^="icon-"], .admin .nav-pills > .active > a > [class*=" icon-"], .admin .nav-list > .active > a > [class^="icon-"], .admin .nav-list > .active > a > [class*=" icon-"], .admin .navbar-inverse .nav > .active > a > [class^="icon-"], .admin .navbar-inverse .nav > .active > a > [class*=" icon-"], .admin .dropdown-menu > li > a:hover > [class^="icon-"], .admin .dropdown-menu > li > a:hover > [class*=" icon-"], .admin .dropdown-menu > .active > a > [class^="icon-"], .admin .dropdown-menu > .active > a > [class*=" icon-"], .admin .dropdown-submenu:hover > a > [class^="icon-"], .admin .dropdown-submenu:hover > a > [class*=" icon-"] { background-image: url(../images/glyphicons-halflings-white.png?1361243119); }
+.admin .icon-glass { background-position: 0 0; }
+.admin .icon-music { background-position: -24px 0; }
+.admin .icon-search { background-position: -48px 0; }
+.admin .icon-envelope { background-position: -72px 0; }
+.admin .icon-heart { background-position: -96px 0; }
+.admin .icon-star { background-position: -120px 0; }
+.admin .icon-star-empty { background-position: -144px 0; }
+.admin .icon-user { background-position: -168px 0; }
+.admin .icon-film { background-position: -192px 0; }
+.admin .icon-th-large { background-position: -216px 0; }
+.admin .icon-th { background-position: -240px 0; }
+.admin .icon-th-list { background-position: -264px 0; }
+.admin .icon-ok { background-position: -288px 0; }
+.admin .icon-remove { background-position: -312px 0; }
+.admin .icon-zoom-in { background-position: -336px 0; }
+.admin .icon-zoom-out { background-position: -360px 0; }
+.admin .icon-off { background-position: -384px 0; }
+.admin .icon-signal { background-position: -408px 0; }
+.admin .icon-cog { background-position: -432px 0; }
+.admin .icon-trash { background-position: -456px 0; }
+.admin .icon-home { background-position: 0 -24px; }
+.admin .icon-file { background-position: -24px -24px; }
+.admin .icon-time { background-position: -48px -24px; }
+.admin .icon-road { background-position: -72px -24px; }
+.admin .icon-download-alt { background-position: -96px -24px; }
+.admin .icon-download { background-position: -120px -24px; }
+.admin .icon-upload { background-position: -144px -24px; }
+.admin .icon-inbox { background-position: -168px -24px; }
+.admin .icon-play-circle { background-position: -192px -24px; }
+.admin .icon-repeat { background-position: -216px -24px; }
+.admin .icon-refresh { background-position: -240px -24px; }
+.admin .icon-list-alt { background-position: -264px -24px; }
+.admin .icon-lock { background-position: -287px -24px; }
+.admin .icon-flag { background-position: -312px -24px; }
+.admin .icon-headphones { background-position: -336px -24px; }
+.admin .icon-volume-off { background-position: -360px -24px; }
+.admin .icon-volume-down { background-position: -384px -24px; }
+.admin .icon-volume-up { background-position: -408px -24px; }
+.admin .icon-qrcode { background-position: -432px -24px; }
+.admin .icon-barcode { background-position: -456px -24px; }
+.admin .icon-tag { background-position: 0 -48px; }
+.admin .icon-tags { background-position: -25px -48px; }
+.admin .icon-book { background-position: -48px -48px; }
+.admin .icon-bookmark { background-position: -72px -48px; }
+.admin .icon-print { background-position: -96px -48px; }
+.admin .icon-camera { background-position: -120px -48px; }
+.admin .icon-font { background-position: -144px -48px; }
+.admin .icon-bold { background-position: -167px -48px; }
+.admin .icon-italic { background-position: -192px -48px; }
+.admin .icon-text-height { background-position: -216px -48px; }
+.admin .icon-text-width { background-position: -240px -48px; }
+.admin .icon-align-left { background-position: -264px -48px; }
+.admin .icon-align-center { background-position: -288px -48px; }
+.admin .icon-align-right { background-position: -312px -48px; }
+.admin .icon-align-justify { background-position: -336px -48px; }
+.admin .icon-list { background-position: -360px -48px; }
+.admin .icon-indent-left { background-position: -384px -48px; }
+.admin .icon-indent-right { background-position: -408px -48px; }
+.admin .icon-facetime-video { background-position: -432px -48px; }
+.admin .icon-picture { background-position: -456px -48px; }
+.admin .icon-pencil { background-position: 0 -72px; }
+.admin .icon-map-marker { background-position: -24px -72px; }
+.admin .icon-adjust { background-position: -48px -72px; }
+.admin .icon-tint { background-position: -72px -72px; }
+.admin .icon-edit { background-position: -96px -72px; }
+.admin .icon-share { background-position: -120px -72px; }
+.admin .icon-check { background-position: -144px -72px; }
+.admin .icon-move { background-position: -168px -72px; }
+.admin .icon-step-backward { background-position: -192px -72px; }
+.admin .icon-fast-backward { background-position: -216px -72px; }
+.admin .icon-backward { background-position: -240px -72px; }
+.admin .icon-play { background-position: -264px -72px; }
+.admin .icon-pause { background-position: -288px -72px; }
+.admin .icon-stop { background-position: -312px -72px; }
+.admin .icon-forward { background-position: -336px -72px; }
+.admin .icon-fast-forward { background-position: -360px -72px; }
+.admin .icon-step-forward { background-position: -384px -72px; }
+.admin .icon-eject { background-position: -408px -72px; }
+.admin .icon-chevron-left { background-position: -432px -72px; }
+.admin .icon-chevron-right { background-position: -456px -72px; }
+.admin .icon-plus-sign { background-position: 0 -96px; }
+.admin .icon-minus-sign { background-position: -24px -96px; }
+.admin .icon-remove-sign { background-position: -48px -96px; }
+.admin .icon-ok-sign { background-position: -72px -96px; }
+.admin .icon-question-sign { background-position: -96px -96px; }
+.admin .icon-info-sign { background-position: -120px -96px; }
+.admin .icon-screenshot { background-position: -144px -96px; }
+.admin .icon-remove-circle { background-position: -168px -96px; }
+.admin .icon-ok-circle { background-position: -192px -96px; }
+.admin .icon-ban-circle { background-position: -216px -96px; }
+.admin .icon-arrow-left { background-position: -240px -96px; }
+.admin .icon-arrow-right { background-position: -264px -96px; }
+.admin .icon-arrow-up { background-position: -289px -96px; }
+.admin .icon-arrow-down { background-position: -312px -96px; }
+.admin .icon-share-alt { background-position: -336px -96px; }
+.admin .icon-resize-full { background-position: -360px -96px; }
+.admin .icon-resize-small { background-position: -384px -96px; }
+.admin .icon-plus { background-position: -408px -96px; }
+.admin .icon-minus { background-position: -433px -96px; }
+.admin .icon-asterisk { background-position: -456px -96px; }
+.admin .icon-exclamation-sign { background-position: 0 -120px; }
+.admin .icon-gift { background-position: -24px -120px; }
+.admin .icon-leaf { background-position: -48px -120px; }
+.admin .icon-fire { background-position: -72px -120px; }
+.admin .icon-eye-open { background-position: -96px -120px; }
+.admin .icon-eye-close { background-position: -120px -120px; }
+.admin .icon-warning-sign { background-position: -144px -120px; }
+.admin .icon-plane { background-position: -168px -120px; }
+.admin .icon-calendar { background-position: -192px -120px; }
+.admin .icon-random { background-position: -216px -120px; width: 16px; }
+.admin .icon-comment { background-position: -240px -120px; }
+.admin .icon-magnet { background-position: -264px -120px; }
+.admin .icon-chevron-up { background-position: -288px -120px; }
+.admin .icon-chevron-down { background-position: -313px -119px; }
+.admin .icon-retweet { background-position: -336px -120px; }
+.admin .icon-shopping-cart { background-position: -360px -120px; }
+.admin .icon-folder-close { background-position: -384px -120px; }
+.admin .icon-folder-open { background-position: -408px -120px; width: 16px; }
+.admin .icon-resize-vertical { background-position: -432px -119px; }
+.admin .icon-resize-horizontal { background-position: -456px -118px; }
+.admin .icon-hdd { background-position: 0 -144px; }
+.admin .icon-bullhorn { background-position: -24px -144px; }
+.admin .icon-bell { background-position: -48px -144px; }
+.admin .icon-certificate { background-position: -72px -144px; }
+.admin .icon-thumbs-up { background-position: -96px -144px; }
+.admin .icon-thumbs-down { background-position: -120px -144px; }
+.admin .icon-hand-right { background-position: -144px -144px; }
+.admin .icon-hand-left { background-position: -168px -144px; }
+.admin .icon-hand-up { background-position: -192px -144px; }
+.admin .icon-hand-down { background-position: -216px -144px; }
+.admin .icon-circle-arrow-right { background-position: -240px -144px; }
+.admin .icon-circle-arrow-left { background-position: -264px -144px; }
+.admin .icon-circle-arrow-up { background-position: -288px -144px; }
+.admin .icon-circle-arrow-down { background-position: -312px -144px; }
+.admin .icon-globe { background-position: -336px -144px; }
+.admin .icon-wrench { background-position: -360px -144px; }
+.admin .icon-tasks { background-position: -384px -144px; }
+.admin .icon-filter { background-position: -408px -144px; }
+.admin .icon-briefcase { background-position: -432px -144px; }
+.admin .icon-fullscreen { background-position: -456px -144px; }
+.admin .dropup, .admin .dropdown { position: relative; }
+.admin .dropdown-toggle { *margin-bottom: -3px; }
+.admin .dropdown-toggle:active, .admin .open .dropdown-toggle { outline: 0; }
+.admin .caret { display: inline-block; width: 0; height: 0; vertical-align: top; border-top: 4px solid black; border-right: 4px solid transparent; border-left: 4px solid transparent; content: ""; }
+.admin .dropdown .caret { margin-top: 8px; margin-left: 2px; }
+.admin .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; background-color: white; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.2); *border-right-width: 2px; *border-bottom-width: 2px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; }
+.admin .dropdown-menu.pull-right { right: 0; left: auto; }
+.admin .dropdown-menu .divider { *width: 100%; height: 1px; margin: 9px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid white; }
+.admin .dropdown-menu li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 20px; color: #333333; white-space: nowrap; }
+.admin .dropdown-menu li > a:hover, .admin .dropdown-menu li > a:focus, .admin .dropdown-submenu:hover > a { text-decoration: none; color: white; background-color: #0081c2; background-image: -moz-linear-gradient(top, #0088cc, #0077b3); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); background-image: -o-linear-gradient(top, #0088cc, #0077b3); background-image: linear-gradient(to bottom, #0088cc, #0077b3); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF0088CC', endColorstr='#FF0077B3', GradientType=0); }
+.admin .dropdown-menu .active > a, .admin .dropdown-menu .active > a:hover { color: #333333; text-decoration: none; outline: 0; background-color: #0081c2; background-image: -moz-linear-gradient(top, #0088cc, #0077b3); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); background-image: -o-linear-gradient(top, #0088cc, #0077b3); background-image: linear-gradient(to bottom, #0088cc, #0077b3); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF0088CC', endColorstr='#FF0077B3', GradientType=0); }
+.admin .dropdown-menu .disabled > a, .admin .dropdown-menu .disabled > a:hover { color: #999999; }
+.admin .dropdown-menu .disabled > a:hover { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); cursor: default; }
+.admin .open { *z-index: 1000; }
+.admin .open > .dropdown-menu { display: block; }
+.admin .pull-right > .dropdown-menu { right: 0; left: auto; }
+.admin .dropup .caret, .admin .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px solid black; content: ""; }
+.admin .dropup .dropdown-menu, .admin .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 1px; }
+.admin .dropdown-submenu { position: relative; }
+.admin .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -6px; margin-left: -1px; -webkit-border-radius: 0 6px 6px 6px; -moz-border-radius: 0 6px 6px 6px; border-radius: 0 6px 6px 6px; }
+.admin .dropdown-submenu:hover > .dropdown-menu { display: block; }
+.admin .dropup .dropdown-submenu > .dropdown-menu { top: auto; bottom: 0; margin-top: 0; margin-bottom: -2px; -webkit-border-radius: 5px 5px 5px 0; -moz-border-radius: 5px 5px 5px 0; border-radius: 5px 5px 5px 0; }
+.admin .dropdown-submenu > a:after { display: block; content: " "; float: right; width: 0; height: 0; border-color: transparent; border-style: solid; border-width: 5px 0 5px 5px; border-left-color: #cccccc; margin-top: 5px; margin-right: -10px; }
+.admin .dropdown-submenu:hover > a:after { border-left-color: white; }
+.admin .dropdown-submenu.pull-left { float: none; }
+.admin .dropdown-submenu.pull-left > .dropdown-menu { left: -100%; margin-left: 10px; -webkit-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px; }
+.admin .dropdown .dropdown-menu .nav-header { padding-left: 20px; padding-right: 20px; }
+.admin .typeahead { z-index: 1051; margin-top: 2px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
+.admin .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: whitesmoke; border: 1px solid #e3e3e3; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); }
+.admin .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); }
+.admin .well-large { padding: 24px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; }
+.admin .well-small { padding: 9px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
+.admin .fade { opacity: 0; -webkit-transition: opacity 0.15s linear; -moz-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; }
+.admin .fade.in { opacity: 1; }
+.admin .collapse { position: relative; height: 0; overflow: hidden; -webkit-transition: height 0.35s ease; -moz-transition: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease; }
+.admin .collapse.in { height: auto; }
+.admin .close { float: right; font-size: 20px; font-weight: bold; line-height: 20px; color: black; text-shadow: 0 1px 0 white; opacity: 0.2; filter: alpha(opacity=20); }
+.admin .close:hover { color: black; text-decoration: none; cursor: pointer; opacity: 0.4; filter: alpha(opacity=40); }
+.admin button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; }
+.admin .btn { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; padding: 4px 12px; margin-bottom: 0; font-size: 14px; line-height: 20px; text-align: center; vertical-align: middle; cursor: pointer; color: #333333; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); background-color: whitesmoke; background-image: -moz-linear-gradient(top, white, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, white, #e6e6e6); background-image: -o-linear-gradient(top, white, #e6e6e6); background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFE6E6E6', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #e6e6e6; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); border: 1px solid #bbbbbb; *border: 0; border-bottom-color: #a2a2a2; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; *margin-left: .3em; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); }
+.admin .btn:hover, .admin .btn:active, .admin .btn.active, .admin .btn.disabled, .admin .btn[disabled] { color: #333333; background-color: #e6e6e6; *background-color: #d9d9d9; }
+.admin .btn:active, .admin .btn.active { background-color: #cccccc \9; }
+.admin .btn:first-child { *margin-left: 0; }
+.admin .btn:hover { color: #333333; text-decoration: none; background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear; }
+.admin .btn:focus { outline: thin dotted #333333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; }
+.admin .btn.active, .admin .btn:active { background-image: none; outline: 0; -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); }
+.admin .btn.disabled, .admin .btn[disabled] { cursor: default; background-image: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; }
+.admin .btn-large { padding: 11px 19px; font-size: 17.5px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; }
+.admin .btn-large [class^="icon-"], .admin .btn-large [class*=" icon-"] { margin-top: 4px; }
+.admin .btn-small { padding: 2px 10px; font-size: 11.9px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
+.admin .btn-small [class^="icon-"], .admin .btn-small [class*=" icon-"] { margin-top: 0; }
+.admin .btn-mini [class^="icon-"], .admin .btn-mini [class*=" icon-"] { margin-top: -1px; }
+.admin .btn-mini { padding: 0px 6px; font-size: 10.5px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
+.admin .btn-block { display: block; width: 100%; padding-left: 0; padding-right: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
+.admin .btn-block + .btn-block { margin-top: 5px; }
+.admin input[type="submit"].btn-block, .admin input[type="reset"].btn-block, .admin input[type="button"].btn-block { width: 100%; }
+.admin .btn-primary.active, .admin .btn-warning.active, .admin .btn-danger.active, .admin .btn-success.active, .admin .btn-info.active, .admin .btn-inverse.active { color: rgba(255, 255, 255, 0.75); }
+.admin .btn { border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); }
+.admin .btn-primary { color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #006ccc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(to bottom, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF0088CC', endColorstr='#FF0044CC', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #0044cc; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); }
+.admin .btn-primary:hover, .admin .btn-primary:active, .admin .btn-primary.active, .admin .btn-primary.disabled, .admin .btn-primary[disabled] { color: white; background-color: #0044cc; *background-color: #003bb3; }
+.admin .btn-primary:active, .admin .btn-primary.active { background-color: #003399 \9; }
+.admin .btn-warning { color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #f9a732; background-image: -moz-linear-gradient(top, #fbb450, #f89406); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); background-image: -webkit-linear-gradient(top, #fbb450, #f89406); background-image: -o-linear-gradient(top, #fbb450, #f89406); background-image: linear-gradient(to bottom, #fbb450, #f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFBB450', endColorstr='#FFF89406', GradientType=0); border-color: #f89406 #f89406 #ad6704; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #f89406; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); }
+.admin .btn-warning:hover, .admin .btn-warning:active, .admin .btn-warning.active, .admin .btn-warning.disabled, .admin .btn-warning[disabled] { color: white; background-color: #f89406; *background-color: #df8505; }
+.admin .btn-warning:active, .admin .btn-warning.active { background-color: #c67605 \9; }
+.admin .btn-danger { color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #da4e49; background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEE5F5B', endColorstr='#FFBD362F', GradientType=0); border-color: #bd362f #bd362f #802420; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #bd362f; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); }
+.admin .btn-danger:hover, .admin .btn-danger:active, .admin .btn-danger.active, .admin .btn-danger.disabled, .admin .btn-danger[disabled] { color: white; background-color: #bd362f; *background-color: #a9302a; }
+.admin .btn-danger:active, .admin .btn-danger.active { background-color: #942a25 \9; }
+.admin .btn-success { color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #5bb65b; background-image: -moz-linear-gradient(top, #62c462, #51a351); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); background-image: -webkit-linear-gradient(top, #62c462, #51a351); background-image: -o-linear-gradient(top, #62c462, #51a351); background-image: linear-gradient(to bottom, #62c462, #51a351); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF62C462', endColorstr='#FF51A351', GradientType=0); border-color: #51a351 #51a351 #387038; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #51a351; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); }
+.admin .btn-success:hover, .admin .btn-success:active, .admin .btn-success.active, .admin .btn-success.disabled, .admin .btn-success[disabled] { color: white; background-color: #51a351; *background-color: #499249; }
+.admin .btn-success:active, .admin .btn-success.active { background-color: #408140 \9; }
+.admin .btn-info { color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #49afcd; background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF5BC0DE', endColorstr='#FF2F96B4', GradientType=0); border-color: #2f96b4 #2f96b4 #1f6377; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #2f96b4; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); }
+.admin .btn-info:hover, .admin .btn-info:active, .admin .btn-info.active, .admin .btn-info.disabled, .admin .btn-info[disabled] { color: white; background-color: #2f96b4; *background-color: #2a85a0; }
+.admin .btn-info:active, .admin .btn-info.active { background-color: #24748c \9; }
+.admin .btn-inverse { color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #363636; background-image: -moz-linear-gradient(top, #444444, #222222); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); background-image: -webkit-linear-gradient(top, #444444, #222222); background-image: -o-linear-gradient(top, #444444, #222222); background-image: linear-gradient(to bottom, #444444, #222222); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF444444', endColorstr='#FF222222', GradientType=0); border-color: #222222 #222222 black; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #222222; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); }
+.admin .btn-inverse:hover, .admin .btn-inverse:active, .admin .btn-inverse.active, .admin .btn-inverse.disabled, .admin .btn-inverse[disabled] { color: white; background-color: #222222; *background-color: #151515; }
+.admin .btn-inverse:active, .admin .btn-inverse.active { background-color: #090909 \9; }
+.admin button.btn, .admin input[type="submit"].btn { *padding-top: 3px; *padding-bottom: 3px; }
+.admin button.btn::-moz-focus-inner, .admin input[type="submit"].btn::-moz-focus-inner { padding: 0; border: 0; }
+.admin button.btn.btn-large, .admin input[type="submit"].btn.btn-large { *padding-top: 7px; *padding-bottom: 7px; }
+.admin button.btn.btn-small, .admin input[type="submit"].btn.btn-small { *padding-top: 3px; *padding-bottom: 3px; }
+.admin button.btn.btn-mini, .admin input[type="submit"].btn.btn-mini { *padding-top: 1px; *padding-bottom: 1px; }
+.admin .btn-link, .admin .btn-link:active, .admin .btn-link[disabled] { background-color: transparent; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; }
+.admin .btn-link { border-color: transparent; cursor: pointer; color: #0088cc; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .btn-link:hover { color: #005580; text-decoration: underline; background-color: transparent; }
+.admin .btn-link[disabled]:hover { color: #333333; text-decoration: none; }
+.admin .btn-group { position: relative; display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; font-size: 0; vertical-align: middle; white-space: nowrap; *margin-left: .3em; }
+.admin .btn-group:first-child { *margin-left: 0; }
+.admin .btn-group + .btn-group { margin-left: 5px; }
+.admin .btn-toolbar { font-size: 0; margin-top: 10px; margin-bottom: 10px; }
+.admin .btn-toolbar > .btn + .btn, .admin .btn-toolbar > .btn-group + .btn, .admin .btn-toolbar > .btn + .btn-group { margin-left: 5px; }
+.admin .btn-group > .btn { position: relative; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .btn-group > .btn + .btn { margin-left: -1px; }
+.admin .btn-group > .btn, .admin .btn-group > .dropdown-menu, .admin .btn-group > .popover { font-size: 14px; }
+.admin .btn-group > .btn-mini { font-size: 10.5px; }
+.admin .btn-group > .btn-small { font-size: 11.9px; }
+.admin .btn-group > .btn-large { font-size: 17.5px; }
+.admin .btn-group > .btn:first-child { margin-left: 0; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; }
+.admin .btn-group > .btn:last-child, .admin .btn-group > .dropdown-toggle { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; }
+.admin .btn-group > .btn.large:first-child { margin-left: 0; -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; }
+.admin .btn-group > .btn.large:last-child, .admin .btn-group > .large.dropdown-toggle { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; }
+.admin .btn-group > .btn:hover, .admin .btn-group > .btn:focus, .admin .btn-group > .btn:active, .admin .btn-group > .btn.active { z-index: 2; }
+.admin .btn-group .dropdown-toggle:active, .admin .btn-group.open .dropdown-toggle { outline: 0; }
+.admin .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); *padding-top: 5px; *padding-bottom: 5px; }
+.admin .btn-group > .btn-mini + .dropdown-toggle { padding-left: 5px; padding-right: 5px; *padding-top: 2px; *padding-bottom: 2px; }
+.admin .btn-group > .btn-small + .dropdown-toggle { *padding-top: 5px; *padding-bottom: 4px; }
+.admin .btn-group > .btn-large + .dropdown-toggle { padding-left: 12px; padding-right: 12px; *padding-top: 7px; *padding-bottom: 7px; }
+.admin .btn-group.open .dropdown-toggle { background-image: none; -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); }
+.admin .btn-group.open .btn.dropdown-toggle { background-color: #e6e6e6; }
+.admin .btn-group.open .btn-primary.dropdown-toggle { background-color: #0044cc; }
+.admin .btn-group.open .btn-warning.dropdown-toggle { background-color: #f89406; }
+.admin .btn-group.open .btn-danger.dropdown-toggle { background-color: #bd362f; }
+.admin .btn-group.open .btn-success.dropdown-toggle { background-color: #51a351; }
+.admin .btn-group.open .btn-info.dropdown-toggle { background-color: #2f96b4; }
+.admin .btn-group.open .btn-inverse.dropdown-toggle { background-color: #222222; }
+.admin .btn .caret { margin-top: 8px; margin-left: 0; }
+.admin .btn-mini .caret, .admin .btn-small .caret, .admin .btn-large .caret { margin-top: 6px; }
+.admin .btn-large .caret { border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; }
+.admin .dropup .btn-large .caret { border-bottom-width: 5px; }
+.admin .btn-primary .caret, .admin .btn-warning .caret, .admin .btn-danger .caret, .admin .btn-info .caret, .admin .btn-success .caret, .admin .btn-inverse .caret { border-top-color: white; border-bottom-color: white; }
+.admin .btn-group-vertical { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; }
+.admin .btn-group-vertical > .btn { display: block; float: none; max-width: 100%; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .btn-group-vertical > .btn + .btn { margin-left: 0; margin-top: -1px; }
+.admin .btn-group-vertical > .btn:first-child { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; }
+.admin .btn-group-vertical > .btn:last-child { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; }
+.admin .btn-group-vertical > .btn-large:first-child { -webkit-border-radius: 6px 6px 0 0; -moz-border-radius: 6px 6px 0 0; border-radius: 6px 6px 0 0; }
+.admin .btn-group-vertical > .btn-large:last-child { -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; }
+.admin .alert { padding: 8px 35px 8px 14px; margin-bottom: 20px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); background-color: #fcf8e3; border: 1px solid #fbeed5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
+.admin .alert, .admin .alert h4 { color: #c09853; }
+.admin .alert h4 { margin: 0; }
+.admin .alert .close { position: relative; top: -2px; right: -21px; line-height: 20px; }
+.admin .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #468847; }
+.admin .alert-success h4 { color: #468847; }
+.admin .alert-danger, .admin .alert-error { background-color: #f2dede; border-color: #eed3d7; color: #b94a48; }
+.admin .alert-danger h4, .admin .alert-error h4 { color: #b94a48; }
+.admin .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #3a87ad; }
+.admin .alert-info h4 { color: #3a87ad; }
+.admin .alert-block { padding-top: 14px; padding-bottom: 14px; }
+.admin .alert-block > p, .admin .alert-block > ul { margin-bottom: 0; }
+.admin .alert-block p + p { margin-top: 5px; }
+.admin .nav { margin-left: 0; margin-bottom: 20px; list-style: none; }
+.admin .nav > li > a { display: block; }
+.admin .nav > li > a:hover { text-decoration: none; background-color: #eeeeee; }
+.admin .nav > li > a > img { max-width: none; }
+.admin .nav > .pull-right { float: right; }
+.admin .nav-header { display: block; padding: 3px 15px; font-size: 11px; font-weight: bold; line-height: 20px; color: #999999; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-transform: uppercase; }
+.admin .nav li + .nav-header { margin-top: 9px; }
+.admin .nav-list { padding-left: 15px; padding-right: 15px; margin-bottom: 0; }
+.admin .nav-list > li > a, .admin .nav-list .nav-header { margin-left: -15px; margin-right: -15px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
+.admin .nav-list > li > a { padding: 3px 15px; }
+.admin .nav-list > .active > a, .admin .nav-list > .active > a:hover { color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); background-color: #0088cc; }
+.admin .nav-list [class^="icon-"], .admin .nav-list [class*=" icon-"] { margin-right: 2px; }
+.admin .nav-list .divider { *width: 100%; height: 1px; margin: 9px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid white; }
+.admin .nav-tabs, .admin .nav-pills { *zoom: 1; }
+.admin .nav-tabs:before, .admin .nav-tabs:after, .admin .nav-pills:before, .admin .nav-pills:after { display: table; content: ""; line-height: 0; }
+.admin .nav-tabs:after, .admin .nav-pills:after { clear: both; }
+.admin .nav-tabs > li, .admin .nav-pills > li { float: left; }
+.admin .nav-tabs > li > a, .admin .nav-pills > li > a { padding-right: 12px; padding-left: 12px; margin-right: 2px; line-height: 14px; }
+.admin .nav-tabs { border-bottom: 1px solid #dddddd; }
+.admin .nav-tabs > li { margin-bottom: -1px; }
+.admin .nav-tabs > li > a { padding-top: 8px; padding-bottom: 8px; line-height: 20px; border: 1px solid transparent; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; }
+.admin .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #dddddd; }
+.admin .nav-tabs > .active > a, .admin .nav-tabs > .active > a:hover { color: #555555; background-color: white; border: 1px solid #dddddd; border-bottom-color: transparent; cursor: default; }
+.admin .nav-pills > li > a { padding-top: 8px; padding-bottom: 8px; margin-top: 2px; margin-bottom: 2px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
+.admin .nav-pills > .active > a, .admin .nav-pills > .active > a:hover { color: white; background-color: #0088cc; }
+.admin .nav-stacked > li { float: none; }
+.admin .nav-stacked > li > a { margin-right: 0; }
+.admin .nav-tabs.nav-stacked { border-bottom: 0; }
+.admin .nav-tabs.nav-stacked > li > a { border: 1px solid #dddddd; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .nav-tabs.nav-stacked > li:first-child > a { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; }
+.admin .nav-tabs.nav-stacked > li:last-child > a { -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; }
+.admin .nav-tabs.nav-stacked > li > a:hover { border-color: #ddd; z-index: 2; }
+.admin .nav-pills.nav-stacked > li > a { margin-bottom: 3px; }
+.admin .nav-pills.nav-stacked > li:last-child > a { margin-bottom: 1px; }
+.admin .nav-tabs .dropdown-menu { -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; }
+.admin .nav-pills .dropdown-menu { -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; }
+.admin .nav .dropdown-toggle .caret { border-top-color: #0088cc; border-bottom-color: #0088cc; margin-top: 6px; }
+.admin .nav .dropdown-toggle:hover .caret { border-top-color: #005580; border-bottom-color: #005580; }
+.admin .nav-tabs .dropdown-toggle .caret { margin-top: 8px; }
+.admin .nav .active .dropdown-toggle .caret { border-top-color: #fff; border-bottom-color: #fff; }
+.admin .nav-tabs .active .dropdown-toggle .caret { border-top-color: #555555; border-bottom-color: #555555; }
+.admin .nav > .dropdown.active > a:hover { cursor: pointer; }
+.admin .nav-tabs .open .dropdown-toggle, .admin .nav-pills .open .dropdown-toggle, .admin .nav > li.dropdown.open.active > a:hover { color: white; background-color: #999999; border-color: #999999; }
+.admin .nav li.dropdown.open .caret, .admin .nav li.dropdown.open.active .caret, .admin .nav li.dropdown.open a:hover .caret { border-top-color: white; border-bottom-color: white; opacity: 1; filter: alpha(opacity=100); }
+.admin .tabs-stacked .open > a:hover { border-color: #999999; }
+.admin .tabbable { *zoom: 1; }
+.admin .tabbable:before, .admin .tabbable:after { display: table; content: ""; line-height: 0; }
+.admin .tabbable:after { clear: both; }
+.admin .tab-content { overflow: auto; }
+.admin .tabs-below > .nav-tabs, .admin .tabs-right > .nav-tabs, .admin .tabs-left > .nav-tabs { border-bottom: 0; }
+.admin .tab-content > .tab-pane, .admin .pill-content > .pill-pane { display: none; }
+.admin .tab-content > .active, .admin .pill-content > .active { display: block; }
+.admin .tabs-below > .nav-tabs { border-top: 1px solid #dddddd; }
+.admin .tabs-below > .nav-tabs > li { margin-top: -1px; margin-bottom: 0; }
+.admin .tabs-below > .nav-tabs > li > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; }
+.admin .tabs-below > .nav-tabs > li > a:hover { border-bottom-color: transparent; border-top-color: #ddd; }
+.admin .tabs-below > .nav-tabs > .active > a, .admin .tabs-below > .nav-tabs > .active > a:hover { border-color: transparent #dddddd #dddddd #dddddd; }
+.admin .tabs-left > .nav-tabs > li, .admin .tabs-right > .nav-tabs > li { float: none; }
+.admin .tabs-left > .nav-tabs > li > a, .admin .tabs-right > .nav-tabs > li > a { min-width: 74px; margin-right: 0; margin-bottom: 3px; }
+.admin .tabs-left > .nav-tabs { float: left; margin-right: 19px; border-right: 1px solid #dddddd; }
+.admin .tabs-left > .nav-tabs > li > a { margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; }
+.admin .tabs-left > .nav-tabs > li > a:hover { border-color: #eeeeee #dddddd #eeeeee #eeeeee; }
+.admin .tabs-left > .nav-tabs .active > a, .admin .tabs-left > .nav-tabs .active > a:hover { border-color: #dddddd transparent #dddddd #dddddd; *border-right-color: white; }
+.admin .tabs-right > .nav-tabs { float: right; margin-left: 19px; border-left: 1px solid #dddddd; }
+.admin .tabs-right > .nav-tabs > li > a { margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; }
+.admin .tabs-right > .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #eeeeee #dddddd; }
+.admin .tabs-right > .nav-tabs .active > a, .admin .tabs-right > .nav-tabs .active > a:hover { border-color: #dddddd #dddddd #dddddd transparent; *border-left-color: white; }
+.admin .nav > .disabled > a { color: #999999; }
+.admin .nav > .disabled > a:hover { text-decoration: none; background-color: transparent; cursor: default; }
+.admin .navbar { overflow: visible; margin-bottom: 20px; *position: relative; *z-index: 2; }
+.admin .navbar-inner { min-height: 40px; padding-left: 20px; padding-right: 20px; background-color: #f9f9f9; background-image: -moz-linear-gradient(top, white, #f2f2f2); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#f2f2f2)); background-image: -webkit-linear-gradient(top, white, #f2f2f2); background-image: -o-linear-gradient(top, white, #f2f2f2); background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFF2F2F2', GradientType=0); border: 1px solid #d4d4d4; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); *zoom: 1; }
+.admin .navbar-inner:before, .admin .navbar-inner:after { display: table; content: ""; line-height: 0; }
+.admin .navbar-inner:after { clear: both; }
+.admin .navbar .container { width: auto; }
+.admin .nav-collapse.collapse { height: auto; overflow: visible; }
+.admin .navbar .brand { float: left; display: block; padding: 10px 20px 10px; margin-left: -20px; font-size: 20px; font-weight: 200; color: #777777; text-shadow: 0 1px 0 white; }
+.admin .navbar .brand:hover { text-decoration: none; }
+.admin .navbar-text { margin-bottom: 0; line-height: 40px; color: #777777; }
+.admin .navbar-link { color: #777777; }
+.admin .navbar-link:hover { color: #333333; }
+.admin .navbar .divider-vertical { height: 40px; margin: 0 9px; border-left: 1px solid #f2f2f2; border-right: 1px solid white; }
+.admin .navbar .btn, .admin .navbar .btn-group { margin-top: 5px; }
+.admin .navbar .btn-group .btn, .admin .navbar .input-prepend .btn, .admin .navbar .input-append .btn { margin-top: 0; }
+.admin .navbar-form { margin-bottom: 0; *zoom: 1; }
+.admin .navbar-form:before, .admin .navbar-form:after { display: table; content: ""; line-height: 0; }
+.admin .navbar-form:after { clear: both; }
+.admin .navbar-form input, .admin .navbar-form select, .admin .navbar-form .radio, .admin .navbar-form .checkbox { margin-top: 5px; }
+.admin .navbar-form input, .admin .navbar-form select, .admin .navbar-form .btn { display: inline-block; margin-bottom: 0; }
+.admin .navbar-form input[type="image"], .admin .navbar-form input[type="checkbox"], .admin .navbar-form input[type="radio"] { margin-top: 3px; }
+.admin .navbar-form .input-append, .admin .navbar-form .input-prepend { margin-top: 5px; white-space: nowrap; }
+.admin .navbar-form .input-append input, .admin .navbar-form .input-prepend input { margin-top: 0; }
+.admin .navbar-search { position: relative; float: left; margin-top: 5px; margin-bottom: 0; }
+.admin .navbar-search .search-query { margin-bottom: 0; padding: 4px 14px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; line-height: 1; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; }
+.admin .navbar-static-top { position: static; margin-bottom: 0; }
+.admin .navbar-static-top .navbar-inner { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .navbar-fixed-top, .admin .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; margin-bottom: 0; }
+.admin .navbar-fixed-top .navbar-inner, .admin .navbar-static-top .navbar-inner { border-width: 0 0 1px; }
+.admin .navbar-fixed-bottom .navbar-inner { border-width: 1px 0 0; }
+.admin .navbar-fixed-top .navbar-inner, .admin .navbar-fixed-bottom .navbar-inner { padding-left: 0; padding-right: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; }
+.admin .navbar-static-top .container, .admin .navbar-fixed-top .container, .admin .navbar-fixed-bottom .container { width: 940px; }
+.admin .navbar-fixed-top { top: 0; }
+.admin .navbar-fixed-top .navbar-inner, .admin .navbar-static-top .navbar-inner { -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); }
+.admin .navbar-fixed-bottom { bottom: 0; }
+.admin .navbar-fixed-bottom .navbar-inner { -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); }
+.admin .navbar .nav { position: relative; left: 0; display: block; float: left; margin: 0 10px 0 0; }
+.admin .navbar .nav.pull-right { float: right; margin-right: 0; }
+.admin .navbar .nav > li { float: left; }
+.admin .navbar .nav > li > a { float: none; padding: 10px 15px 10px; color: #777777; text-decoration: none; text-shadow: 0 1px 0 white; }
+.admin .navbar .nav .dropdown-toggle .caret { margin-top: 8px; }
+.admin .navbar .nav > li > a:focus, .admin .navbar .nav > li > a:hover { background-color: transparent; color: #333333; text-decoration: none; }
+.admin .navbar .nav > .active > a, .admin .navbar .nav > .active > a:hover, .admin .navbar .nav > .active > a:focus { color: #555555; text-decoration: none; background-color: #e6e6e6; -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); }
+.admin .navbar .btn-navbar { display: none; float: right; padding: 7px 10px; margin-left: 5px; margin-right: 5px; color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #ededed; background-image: -moz-linear-gradient(top, #f2f2f2, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #f2f2f2, #e6e6e6); background-image: -o-linear-gradient(top, #f2f2f2, #e6e6e6); background-image: linear-gradient(to bottom, #f2f2f2, #e6e6e6); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFF2F2F2', endColorstr='#FFE6E6E6', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #e6e6e6; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); }
+.admin .navbar .btn-navbar:hover, .admin .navbar .btn-navbar:active, .admin .navbar .btn-navbar.active, .admin .navbar .btn-navbar.disabled, .admin .navbar .btn-navbar[disabled] { color: white; background-color: #e6e6e6; *background-color: #d9d9d9; }
+.admin .navbar .btn-navbar:active, .admin .navbar .btn-navbar.active { background-color: #cccccc \9; }
+.admin .navbar .btn-navbar .icon-bar { display: block; width: 18px; height: 2px; background-color: #f5f5f5; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
+.admin .btn-navbar .icon-bar + .icon-bar { margin-top: 3px; }
+.admin .navbar .nav > li > .dropdown-menu:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #cccccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 9px; }
+.admin .navbar .nav > li > .dropdown-menu:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid white; position: absolute; top: -6px; left: 10px; }
+.admin .navbar-fixed-bottom .nav > li > .dropdown-menu:before { border-top: 7px solid #cccccc; border-top-color: rgba(0, 0, 0, 0.2); border-bottom: 0; bottom: -7px; top: auto; }
+.admin .navbar-fixed-bottom .nav > li > .dropdown-menu:after { border-top: 6px solid white; border-bottom: 0; bottom: -6px; top: auto; }
+.admin .navbar .nav li.dropdown > a:hover .caret { border-top-color: #555555; border-bottom-color: #555555; }
+.admin .navbar .nav li.dropdown.open > .dropdown-toggle, .admin .navbar .nav li.dropdown.active > .dropdown-toggle, .admin .navbar .nav li.dropdown.open.active > .dropdown-toggle { background-color: #e6e6e6; color: #555555; }
+.admin .navbar .nav li.dropdown > .dropdown-toggle .caret { border-top-color: #777777; border-bottom-color: #777777; }
+.admin .navbar .nav li.dropdown.open > .dropdown-toggle .caret, .admin .navbar .nav li.dropdown.active > .dropdown-toggle .caret, .admin .navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { border-top-color: #555555; border-bottom-color: #555555; }
+.admin .navbar .pull-right > li > .dropdown-menu, .admin .navbar .nav > li > .dropdown-menu.pull-right { left: auto; right: 0; }
+.admin .navbar .pull-right > li > .dropdown-menu:before, .admin .navbar .nav > li > .dropdown-menu.pull-right:before { left: auto; right: 12px; }
+.admin .navbar .pull-right > li > .dropdown-menu:after, .admin .navbar .nav > li > .dropdown-menu.pull-right:after { left: auto; right: 13px; }
+.admin .navbar .pull-right > li > .dropdown-menu .dropdown-menu, .admin .navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { left: auto; right: 100%; margin-left: 0; margin-right: -1px; -webkit-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px; }
+.admin .navbar-inverse .navbar-inner { background-color: #1b1b1b; background-image: -moz-linear-gradient(top, #222222, #111111); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); background-image: -webkit-linear-gradient(top, #222222, #111111); background-image: -o-linear-gradient(top, #222222, #111111); background-image: linear-gradient(to bottom, #222222, #111111); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF222222', endColorstr='#FF111111', GradientType=0); border-color: #252525; }
+.admin .navbar-inverse .brand, .admin .navbar-inverse .nav > li > a { color: #999999; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }
+.admin .navbar-inverse .brand:hover, .admin .navbar-inverse .nav > li > a:hover { color: white; }
+.admin .navbar-inverse .brand { color: #999999; }
+.admin .navbar-inverse .navbar-text { color: #999999; }
+.admin .navbar-inverse .nav > li > a:focus, .admin .navbar-inverse .nav > li > a:hover { background-color: transparent; color: white; }
+.admin .navbar-inverse .nav .active > a, .admin .navbar-inverse .nav .active > a:hover, .admin .navbar-inverse .nav .active > a:focus { color: white; background-color: #111111; }
+.admin .navbar-inverse .navbar-link { color: #999999; }
+.admin .navbar-inverse .navbar-link:hover { color: white; }
+.admin .navbar-inverse .divider-vertical { border-left-color: #111111; border-right-color: #222222; }
+.admin .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, .admin .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .admin .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { background-color: #111111; color: white; }
+.admin .navbar-inverse .nav li.dropdown > a:hover .caret { border-top-color: white; color: white; }
+.admin .navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { border-top-color: #999999; border-bottom-color: #999999; }
+.admin .navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, .admin .navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, .admin .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { border-top-color: white; border-bottom-color: white; }
+.admin .navbar-inverse .navbar-search .search-query { color: white; background-color: #515151; border-color: #111111; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); -webkit-transition: none; -moz-transition: none; -o-transition: none; transition: none; }
+.admin .navbar-inverse .navbar-search .search-query:-moz-placeholder { color: #cccccc; }
+.admin .navbar-inverse .navbar-search .search-query:-ms-input-placeholder { color: #cccccc; }
+.admin .navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { color: #cccccc; }
+.admin .navbar-inverse .navbar-search .search-query:focus, .admin .navbar-inverse .navbar-search .search-query.focused { padding: 5px 15px; color: #333333; text-shadow: 0 1px 0 white; background-color: white; border: 0; -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); outline: 0; }
+.admin .navbar-inverse .btn-navbar { color: white; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #0e0e0e; background-image: -moz-linear-gradient(top, #151515, #040404); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); background-image: -webkit-linear-gradient(top, #151515, #040404); background-image: -o-linear-gradient(top, #151515, #040404); background-image: linear-gradient(to bottom, #151515, #040404); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF151515', endColorstr='#FF040404', GradientType=0); border-color: #040404 #040404 black; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #040404; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); }
+.admin .navbar-inverse .btn-navbar:hover, .admin .navbar-inverse .btn-navbar:active, .admin .navbar-inverse .btn-navbar.active, .admin .navbar-inverse .btn-navbar.disabled, .admin .navbar-inverse .btn-navbar[disabled] { color: white; background-color: #040404; *background-color: black; }
+.admin .navbar-inverse .btn-navbar:active, .admin .navbar-inverse .btn-navbar.active { background-color: black \9; }
+.admin .breadcrumb { padding: 8px 15px; margin: 0 0 20px; list-style: none; background-color: #f5f5f5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
+.admin .breadcrumb > li { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; text-shadow: 0 1px 0 white; }
+.admin .breadcrumb > li > .divider { padding: 0 5px; color: #ccc; }
+.admin .breadcrumb .active { color: #999999; }
+.admin .pagination { margin: 20px 0; }
+.admin .pagination ul { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; margin-left: 0; margin-bottom: 0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
+.admin .pagination ul > li { display: inline; }
+.admin .pagination ul > li > a, .admin .pagination ul > li > span { float: left; padding: 4px 12px; line-height: 20px; text-decoration: none; background-color: white; border: 1px solid #dddddd; border-left-width: 0; }
+.admin .pagination ul > li > a:hover, .admin .pagination ul > .active > a, .admin .pagination ul > .active > span { background-color: whitesmoke; }
+.admin .pagination ul > .active > a, .admin .pagination ul > .active > span { color: #999999; cursor: default; }
+.admin .pagination ul > .disabled > span, .admin .pagination ul > .disabled > a, .admin .pagination ul > .disabled > a:hover { color: #999999; background-color: transparent; cursor: default; }
+.admin .pagination ul > li:first-child > a, .admin .pagination ul > li:first-child > span { border-left-width: 1px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; }
+.admin .pagination ul > li:last-child > a, .admin .pagination ul > li:last-child > span { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; }
+.admin .pagination-centered { text-align: center; }
+.admin .pagination-right { text-align: right; }
+.admin .pagination-large ul > li > a, .admin .pagination-large ul > li > span { padding: 11px 19px; font-size: 17.5px; }
+.admin .pagination-large ul > li:first-child > a, .admin .pagination-large ul > li:first-child > span { -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; }
+.admin .pagination-large ul > li:last-child > a, .admin .pagination-large ul > li:last-child > span { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; }
+.admin .pagination-mini ul > li:first-child > a, .admin .pagination-mini ul > li:first-child > span, .admin .pagination-small ul > li:first-child > a, .admin .pagination-small ul > li:first-child > span { -webkit-border-top-left-radius: 3px; -moz-border-radius-topleft: 3px; border-top-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; border-bottom-left-radius: 3px; }
+.admin .pagination-mini ul > li:last-child > a, .admin .pagination-mini ul > li:last-child > span, .admin .pagination-small ul > li:last-child > a, .admin .pagination-small ul > li:last-child > span { -webkit-border-top-right-radius: 3px; -moz-border-radius-topright: 3px; border-top-right-radius: 3px; -webkit-border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; border-bottom-right-radius: 3px; }
+.admin .pagination-small ul > li > a, .admin .pagination-small ul > li > span { padding: 2px 10px; font-size: 11.9px; }
+.admin .pagination-mini ul > li > a, .admin .pagination-mini ul > li > span { padding: 0px 6px; font-size: 10.5px; }
+.admin .pager { margin: 20px 0; list-style: none; text-align: center; *zoom: 1; }
+.admin .pager:before, .admin .pager:after { display: table; content: ""; line-height: 0; }
+.admin .pager:after { clear: both; }
+.admin .pager li { display: inline; }
+.admin .pager li > a, .admin .pager li > span { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #dddddd; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; }
+.admin .pager li > a:hover { text-decoration: none; background-color: #f5f5f5; }
+.admin .pager .next > a, .admin .pager .next > span { float: right; }
+.admin .pager .previous > a, .admin .pager .previous > span { float: left; }
+.admin .pager .disabled > a, .admin .pager .disabled > a:hover, .admin .pager .disabled > span { color: #999999; background-color: #fff; cursor: default; }
+.admin .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: black; }
+.admin .modal-backdrop.fade { opacity: 0; }
+.admin .modal-backdrop, .admin .modal-backdrop.fade.in { opacity: 0.8; filter: alpha(opacity=80); }
+.admin .modal { position: fixed; top: 50%; left: 50%; z-index: 1050; width: 560px; margin: -250px 0 0 -280px; background-color: white; border: 1px solid #999999; border: 1px solid rgba(0, 0, 0, 0.3); *border: 1px solid #999999; /* IE6-7 */ -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; outline: none; }
+.admin .modal.fade { -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; -moz-transition: opacity 0.3s linear, top 0.3s ease-out; -o-transition: opacity 0.3s linear, top 0.3s ease-out; transition: opacity 0.3s linear, top 0.3s ease-out; top: -25%; }
+.admin .modal.fade.in { top: 50%; }
+.admin .modal-header { padding: 9px 15px; border-bottom: 1px solid #eeeeee; }
+.admin .modal-header .close { margin-top: 2px; }
+.admin .modal-header h3 { margin: 0; line-height: 30px; }
+.admin .modal-body { position: relative; overflow-y: auto; max-height: 400px; padding: 15px; }
+.admin .modal-form { margin-bottom: 0; }
+.admin .modal-footer { padding: 14px 15px 15px; margin-bottom: 0; text-align: right; background-color: #f5f5f5; border-top: 1px solid #dddddd; -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; -webkit-box-shadow: inset 0 1px 0 white; -moz-box-shadow: inset 0 1px 0 white; box-shadow: inset 0 1px 0 white; *zoom: 1; }
+.admin .modal-footer:before, .admin .modal-footer:after { display: table; content: ""; line-height: 0; }
+.admin .modal-footer:after { clear: both; }
+.admin .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; }
+.admin .modal-footer .btn-group .btn + .btn { margin-left: -1px; }
+.admin .modal-footer .btn-block + .btn-block { margin-left: 0; }
+.admin .tooltip { position: absolute; z-index: 1030; display: block; visibility: visible; padding: 5px; font-size: 11px; opacity: 0; filter: alpha(opacity=0); }
+.admin .tooltip.in { opacity: 0.8; filter: alpha(opacity=80); }
+.admin .tooltip.top { margin-top: -3px; }
+.admin .tooltip.right { margin-left: 3px; }
+.admin .tooltip.bottom { margin-top: 3px; }
+.admin .tooltip.left { margin-left: -3px; }
+.admin .tooltip-inner { max-width: 200px; padding: 3px 8px; color: white; text-align: center; text-decoration: none; background-color: black; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
+.admin .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; }
+.admin .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: black; }
+.admin .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: black; }
+.admin .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: black; }
+.admin .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: black; }
+.admin .popover { position: absolute; top: 0; left: 0; z-index: 1010; display: none; width: 236px; padding: 1px; text-align: left; background-color: white; -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); white-space: normal; }
+.admin .popover.top { margin-top: -10px; }
+.admin .popover.right { margin-left: 10px; }
+.admin .popover.bottom { margin-top: 10px; }
+.admin .popover.left { margin-left: -10px; }
+.admin .popover-title { margin: 0; padding: 8px 14px; font-size: 14px; font-weight: normal; line-height: 18px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; -webkit-border-radius: 5px 5px 0 0; -moz-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; }
+.admin .popover-content { padding: 9px 14px; }
+.admin .popover .arrow, .admin .popover .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; }
+.admin .popover .arrow { border-width: 11px; }
+.admin .popover .arrow:after { border-width: 10px; content: ""; }
+.admin .popover.top .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #999; border-top-color: rgba(0, 0, 0, 0.25); bottom: -11px; }
+.admin .popover.top .arrow:after { bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: white; }
+.admin .popover.right .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #999; border-right-color: rgba(0, 0, 0, 0.25); }
+.admin .popover.right .arrow:after { left: 1px; bottom: -10px; border-left-width: 0; border-right-color: white; }
+.admin .popover.bottom .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999; border-bottom-color: rgba(0, 0, 0, 0.25); top: -11px; }
+.admin .popover.bottom .arrow:after { top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: white; }
+.admin .popover.left .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999; border-left-color: rgba(0, 0, 0, 0.25); }
+.admin .popover.left .arrow:after { right: 1px; border-right-width: 0; border-left-color: white; bottom: -10px; }
+.admin .thumbnails { margin-left: -20px; list-style: none; *zoom: 1; }
+.admin .thumbnails:before, .admin .thumbnails:after { display: table; content: ""; line-height: 0; }
+.admin .thumbnails:after { clear: both; }
+.admin .row-fluid .thumbnails { margin-left: 0; }
+.admin .thumbnails > li { float: left; margin-bottom: 20px; margin-left: 20px; }
+.admin .thumbnail { display: block; padding: 4px; line-height: 20px; border: 1px solid #dddddd; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; }
+.admin a.thumbnail:hover { border-color: #0088cc; -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); }
+.admin .thumbnail > img { display: block; max-width: 100%; margin-left: auto; margin-right: auto; }
+.admin .thumbnail .caption { padding: 9px; color: #555555; }
+.admin .media, .admin .media-body { overflow: hidden; *overflow: visible; zoom: 1; }
+.admin .media, .admin .media .media { margin-top: 15px; }
+.admin .media:first-child { margin-top: 0; }
+.admin .media-object { display: block; }
+.admin .media-heading { margin: 0 0 5px; }
+.admin .media .pull-left { margin-right: 10px; }
+.admin .media .pull-right { margin-left: 10px; }
+.admin .media-list { margin-left: 0; list-style: none; }
+.admin .label, .admin .badge { display: inline-block; padding: 2px 4px; font-size: 11.844px; font-weight: bold; line-height: 14px; color: white; vertical-align: baseline; white-space: nowrap; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #999999; }
+.admin .label { -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
+.admin .badge { padding-left: 9px; padding-right: 9px; -webkit-border-radius: 9px; -moz-border-radius: 9px; border-radius: 9px; }
+.admin .label:empty, .admin .badge:empty { display: none; }
+.admin a.label:hover, .admin a.badge:hover { color: white; text-decoration: none; cursor: pointer; }
+.admin .label-important { background-color: #b94a48; }
+.admin .label-important[href] { background-color: #953b39; }
+.admin .label-warning { background-color: #f89406; }
+.admin .label-warning[href] { background-color: #c67605; }
+.admin .label-success { background-color: #468847; }
+.admin .label-success[href] { background-color: #356635; }
+.admin .label-info { background-color: #3a87ad; }
+.admin .label-info[href] { background-color: #2d6987; }
+.admin .label-inverse { background-color: #333333; }
+.admin .label-inverse[href] { background-color: #1a1a1a; }
+.admin .badge-important { background-color: #b94a48; }
+.admin .badge-important[href] { background-color: #953b39; }
+.admin .badge-warning { background-color: #f89406; }
+.admin .badge-warning[href] { background-color: #c67605; }
+.admin .badge-success { background-color: #468847; }
+.admin .badge-success[href] { background-color: #356635; }
+.admin .badge-info { background-color: #3a87ad; }
+.admin .badge-info[href] { background-color: #2d6987; }
+.admin .badge-inverse { background-color: #333333; }
+.admin .badge-inverse[href] { background-color: #1a1a1a; }
+.admin .btn .label, .admin .btn .badge { position: relative; top: -1px; }
+.admin .btn-mini .label, .admin .btn-mini .badge { top: 0; }
+.admin .progress { overflow: hidden; height: 20px; margin-bottom: 20px; background-color: #f6f6f6; background-image: -moz-linear-gradient(top, whitesmoke, #f9f9f9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(whitesmoke), to(#f9f9f9)); background-image: -webkit-linear-gradient(top, whitesmoke, #f9f9f9); background-image: -o-linear-gradient(top, whitesmoke, #f9f9f9); background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFF5F5F5', endColorstr='#FFF9F9F9', GradientType=0); -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
+.admin .progress .bar { width: 0%; height: 100%; color: white; float: left; font-size: 12px; text-align: center; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #0d90d1; background-image: -moz-linear-gradient(top, #149bdf, #0480be); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); background-image: -webkit-linear-gradient(top, #149bdf, #0480be); background-image: -o-linear-gradient(top, #149bdf, #0480be); background-image: linear-gradient(to bottom, #149bdf, #0480be); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF149BDF', endColorstr='#FF0480BE', GradientType=0); -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: width 0.6s ease; -moz-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; }
+.admin .progress .bar + .bar { -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); }
+.admin .progress-striped .bar { background-color: #149bdf; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -webkit-background-size: 40px 40px; -moz-background-size: 40px 40px; -o-background-size: 40px 40px; background-size: 40px 40px; }
+.admin .progress.active .bar { -webkit-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite; -ms-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; }
+.admin .progress-danger .bar, .admin .progress .bar-danger { background-color: #dd514b; background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEE5F5B', endColorstr='#FFC43C35', GradientType=0); }
+.admin .progress-danger.progress-striped .bar, .admin .progress-striped .bar-danger { background-color: #ee5f5b; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
+.admin .progress-success .bar, .admin .progress .bar-success { background-color: #5db95d; background-image: -moz-linear-gradient(top, #62c462, #57a957); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); background-image: -webkit-linear-gradient(top, #62c462, #57a957); background-image: -o-linear-gradient(top, #62c462, #57a957); background-image: linear-gradient(to bottom, #62c462, #57a957); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF62C462', endColorstr='#FF57A957', GradientType=0); }
+.admin .progress-success.progress-striped .bar, .admin .progress-striped .bar-success { background-color: #62c462; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
+.admin .progress-info .bar, .admin .progress .bar-info { background-color: #4bb1cf; background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); background-image: -o-linear-gradient(top, #5bc0de, #339bb9); background-image: linear-gradient(to bottom, #5bc0de, #339bb9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF5BC0DE', endColorstr='#FF339BB9', GradientType=0); }
+.admin .progress-info.progress-striped .bar, .admin .progress-striped .bar-info { background-color: #5bc0de; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
+.admin .progress-warning .bar, .admin .progress .bar-warning { background-color: #f9a732; background-image: -moz-linear-gradient(top, #fbb450, #f89406); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); background-image: -webkit-linear-gradient(top, #fbb450, #f89406); background-image: -o-linear-gradient(top, #fbb450, #f89406); background-image: linear-gradient(to bottom, #fbb450, #f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFBB450', endColorstr='#FFF89406', GradientType=0); }
+.admin .progress-warning.progress-striped .bar, .admin .progress-striped .bar-warning { background-color: #fbb450; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); }
+.admin .accordion { margin-bottom: 20px; }
+.admin .accordion-group { margin-bottom: 2px; border: 1px solid #e5e5e5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
+.admin .accordion-heading { border-bottom: 0; }
+.admin .accordion-heading .accordion-toggle { display: block; padding: 8px 15px; }
+.admin .accordion-toggle { cursor: pointer; }
+.admin .accordion-inner { padding: 9px 15px; border-top: 1px solid #e5e5e5; }
+.admin .carousel { position: relative; margin-bottom: 20px; line-height: 1; }
+.admin .carousel-inner { overflow: hidden; width: 100%; position: relative; }
+.admin .carousel-inner > .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -moz-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; }
+.admin .carousel-inner > .item > img { display: block; line-height: 1; }
+.admin .carousel-inner > .active, .admin .carousel-inner > .next, .admin .carousel-inner > .prev { display: block; }
+.admin .carousel-inner > .active { left: 0; }
+.admin .carousel-inner > .next, .admin .carousel-inner > .prev { position: absolute; top: 0; width: 100%; }
+.admin .carousel-inner > .next { left: 100%; }
+.admin .carousel-inner > .prev { left: -100%; }
+.admin .carousel-inner > .next.left, .admin .carousel-inner > .prev.right { left: 0; }
+.admin .carousel-inner > .active.left { left: -100%; }
+.admin .carousel-inner > .active.right { left: 100%; }
+.admin .carousel-control { position: absolute; top: 40%; left: 15px; width: 40px; height: 40px; margin-top: -20px; font-size: 60px; font-weight: 100; line-height: 30px; color: white; text-align: center; background: #222222; border: 3px solid white; -webkit-border-radius: 23px; -moz-border-radius: 23px; border-radius: 23px; opacity: 0.5; filter: alpha(opacity=50); }
+.admin .carousel-control.right { left: auto; right: 15px; }
+.admin .carousel-control:hover { color: white; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); }
+.admin .carousel-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 15px; background: #333333; background: rgba(0, 0, 0, 0.75); }
+.admin .carousel-caption h4, .admin .carousel-caption p { color: white; line-height: 20px; }
+.admin .carousel-caption h4 { margin: 0 0 5px; }
+.admin .carousel-caption p { margin-bottom: 0; }
+.admin .hero-unit { padding: 60px; margin-bottom: 30px; font-size: 18px; font-weight: 200; line-height: 30px; color: inherit; background-color: #eeeeee; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; }
+.admin .hero-unit h1 { margin-bottom: 0; font-size: 60px; line-height: 1; color: inherit; letter-spacing: -1px; }
+.admin .hero-unit li { line-height: 30px; }
+.admin .pull-right { float: right; }
+.admin .pull-left { float: left; }
+.admin .hide { display: none; }
+.admin .show { display: block; }
+.admin .invisible { visibility: hidden; }
+.admin .affix { position: fixed; }
+.admin .clearfix { *zoom: 1; }
+.admin .clearfix:before, .admin .clearfix:after { display: table; content: ""; line-height: 0; }
+.admin .clearfix:after { clear: both; }
+.admin .hide-text { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; }
+.admin .input-block-level { display: block; width: 100%; min-height: 30px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
+.admin #main { padding-top: 50px; }
+.admin .form-inline { display: inline; }
+.admin table .form { display: inline-block; margin: 0; }
+.admin .accordion-group { border: none; }
+.admin .accordion-heading .btn { float: left; margin: 6px 15px; }
+.admin .accordion-heading .accordion-toggle { padding: 2px; }
+.admin .accordion-heading .accordion-toggle:hover { text-decoration: none; }
+.admin div.item-detail div:nth-child(odd) span { background-color: #eee; }
+.admin span.label.tag { margin-right: 2px; }
+.admin span.label.tag a { color: white; }
+.admin body.admin blockquote p { font-size: 13px; display: inline; }
+.admin div#user_locale_switcher div.btn-group:before, .admin div#user_locale_switcher div.btn-group:after { display: inline; }
+.admin #request_hidden_user_subject_field { width: 440px; }
+.admin #request_hidden_user_explanation_field { width: 100%; height: 15em; }
+.admin #request_hidden_user_subject, .admin #request_hide_button, .admin #request_hidden_user_explanation { display: none; }
+.admin #outgoing_message_body, .admin #comment_body { width: 750px; }
diff --git a/public/down.default.html b/public/down.default.html
index c01e8fa19..ce4887b51 100644
--- a/public/down.default.html
+++ b/public/down.default.html
@@ -1,6 +1,7 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
<html lang="en-gb">
<head>
+ <meta charset="utf-8">
<title>
WhatDoTheyKnow - make and browse Freedom of Information (FOI) requests
</title>
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index 1a6aa1d84..2823f3978 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -1743,3 +1743,7 @@ text-decoration:underline;
.request_listing a,.body_listing a,.user_listing a,.request_short_listing a,h2 a,.feed_link a {
text-decoration:none;
}
+
+.big {
+ font-size: larger;
+}
diff --git a/script/runner b/script/runner
index 7e910e443..73b03847d 100755
--- a/script/runner
+++ b/script/runner
@@ -30,7 +30,7 @@ Dir.chdir(alaveteli_dir) do
fh.puts pid
end
end
-
+
Process.detach(pid)
else
# Not daemon mode
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb
index 38e874469..7b2876aff 100644
--- a/spec/controllers/public_body_controller_spec.rb
+++ b/spec/controllers/public_body_controller_spec.rb
@@ -62,6 +62,11 @@ describe PublicBodyController, "when showing a body" do
RoutingFilter.active = true
end
+ it "should remember the filter (view) setting on redirecting" do
+ get :show, :show_locale => "es", :url_name => "tgq", :view => 'successful'
+ response.should redirect_to show_public_body_successful_url(:url_name => "etgq")
+ end
+
it "should redirect to newest name if you use historic name of public body in URL" do
get :show, :url_name => "hdink", :view => 'all'
response.should redirect_to(:controller => 'public_body', :action => 'show', :url_name => "dfh")
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 842b4e47c..396182f00 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -337,12 +337,12 @@ describe RequestController, "when showing one request" do
it 'should not show the describe state form' do
make_request
- response.should_not have_selector('div.describe_state_form')
+ response.should_not have_tag('div.describe_state_form')
end
it 'should not ask the user to use the describe state form' do
make_request
- response.should_not have_selector('p#request_status', :content => "answer the question above")
+ response.should_not have_tag('p#request_status', :text => /answer the question above/)
end
end
@@ -1251,8 +1251,7 @@ describe RequestController, "when classifying an information request" do
end
it 'should redirect to the request page' do
- post :describe_state, :id => @external_request.id,
- :submitted_describe_state => 1
+ post :describe_state, :id => @external_request.id
response.should redirect_to(:action => 'show',
:controller => 'request',
:url_title => @external_request.url_title)
@@ -1272,8 +1271,7 @@ describe RequestController, "when classifying an information request" do
def post_status(status)
post :describe_state, :incoming_message => { :described_state => status },
:id => @dog_request.id,
- :last_info_request_event_id => @dog_request.last_event_id_needing_description,
- :submitted_describe_state => 1
+ :last_info_request_event_id => @dog_request.last_event_id_needing_description
end
it "should require login" do
@@ -1283,6 +1281,7 @@ describe RequestController, "when classifying an information request" do
end
it 'should ask whether the request is old and unclassified' do
+ session[:user_id] = users(:silly_name_user).id
@dog_request.should_receive(:is_old_unclassified?)
post_status('rejected')
end
@@ -1322,7 +1321,7 @@ describe RequestController, "when classifying an information request" do
it 'should classify the request' do
@dog_request.stub!(:calculate_status).and_return('rejected')
- @dog_request.should_receive(:set_described_state).with('rejected')
+ @dog_request.should_receive(:set_described_state).with('rejected', users(:silly_name_user), nil)
post_status('rejected')
end
@@ -1350,6 +1349,26 @@ describe RequestController, "when classifying an information request" do
flash[:notice].should == 'Thank you for updating this request!'
end
+ context "playing the classification game" do
+ before :each do
+ session[:request_game] = true
+ end
+
+ it "should continue the game after classifying a request" do
+ post_status("rejected")
+ flash[:notice].should =~ /There are some more requests below for you to classify/
+ response.should redirect_to categorise_play_url
+ end
+ end
+
+ it "should send a mail from the user who changed the state to requires_admin" do
+ post :describe_state, :incoming_message => { :described_state => "requires_admin", :message => "a message" }, :id => @dog_request.id, :incoming_message_id => incoming_messages(:useless_incoming_message), :last_info_request_event_id => @dog_request.last_event_id_needing_description
+
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 1
+ mail = deliveries[0]
+ mail.from_addrs.first.to_s.should == users(:silly_name_user).name_and_email
+ end
end
end
@@ -1365,7 +1384,7 @@ describe RequestController, "when classifying an information request" do
it 'should update the status of the request' do
@dog_request.stub!(:calculate_status).and_return('rejected')
- @dog_request.should_receive(:set_described_state).with('rejected')
+ @dog_request.should_receive(:set_described_state).with('rejected', @admin_user, nil)
post_status('rejected')
end
@@ -1418,7 +1437,7 @@ describe RequestController, "when classifying an information request" do
it 'should update the status of the request' do
@dog_request.stub!(:calculate_status).and_return('rejected')
- @dog_request.should_receive(:set_described_state).with('rejected')
+ @dog_request.should_receive(:set_described_state).with('rejected', @admin_user, nil)
post_status('rejected')
end
@@ -1453,6 +1472,22 @@ describe RequestController, "when classifying an information request" do
@dog_request.stub!(:each).and_return([@dog_request])
end
+ it "should let you know when you forget to select a status" do
+ post :describe_state, :id => @dog_request.id,
+ :last_info_request_event_id => @dog_request.last_event_id_needing_description
+ response.should redirect_to show_request_url(:url_title => @dog_request.url_title)
+ flash[:error].should == _("Please choose whether or not you got some of the information that you wanted.")
+ end
+
+ it "should not change the status if the request has changed while viewing it" do
+ @dog_request.stub!(:last_event_id_needing_description).and_return(2)
+
+ post :describe_state, :incoming_message => { :described_state => "rejected" },
+ :id => @dog_request.id, :last_info_request_event_id => 1
+ response.should redirect_to show_request_url(:url_title => @dog_request.url_title)
+ flash[:error].should =~ /The request has been updated since you originally loaded this page/
+ end
+
it "should successfully classify response if logged in as user controlling request" do
post_status('rejected')
response.should redirect_to(:controller => 'help', :action => 'unhappy', :url_title => @dog_request.url_title)
@@ -1473,22 +1508,34 @@ describe RequestController, "when classifying an information request" do
post_status('rejected')
end
- it "should send email when classified as requires_admin" do
- post :describe_state, :incoming_message => { :described_state => "requires_admin" }, :id => @dog_request.id, :incoming_message_id => incoming_messages(:useless_incoming_message), :last_info_request_event_id => @dog_request.last_event_id_needing_description, :submitted_describe_state => 1
- response.should redirect_to(:controller => 'help', :action => 'contact')
+ it "should go to the page asking for more information when classified as requires_admin" do
+ post :describe_state, :incoming_message => { :described_state => "requires_admin" }, :id => @dog_request.id, :incoming_message_id => incoming_messages(:useless_incoming_message), :last_info_request_event_id => @dog_request.last_event_id_needing_description
+ response.should redirect_to describe_state_message_url(:url_title => @dog_request.url_title, :described_state => "requires_admin")
@dog_request.reload
- @dog_request.awaiting_description.should == false
- @dog_request.described_state.should == 'requires_admin'
- @dog_request.get_last_response_event.calculated_state.should == 'requires_admin'
+ @dog_request.described_state.should_not == 'requires_admin'
+
+ ActionMailer::Base.deliveries.should be_empty
+ end
+
+ context "message is included when classifying as requires_admin" do
+ it "should send an email including the message" do
+ post :describe_state,
+ :incoming_message => {
+ :described_state => "requires_admin",
+ :message => "Something weird happened" },
+ :id => @dog_request.id,
+ :last_info_request_event_id => @dog_request.last_event_id_needing_description
- deliveries = ActionMailer::Base.deliveries
- deliveries.size.should == 1
- mail = deliveries[0]
- mail.body.should =~ /as needing admin/
- mail.from_addrs.first.to_s.should == @request_owner.email
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 1
+ mail = deliveries[0]
+ mail.body.should =~ /as needing admin/
+ mail.body.should =~ /Something weird happened/
+ end
end
+
it 'should say it is showing advice as to what to do next' do
post_status('rejected')
flash[:notice].should match(/Here is what to do now/)
@@ -1598,12 +1645,22 @@ describe RequestController, "when classifying an information request" do
expect_redirect('internal_review', request_url)
end
- it 'should redirect to the "help general url" when status is updated to "requires admin"' do
- expect_redirect('requires_admin', "help/contact")
+ it 'should redirect to the "request url" when status is updated to "requires admin"' do
+ post :describe_state, :incoming_message => {
+ :described_state => 'requires_admin',
+ :message => "A message" },
+ :id => @dog_request.id,
+ :last_info_request_event_id => @dog_request.last_event_id_needing_description
+ response.should redirect_to show_request_url(:url_title => @dog_request.url_title)
end
- it 'should redirect to the "help general url" when status is updated to "error message"' do
- expect_redirect('error_message', "help/contact")
+ it 'should redirect to the "request url" when status is updated to "error message"' do
+ post :describe_state, :incoming_message => {
+ :described_state => 'error_message',
+ :message => "A message" },
+ :id => @dog_request.id,
+ :last_info_request_event_id => @dog_request.last_event_id_needing_description
+ response.should redirect_to show_request_url(:url_title => @dog_request.url_title)
end
it 'should redirect to the "respond to last url url" when status is updated to "user_withdrawn"' do
diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb
index 8d9d7637b..e9501b1ed 100644
--- a/spec/controllers/track_controller_spec.rb
+++ b/spec/controllers/track_controller_spec.rb
@@ -57,7 +57,6 @@ end
describe TrackController, "when sending alerts for a track" do
render_views
- include LinkToHelper # for main_url
before(:each) do
load_raw_emails_data
@@ -104,7 +103,7 @@ describe TrackController, "when sending alerts for a track" do
# Given we can't click the link, check the token is right instead
post_redirect = PostRedirect.find_by_email_token(mail_token)
- expected_url = main_url("/user/" + users(:silly_name_user).url_name + "#email_subscriptions") # XXX can't call URL making functions here, what is correct way to do this?
+ expected_url = show_user_url(:url_name => users(:silly_name_user).url_name, :anchor => "email_subscriptions")
post_redirect.uri.should == expected_url
# Check nothing more is delivered if we try again
diff --git a/spec/fixtures/files/incoming-request-empty.email b/spec/fixtures/files/incoming-request-empty.email
new file mode 100644
index 000000000..890a14f21
--- /dev/null
+++ b/spec/fixtures/files/incoming-request-empty.email
@@ -0,0 +1,8 @@
+From: EMAIL_FROM
+To: FOI Person <EMAIL_TO>
+Bcc:
+Subject: Re: Nothing to see here.
+Reply-To:
+In-Reply-To: <471f1eae5d1cb_7347..fdbe67386163@cat.tmail>
+
+
diff --git a/spec/fixtures/info_request_events.yml b/spec/fixtures/info_request_events.yml
index c1a00ad47..3907703d8 100644
--- a/spec/fixtures/info_request_events.yml
+++ b/spec/fixtures/info_request_events.yml
@@ -171,3 +171,14 @@ anonymous_external_outgoing_message_event:
created_at: 2009-01-03 02:23:45.6789100
described_state: waiting_response
calculated_state: waiting_response
+
+other_request_outgoing_message_event:
+ id: 916
+ params_yaml: "--- \n\
+ :outgoing_message_id: 10\n"
+ outgoing_message_id: 10
+ info_request_id: 111
+ event_type: sent
+ created_at: <%= Time.now %>
+ described_state: waiting_response
+ calculated_state: waiting_response
diff --git a/spec/fixtures/info_requests.yml b/spec/fixtures/info_requests.yml
index 9361ec486..97effd036 100644
--- a/spec/fixtures/info_requests.yml
+++ b/spec/fixtures/info_requests.yml
@@ -107,3 +107,15 @@ anonymous_external_request:
awaiting_description: false
comments_allowed: true
idhash: 7654321a
+other_request:
+ id: 111
+ title: Another request
+ url_title: another_request
+ created_at: 2010-01-01 02:23:45.6789100
+ updated_at: 2010-01-01 02:23:45.6789100
+ public_body_id: 7
+ user_id: 6
+ described_state: waiting_response
+ awaiting_description: false
+ comments_allowed: true
+ idhash: b234567
diff --git a/spec/fixtures/outgoing_messages.yml b/spec/fixtures/outgoing_messages.yml
index 55df8473e..c71ee08bf 100644
--- a/spec/fixtures/outgoing_messages.yml
+++ b/spec/fixtures/outgoing_messages.yml
@@ -108,3 +108,14 @@ anonymous_external_outgoing_message:
updated_at: 2009-01-12 01:56:58.586598
what_doing: normal_sort
+other_outgoing_message:
+ id: 10
+ info_request_id: 111
+ message_type: initial_request
+ status: sent
+ body: "Just another request"
+ last_sent_at: <%= Time.now %>
+ created_at: 2009-01-12 01:56:58.586598
+ updated_at: 2009-01-12 01:56:58.586598
+ what_doing: normal_sort
+
diff --git a/spec/fixtures/public_bodies.yml b/spec/fixtures/public_bodies.yml
index 615c4bcb6..65cba4b28 100644
--- a/spec/fixtures/public_bodies.yml
+++ b/spec/fixtures/public_bodies.yml
@@ -72,3 +72,18 @@ sensible_walks_public_body:
created_at: 2008-10-25 10:51:01.161639
api_key: 5
info_requests_count: 1
+other_public_body:
+ id: 7
+ version: 1
+ name: 'Another Public Body'
+ first_letter: A
+ request_email: other@localhost
+ short_name: Another Public Body
+ url_name: another_public_body
+ notes: More notes
+ updated_at: 2008-10-25 10:51:01.161639
+ last_edit_comment: Another edit
+ last_edit_editor: louise
+ created_at: 2008-10-25 10:51:01.161639
+ api_key: 6
+ info_requests_count: 0
diff --git a/spec/fixtures/public_body_translations.yml b/spec/fixtures/public_body_translations.yml
index 24b14c470..61e07fb5b 100644
--- a/spec/fixtures/public_body_translations.yml
+++ b/spec/fixtures/public_body_translations.yml
@@ -88,3 +88,16 @@ sensible_walks_en_public_body_translation:
notes: I bet you’ve never heard of it.
publication_scheme: ""
disclosure_log: ""
+
+other_public_body_translation:
+ id: 8
+ public_body_id: 7
+ locale: en
+ name: "Another Public Body"
+ first_letter: A
+ request_email: other@localhost
+ short_name: Another Public Body
+ url_name: another_public_body
+ notes: More notes
+ publication_scheme: ""
+ disclosure_log: ""
diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml
index d6391c5e8..c9730d855 100644
--- a/spec/fixtures/users.yml
+++ b/spec/fixtures/users.yml
@@ -1,4 +1,4 @@
-bob_smith_user:
+bob_smith_user:
id: "1"
name: Bob Smith
url_name: bob_smith
@@ -13,7 +13,7 @@ bob_smith_user:
locale: 'en'
about_me: 'I like making requests about fancy dogs and naughty chickens and stuff.'
receive_email_alerts: true
-silly_name_user:
+silly_name_user:
id: "2"
name: "Silly <em>Name</em>"
url_name: silly_emnameem
@@ -28,7 +28,7 @@ silly_name_user:
locale: 'en'
about_me: ''
receive_email_alerts: true
-admin_user:
+admin_user:
id: "3"
name: Joe Admin
url_name: joe_admin
@@ -43,7 +43,7 @@ admin_user:
locale: ''
about_me: ''
receive_email_alerts: true
-unconfirmed_user:
+unconfirmed_user:
id: "4"
name: "Unconfirmed"
url_name: unconfirmed
@@ -71,3 +71,17 @@ robin_user:
ban_text: ''
about_me: 'I am the best'
receive_email_alerts: true
+another_user:
+ id: 6
+ name: Another User
+ url_name: another_user
+ email: another@localhost
+ salt: "-6116981980.392287733335677"
+ hashed_password: 6b7cd45a5f35fd83febc0452a799530398bfb6e8 # jonespassword
+ updated_at: 2012-01-01 10:39:15.491593
+ created_at: 2012-01-01 10:39:15.491593
+ email_confirmed: true
+ admin_level: 'none'
+ ban_text: ''
+ about_me: 'Just another user'
+ receive_email_alerts: true
diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb
index 63daf1a75..5233f3f7f 100644
--- a/spec/helpers/link_to_helper_spec.rb
+++ b/spec/helpers/link_to_helper_spec.rb
@@ -16,11 +16,11 @@ describe LinkToHelper do
it 'should return a path like /request/test_title' do
- request_url(@mock_request).should == '/request/test_title'
+ request_path(@mock_request).should == '/request/test_title'
end
it 'should return a path including any extra parameters passed' do
- request_url(@mock_request, {:update_status => 1}).should == '/request/test_title?update_status=1'
+ request_path(@mock_request, {:update_status => 1}).should == '/request/test_title?update_status=1'
end
end
diff --git a/spec/integration/request_controller_spec.rb b/spec/integration/request_controller_spec.rb
new file mode 100644
index 000000000..24667bdf1
--- /dev/null
+++ b/spec/integration/request_controller_spec.rb
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe RequestController, "when classifying an information request" do
+
+ describe 'when the request is internal' do
+
+ before(:each) do
+ @dog_request = info_requests(:fancy_dog_request)
+ # This should happen automatically before each test but doesn't with these integration
+ # tests for some reason.
+ ActionMailer::Base.deliveries = []
+ end
+
+ describe 'when logged in as the requestor' do
+
+ before :each do
+ @request_owner = @dog_request.user
+ visit signin_path
+ fill_in "Your e-mail:", :with => @request_owner.email
+ fill_in "Password:", :with => "jonespassword"
+ click_button "Sign in"
+ end
+
+ it "should send an email including the message" do
+ visit describe_state_message_path(:url_title => @dog_request.url_title,
+ :described_state => "requires_admin")
+ fill_in "Please tell us more:", :with => "Okay. I don't quite understand."
+ click_button "Submit status and send message"
+
+ response.should contain "Thank you! We'll look into what happened and try and fix it up."
+
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 1
+ mail = deliveries[0]
+ mail.body.should =~ /as needing admin/
+ mail.body.should =~ /Okay. I don't quite understand./
+ end
+ end
+ end
+end
diff --git a/spec/lib/ability_spec.rb b/spec/lib/ability_spec.rb
new file mode 100644
index 000000000..f075d0f32
--- /dev/null
+++ b/spec/lib/ability_spec.rb
@@ -0,0 +1,51 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe Ability do
+ describe ".can_update_request_state?" do
+ context "old and unclassified request" do
+ let(:request) { mock_model(InfoRequest, :is_old_unclassified? => true) }
+
+ context "logged out" do
+ let(:user) { nil }
+ before(:each) { request.stub!(:is_owning_user?).and_return(false) }
+ it { Ability::can_update_request_state?(user, request).should be_false }
+ end
+
+ context "logged in but not owner of request" do
+ let(:user) { mock_model(User) }
+ before(:each) { request.stub!(:is_owning_user?).and_return(false) }
+
+ it { Ability::can_update_request_state?(user, request).should be_true }
+ end
+ end
+
+ context "new request" do
+ let(:request) { mock_model(InfoRequest, :is_old_unclassified? => false) }
+
+ context "logged out" do
+ let(:user) { nil }
+ before(:each) { request.stub!(:is_owning_user?).and_return(false) }
+
+ it { Ability::can_update_request_state?(user, request).should be_false }
+ end
+
+ context "logged in" do
+ let(:user) { mock_model(User) }
+
+ # An owner of a request can also be someone with admin powers
+ context "as owner of request" do
+ before(:each) { request.stub!(:is_owning_user?).and_return(true) }
+
+ it { Ability::can_update_request_state?(user, request).should be_true }
+ end
+
+ context "but not owner of request" do
+ before(:each) { request.stub!(:is_owning_user?).and_return(false) }
+
+ it { Ability::can_update_request_state?(user, request).should be_false }
+ end
+ end
+ end
+ end
+end
+
diff --git a/spec/mailers/request_mailer_spec.rb b/spec/mailers/request_mailer_spec.rb
index 9597045eb..68cef2f0b 100644
--- a/spec/mailers/request_mailer_spec.rb
+++ b/spec/mailers/request_mailer_spec.rb
@@ -27,7 +27,7 @@ describe RequestMailer, " when receiving incoming mail" do
receive_incoming_mail('incoming-request-plain.email', 'dummy@localhost')
ir.incoming_messages.size.should == 1
InfoRequest.holding_pen_request.incoming_messages.size.should == 1
- last_event = InfoRequest.holding_pen_request.incoming_messages[0].info_request.get_last_event
+ last_event = InfoRequest.holding_pen_request.incoming_messages[0].info_request.info_request_events.last
last_event.params[:rejected_reason].should == "Could not identify the request from the email address"
deliveries = ActionMailer::Base.deliveries
@@ -47,7 +47,7 @@ describe RequestMailer, " when receiving incoming mail" do
receive_incoming_mail('incoming-request-plain.email', ir.incoming_email, "")
ir.incoming_messages.size.should == 1
InfoRequest.holding_pen_request.incoming_messages.size.should == 1
- last_event = InfoRequest.holding_pen_request.incoming_messages[0].info_request.get_last_event
+ last_event = InfoRequest.holding_pen_request.incoming_messages[0].info_request.info_request_events.last
last_event.params[:rejected_reason].should =~ /there is no "From" address/
deliveries = ActionMailer::Base.deliveries
@@ -67,7 +67,7 @@ describe RequestMailer, " when receiving incoming mail" do
receive_incoming_mail('incoming-request-plain.email', ir.incoming_email, "frob@nowhere.com")
ir.incoming_messages.size.should == 1
InfoRequest.holding_pen_request.incoming_messages.size.should == 1
- last_event = InfoRequest.holding_pen_request.incoming_messages[0].info_request.get_last_event
+ last_event = InfoRequest.holding_pen_request.incoming_messages[0].info_request.info_request_events.last
last_event.params[:rejected_reason].should =~ /Only the authority can reply/
deliveries = ActionMailer::Base.deliveries
@@ -152,7 +152,7 @@ describe RequestMailer, " when receiving incoming mail" do
receive_incoming_mail('incoming-request-plain.email', ir.incoming_email)
ir.incoming_messages.size.should == 1
InfoRequest.holding_pen_request.incoming_messages.size.should == 1 # arrives in holding pen
- last_event = InfoRequest.holding_pen_request.incoming_messages[0].info_request.get_last_event
+ last_event = InfoRequest.holding_pen_request.incoming_messages[0].info_request.info_request_events.last
last_event.params[:rejected_reason].should =~ /allow new responses from nobody/
# should be a message to admin regarding holding pen
@@ -329,6 +329,27 @@ describe RequestMailer, 'when sending mail when someone has updated an old uncla
end
+
+describe RequestMailer, 'when sending a new response email' do
+
+ before do
+ @user = mock_model(User, :name_and_email => 'test name and email')
+ @public_body = mock_model(PublicBody, :name => 'Test public body')
+ @info_request = mock_model(InfoRequest, :user => @user,
+ :law_used_full => 'Freedom of Information',
+ :title => 'Here is a character that needs quoting …',
+ :public_body => @public_body,
+ :display_status => 'Refused.',
+ :url_title => 'test_request')
+ @incoming_message = mock_model(IncomingMessage, :info_request => @info_request)
+ end
+
+ it 'should not error when sending mails requests with characters requiring quoting in the subject' do
+ @mail = RequestMailer.new_response(@info_request, @incoming_message)
+ end
+
+end
+
describe RequestMailer, 'requires_admin' do
before(:each) do
user = mock_model(User, :name_and_email => 'Bruce Jones',
@@ -347,15 +368,9 @@ describe RequestMailer, 'requires_admin' do
mail.body.should include('http://test.host/en/admin/request/show/123')
end
- context 'has an ADMIN_BASE_URL set' do
- before(:each) do
- AlaveteliConfiguration::should_receive(:admin_base_url).and_return('http://our.proxy.server/admin/alaveteli/')
- end
-
- it 'body should contain the full admin URL' do
- mail = RequestMailer.requires_admin(@info_request).deliver
-
- mail.body.should include('http://our.proxy.server/admin/alaveteli/request/show/123')
- end
+ it "body should contain the message from the user" do
+ mail = RequestMailer.requires_admin(@info_request, nil, "Something has gone wrong").deliver
+ mail.body.should include 'Something has gone wrong'
end
+
end
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index a1a6e6c27..3eb88b2bb 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -426,8 +426,8 @@ describe InfoRequest do
before do
Time.stub!(:now).and_return(Time.utc(2007, 11, 9, 23, 59))
- @mock_comment_event = mock_model(InfoRequestEvent, :created_at => Time.now - 23.days, :event_type => 'comment')
- @mock_response_event = mock_model(InfoRequestEvent, :created_at => Time.now - 22.days, :event_type => 'response')
+ @mock_comment_event = mock_model(InfoRequestEvent, :created_at => Time.now - 23.days, :event_type => 'comment', :response? => false)
+ @mock_response_event = mock_model(InfoRequestEvent, :created_at => Time.now - 22.days, :event_type => 'response', :response? => true)
@info_request = InfoRequest.new(:prominence => 'normal',
:awaiting_description => true,
:info_request_events => [@mock_response_event, @mock_comment_event])
diff --git a/spec/models/purge_request_spec.rb b/spec/models/purge_request_spec.rb
index 94fe01317..7b67fca52 100644
--- a/spec/models/purge_request_spec.rb
+++ b/spec/models/purge_request_spec.rb
@@ -1,12 +1,13 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'fakeweb'
-describe PurgeRequest, "purging things" do
+describe PurgeRequest, "purging things" do
before do
+ PurgeRequest.destroy_all
FakeWeb.last_request = nil
end
- it 'should issue purge requests to the server' do
+ it 'should issue purge requests to the server' do
req = PurgeRequest.new(:url => "/begone_from_here",
:model => "don't care",
:model_id => "don't care")
@@ -16,7 +17,7 @@ describe PurgeRequest, "purging things" do
PurgeRequest.all().count.should == 0
end
- it 'should fail silently for a misconfigured server' do
+ it 'should fail silently for a misconfigured server' do
FakeWeb.register_uri(:get, %r|brokenv|, :body => "BROKEN")
config = MySociety::Config.load_default()
config['VARNISH_HOST'] = "brokencache"
@@ -29,4 +30,4 @@ describe PurgeRequest, "purging things" do
PurgeRequest.all().count.should == 0
end
end
-
+
diff --git a/spec/script/mailin-spec.rb b/spec/script/mailin-spec.rb
deleted file mode 100644
index d80789635..000000000
--- a/spec/script/mailin-spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
-require "external_command"
-
-def mailin_test(email_filename)
- Dir.chdir Rails.root do
- xc = ExternalCommand.new("script/mailin")
- xc.run(load_file_fixture(email_filename))
- xc.err.should == ""
- return xc
- end
-end
-
-describe "When importing mail into the application" do
-
- it "should not produce any output and should return a 0 code on importing a plain email" do
- r = mailin_test("incoming-request-plain.email")
- r.status.should == 0
- r.out.should == ""
- end
-
-end \ No newline at end of file
diff --git a/spec/script/mailin_spec.rb b/spec/script/mailin_spec.rb
new file mode 100644
index 000000000..acd06ff3b
--- /dev/null
+++ b/spec/script/mailin_spec.rb
@@ -0,0 +1,37 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require "external_command"
+
+def mailin_test(email_filename)
+ Dir.chdir Rails.root do
+ xc = ExternalCommand.new("script/mailin")
+ mail = load_file_fixture(email_filename)
+ ir = info_requests(:other_request)
+ mail.gsub!('EMAIL_TO', ir.incoming_email)
+ mail.gsub!('EMAIL_FROM', 'responder@localhost')
+ xc.run(mail)
+ xc.err.should == ""
+ return xc
+ end
+end
+
+describe "When importing mail into the application" do
+
+ # Turn off transactional fixtures for this suite - incoming message is imported
+ # outside the transaction via ExternalCommand, so needs to be destroyed outside the
+ # transaction
+ self.use_transactional_fixtures = false
+
+ it "should not produce any output and should return a 0 code on importing a plain email" do
+ r = mailin_test("incoming-request-empty.email")
+ r.status.should == 0
+ r.out.should == ""
+ end
+
+ # Destroy the incoming message so that it doesn't affect other tests
+ after do
+ ir = info_requests(:other_request)
+ incoming_message = ir.incoming_messages[0]
+ incoming_message.fully_destroy
+ end
+
+end
diff --git a/spec/views/request/show.html.erb_spec.rb b/spec/views/request/show.html.erb_spec.rb
index 7fc96a36c..1c1ab8476 100644
--- a/spec/views/request/show.html.erb_spec.rb
+++ b/spec/views/request/show.html.erb_spec.rb
@@ -85,7 +85,7 @@ describe 'request/show' do
it 'should show a link to follow up the last response with clarification' do
request_page
- expected_url = "http://test.host/en/request/#{@mock_request.id}/response/#{@mock_response.id}#followup"
+ expected_url = "/request/#{@mock_request.id}/response/#{@mock_response.id}#followup"
response.should have_selector("a", :href => expected_url, :content => 'send a follow up message')
end
@@ -100,7 +100,7 @@ describe 'request/show' do
it 'should show a link to follow up the request without reference to a specific response' do
request_page
- expected_url = "http://test.host/en/request/#{@mock_request.id}/response#followup"
+ expected_url = "/request/#{@mock_request.id}/response#followup"
response.should have_selector("a", :href => expected_url, :content => 'send a follow up message')
end
end