aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.compass/config.rb30
-rw-r--r--.gitignore1
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock16
-rw-r--r--README.md2
-rw-r--r--app/controllers/admin_censor_rule_controller.rb12
-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/general_controller.rb2
-rw-r--r--app/controllers/public_body_controller.rb2
-rw-r--r--app/controllers/request_controller.rb10
-rw-r--r--app/controllers/services_controller.rb2
-rw-r--r--app/controllers/user_controller.rb2
-rwxr-xr-xapp/helpers/link_to_helper.rb182
-rw-r--r--app/models/request_mailer.rb26
-rw-r--r--app/models/track_mailer.rb2
-rw-r--r--app/models/track_thing.rb2
-rw-r--r--app/sass/admin.scss112
-rw-r--r--app/views/admin_censor_rule/_form.rhtml103
-rw-r--r--app/views/admin_censor_rule/_show.rhtml10
-rw-r--r--app/views/admin_censor_rule/new.rhtml8
-rw-r--r--app/views/admin_general/_admin_navbar.rhtml23
-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.rhtml8
-rw-r--r--app/views/admin_general/index.rhtml286
-rw-r--r--app/views/admin_general/stats.rhtml95
-rw-r--r--app/views/admin_general/timeline.rhtml37
-rw-r--r--app/views/admin_public_body/_form.rhtml116
-rw-r--r--app/views/admin_public_body/_one_list.rhtml55
-rw-r--r--app/views/admin_public_body/_tag_help.rhtml30
-rw-r--r--app/views/admin_public_body/_tags.rhtml6
-rw-r--r--app/views/admin_public_body/edit.rhtml52
-rw-r--r--app/views/admin_public_body/import_csv.rhtml33
-rw-r--r--app/views/admin_public_body/list.rhtml34
-rw-r--r--app/views/admin_public_body/new.rhtml37
-rw-r--r--app/views/admin_public_body/show.rhtml148
-rw-r--r--app/views/admin_request/_incoming_message_actions.rhtml49
-rw-r--r--app/views/admin_request/_some_requests.rhtml61
-rw-r--r--app/views/admin_request/edit.rhtml12
-rw-r--r--app/views/admin_request/edit_comment.rhtml2
-rw-r--r--app/views/admin_request/list.rhtml12
-rw-r--r--app/views/admin_request/list_old_unclassified.rhtml3
-rw-r--r--app/views/admin_request/show.rhtml547
-rw-r--r--app/views/admin_request/show_raw_email.rhtml4
-rw-r--r--app/views/admin_track/_some_tracks.rhtml101
-rw-r--r--app/views/admin_track/list.rhtml45
-rw-r--r--app/views/admin_user/_form.rhtml77
-rw-r--r--app/views/admin_user/_user_table.rhtml63
-rw-r--r--app/views/admin_user/edit.rhtml14
-rw-r--r--app/views/admin_user/list.rhtml12
-rw-r--r--app/views/admin_user/show.rhtml95
-rw-r--r--app/views/api/request_events.atom.builder4
-rw-r--r--app/views/comment/_single_comment.rhtml6
-rw-r--r--app/views/contact_mailer/from_admin_message.rhtml2
-rw-r--r--app/views/contact_mailer/to_admin_message.rhtml8
-rw-r--r--app/views/contact_mailer/user_message.rhtml2
-rw-r--r--app/views/general/_advanced_search_tips.rhtml34
-rw-r--r--app/views/general/_footer.rhtml2
-rw-r--r--app/views/general/_frontpage_bodies_list.rhtml2
-rw-r--r--app/views/general/_frontpage_intro_sentence.rhtml2
-rw-r--r--app/views/general/_frontpage_requests_list.rhtml8
-rw-r--r--app/views/general/_orglink.rhtml2
-rw-r--r--app/views/general/_topnav.rhtml12
-rw-r--r--app/views/general/search.rhtml12
-rw-r--r--app/views/help/api.rhtml4
-rw-r--r--app/views/help/contact.rhtml2
-rw-r--r--app/views/help/unhappy.rhtml4
-rw-r--r--app/views/layouts/admin.rhtml51
-rw-r--r--app/views/layouts/default.rhtml8
-rw-r--r--app/views/outgoing_mailer/followup.rhtml4
-rw-r--r--app/views/outgoing_mailer/initial_request.rhtml2
-rw-r--r--app/views/public_body/_alphabet.rhtml2
-rw-r--r--app/views/public_body/_body_listing_single.rhtml4
-rw-r--r--app/views/public_body/_list_sidebar_extra.rhtml2
-rw-r--r--app/views/public_body/list.rhtml2
-rw-r--r--app/views/public_body/show.rhtml4
-rw-r--r--app/views/public_body/view_email.rhtml4
-rw-r--r--app/views/request/_after_actions.rhtml14
-rw-r--r--app/views/request/_bubble.rhtml12
-rw-r--r--app/views/request/_correspondence.rhtml6
-rw-r--r--app/views/request/_followup.rhtml8
-rw-r--r--app/views/request/_request_listing_short_via_event.rhtml6
-rw-r--r--app/views/request/_request_listing_single.rhtml2
-rw-r--r--app/views/request/_request_listing_via_event.rhtml8
-rw-r--r--app/views/request/_sidebar.rhtml4
-rw-r--r--app/views/request/_view_html_prefix.rhtml2
-rw-r--r--app/views/request/_wall_listing.rhtml4
-rw-r--r--app/views/request/details.rhtml4
-rw-r--r--app/views/request/new.rhtml4
-rw-r--r--app/views/request/select_authority.rhtml2
-rw-r--r--app/views/request/show.rhtml10
-rw-r--r--app/views/request_game/play.rhtml4
-rw-r--r--app/views/request_mailer/external_response.rhtml2
-rw-r--r--app/views/request_mailer/fake_response.rhtml2
-rw-r--r--app/views/request_mailer/new_response.rhtml4
-rw-r--r--app/views/request_mailer/new_response_reminder_alert.rhtml2
-rw-r--r--app/views/request_mailer/overdue_alert.rhtml2
-rw-r--r--app/views/request_mailer/requires_admin.rhtml4
-rw-r--r--app/views/request_mailer/very_overdue_alert.rhtml2
-rw-r--r--app/views/track/_tracking_links.rhtml8
-rw-r--r--app/views/track_mailer/event_digest.rhtml8
-rw-r--r--app/views/user/_show_user_info.rhtml8
-rw-r--r--app/views/user/_signin.rhtml2
-rw-r--r--app/views/user/_user_listing_single.rhtml4
-rw-r--r--app/views/user/set_draft_profile_photo.rhtml2
-rw-r--r--app/views/user/show.rhtml6
-rw-r--r--app/views/user_mailer/already_registered.rhtml4
-rw-r--r--app/views/user_mailer/changeemail_confirm.rhtml2
-rw-r--r--app/views/user_mailer/confirm_login.rhtml4
-rw-r--r--config/environment.rb11
-rw-r--r--config/general.yml-example14
-rw-r--r--config/routes.rb23
-rw-r--r--config/test.yml9
-rw-r--r--doc/ADMIN.md21
-rw-r--r--lib/configuration.rb2
-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--spec/controllers/track_controller_spec.rb3
-rw-r--r--spec/helpers/link_to_helper_spec.rb42
-rw-r--r--spec/models/request_mailer_spec.rb12
-rw-r--r--spec/spec_helper.rb16
-rw-r--r--spec/views/request/show.rhtml_spec.rb4
132 files changed, 3637 insertions, 1245 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 3233196e7..e0b1e3b21 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ TAGS
/files/
/public/download
/public/*theme
+!/public/adminbootstraptheme
/vendor/bundle
.bundle
bin/
diff --git a/Gemfile b/Gemfile
index 7cd8c22dc..851ed38ff 100644
--- a/Gemfile
+++ b/Gemfile
@@ -48,6 +48,7 @@ group :test do
gem 'fakeweb'
gem 'rspec-rails', '~> 1.3.4'
gem 'test-unit', '~> 1.2.3', :platforms => :ruby_19
+ gem 'coveralls', :require => false
end
group :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index 25b156184..27f574f4f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -34,11 +34,18 @@ GEM
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
chunky_png (1.2.6)
+ colorize (0.5.8)
columnize (0.3.6)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
+ coveralls (0.6.0)
+ colorize
+ multi_json (~> 1.3)
+ rest-client
+ simplecov (>= 0.7)
+ thor
daemons (1.1.9)
erubis (2.7.0)
eventmachine (1.0.0)
@@ -78,6 +85,7 @@ GEM
thin
memcache-client (1.8.5)
mime-types (1.19)
+ multi_json (1.6.1)
net-http-local (0.1.2)
net-purge (0.1.0)
net-scp (1.1.0)
@@ -96,6 +104,8 @@ GEM
rdoc (3.12.1)
json (~> 1.4)
recaptcha (0.3.4)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
rmagick (2.13.1)
routing-filter (0.2.4)
actionpack
@@ -123,6 +133,10 @@ GEM
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
sass (3.2.1)
+ simplecov (0.7.1)
+ multi_json (~> 1.0)
+ simplecov-html (~> 0.7.1)
+ simplecov-html (0.7.1)
sinatra (1.2.8)
rack (~> 1.1)
tilt (>= 1.2.2, < 2.0)
@@ -139,6 +153,7 @@ GEM
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
+ thor (0.17.0)
tilt (1.3.3)
treetop (1.4.11)
polyglot
@@ -157,6 +172,7 @@ DEPENDENCIES
bootstrap-sass
capistrano
compass
+ coveralls
erubis
fakeweb
fast_gettext (>= 0.6.0)
diff --git a/README.md b/README.md
index 7313df071..71c6b096f 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)
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..f6abc70df 100644
--- a/app/controllers/admin_censor_rule_controller.rb
+++ b/app/controllers/admin_censor_rule_controller.rb
@@ -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 ac12e97b2..bb5e98852 100644
--- a/app/controllers/admin_public_body_controller.rb
+++ b/app/controllers/admin_public_body_controller.rb
@@ -92,7 +92,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
@@ -111,7 +111,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 ed8de7755..d84b44b6f 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -42,7 +42,7 @@ class AdminRequestController < AdminController
vars = OpenStruct.new(:name_to => @info_request.user_name,
:name_from => Configuration::contact_name,
:info_request => @info_request, :reason => params[:reason],
- :info_request_url => 'http://' + Configuration::domain + request_url(@info_request),
+ :info_request_url => 'http://' + Configuration::domain + request_path(@info_request),
:site_name => site_name)
template = File.read(File.join(File.dirname(__FILE__), "..", "views", "admin_request", "hidden_user_explanation.rhtml"))
@request_hidden_user_explanation = ERB.new(template).result(vars.instance_eval { binding })
@@ -52,7 +52,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
@@ -98,7 +98,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
@@ -114,7 +114,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
@@ -131,7 +131,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
@@ -144,7 +144,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
@@ -168,7 +168,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
@@ -186,7 +186,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
@@ -203,7 +203,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
@@ -223,7 +223,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
@@ -246,7 +246,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])
@@ -265,10 +265,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
@@ -292,20 +292,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
@@ -355,7 +355,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
@@ -387,7 +387,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 03217da45..525c96782 100644
--- a/app/controllers/admin_track_controller.rb
+++ b/app/controllers/admin_track_controller.rb
@@ -9,6 +9,7 @@ class AdminTrackController < AdminController
@query = params[:query]
@admin_tracks = TrackThing.paginate :order => "created_at desc", :page => params[:page], :per_page => 100,
:conditions => @query.nil? ? nil : ["lower(track_query) like lower('%'||?||'%')", @query ]
+ @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 ed20ddcf4..feffa208e 100644
--- a/app/controllers/admin_user_controller.rb
+++ b/app/controllers/admin_user_controller.rb
@@ -48,7 +48,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
@@ -58,7 +58,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
@@ -66,15 +66,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
@@ -91,7 +91,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 15fb4f5f9..5d8ceb888 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -220,7 +220,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,
@@ -228,7 +228,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/general_controller.rb b/app/controllers/general_controller.rb
index a8bbc22ff..f6a46458e 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -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 1bcc0145c..aa6980b69 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -31,7 +31,7 @@ class PublicBodyController < ApplicationController
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$})
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 6b8444f90..fe948db19 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
@@ -369,7 +369,7 @@ class RequestController < ApplicationController
<p>If you write about this request (for example in a forum or a blog) please link to this page, and add an
annotation below telling people about your writing.</p>",:law_used_full=>@info_request.law_used_full,
:late_number_of_days => Configuration::reply_late_after_days)
- redirect_to show_new_request_path(:url_title => @info_request.url_title)
+ redirect_to show_new_request_url(:url_title => @info_request.url_title)
end
# Submitted to the describing state of messages form
@@ -438,8 +438,8 @@ class RequestController < ApplicationController
# Don't give advice on what to do next, as it isn't their request
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)
@@ -894,7 +894,7 @@ class RequestController < ApplicationController
convert_command = Configuration::html_to_pdf_command
done = false
if !convert_command.blank? && File.exists?(convert_command)
- url = "http://#{Configuration::domain}#{request_url(@info_request)}?print_stylesheet=1"
+ url = "http://#{Configuration::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 a27e71264..e75dac903 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -38,7 +38,7 @@ class ServicesController < ApplicationController
:locals => {:name_to => info_request.user_name,
:name_from => Configuration::contact_name,
:info_request => info_request, :reason => params[:reason],
- :info_request_url => 'http://' + Configuration::domain + request_url(info_request),
+ :info_request_url => 'http://' + Configuration::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 4ee527bae..fc8b6e014 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -422,7 +422,7 @@ class UserController < ApplicationController
ContactMailer.deliver_user_message(
@user,
@recipient_user,
- main_url(user_url(@user)),
+ user_url(@user),
params[:contact][:subject],
params[:contact][:message]
)
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 42c1e0549..15cce39eb 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -10,95 +10,105 @@ 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
+ link_to name, admin_request_show_url(info_request), :class => cls
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)) + ")"
+ link_to(h(info_request.title), request_url(info_request)) + " (" + link_to("admin", admin_request_show_url(info_request)) + ")"
end
- def request_similar_url(info_request)
- return similar_request_url(:url_title => info_request.url_title, :only_path => true)
+ def request_details_path(info_request)
+ details_request_path(:url_title => info_request.url_title)
end
- def request_details_url(info_request)
- return details_request_url(:url_title => info_request.url_title, :only_path => true)
+ # 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
- # Incoming / outgoing messages
- def incoming_message_url(incoming_message)
- return request_url(incoming_message.info_request)+"#incoming-"+incoming_message.id.to_s
+ def incoming_message_path(incoming_message)
+ incoming_message_url(incoming_message, :only_path => true)
+ end
+
+ def outgoing_message_url(outgoing_message, options = {})
+ return request_path(outgoing_message.info_request, options.merge(:anchor => "outgoing-#{outgoing_message.id}"))
+ end
+
+ 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
+
+ def respond_to_last_path(info_request)
+ respond_to_last_url(info_request, :only_path => true)
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 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_path(public_body)
+ public_body_url(public_body, :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)
+ link_to h(public_body.short_or_long_name), public_body_path(public_body)
end
def public_body_link(public_body, cls=nil)
- link_to h(public_body.name), public_body_url(public_body), :class => cls
+ link_to h(public_body.name), public_body_path(public_body), :class => cls
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))
- end
-
- def public_body_admin_url(public_body)
- return admin_url('body/show/' + public_body.id.to_s)
+ link_to h(public_body.name), public_body_url(public_body)
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)) + ")"
+ link_to(h(public_body.name), public_body_url(public_body)) + " (" + link_to("admin", admin_body_show_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,7 +120,7 @@ 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
@@ -119,12 +129,16 @@ module LinkToHelper
text = external_text ? 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(text), 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 +149,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 +174,40 @@ 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
+ link_to name, admin_user_show_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(h(user.name), user_url(user)) + " (" + link_to("admin", admin_user_show_url(user)) + ")"
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)
@@ -213,31 +235,26 @@ module LinkToHelper
return url
end
- def search_link(query, variety_postfix = nil, sort_postfix = nil, advanced = nil)
- link_to h(query), search_url(query)
- end
- # Admin pages
- def admin_url(relative_path)
- admin_url_prefix = Configuration::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://" + Configuration::domain
url = url_prefix + relative_path
if !append.nil?
@@ -253,6 +270,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/models/request_mailer.rb b/app/models/request_mailer.rb
index dc2c5fe21..6f8d88a1a 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -71,8 +71,8 @@ class RequestMailer < ApplicationMailer
@from = user.name_and_email
@recipients = contact_from_name_and_email
@subject = _("FOI response requires admin ({{reason}}) - {{title}}", :reason => info_request.described_state, :title => info_request.title)
- 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)
@body = {:reported_by => user, :info_request => info_request, :url => url, :admin_url => admin_url }
end
@@ -80,14 +80,14 @@ 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)
@from = contact_from_name_and_email
headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # not much we can do if the user's email is broken
'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
- @subject = _("New response to your FOI request - ") + info_request.title
+ @subject = (_("New response to your FOI request - ") + info_request.title).html_safe
@body = { :incoming_message => incoming_message, :info_request => info_request, :url => url }
end
@@ -106,7 +106,7 @@ class RequestMailer < ApplicationMailer
'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
'X-Auto-Response-Suppress' => 'OOF'
@recipients = 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
@body = { :info_request => info_request, :url => url }
end
@@ -125,7 +125,7 @@ class RequestMailer < ApplicationMailer
'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
'X-Auto-Response-Suppress' => 'OOF'
@recipients = 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
@body = { :info_request => info_request, :url => url }
end
@@ -135,7 +135,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)
@@ -157,7 +157,7 @@ class RequestMailer < ApplicationMailer
'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
@subject = _("Someone has updated the status of your request")
- url = main_url(request_url(info_request))
+ url = request_url(info_request)
@body = {:info_request => info_request, :url => url}
end
@@ -177,7 +177,7 @@ class RequestMailer < ApplicationMailer
'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
- @subject = _("Clarify your FOI request - ") + info_request.title
+ @subject = (_("Clarify your FOI request - ") + info_request.title).html_safe
@body = { :incoming_message => incoming_message, :info_request => info_request, :url => url }
end
@@ -188,8 +188,8 @@ class RequestMailer < ApplicationMailer
'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
- @subject = _("Somebody added a note to your FOI request - ") + info_request.title
- @body = { :comment => comment, :info_request => info_request, :url => main_url(comment_url(comment)) }
+ @subject = (_("Somebody added a note to your FOI request - ") + info_request.title).html_safe
+ @body = { :comment => comment, :info_request => info_request, :url => comment_url(comment) }
end
def comment_on_alert_plural(info_request, count, earliest_unalerted_comment)
@from = contact_from_name_and_email
@@ -197,8 +197,8 @@ class RequestMailer < ApplicationMailer
'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834
'X-Auto-Response-Suppress' => 'OOF'
@recipients = info_request.user.name_and_email
- @subject = _("Some notes have been added to your FOI request - ") + info_request.title
- @body = { :count => count, :info_request => info_request, :url => main_url(comment_url(earliest_unalerted_comment)) }
+ @subject = (_("Some notes have been added to your FOI request - ") + info_request.title).html_safe
+ @body = { :count => count, :info_request => info_request, :url => comment_url(earliest_unalerted_comment) }
end
# Class function, called by script/mailin with all incoming responses.
diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb
index 7dfa87f52..51440e4d7 100644
--- a/app/models/track_mailer.rb
+++ b/app/models/track_mailer.rb
@@ -7,7 +7,7 @@
class TrackMailer < ApplicationMailer
def event_digest(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/track_thing.rb b/app/models/track_thing.rb
index dfe92b7fe..a0c74bdb6 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.rhtml b/app/views/admin_censor_rule/_form.rhtml
index ac43de704..ac84935c5 100644
--- a/app/views/admin_censor_rule/_form.rhtml
+++ b/app/views/admin_censor_rule/_form.rhtml
@@ -1,40 +1,77 @@
<%= 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_link(info_request)%>
+ <%= request_admin_link(info_request, "(admin)", "btn btn-info")%>
+ <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>
+ <% end %>
+ <% unless user.nil? %>
+ <%= user_link(user) %>
+ <%= user_admin_link(user, "admin", "btn btn-info") %>
+ <%= 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.rhtml b/app/views/admin_censor_rule/_show.rhtml
index 363c3fb6f..baa93e832 100644
--- a/app/views/admin_censor_rule/_show.rhtml
+++ b/app/views/admin_censor_rule/_show.rhtml
@@ -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 %>
@@ -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)", "../../censor/new?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", "../../censor/new?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/new.rhtml b/app/views/admin_censor_rule/new.rhtml
index c6b8cea6a..6cac58b3b 100644
--- a/app/views/admin_censor_rule/new.rhtml
+++ b/app/views/admin_censor_rule/new.rhtml
@@ -1,9 +1,11 @@
-<% @title = 'New censor rule' %>
+<% @title = _('New censor rule') %>
<h1><%=@title%></h1>
-<% form_tag 'create' do %>
+<% form_tag 'create', :class => "form form-horizontal" do %>
<%= render :partial => 'form', :locals => { :info_request => @info_request, :user => @user } %>
- <p><%= submit_tag "Create" %></p>
+ <div class="form-actions">
+ <%= submit_tag "Create", :class => "btn btn-primary" %>
+ </div>
<% end %>
diff --git a/app/views/admin_general/_admin_navbar.rhtml b/app/views/admin_general/_admin_navbar.rhtml
index 8b1378917..49592c545 100644
--- a/app/views/admin_general/_admin_navbar.rhtml
+++ b/app/views/admin_general/_admin_navbar.rhtml
@@ -1 +1,24 @@
+<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.rhtml b/app/views/admin_general/debug.rhtml
index b0749bedb..7fd256025 100644
--- a/app/views/admin_general/debug.rhtml
+++ b/app/views/admin_general/debug.rhtml
@@ -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.rhtml b/app/views/admin_general/index.rhtml
index 48bd7f694..afccb757d 100644
--- a/app/views/admin_general/index.rhtml
+++ b/app/views/admin_general/index.rhtml
@@ -1,109 +1,189 @@
<% @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>
-
- <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 %>
- </ul>
-
-<% end %>
-
-<% if @error_message_requests.size > 0 %>
- <h3>Fix these delivery and other errors (<%=@error_message_requests.size%> total)</h3>
+<div class="row">
+ <div class="span12">
+ <h1><%=@title%></h1>
<ul>
- <% for @request in @error_message_requests %>
- <li>
- <%= request_both_links(@request)%>
- &ndash; <%=simple_date(@request.get_last_event.created_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>
+
+
+<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><i class='icon-chevron-right'></i> 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)", "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 %>
+ </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> <i class='icon-chevron-right'></i>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">
+ <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_path(@request))%>
+ <%= link_to(@request.title, request_path(@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><i class='icon-chevron-right'></i> 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">
+ <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_path(@request))%>
+ <%= link_to(@request.title, request_path(@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><i class='icon-chevron-right'></i> 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">
+ <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_path(@request))%>
+ <%= link_to(@request.title, request_path(@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><i class='icon-chevron-right'></i> 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">
+ <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_body_show_path(@blank_contact))%>
+ <%= link_to h(@blank_contact.name), public_body_path(@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><i class='icon-chevron-right'></i> 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">
+ <%= link_to("<i class='icon-tags'></i>".html_safe, admin_request_show_path(@request)) %>
+ <%= link_to(@request.title, request_link(@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 %>
-
-<% 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 %>
-
-<% 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>
-<% end %>
-
-
diff --git a/app/views/admin_general/stats.rhtml b/app/views/admin_general/stats.rhtml
index b22adb581..f9163b332 100644
--- a/app/views/admin_general/stats.rhtml
+++ b/app/views/admin_general/stats.rhtml
@@ -1,38 +1,61 @@
<% @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">
+ </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">
+ </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.rhtml b/app/views/admin_general/timeline.rhtml
index e84539970..0c5f24279 100644
--- a/app/views/admin_general/timeline.rhtml
+++ b/app/views/admin_general/timeline.rhtml
@@ -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">
+ <a class="btn" href="?hour=1">Hour</a>
+ <a class="btn" href="?day=1">Day</a>
+ <a class="btn" href="?">2 days</a>
+ <a class="btn" href="?week=1">Week</a>
+ <a class="btn" href="?month=1">Month</a>
+ <a class="btn" href="?all=1">All time</a>
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h1><%=h @events_title%></h1>
+ </div>
+</div>
<% last_date = nil %>
<% for event, event_at in @events %>
@@ -26,7 +31,9 @@
<%= simple_time(event_at) %>
<% if event.is_a? InfoRequestEvent %>
- <%= request_both_links(event.info_request) %>
+ <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_path(event.info_request), :title => "view full details")%>
+ <%= link_to(event.info_request.title, request_path(event.info_request), :title => "view request on public website")%>
+
<% if event.event_type == 'edit' %>
was edited by administrator <strong><%=h event.params[:editor] %></strong>.
<% for p in ['title', 'prominence', 'described_state', 'awaiting_description']
@@ -72,7 +79,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 %>.
@@ -88,12 +95,12 @@
had '<%=event.event_type%>' done to it, parameters <%=h event.params_yaml%>.
<% end %>
<% else %>
- <%= public_body_both_links(event.public_body) %>
+ <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_body_show_path(event.public_body), :title => "view full details")%>
+ <%= link_to(event.public_body.name, public_body_path(event.public_body), :title => "view authority on public website")%>
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.rhtml b/app/views/admin_public_body/_form.rhtml
index 0d6ae51e2..3f346842c 100644
--- a/app/views/admin_public_body/_form.rhtml
+++ b/app/views/admin_public_body/_form.rhtml
@@ -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.translation(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/_one_list.rhtml b/app/views/admin_public_body/_one_list.rhtml
index e0d2399d0..cf1866212 100644
--- a/app/views/admin_public_body/_one_list.rhtml
+++ b/app/views/admin_public_body/_one_list.rhtml
@@ -1,29 +1,46 @@
-<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"><i class="icon-chevron-right"></i></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.rhtml b/app/views/admin_public_body/_tag_help.rhtml
index 0d0f84dda..b64e65877 100644
--- a/app/views/admin_public_body/_tag_help.rhtml
+++ b/app/views/admin_public_body/_tag_help.rhtml
@@ -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.rhtml b/app/views/admin_public_body/_tags.rhtml
index 85dc942fd..55c9db906 100644
--- a/app/views/admin_public_body/_tags.rhtml
+++ b/app/views/admin_public_body/_tags.rhtml
@@ -1,10 +1,10 @@
<% 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>)
<% end %>
diff --git a/app/views/admin_public_body/edit.rhtml b/app/views/admin_public_body/edit.rhtml
index b19477a6b..629f64257 100644
--- a/app/views/admin_public_body/edit.rhtml
+++ b/app/views/admin_public_body/edit.rhtml
@@ -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 => "../update/#{@public_body.id}", :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', "../show/#{@public_body.id}", :class => "btn" %>
+ <%= link_to 'List all', '../list', :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("../destroy/#{@public_body.id}", :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.rhtml b/app/views/admin_public_body/import_csv.rhtml
index 1c6100838..bfe1b0c3b 100644
--- a/app/views/admin_public_body/import_csv.rhtml
+++ b/app/views/admin_public_body/import_csv.rhtml
@@ -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.rhtml b/app/views/admin_public_body/list.rhtml
index c28060604..f9153217e 100644
--- a/app/views/admin_public_body/list.rhtml
+++ b/app/views/admin_public_body/list.rhtml
@@ -1,24 +1,28 @@
<% 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>
- <% if !@query.nil? %>
- <%= link_to 'Show all', 'list' %> |
- <% end %>
- <%= link_to 'New public authority', 'new' %>
- | <%= link_to 'Import from CSV file', 'import_csv' %>
+<div class="btn-toolbar">
+ <div class="btn-group">
+ <%= link_to 'New public authority', 'new', :class => "btn btn-primary" %>
+ </div>
+ <div class="btn-group">
+ <%= link_to 'Import from CSV file', 'import_csv', :class => "btn btn-warning" %>
+ </div>
+</div>
</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>
+<% 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', :class => "btn" %>
+ <% end %><br>
+ (substring search in names and emails; exact match of tags)
<% end %>
@@ -32,9 +36,9 @@
<h2>All authorities</h2>
<% else %>
<h2>Substring search matches (<%= @public_bodies.total_entries %> total)</h2>
+
<% end %>
<%= 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.rhtml b/app/views/admin_public_body/new.rhtml
index 047d5a5bb..e03ebab00 100644
--- a/app/views/admin_public_body/new.rhtml
+++ b/app/views/admin_public_body/new.rhtml
@@ -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 => "create", :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.rhtml b/app/views/admin_public_body/show.rhtml
index cee306988..c59b90697 100644
--- a/app/views/admin_public_body/show.rhtml
+++ b/app/views/admin_public_body/show.rhtml
@@ -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"), "../edit/#{@public_body.id}", :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.rhtml b/app/views/admin_request/_incoming_message_actions.rhtml
index 569132861..9fedcb525 100644
--- a/app/views/admin_request/_incoming_message_actions.rhtml
+++ b/app/views/admin_request/_incoming_message_actions.rhtml
@@ -1,26 +1,45 @@
-<% form_tag '../redeliver_incoming' do %>
- <div>
- id or url_title of request (or a list of requests, comma-separated):
+<formset class="form-horizontal">
+ <legend>Actions</legend>
+ <% form_tag '../redeliver_incoming', :class => "form form-inline" do %>
+ <div class="control-group">
+ <label class="control-label" for="url_title">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 } %>
<% else %>
<%= text_field_tag 'url_title', "", { :size => 20 } %>
<% end %>
<%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %>
- <%= submit_tag "Redeliver to another request" %>
+ <%= 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" for="generate_upload_url">Generate FOI officer upload URL</label>
+ <div class="controls">
+ <%= link_to 'Generate and take me there', "../generate_upload_url/#{incoming_message.info_request.id}?incoming_message_id=#{incoming_message.id}", :class => "btn", :id => "generate_upload_url" %>
+ </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 '../destroy_incoming', :class => "form form-inline" do %>
+ <div class="control-group">
+ <label class="control-label" for="generate_upload_url">Destroy message</label>
+ <div class="controls">
+ <%= hidden_field_tag 'incoming_message_id', incoming_message.id %>
+ <%= submit_tag "Destroy message", :class => "btn btn-danger", :confirm => "This is permanent! Are you sure?" %>
+ </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" for="show_rail_email">Inspect email</label>
+ <div class="controls">
+ <%= link_to "View raw email", "../show_raw_email/#{incoming_message.raw_email_id}", :class => "btn", :id => "show_raw_email" %>
+ </div>
+ </div>
+ <% end %>
+</formset>
diff --git a/app/views/admin_request/_some_requests.rhtml b/app/views/admin_request/_some_requests.rhtml
index dc11e0f55..03a77dd0b 100644
--- a/app/views/admin_request/_some_requests.rhtml
+++ b/app/views/admin_request/_some_requests.rhtml
@@ -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"><i class="icon-chevron-right"></i></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) %> <i class="icon-arrow-right"></i> <%= 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.rhtml b/app/views/admin_request/edit.rhtml
index 8fa2a1fe2..11c017aab 100644
--- a/app/views/admin_request/edit.rhtml
+++ b/app/views/admin_request/edit.rhtml
@@ -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>
diff --git a/app/views/admin_request/edit_comment.rhtml b/app/views/admin_request/edit_comment.rhtml
index ee43e849a..a79c096e3 100644
--- a/app/views/admin_request/edit_comment.rhtml
+++ b/app/views/admin_request/edit_comment.rhtml
@@ -8,7 +8,7 @@
<%= 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>
diff --git a/app/views/admin_request/list.rhtml b/app/views/admin_request/list.rhtml
index cb328543e..ff67dd843 100644
--- a/app/views/admin_request/list.rhtml
+++ b/app/views/admin_request/list.rhtml
@@ -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.rhtml b/app/views/admin_request/list_old_unclassified.rhtml
index 2e75c2174..2bdfcf7f4 100644
--- a/app/views/admin_request/list_old_unclassified.rhtml
+++ b/app/views/admin_request/list_old_unclassified.rhtml
@@ -11,6 +11,5 @@
</li>
<% end %>
</ul>
-<%= will_paginate(@info_requests) %>
-
+<%= will_paginate(@info_requests, :class => "paginator") %>
diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml
index 2541fd323..def158d67 100644
--- a/app/views/admin_request/show.rhtml
+++ b/app/views/admin_request/show.rhtml
@@ -1,230 +1,391 @@
-<% @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 %>
-<% 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 %>
-
- <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')") %>)
+<% form_tag '../move_request', { :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"><i class="icon-chevron-down"></i></a>Request metadata
</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>
+ </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', '../edit/' + @info_request.id.to_s, :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><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %>
+ <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %>
+ <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %>
+ </ul>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ <tr>
+ <td>
+ <b>Created by</b>
+ </td>
+ <td>
+ <% if @info_request.is_external? %>
+ <%= link_to("<i class='icon-eye-open'></i>".html_safe, @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 %>
+ <%= link_to("<i class='icon-eye-open'></i>".html_safe, user_path(@info_request.user), :title => "view user's page on public website") %>
+ <%= user_admin_link_for_request(@info_request) %>
+ <%= 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>
+ <%= link_to("<i class='icon-eye-open'></i>".html_safe, public_body_path(@info_request.public_body), :title => "view authority on public website") %>
+ <%= link_to(@info_request.public_body.name, admin_body_show_path(@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', '../edit/' + @info_request.id.to_s, :class => "btn" %>
+ </td>
+ </tr>
+ </tfoot>
+ </table>
+ </div>
+ </div>
+</div>
<% end %>
+<formset 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', '../generate_upload_url/' + @info_request.id.to_s, :class => "btn" %>
+ <p class="help-block">(see also option to general URLs for individual incoming messages below)</p>
+ </div>
+ </div>
+ <% form_tag '../hide/' + @info_request.id.to_s, :class => "form form-inline", :info_request_id => @info_request.id.to_s, :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 %>
-<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>
+ <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>
-<h2>Events</h2>
+ <% if !['hidden', 'requester_only'].include? @info_request.prominence %>
+ <% if ! @info_request.is_external? %>
-<table>
- <tr>
- <th>Id</th>
- <% for column in InfoRequestEvent.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
-
-<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h info_request_event.id %></td>
- <% for column in InfoRequestEvent.content_columns %>
- <td>
- <% if column.name == 'params_yaml' %>
- <%= info_request_event.params_yaml_as_html %>
- <% elsif column.text? %>
- <%=h (info_request_event.send(column.name) || '').gsub(/_/,' ') %>
- <% 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 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>
- <% end %>
- <% end %>
- </td>
- </tr>
-<% end %>
-</table>
-<h2>Outgoing messages</h2>
+ <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>
-<table>
- <tr>
- <th>Id</th>
- <% for column in OutgoingMessage.content_columns %>
- <th><%= column.human_name %></th>
- <% 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 } %>
-
- <% 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) ) %></td>
+ <% end %>
+ <div class="form-actions" id="request_hide_button">
+ <%= submit_tag _("Hide request"), :class => "btn" %>
+ </div>
<% end %>
+ <% end %>
+</formset>
+
+<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"><i class="icon-chevron-right"></i></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 '../mark_event_as_clarification', :class => "form form-inline admin-table-form admin-inline-form" do %>
+ <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
+ <%= 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"><i class="icon-chevron-right"></i></a>
+ <a href="../edit_outgoing/<%= outgoing_message.id %>">
+ #<%= outgoing_message.id %> -- <%= outgoing_message.status.humanize %> <%= outgoing_message.message_type.humanize %>
+ </a>
+ <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 '../resend', :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) ) %></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"><i class="icon-chevron-right"></i></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"><i class="icon-chevron-right"></i></a>
+ <a href="../edit_comment/<%= comment.id %>">
+ #<%=comment.id%>
+ --
+ <%=h(comment.user.name)%>
+ <%=admin_value(comment.created_at)%>
+ </a>
+ <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 <%= link_to("<i class='icon-eye-open'></i>".html_safe, user_path(comment.user), :title => "view user's page on public website") %>
+
+ <%= link_to(h(comment.user.name), admin_user_show_path(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.rhtml b/app/views/admin_request/show_raw_email.rhtml
index ea0d6017e..c770d432d 100644
--- a/app/views/admin_request/show_raw_email.rhtml
+++ b/app/views/admin_request/show_raw_email.rhtml
@@ -23,8 +23,6 @@
<% end %>
</p>
-<h2>Actions</h2>
-
<div>
<%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => @raw_email.incoming_message } %>
</div>
@@ -33,5 +31,5 @@
<p><%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %></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.rhtml b/app/views/admin_track/_some_tracks.rhtml
index 72ee5fd95..8ae7bd5c1 100644
--- a/app/views/admin_track/_some_tracks.rhtml
+++ b/app/views/admin_track/_some_tracks.rhtml
@@ -1,31 +1,72 @@
-<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>
-<% end %>
-</table>
+<% 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"><i class="icon-chevron-right"></i></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 <%=link_to '<i class="icon-eye-open"></i>'.html_safe, admin_user_show_path(track_thing.tracking_user) %> <%=link_to h(track_thing.tracking_user.name), user_path(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 '../../user/destroy_track', :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 %>
diff --git a/app/views/admin_track/list.rhtml b/app/views/admin_track/list.rhtml
index 58c87ddba..f40ad4e75 100644
--- a/app/views/admin_track/list.rhtml
+++ b/app/views/admin_track/list.rhtml
@@ -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.rhtml b/app/views/admin_user/_form.rhtml
index be69d9a80..756806d2a 100644
--- a/app/views/admin_user/_form.rhtml
+++ b/app/views/admin_user/_form.rhtml
@@ -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', '../banned' %> 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.rhtml b/app/views/admin_user/_user_table.rhtml
index d35c78594..a4227e017 100644
--- a/app/views/admin_user/_user_table.rhtml
+++ b/app/views/admin_user/_user_table.rhtml
@@ -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"><i class="icon-chevron-right"></i></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.rhtml b/app/views/admin_user/edit.rhtml
index 06ddc57d3..c3ee3012b 100644
--- a/app/views/admin_user/edit.rhtml
+++ b/app/views/admin_user/edit.rhtml
@@ -1,16 +1,14 @@
-
-
<h1><%=@title%></h1>
-<% form_tag '../update/' + @admin_user.id.to_s do %>
+<% form_tag "../update/#{@admin_user.id}", :class => "form form-horizontal" do %>
<%= render :partial => 'form' %>
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
+ <div class="form-actions">
+ <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %>
+ </div>
<% end %>
-<p>
-<%= link_to 'Show', '../show/' + @admin_user.id.to_s %> |
-<%= link_to 'List all', '../list' %>
-</p>
+<%= link_to 'Show', "../show/#{@admin_user.id}", :class => "btn" %>
+<%= link_to 'List all', '../list', :class => "btn" %>
<% if false #@admin_user.info_requests.size == 0 %>
<% form_tag('../destroy/' + @admin_user.id.to_s) do %>
diff --git a/app/views/admin_user/list.rhtml b/app/views/admin_user/list.rhtml
index 9de381ecc..df3a1b276 100644
--- a/app/views/admin_user/list.rhtml
+++ b/app/views/admin_user/list.rhtml
@@ -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', 'banned', :class => "btn btn-info" %>
<% end %>
<%= render :partial => 'user_table', :locals => { :users => @admin_users, :banned_column => false } %>
diff --git a/app/views/admin_user/show.rhtml b/app/views/admin_user/show.rhtml
index 4af79e45a..0b3adb332 100644
--- a/app/views/admin_user/show.rhtml
+++ b/app/views/admin_user/show.rhtml
@@ -1,63 +1,82 @@
-<% @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>
-<% end %>
+ <div class="user_photo_on_admin">
+ <% form_tag "../clear_profile_photo/#{@admin_user.id}", :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 "../clear_bounce/#{@admin_user.id}", :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', '../edit/' + @admin_user.id.to_s, :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)", "../login_as/#{@admin_user.id}", :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 +85,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.rhtml b/app/views/comment/_single_comment.rhtml
index b645721cf..421a9d4ba 100644
--- a/app/views/comment/_single_comment.rhtml
+++ b/app/views/comment/_single_comment.rhtml
@@ -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/contact_mailer/from_admin_message.rhtml b/app/views/contact_mailer/from_admin_message.rhtml
index 43938e0dd..4169d8d3a 100644
--- a/app/views/contact_mailer/from_admin_message.rhtml
+++ b/app/views/contact_mailer/from_admin_message.rhtml
@@ -1,2 +1,2 @@
-<%= @message %>
+<%= raw @message %>
diff --git a/app/views/contact_mailer/to_admin_message.rhtml b/app/views/contact_mailer/to_admin_message.rhtml
index 9c0a74c02..dc9b1090b 100644
--- a/app/views/contact_mailer/to_admin_message.rhtml
+++ b/app/views/contact_mailer/to_admin_message.rhtml
@@ -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.rhtml b/app/views/contact_mailer/user_message.rhtml
index b1d6e81ae..afa1494db 100644
--- a/app/views/contact_mailer/user_message.rhtml
+++ b/app/views/contact_mailer/user_message.rhtml
@@ -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.rhtml b/app/views/general/_advanced_search_tips.rhtml
index 914abc1af..08ce04439 100644
--- a/app/views/general/_advanced_search_tips.rhtml
+++ b/app/views/general/_advanced_search_tips.rhtml
@@ -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.rhtml b/app/views/general/_footer.rhtml
index ab5ab2c47..36f3919f0 100644
--- a/app/views/general/_footer.rhtml
+++ b/app/views/general/_footer.rhtml
@@ -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/<%= Configuration::twitter_username %>"><%= _("Follow us on twitter") %></a>
<%= render :partial => 'general/credits' %>
</div>
diff --git a/app/views/general/_frontpage_bodies_list.rhtml b/app/views/general/_frontpage_bodies_list.rhtml
index 503b38953..54400602b 100644
--- a/app/views/general/_frontpage_bodies_list.rhtml
+++ b/app/views/general/_frontpage_bodies_list.rhtml
@@ -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.rhtml b/app/views/general/_frontpage_intro_sentence.rhtml
index 70b47ad06..74b849fc9 100644
--- a/app/views/general/_frontpage_intro_sentence.rhtml
+++ b/app/views/general/_frontpage_intro_sentence.rhtml
@@ -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.rhtml b/app/views/general/_frontpage_requests_list.rhtml
index 3b0efb65e..fa498dfa7 100644
--- a/app/views/general/_frontpage_requests_list.rhtml
+++ b/app/views/general/_frontpage_requests_list.rhtml
@@ -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/_orglink.rhtml b/app/views/general/_orglink.rhtml
index fbe688d85..66002c021 100644
--- a/app/views/general/_orglink.rhtml
+++ b/app/views/general/_orglink.rhtml
@@ -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.rhtml b/app/views/general/_topnav.rhtml
index 8ef928bba..c7f2cedea 100644
--- a/app/views/general/_topnav.rhtml
+++ b/app/views/general/_topnav.rhtml
@@ -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/search.rhtml b/app/views/general/search.rhtml
index 7d402b9b9..50f9f9286 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.rhtml
@@ -43,7 +43,7 @@
<%= 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.rhtml b/app/views/help/api.rhtml
index da6253f87..3a6c867ee 100644
--- a/app/views/help/api.rhtml
+++ b/app/views/help/api.rhtml
@@ -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>
@@ -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.rhtml b/app/views/help/contact.rhtml
index fab5017b8..b1b5d4f24 100644
--- a/app/views/help/contact.rhtml
+++ b/app/views/help/contact.rhtml
@@ -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.request_uri) %>)
+ (or <%= link_to "sign in", signin_path(:r => request.request_uri) %>)
</p>
<p>
diff --git a/app/views/help/unhappy.rhtml b/app/views/help/unhappy.rhtml
index 2b00341c2..79e3f8273 100644
--- a/app/views/help/unhappy.rhtml
+++ b/app/views/help/unhappy.rhtml
@@ -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.rhtml b/app/views/layouts/admin.rhtml
index d85eecbf2..447b24537 100644
--- a/app/views/layouts/admin.rhtml
+++ b/app/views/layouts/admin.rhtml
@@ -3,37 +3,36 @@
<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.rhtml b/app/views/layouts/default.rhtml
index 9eb967578..1e6a61f58 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -13,7 +13,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 +32,7 @@
<% end %>
<% end %>
<% if @has_json %>
- <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h main_url(request.request_uri, '.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 +92,9 @@
<% end %>
- <%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>
+ <%= link_to _("Sign out"), signout_path(:r => request.request_uri) %>
<% else %>
- <%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>
+ <%= link_to _("Sign in or sign up"), signin_path(:r => request.request_uri) %>
<% end %>
</div>
<% end %>
diff --git a/app/views/outgoing_mailer/followup.rhtml b/app/views/outgoing_mailer/followup.rhtml
index 7050a295b..049ebc881 100644
--- a/app/views/outgoing_mailer/followup.rhtml
+++ b/app/views/outgoing_mailer/followup.rhtml
@@ -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.rhtml b/app/views/outgoing_mailer/initial_request.rhtml
index d537a20bc..5c418ecc7 100644
--- a/app/views/outgoing_mailer/initial_request.rhtml
+++ b/app/views/outgoing_mailer/initial_request.rhtml
@@ -1,4 +1,4 @@
-<%= @outgoing_message.body.strip %>
+<%= raw @outgoing_message.body.strip %>
-------------------------------------------------------------------
diff --git a/app/views/public_body/_alphabet.rhtml b/app/views/public_body/_alphabet.rhtml
index 92674b8aa..46b345c2a 100644
--- a/app/views/public_body/_alphabet.rhtml
+++ b/app/views/public_body/_alphabet.rhtml
@@ -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.rhtml b/app/views/public_body/_body_listing_single.rhtml
index b01d2ebb2..d0496fbb8 100644
--- a/app/views/public_body/_body_listing_single.rhtml
+++ b/app/views/public_body/_body_listing_single.rhtml
@@ -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.rhtml b/app/views/public_body/_list_sidebar_extra.rhtml
index 54f20a736..d3d65fec8 100644
--- a/app/views/public_body/_list_sidebar_extra.rhtml
+++ b/app/views/public_body/_list_sidebar_extra.rhtml
@@ -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.rhtml b/app/views/public_body/list.rhtml
index dd97b99fd..ea5cd9613 100644
--- a/app/views/public_body/list.rhtml
+++ b/app/views/public_body/list.rhtml
@@ -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 %>
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml
index 8fc1eadda..df6346e4f 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.rhtml
@@ -26,7 +26,7 @@
<% end %>
<% end %>
<% end %>
- <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br>
+ <%= link_to _('View FOI email address'), view_public_body_email_path(@public_body.url_name) %><br>
</div>
<div id="header_left">
@@ -37,7 +37,7 @@
<%=@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>
diff --git a/app/views/public_body/view_email.rhtml b/app/views/public_body/view_email.rhtml
index 79d7f7f4c..3799d227b 100644
--- a/app/views/public_body/view_email.rhtml
+++ b/app/views/public_body/view_email.rhtml
@@ -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.rhtml b/app/views/request/_after_actions.rhtml
index 3d74cf42d..d3ddb981b 100644
--- a/app/views/request/_after_actions.rhtml
+++ b/app/views/request/_after_actions.rhtml
@@ -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.rhtml b/app/views/request/_bubble.rhtml
index 747e2aa1f..94498612a 100644
--- a/app/views/request/_bubble.rhtml
+++ b/app/views/request/_bubble.rhtml
@@ -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.rhtml b/app/views/request/_correspondence.rhtml
index 99c6c7d26..68711b259 100644
--- a/app/views/request/_correspondence.rhtml
+++ b/app/views/request/_correspondence.rhtml
@@ -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/_followup.rhtml b/app/views/request/_followup.rhtml
index 045bcd9ba..bccfccca7 100644
--- a/app/views/request/_followup.rhtml
+++ b/app/views/request/_followup.rhtml
@@ -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/_request_listing_short_via_event.rhtml b/app/views/request/_request_listing_short_via_event.rhtml
index d93a91070..c2f6474a1 100644
--- a/app/views/request/_request_listing_short_via_event.rhtml
+++ b/app/views/request/_request_listing_short_via_event.rhtml
@@ -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_single.rhtml b/app/views/request/_request_listing_single.rhtml
index e8c1a393f..56737fd3e 100644
--- a/app/views/request/_request_listing_single.rhtml
+++ b/app/views/request/_request_listing_single.rhtml
@@ -1,6 +1,6 @@
<div class="request_listing">
<span class="head">
- <%= link_to h(info_request.title), (@play_urls ? request_path(:url_title => info_request.url_title) : request_url(info_request)) %>
+ <%= link_to h(info_request.title), (@play_urls ? categorise_request_path(:url_title => info_request.url_title) : request_path(info_request)) %>
</span>
<span class="desc">
<%= excerpt(info_request.initial_request_text, "", 150) %>
diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml
index 2ba9613e5..cc8bae8a9 100644
--- a/app/views/request/_request_listing_via_event.rhtml
+++ b/app/views/request/_request_listing_via_event.rhtml
@@ -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.rhtml b/app/views/request/_sidebar.rhtml
index 884d4b2b1..94588c15b 100644
--- a/app/views/request/_sidebar.rhtml
+++ b/app/views/request/_sidebar.rhtml
@@ -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.rhtml b/app/views/request/_view_html_prefix.rhtml
index b29830ac7..3a9946745 100644
--- a/app/views/request/_view_html_prefix.rhtml
+++ b/app/views/request/_view_html_prefix.rhtml
@@ -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.rhtml b/app/views/request/_wall_listing.rhtml
index 26d34e1a1..4a76b09bf 100644
--- a/app/views/request/_wall_listing.rhtml
+++ b/app/views/request/_wall_listing.rhtml
@@ -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/details.rhtml b/app/views/request/details.rhtml
index d4c63902f..3cb2f5afe 100644
--- a/app/views/request/details.rhtml
+++ b/app/views/request/details.rhtml
@@ -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.rhtml b/app/views/request/new.rhtml
index c16105560..d25da8141 100644
--- a/app/views/request/new.rhtml
+++ b/app/views/request/new.rhtml
@@ -26,7 +26,7 @@
<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 %>
@@ -41,7 +41,7 @@
<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 %>
diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.rhtml
index df0498d6a..94e690e64 100644
--- a/app/views/request/select_authority.rhtml
+++ b/app/views/request/select_authority.rhtml
@@ -35,7 +35,7 @@
<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, :title => "type your search term here" } %>
<%= hidden_field_tag 'bodies', 1 %>
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index 0cae3a9aa..ef49ef958 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -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.request_uri) %> <%= _('to send a follow up message.') %>
+ <%= link_to _("sign in"), signin_path(:r => request.request_uri) %> <%= _('to send a follow up message.') %>
<% end %>
<% end %>
<% elsif @status == 'gone_postal' %>
diff --git a/app/views/request_game/play.rhtml b/app/views/request_game/play.rhtml
index 3bd23e306..d5aa0d00e 100644
--- a/app/views/request_game/play.rhtml
+++ b/app/views/request_game/play.rhtml
@@ -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/external_response.rhtml b/app/views/request_mailer/external_response.rhtml
index e9858f03f..896054a43 100644
--- a/app/views/request_mailer/external_response.rhtml
+++ b/app/views/request_mailer/external_response.rhtml
@@ -1 +1 @@
-<%=@body%>
+<%= raw @body %>
diff --git a/app/views/request_mailer/fake_response.rhtml b/app/views/request_mailer/fake_response.rhtml
index e9858f03f..896054a43 100644
--- a/app/views/request_mailer/fake_response.rhtml
+++ b/app/views/request_mailer/fake_response.rhtml
@@ -1 +1 @@
-<%=@body%>
+<%= raw @body %>
diff --git a/app/views/request_mailer/new_response.rhtml b/app/views/request_mailer/new_response.rhtml
index 083f873b4..672212f20 100644
--- a/app/views/request_mailer/new_response.rhtml
+++ b/app/views/request_mailer/new_response.rhtml
@@ -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.rhtml b/app/views/request_mailer/new_response_reminder_alert.rhtml
index 86fc71de7..c196dafe6 100644
--- a/app/views/request_mailer/new_response_reminder_alert.rhtml
+++ b/app/views/request_mailer/new_response_reminder_alert.rhtml
@@ -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.rhtml b/app/views/request_mailer/overdue_alert.rhtml
index b8a9ba525..249bf6bb8 100644
--- a/app/views/request_mailer/overdue_alert.rhtml
+++ b/app/views/request_mailer/overdue_alert.rhtml
@@ -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.rhtml b/app/views/request_mailer/requires_admin.rhtml
index 06a798792..e7ab53c59 100644
--- a/app/views/request_mailer/requires_admin.rhtml
+++ b/app/views/request_mailer/requires_admin.rhtml
@@ -1,9 +1,9 @@
---------------------------------------------------------------------
-<%=@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.rhtml b/app/views/request_mailer/very_overdue_alert.rhtml
index 6abd198a0..80597473c 100644
--- a/app/views/request_mailer/very_overdue_alert.rhtml
+++ b/app/views/request_mailer/very_overdue_alert.rhtml
@@ -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.rhtml b/app/views/track/_tracking_links.rhtml
index 06e87ac74..d89c0e4a9 100644
--- a/app/views/track/_tracking_links.rhtml
+++ b/app/views/track/_tracking_links.rhtml
@@ -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.rhtml b/app/views/track_mailer/event_digest.rhtml
index dc8132b99..8dbc7fe06 100644
--- a/app/views/track_mailer/event_digest.rhtml
+++ b/app/views/track_mailer/event_digest.rhtml
@@ -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.rhtml b/app/views/user/_show_user_info.rhtml
index 3c229e9ce..305300236 100644
--- a/app/views/user/_show_user_info.rhtml
+++ b/app/views/user/_show_user_info.rhtml
@@ -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.rhtml b/app/views/user/_signin.rhtml
index c4d917991..7db07e4b4 100644
--- a/app/views/user/_signin.rhtml
+++ b/app/views/user/_signin.rhtml
@@ -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/_user_listing_single.rhtml b/app/views/user/_user_listing_single.rhtml
index 53df3a7e8..ed1b95718 100644
--- a/app/views/user/_user_listing_single.rhtml
+++ b/app/views/user/_user_listing_single.rhtml
@@ -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.rhtml b/app/views/user/set_draft_profile_photo.rhtml
index b3faba7fc..757498249 100644
--- a/app/views/user/set_draft_profile_photo.rhtml
+++ b/app/views/user/set_draft_profile_photo.rhtml
@@ -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.rhtml b/app/views/user/show.rhtml
index 9d8bf6f2f..a3dea619d 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -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 %>
diff --git a/app/views/user_mailer/already_registered.rhtml b/app/views/user_mailer/already_registered.rhtml
index 59ffcbf94..32c2c7e63 100644
--- a/app/views/user_mailer/already_registered.rhtml
+++ b/app/views/user_mailer/already_registered.rhtml
@@ -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.rhtml b/app/views/user_mailer/changeemail_confirm.rhtml
index ffb9737f7..c73e9486b 100644
--- a/app/views/user_mailer/changeemail_confirm.rhtml
+++ b/app/views/user_mailer/changeemail_confirm.rhtml
@@ -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.rhtml b/app/views/user_mailer/confirm_login.rhtml
index 6f4feff00..fa86dc2b1 100644
--- a/app/views/user_mailer/confirm_login.rhtml
+++ b/app/views/user_mailer/confirm_login.rhtml
@@ -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/environment.rb b/config/environment.rb
index 7ffbe8701..268a44e65 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -117,17 +117,6 @@ end
# Domain for URLs (so can work for scripts, not just web pages)
ActionMailer::Base.default_url_options[:host] = Configuration::domain
-# So that javascript assets use full URL, so proxied admin URLs read javascript OK
-if (Configuration::domain != "")
- ActionController::Base.asset_host = Proc.new { |source, request|
- if ENV["RAILS_ENV"] != "test" && request.fullpath.match(/^\/admin\//)
- Configuration::admin_public_url
- else
- Configuration::domain
- end
- }
-end
-
# fallback locale and available locales
available_locales = Configuration::available_locales.split(/ /)
default_locale = Configuration::default_locale
diff --git a/config/general.yml-example b/config/general.yml-example
index bfe289541..6bf54f400 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -53,7 +53,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 +99,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/routes.rb b/config/routes.rb
index 3512b4cd4..adc8663c5 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -10,7 +10,7 @@ $alaveteli_route_extensions.each do |f|
end
ActionController::Routing::Routes.draw do |map|
-
+
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
@@ -43,7 +43,7 @@ ActionController::Routing::Routes.draw do |map|
request.request_list '/list', :action => 'list'
request.select_authority '/select_authority', :action => 'select_authority'
-
+
request.new_request '/new', :action => 'new'
request.new_request_to_body '/new/:url_name', :action => 'new'
@@ -64,7 +64,7 @@ ActionController::Routing::Routes.draw do |map|
request.upload_response "/upload/request/:url_title", :action => 'upload_response'
request.download_entire_request '/request/:url_title/download', :action => 'download_entire_request'
-
+
# It would be nice to add :conditions => { :method => :post } to this next one,
# because it ought not really to be available as a GET request since it changes
# the server state. Unfortunately this doesn’t play well with the PostRedirect
@@ -161,9 +161,9 @@ ActionController::Routing::Routes.draw do |map|
end
map.with_options :controller => 'request_game' do |game|
- game.play '/categorise/play', :action => 'play'
- game.request '/categorise/request/:url_title', :action => 'show'
- game.stop '/categorise/stop', :action => 'stop'
+ game.categorise_play '/categorise/play', :action => 'play'
+ game.categorise_request '/categorise/request/:url_title', :action => 'show'
+ game.categorise_stop '/categorise/stop', :action => 'stop'
end
map.with_options :controller => 'admin_public_body' do |body|
@@ -185,6 +185,7 @@ ActionController::Routing::Routes.draw do |map|
admin.admin_timeline '/admin/timeline', :action => 'timeline'
admin.admin_debug '/admin/debug', :action => 'debug'
admin.admin_stats '/admin/stats', :action => 'stats'
+ admin.admin_js '/admin/javascripts/admin.js', :action => 'admin_js'
end
map.with_options :controller => 'admin_request' do |admin|
@@ -217,7 +218,7 @@ ActionController::Routing::Routes.draw do |map|
user.admin_user_list_banned '/admin/user/banned', :action => 'list_banned'
user.admin_user_show '/admin/user/show/:id', :action => 'show'
user.admin_user_edit '/admin/user/edit/:id', :action => 'edit'
- user.admin_user_show '/admin/user/show_bounce_message/:id', :action => 'show_bounce_message'
+ user.admin_user_show_bounce '/admin/user/show_bounce_message/:id', :action => 'show_bounce_message'
user.admin_user_update '/admin/user/update/:id', :action => 'update'
user.admin_user_clear_bounce '/admin/user/clear_bounce/:id', :action => 'clear_bounce'
user.admin_user_destroy_track '/admin/user/destroy_track', :action => 'destroy_track'
@@ -236,16 +237,16 @@ ActionController::Routing::Routes.draw do |map|
rule.admin_rule_update '/admin/censor/update/:id', :action => 'update'
rule.admin_rule_destroy '/admin/censor/destroy/:censor_rule_id', :action => 'destroy'
end
-
+
map.with_options :controller => 'api' do |api|
api.api_create_request '/api/v2/request.json', :action => 'create_request', :conditions => { :method => :post }
-
+
api.api_show_request '/api/v2/request/:id.json', :action => 'show_request', :conditions => { :method => :get }
api.api_add_correspondence '/api/v2/request/:id.json', :action => 'add_correspondence', :conditions => { :method => :post }
-
+
api.api_body_request_events '/api/v2/body/:id/request_events.:feed_type', :action => 'body_request_events', :feed_type => '^(json|atom)$'
end
-
+
map.filter('conditionallyprependlocale')
# Allow downloading Web Service WSDL as a file with an extension
diff --git a/config/test.yml b/config/test.yml
index ef270dcf2..f40b11764 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/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/lib/configuration.rb b/lib/configuration.rb
index 11fe1c56e..d1da45fcf 100644
--- a/lib/configuration.rb
+++ b/lib/configuration.rb
@@ -4,9 +4,7 @@
module Configuration
DEFAULTS = {
- :ADMIN_BASE_URL => '',
:ADMIN_PASSWORD => '',
- :ADMIN_PUBLIC_URL => '',
:ADMIN_USERNAME => '',
:AVAILABLE_LOCALES => '',
:BLACKHOLE_PREFIX => 'do-not-reply-to-this-address',
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/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb
index c785960b5..5505afe59 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
integrate_views
- include LinkToHelper # for main_url
before(:each) do
load_raw_emails_data
@@ -105,7 +104,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/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb
index 030fd612d..3e997f9f9 100644
--- a/spec/helpers/link_to_helper_spec.rb
+++ b/spec/helpers/link_to_helper_spec.rb
@@ -17,27 +17,15 @@ 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
- describe "when appending something to a URL" do
- it 'should append to things without query strings' do
- main_url('/a', '.json').should == 'http://test.host/a.json'
- end
- it 'should append to things with query strings' do
- main_url('/a?z=1', '.json').should == 'http://test.host/a.json?z=1'
- end
- it 'should fail silently with invalid URLs' do
- main_url('/a?z=9%', '.json').should == 'http://test.host/a?z=9%'
- end
- end
-
describe 'when displaying a user admin link for a request' do
it 'should return the text "An anonymous user (external)" in the case where there is no external username' do
@@ -48,32 +36,6 @@ describe LinkToHelper do
end
- describe 'admin_url' do
- context 'with no ADMIN_BASE_URL set' do
- it 'should prepend the admin general index path to a simple string' do
- admin_url('unclassified').should == 'http://test.host/en/admin/unclassified'
- end
-
- it 'should prepend the admin general index path to a deeper URL' do
- admin_url('request/show/123').should == 'http://test.host/en/admin/request/show/123'
- end
- end
-
- context 'with ADMIN_BASE_URL set' do
- before(:each) do
- Configuration::should_receive(:admin_base_url).and_return('https://www.example.com/secure/alaveteli-admin/')
- end
-
- it 'should prepend the admin base URL to a simple string' do
- admin_url('unclassified').should == 'https://www.example.com/secure/alaveteli-admin/unclassified'
- end
-
- it 'should prepend the admin base URL to a deeper URL' do
- admin_url('request/show/123').should == 'https://www.example.com/secure/alaveteli-admin/request/show/123'
- end
- end
- end
-
describe 'simple_date' do
it 'should respect time zones' do
Time.use_zone('Australia/Sydney') do
diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb
index 000a0c12e..dd5a322fb 100644
--- a/spec/models/request_mailer_spec.rb
+++ b/spec/models/request_mailer_spec.rb
@@ -366,16 +366,4 @@ 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
- Configuration::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.deliver_requires_admin(@info_request)
-
- mail.body.should include('http://our.proxy.server/admin/alaveteli/request/show/123')
- end
- end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 561a75da6..b04ed4b54 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,16 @@
+require 'simplecov'
+require 'coveralls'
+
+# Generate coverage locally in html as well as in coveralls.io
+SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
+ SimpleCov::Formatter::HTMLFormatter,
+ Coveralls::SimpleCov::Formatter
+]
+SimpleCov.start('rails') do
+ add_filter 'commonlib'
+ add_filter 'vendor/plugins'
+end
+
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] = 'test'
@@ -222,6 +235,9 @@ if $tempfilecount.nil?
end
def process(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
self.original_process(action, parameters, session, flash, http_method)
+ # Don't try validating the admin interface.
+ # TODO: Make the admin interface valid html5
+ return if @request.parameters["controller"] =~ /admin_/
# don't validate auto-generated HTML
return if @request.query_parameters["action"] == "get_attachment_as_html"
# XXX Is there a better way to check this than calling a private method?
diff --git a/spec/views/request/show.rhtml_spec.rb b/spec/views/request/show.rhtml_spec.rb
index 4429e9e58..a22f29951 100644
--- a/spec/views/request/show.rhtml_spec.rb
+++ b/spec/views/request/show.rhtml_spec.rb
@@ -98,7 +98,7 @@ describe 'when viewing an information request' do
it 'should show a link to follow up the last response with clarification' do
request_page
- expected_url = "http://test.host/request/#{@mock_request.id}/response/#{@mock_response.id}#followup"
+ expected_url = "/request/#{@mock_request.id}/response/#{@mock_response.id}#followup"
response.should have_tag("a[href=#{expected_url}]", :text => 'send a follow up message')
end
@@ -118,7 +118,7 @@ describe 'when viewing an information request' 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/request/#{@mock_request.id}/response#followup"
+ expected_url = "/request/#{@mock_request.id}/response#followup"
response.should have_tag("a[href=#{expected_url}]", :text => 'send a follow up message')
end
end