padrino-admin 0.11.3 → 0.11.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +3 -3
- data/lib/padrino-admin/access_control.rb +46 -47
- data/lib/padrino-admin/bootstrap-less/alerts.less +29 -55
- data/lib/padrino-admin/bootstrap-less/badges.less +13 -15
- data/lib/padrino-admin/bootstrap-less/bootstrap.less +17 -21
- data/lib/padrino-admin/bootstrap-less/breadcrumbs.less +6 -11
- data/lib/padrino-admin/bootstrap-less/button-groups.less +114 -32
- data/lib/padrino-admin/bootstrap-less/buttons.less +41 -41
- data/lib/padrino-admin/bootstrap-less/carousel.less +43 -18
- data/lib/padrino-admin/bootstrap-less/close.less +4 -4
- data/lib/padrino-admin/bootstrap-less/code.less +8 -10
- data/lib/padrino-admin/bootstrap-less/component-animations.less +10 -4
- data/lib/padrino-admin/bootstrap-less/dropdowns.less +78 -51
- data/lib/padrino-admin/bootstrap-less/forms.less +183 -274
- data/lib/padrino-admin/bootstrap-less/glyphicons.less +232 -0
- data/lib/padrino-admin/bootstrap-less/grid.less +230 -88
- data/lib/padrino-admin/bootstrap-less/input-groups.less +127 -0
- data/lib/padrino-admin/bootstrap-less/jumbotron.less +16 -8
- data/lib/padrino-admin/bootstrap-less/labels.less +25 -37
- data/lib/padrino-admin/bootstrap-less/list-group.less +34 -35
- data/lib/padrino-admin/bootstrap-less/media.less +7 -5
- data/lib/padrino-admin/bootstrap-less/mixins.less +321 -108
- data/lib/padrino-admin/bootstrap-less/modals.less +24 -20
- data/lib/padrino-admin/bootstrap-less/navbar.less +474 -216
- data/lib/padrino-admin/bootstrap-less/navs.less +67 -85
- data/lib/padrino-admin/bootstrap-less/pager.less +4 -4
- data/lib/padrino-admin/bootstrap-less/pagination.less +64 -69
- data/lib/padrino-admin/bootstrap-less/panels.less +114 -62
- data/lib/padrino-admin/bootstrap-less/popovers.less +18 -18
- data/lib/padrino-admin/bootstrap-less/print.less +22 -7
- data/lib/padrino-admin/bootstrap-less/progress-bars.less +10 -33
- data/lib/padrino-admin/bootstrap-less/responsive-utilities.less +141 -40
- data/lib/padrino-admin/bootstrap-less/scaffolding.less +66 -19
- data/lib/padrino-admin/bootstrap-less/tables.less +154 -158
- data/lib/padrino-admin/bootstrap-less/theme.less +232 -0
- data/lib/padrino-admin/bootstrap-less/thumbnails.less +9 -20
- data/lib/padrino-admin/bootstrap-less/tooltip.less +3 -3
- data/lib/padrino-admin/bootstrap-less/type.less +47 -55
- data/lib/padrino-admin/bootstrap-less/utilities.less +2 -2
- data/lib/padrino-admin/bootstrap-less/variables.less +289 -93
- data/lib/padrino-admin/bootstrap-less/wells.less +2 -2
- data/lib/padrino-admin/generators/actions.rb +11 -10
- data/lib/padrino-admin/generators/admin_app.rb +11 -11
- data/lib/padrino-admin/generators/admin_page.rb +9 -9
- data/lib/padrino-admin/generators/orm.rb +6 -7
- data/lib/padrino-admin/generators/templates/account/activerecord.rb.tt +7 -7
- data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +16 -16
- data/lib/padrino-admin/generators/templates/account/datamapper.rb.tt +7 -7
- data/lib/padrino-admin/generators/templates/account/minirecord.rb.tt +7 -7
- data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +8 -8
- data/lib/padrino-admin/generators/templates/account/mongomapper.rb.tt +7 -7
- data/lib/padrino-admin/generators/templates/account/ohm.rb.tt +9 -9
- data/lib/padrino-admin/generators/templates/account/sequel.rb.tt +8 -8
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js +9 -3
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js +4 -2
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +4 -4
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js +9 -5
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js +19 -12
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js +68 -45
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js +6 -7
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js +43 -40
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/popover.js +16 -10
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js +6 -4
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js +4 -2
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tooltip.js +78 -48
- data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/transition.js +10 -1
- data/lib/padrino-admin/generators/templates/assets/stylesheets/application.css +1 -0
- data/lib/padrino-admin/generators/templates/assets/stylesheets/bootstrap.css +622 -334
- data/lib/padrino-admin/generators/templates/erb/app/layouts/error.erb.tt +2 -2
- data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +9 -9
- data/lib/padrino-admin/generators/templates/erb/page/_form.erb.tt +3 -3
- data/lib/padrino-admin/generators/templates/erb/page/index.erb.tt +3 -3
- data/lib/padrino-admin/generators/templates/haml/app/layouts/error.haml.tt +1 -1
- data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +9 -7
- data/lib/padrino-admin/generators/templates/haml/page/_form.haml.tt +2 -2
- data/lib/padrino-admin/generators/templates/haml/page/index.haml.tt +2 -2
- data/lib/padrino-admin/generators/templates/page/controller.rb.tt +3 -3
- data/lib/padrino-admin/generators/templates/slim/app/layouts/error.slim.tt +1 -1
- data/lib/padrino-admin/generators/templates/slim/app/sessions/new.slim.tt +9 -7
- data/lib/padrino-admin/generators/templates/slim/page/_form.slim.tt +2 -2
- data/lib/padrino-admin/generators/templates/slim/page/index.slim.tt +2 -2
- data/lib/padrino-admin/helpers/authentication_helpers.rb +35 -35
- data/lib/padrino-admin/helpers/view_helpers.rb +12 -19
- data/lib/padrino-admin/utils/crypt.rb +10 -9
- data/lib/padrino-admin.rb +4 -5
- data/test/fixtures/data_mapper.rb +10 -9
- data/test/generators/test_account_model_generator.rb +2 -2
- metadata +14 -21
@@ -14,12 +14,12 @@ module Padrino
|
|
14
14
|
# Defines the "banner" text for the CLI.
|
15
15
|
def self.banner; "padrino-gen admin"; end
|
16
16
|
|
17
|
-
# Include related modules
|
17
|
+
# Include related modules.
|
18
18
|
include Thor::Actions
|
19
19
|
include Padrino::Generators::Actions
|
20
20
|
include Padrino::Generators::Admin::Actions
|
21
|
-
|
22
|
-
# Look for custom template files in a generators folder under the project root
|
21
|
+
|
22
|
+
# Look for custom template files in a generators folder under the project root.
|
23
23
|
def source_paths
|
24
24
|
if File.exists? destination_root('generators', 'templates')
|
25
25
|
["#{destination_root('generators')}", File.expand_path(File.dirname(__FILE__))]
|
@@ -40,7 +40,7 @@ module Padrino
|
|
40
40
|
class_option :renderer, :aliases => '-e', :desc => "Rendering engine (erb, haml)", :type => :string
|
41
41
|
class_option :admin_model, :aliases => '-m', :desc => "The name of model for access controlling", :default => 'Account', :type => :string
|
42
42
|
|
43
|
-
# Copies over the Padrino base admin application
|
43
|
+
# Copies over the Padrino base admin application.
|
44
44
|
def create_admin
|
45
45
|
self.destination_root = options[:root]
|
46
46
|
if in_app_root?
|
@@ -55,7 +55,7 @@ module Padrino
|
|
55
55
|
raise SystemExit
|
56
56
|
end
|
57
57
|
|
58
|
-
# Get the app's namespace
|
58
|
+
# Get the app's namespace.
|
59
59
|
@app_name = fetch_app_name
|
60
60
|
|
61
61
|
store_component_choice(:admin_renderer, tmp_ext)
|
@@ -122,7 +122,7 @@ module Padrino
|
|
122
122
|
template "templates/#{ext}/app/layouts/application.#{ext}.tt", destination_root("admin/views/layouts/application.#{ext}")
|
123
123
|
template "templates/#{ext}/app/layouts/error.#{ext}.tt", destination_root("admin/views/layouts/error.#{ext}")
|
124
124
|
template "templates/#{ext}/app/sessions/new.#{ext}.tt", destination_root("admin/views/sessions/new.#{ext}")
|
125
|
-
#
|
125
|
+
# Custom error.
|
126
126
|
template "templates/#{ext}/app/errors/403.#{ext}.tt", destination_root("admin/views/errors/403.#{ext}")
|
127
127
|
template "templates/#{ext}/app/errors/404.#{ext}.tt", destination_root("admin/views/errors/404.#{ext}")
|
128
128
|
template "templates/#{ext}/app/errors/500.#{ext}.tt", destination_root("admin/views/errors/500.#{ext}")
|
@@ -132,11 +132,11 @@ module Padrino
|
|
132
132
|
require_dependencies('bcrypt-ruby', :require => 'bcrypt')
|
133
133
|
end
|
134
134
|
|
135
|
-
# A nicer select box
|
135
|
+
# A nicer select box.
|
136
136
|
# TODO FIXME This doesn't make much sense in here. Review.
|
137
137
|
# gsub_file destination_root("admin/views/#{@model_plural}/_form.#{ext}"), "f.text_field :role, :class => :text_field", "f.select :role, :options => access_control.roles"
|
138
138
|
|
139
|
-
# Destroy account only if not logged in
|
139
|
+
# Destroy account only if not logged in.
|
140
140
|
gsub_file destination_root("admin/controllers/#{@model_plural}.rb"), "if #{@model_singular}.destroy", "if #{@model_singular} != current_account && #{@model_singular}.destroy"
|
141
141
|
return if self.behavior == :revoke
|
142
142
|
|
@@ -159,6 +159,6 @@ module Padrino
|
|
159
159
|
say "You are not at the root of a Padrino application! (config/boot.rb not found)"
|
160
160
|
end
|
161
161
|
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -7,20 +7,20 @@ module Padrino
|
|
7
7
|
class AdminPage < Thor::Group
|
8
8
|
attr_accessor :default_orm
|
9
9
|
|
10
|
-
# Add this generator to our padrino-gen
|
10
|
+
# Add this generator to our padrino-gen.
|
11
11
|
Padrino::Generators.add_generator(:admin_page, self)
|
12
12
|
|
13
|
-
# Define the source template root
|
13
|
+
# Define the source template root.
|
14
14
|
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
|
15
15
|
# Defines the "banner" text for the CLI.
|
16
16
|
def self.banner; "padrino-gen admin_page [model]"; end
|
17
17
|
|
18
|
-
# Include related modules
|
18
|
+
# Include related modules.
|
19
19
|
include Thor::Actions
|
20
20
|
include Padrino::Generators::Actions
|
21
21
|
include Padrino::Generators::Admin::Actions
|
22
22
|
|
23
|
-
# Look for custom template files in a generators folder under the project root
|
23
|
+
# Look for custom template files in a generators folder under the project root.
|
24
24
|
def source_paths
|
25
25
|
if File.exists? destination_root('generators')
|
26
26
|
["#{destination_root('generators')}", File.expand_path(File.dirname(__FILE__))]
|
@@ -37,10 +37,10 @@ module Padrino
|
|
37
37
|
# class_option :app, :desc => 'The application destination path', :aliases => '-a', :default => '/app', :type => :string
|
38
38
|
class_option :root, :desc => "The root destination", :aliases => '-r', :type => :string
|
39
39
|
class_option :destroy, :aliases => '-d', :default => false, :type => :boolean
|
40
|
-
# Show help if no argv given
|
40
|
+
# Show help if no argv given.
|
41
41
|
require_arguments!
|
42
42
|
|
43
|
-
# Create controller for admin
|
43
|
+
# Create controller for admin.
|
44
44
|
def create_controller
|
45
45
|
self.destination_root = options[:root]
|
46
46
|
# TODO FIXME ??? Review
|
@@ -65,6 +65,6 @@ module Padrino
|
|
65
65
|
say "You are not at the root of a Padrino application! (config/boot.rb not found)"
|
66
66
|
end
|
67
67
|
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -9,14 +9,14 @@ module Padrino
|
|
9
9
|
|
10
10
|
##
|
11
11
|
# Defines the generic ORM management functions used to manipulate data for admin.
|
12
|
-
# @private
|
13
12
|
class Orm
|
14
|
-
attr_reader :klass_name, :klass, :name_plural, :name_singular, :orm
|
13
|
+
attr_reader :klass_name, :klass, :name_plural, :name_singular, :orm, :name_param
|
15
14
|
|
16
15
|
def initialize(name, orm, columns=nil, column_fields=nil)
|
17
16
|
name = name.to_s
|
18
17
|
@klass_name = name.underscore.camelize
|
19
18
|
@klass = @klass_name.constantize rescue nil
|
19
|
+
@name_param = name.underscore.gsub(/\//, '_')
|
20
20
|
@name_singular = name.underscore.gsub(/^.*\//, '') # convert submodules i.e. FooBar::Jank.all # => jank
|
21
21
|
@name_plural = @name_singular.pluralize
|
22
22
|
@orm = orm.to_sym
|
@@ -164,8 +164,7 @@ module Padrino
|
|
164
164
|
else "@#{name_singular}.errors.include?(:#{field})"
|
165
165
|
end
|
166
166
|
end
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
end # Padrino
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
@@ -16,7 +16,7 @@ class <%= @model_name %> < ActiveRecord::Base
|
|
16
16
|
before_save :encrypt_password, :if => :password_required
|
17
17
|
|
18
18
|
##
|
19
|
-
# This method is for authentication purpose
|
19
|
+
# This method is for authentication purpose.
|
20
20
|
#
|
21
21
|
def self.authenticate(email, password)
|
22
22
|
account = first(:conditions => ["lower(email) = lower(?)", email]) if email.present?
|
@@ -28,11 +28,11 @@ class <%= @model_name %> < ActiveRecord::Base
|
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
def encrypt_password
|
32
|
+
self.crypted_password = ::BCrypt::Password.create(password)
|
33
|
+
end
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
def password_required
|
36
|
+
crypted_password.blank? || password.present?
|
37
|
+
end
|
38
38
|
end
|
@@ -25,7 +25,7 @@ class <%= @model_name %> < CouchRest::Model::Base
|
|
25
25
|
after_validation :encrypt_password, :if => :password_required
|
26
26
|
|
27
27
|
##
|
28
|
-
# This method is for authentication purpose
|
28
|
+
# This method is for authentication purpose.
|
29
29
|
#
|
30
30
|
def self.authenticate(email, password)
|
31
31
|
account = find_by_email(email)
|
@@ -37,30 +37,30 @@ class <%= @model_name %> < CouchRest::Model::Base
|
|
37
37
|
end
|
38
38
|
|
39
39
|
##
|
40
|
-
# This method is used by AuthenticationHelper
|
40
|
+
# This method is used by AuthenticationHelper.
|
41
41
|
#
|
42
42
|
def self.find_by_id(id)
|
43
43
|
get(id)
|
44
44
|
end
|
45
45
|
|
46
46
|
private
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
def encrypt_password
|
48
|
+
self.crypted_password = ::BCrypt::Password.create(password)
|
49
|
+
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
def password_required
|
52
|
+
crypted_password.blank? || password.present?
|
53
|
+
end
|
54
54
|
|
55
|
-
|
56
|
-
|
55
|
+
def unique_email_validator
|
56
|
+
account = self.class.find_by_email(email)
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
# Didn't find email in the database.
|
59
|
+
return if account.nil?
|
60
60
|
|
61
|
-
|
62
|
-
|
61
|
+
# Account with same email in database is this account.
|
62
|
+
return if has_key?('_id') && self['_id'] == account['_id']
|
63
63
|
|
64
|
-
|
65
|
-
|
64
|
+
errors.add(:email, "is not unique")
|
65
|
+
end
|
66
66
|
end
|
@@ -26,7 +26,7 @@ class <%= @model_name %>
|
|
26
26
|
before :save, :encrypt_password
|
27
27
|
|
28
28
|
##
|
29
|
-
# This method is for authentication purpose
|
29
|
+
# This method is for authentication purpose.
|
30
30
|
#
|
31
31
|
def self.authenticate(email, password)
|
32
32
|
account = first(:conditions => ["lower(email) = lower(?)", email]) if email.present?
|
@@ -45,11 +45,11 @@ class <%= @model_name %>
|
|
45
45
|
end
|
46
46
|
|
47
47
|
private
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
def password_required
|
49
|
+
crypted_password.blank? || password.present?
|
50
|
+
end
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
def encrypt_password
|
53
|
+
self.crypted_password = ::BCrypt::Password.create(password) if password.present?
|
54
|
+
end
|
55
55
|
end
|
@@ -19,7 +19,7 @@ class <%= @model_name %> < ActiveRecord::Base
|
|
19
19
|
before_save :encrypt_password, :if => :password_required
|
20
20
|
|
21
21
|
##
|
22
|
-
# This method is for authentication purpose
|
22
|
+
# This method is for authentication purpose.
|
23
23
|
#
|
24
24
|
def self.authenticate(email, password)
|
25
25
|
account = first(:conditions => ["lower(email) = lower(?)", email]) if email.present?
|
@@ -31,11 +31,11 @@ class <%= @model_name %> < ActiveRecord::Base
|
|
31
31
|
end
|
32
32
|
|
33
33
|
private
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
def encrypt_password
|
35
|
+
self.crypted_password = ::BCrypt::Password.create(password)
|
36
|
+
end
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
def password_required
|
39
|
+
crypted_password.blank? || password.present?
|
40
|
+
end
|
41
41
|
end
|
@@ -24,7 +24,7 @@ class <%= @model_name %>
|
|
24
24
|
before_save :encrypt_password, :if => :password_required
|
25
25
|
|
26
26
|
##
|
27
|
-
# This method is for authentication purpose
|
27
|
+
# This method is for authentication purpose.
|
28
28
|
#
|
29
29
|
def self.authenticate(email, password)
|
30
30
|
account = where(:email => /#{Regexp.escape(email)}/i).first if email.present?
|
@@ -32,7 +32,7 @@ class <%= @model_name %>
|
|
32
32
|
end
|
33
33
|
|
34
34
|
##
|
35
|
-
# This method is used by AuthenticationHelper
|
35
|
+
# This method is used by AuthenticationHelper.
|
36
36
|
#
|
37
37
|
def self.find_by_id(id)
|
38
38
|
find(id) rescue nil
|
@@ -43,11 +43,11 @@ class <%= @model_name %>
|
|
43
43
|
end
|
44
44
|
|
45
45
|
private
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
def encrypt_password
|
47
|
+
self.crypted_password = ::BCrypt::Password.create(self.password)
|
48
|
+
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
def password_required
|
51
|
+
crypted_password.blank? || self.password.present?
|
52
|
+
end
|
53
53
|
end
|
@@ -24,7 +24,7 @@ class <%= @model_name %>
|
|
24
24
|
before_save :encrypt_password, :if => :password_required
|
25
25
|
|
26
26
|
##
|
27
|
-
# This method is for authentication purpose
|
27
|
+
# This method is for authentication purpose.
|
28
28
|
#
|
29
29
|
def self.authenticate(email, password)
|
30
30
|
account = first(:email => /#{Regexp.escape(email)}/i) if email.present?
|
@@ -36,11 +36,11 @@ class <%= @model_name %>
|
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
def encrypt_password
|
40
|
+
self.crypted_password = ::BCrypt::Password.create(password)
|
41
|
+
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
def password_required
|
44
|
+
crypted_password.blank? || password.present?
|
45
|
+
end
|
46
46
|
end
|
@@ -32,7 +32,7 @@ class Account < Ohm::Model
|
|
32
32
|
end
|
33
33
|
|
34
34
|
##
|
35
|
-
# This method is for authentication purpose
|
35
|
+
# This method is for authentication purpose.
|
36
36
|
#
|
37
37
|
def self.authenticate(email, password)
|
38
38
|
account = with(:email, email) if email.present?
|
@@ -40,14 +40,14 @@ class Account < Ohm::Model
|
|
40
40
|
end
|
41
41
|
|
42
42
|
##
|
43
|
-
# This method is used by AuthenticationHelper
|
43
|
+
# This method is used by AuthenticationHelper.
|
44
44
|
#
|
45
45
|
def self.find_by_id(id)
|
46
46
|
self[id]
|
47
47
|
end
|
48
48
|
|
49
49
|
##
|
50
|
-
# This method is used by Admin Sessions Controller for login bypass
|
50
|
+
# This method is used by Admin Sessions Controller for login bypass.
|
51
51
|
#
|
52
52
|
def self.first
|
53
53
|
first_id = key[:all].sort(:order => "asc", :limit => [0,1]).first
|
@@ -59,11 +59,11 @@ class Account < Ohm::Model
|
|
59
59
|
end
|
60
60
|
|
61
61
|
private
|
62
|
-
|
63
|
-
|
64
|
-
|
62
|
+
def encrypt_password
|
63
|
+
self.crypted_password = ::BCrypt::Password.create(password) if password_required
|
64
|
+
end
|
65
65
|
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
def password_required
|
67
|
+
crypted_password.blank? || password.present?
|
68
|
+
end
|
69
69
|
end
|
@@ -23,7 +23,7 @@ class <%= @model_name %> < Sequel::Model
|
|
23
23
|
end
|
24
24
|
|
25
25
|
##
|
26
|
-
# This method is for authentication purpose
|
26
|
+
# This method is for authentication purpose.
|
27
27
|
#
|
28
28
|
def self.authenticate(email, password)
|
29
29
|
account = filter(Sequel.function(:lower, :email) => Sequel.function(:lower, email)).first
|
@@ -31,7 +31,7 @@ class <%= @model_name %> < Sequel::Model
|
|
31
31
|
end
|
32
32
|
|
33
33
|
##
|
34
|
-
# Replace
|
34
|
+
# Replace ActiveRecord method.
|
35
35
|
#
|
36
36
|
def self.find_by_id(id)
|
37
37
|
self[id] rescue nil
|
@@ -42,11 +42,11 @@ class <%= @model_name %> < Sequel::Model
|
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
def encrypt_password
|
46
|
+
self.crypted_password = ::BCrypt::Password.create(password) if password.present?
|
47
|
+
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
def password_required
|
50
|
+
self.crypted_password.blank? || password.present?
|
51
|
+
end
|
52
52
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ========================================================================
|
2
2
|
* Bootstrap: affix.js v3.0.0
|
3
|
-
* http://
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#affix
|
4
4
|
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
@@ -36,6 +36,8 @@
|
|
36
36
|
this.checkPosition()
|
37
37
|
}
|
38
38
|
|
39
|
+
Affix.RESET = 'affix affix-top affix-bottom'
|
40
|
+
|
39
41
|
Affix.DEFAULTS = {
|
40
42
|
offset: 0
|
41
43
|
}
|
@@ -53,7 +55,6 @@
|
|
53
55
|
var offset = this.options.offset
|
54
56
|
var offsetTop = offset.top
|
55
57
|
var offsetBottom = offset.bottom
|
56
|
-
var reset = 'affix affix-top affix-bottom'
|
57
58
|
|
58
59
|
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
59
60
|
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
@@ -64,11 +65,16 @@
|
|
64
65
|
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
65
66
|
|
66
67
|
if (this.affixed === affix) return
|
68
|
+
if (this.unpin) this.$element.css('top', '')
|
67
69
|
|
68
70
|
this.affixed = affix
|
69
71
|
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
70
72
|
|
71
|
-
this.$element.removeClass(
|
73
|
+
this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
|
74
|
+
|
75
|
+
if (affix == 'bottom') {
|
76
|
+
this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
|
77
|
+
}
|
72
78
|
}
|
73
79
|
|
74
80
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ========================================================================
|
2
2
|
* Bootstrap: alert.js v3.0.0
|
3
|
-
* http://
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#alerts
|
4
4
|
* ========================================================================
|
5
5
|
* Copyright 2013 Twitter, Inc.
|
6
6
|
*
|
@@ -56,7 +56,9 @@
|
|
56
56
|
}
|
57
57
|
|
58
58
|
$.support.transition && $parent.hasClass('fade') ?
|
59
|
-
$parent
|
59
|
+
$parent
|
60
|
+
.one($.support.transition.end, removeElement)
|
61
|
+
.emulateTransitionEnd(150) :
|
60
62
|
removeElement()
|
61
63
|
}
|
62
64
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
|
-
*
|
3
|
-
* Copyright
|
4
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
2
|
+
* bootstrap.js v3.0.0 by @fat and @mdo
|
3
|
+
* Copyright 2013 Twitter Inc.
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
+function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]}}e(function(){e.support.transition=t()})}(window.jQuery),+function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed.bs.alert").remove()}var n=e(this),r=n.attr("data-target");r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var i=e(r);t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close.bs.alert"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(window.jQuery),+function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.is("input")?"val":"html",i=n.data();e+="Text",i.resetText||n.data("resetText",n[r]()),n[r](i[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("bs.button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),+function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.DEFAULTS={interval:5e3,pause:"hover"},t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},t.prototype.to=function(t){var n=this,r=this.getActiveIndex();if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){n.to(t)}):r==t?this.pause().cycle():this.slide(t>r?"next":"prev",e(this.$items[t]))},t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},t.prototype.next=function(){if(this.sliding)return;return this.slide("next")},t.prototype.prev=function(){if(this.sliding)return;return this.slide("prev")},t.prototype.slide=function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u]();var f=e.Event("slide.bs.carousel",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("bs.carousel"),s=e.extend({},t.DEFAULTS,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("bs.carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("bs.carousel").pause().to(o).cycle(),t.preventDefault()}),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var t=e(this);t.carousel(t.data())})})}(window.jQuery),+function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},t.prototype.show=function(){if(this.transitioning||this.$element.hasClass("in"))return;var t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){var i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show.bs.collapse"),"shown.bs.collapse"),e.support.transition&&this.$element[t](this.$element[0][n])},t.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass("in"))return;var t=this.dimension();this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide.bs.collapse"),"hidden"),this.$element[t](0)},t.prototype.reset=function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!=null?"addClass":"removeClass"]("collapse"),this},t.prototype.transition=function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},t.DEFAULTS,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data(),o=n.attr("data-parent"),u=o&&e(o);u&&u.find("[data-toggle=collapse][data-parent="+o+"]").not(n).addClass("collapsed"),n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),+function(e){"use strict";function i(){e(t).remove(),e(n).each(function(t){var n=s(e(this));if(!n.hasClass("open"))return;n.trigger(t=e.Event("hide.bs.dropdown"));if(t.isDefaultPrevented())return;n.removeClass("open").trigger("hidden.bs.dropdown")})}function s(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}var t=".dropdown-backdrop",n="[data-toggle=dropdown]",r=function(t){var n=e(t).on("click.bs.dropdown",this.toggle)};r.prototype.toggle=function(t){var n=e(this);if(n.is(".disabled, :disabled"))return;var r=s(n),o=r.hasClass("open");i();if(!o){"ontouchstart"in document.documentElement&&e('<div class="dropdown-backdrop"/>').insertBefore(e(this)).on("click",i),r.trigger(t=e.Event("show.bs.dropdown"));if(t.isDefaultPrevented())return;r.toggleClass("open").trigger("shown.bs.dropdown")}return n.focus(),!1},r.prototype.keydown=function(t){if(!/(38|40|27)/.test(t.keyCode))return;var r=e(this);t.preventDefault(),t.stopPropagation();if(r.is(".disabled, :disabled"))return;var i=s(r),o=i.hasClass("open");if(!o||o&&t.keyCode==27)return t.which==27&&i.find(n).focus(),r.click();var u=e("[role=menu] li:not(.divider):visible a",i);if(!u.length)return;var a=u.index(u.filter(":focus"));t.keyCode==38&&a>0&&a--,t.keyCode==40&&a<u.length-1&&a++,~a||(a=0),u.eq(a).focus()};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var n=e(this),i=n.data("dropdown");i||n.data("dropdown",i=new r(this)),typeof t=="string"&&i[t].call(n)})},e.fn.dropdown.Constructor=r,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",n,r.prototype.toggle).on("keydown.bs.dropdown.data-api",n+", [role=menu]",r.prototype.keydown)}(window.jQuery),+function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(){return this[this.isShown?"hide":"show"]()},t.prototype.show=function(){var t=this,n=e.Event("show.bs.modal");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown.bs.modal")}):t.$element.focus().trigger("shown.bs.modal")})},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]!==e.target&&!this.$element.has(e.target).length&&this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){e.which==27&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideWithTransition=function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("bs.modal"),s=e.extend({},t.DEFAULTS,r.data(),typeof n=="object"&&n);i||r.data("bs.modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})});var r=e(document.body).on("bs.modal.shown",".modal",function(){r.addClass("modal-open")}).on("bs.modal.hidden",".modal",function(){r.removeClass("modal-open")})}(window.jQuery),+function(e){"use strict";var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,r){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r);var i=this.options.trigger.split(" ");for(var s=i.length;s--;){var o=i[s];if(o=="click")this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if(o!="manual"){var u=o=="hover"?"mouseenter":"focus",a=o=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.enter=function(t){var n=this.getDefaults(),r={};this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)});var i=t instanceof this.constructor?t:e(t.currentTarget)[this.type](r).data("bs."+this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this._options).data("bs."+this.type);clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);if(t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("fade");var r=typeof this.options.placement=="function"?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement;n.detach().css({top:0,left:0,display:"block"}),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var i,s=this.getPosition(),o=n[0].offsetWidth,u=n[0].offsetHeight;switch(r){case"bottom":i={top:s.top+s.height,left:s.left+s.width/2-o/2};break;case"top":i={top:s.top-u,left:s.left+s.width/2-o/2};break;case"left":i={top:s.top+s.height/2-u/2,left:s.left-o};break;case"right":i={top:s.top+s.height/2-u/2,left:s.left+s.width}}this.applyPlacement(i,r),this.$element.trigger("shown.bs."+this.type)}},t.prototype.applyPlacement=function(e,t){var n,r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight;r.offset(e).addClass(t).addClass("in");var o=r[0].offsetWidth,u=r[0].offsetHeight;t=="top"&&u!=s&&(n=!0,e.top=e.top+s-u);if(t=="bottom"||t=="top"){var a=0;e.left<0&&(a=e.left*-2,e.left=0,r.offset(e),o=r[0].offsetWidth,u=r[0].offsetHeight),this.replaceArrow(a-i+o,o,"left")}else this.replaceArrow(u-s,u,"top");n&&r.offset(e)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},t.prototype.hide=function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide.bs."+this.type);this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden.bs."+this.type),this},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this._options).data("bs."+this.type):this;n.tip().hasClass("in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s=typeof n=="object"&&n;i||r.data("bs.tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),+function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title:empty").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=typeof this.options.content=="function"?this.options.content.call(this.$element[0]):this.options.content;return e||this.$element.attr("data-content")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},t.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData(this.type)};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s=typeof n=="object"&&n;i||r.data("bs.popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),+function(e){"use strict";function t(n,r){var i,s=e.proxy(this.process,this),o=e(n).is("body")?e(window):e(n);this.$body=e("body"),this.$scrollElement=o.on("scroll.bs.scroll-spy.data-api",s),this.options=e.extend({},t.DEFAULTS,r),this.selector=(this.options.target||(i=e(n).attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=e([]),this.targets=e([]),this.activeTarget=null,this.refresh(),this.process()}t.DEFAULTS={offset:10},t.prototype.refresh=function(){this.offsets=e([]),this.targets=e([]);var t=this,n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},t.prototype.process=function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},t.prototype.activate=function(t){this.activeTarget=t,e(this.selector).parents(".active").removeClass("active");var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',r=e(n).parents("li").addClass("active");r.parent(".dropdown-menu").length&&(r=r.closest("li.dropdown").addClass("active")),r.trigger("activate")};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("bs.scrollspy"),s=typeof n=="object"&&n;i||r.data("bs.scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),+function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target");r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;var i=n.find(".active:last a")[0],s=e.Event("show.bs.tab",{relatedTarget:i});t.trigger(s);if(s.isDefaultPrevented())return;var o=e(r);this.activate(t.parent("li"),n),this.activate(o,o.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:i})})},t.prototype.activate=function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),+function(e){"use strict";var t=function(n,r){this.options=e.extend({},t.DEFAULTS,r),this.$window=e(window).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(n),this.affixed=this.unpin=null,this.checkPosition()};t.DEFAULTS={offset:0},t.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.top,o=i.bottom,u="affix affix-top affix-bottom";typeof i!="object"&&(o=s=i),typeof s=="function"&&(s=i.top()),typeof o=="function"&&(o=i.bottom());var a=this.unpin!=null&&n+this.unpin<=r.top?!1:o!=null&&r.top+this.$element.height()>=t-o?"bottom":s!=null&&n<=s?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("bs.affix"),s=typeof n=="object"&&n;i||r.data("bs.affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
|
6
|
+
if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("dropdown");d||c.data("dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu]",f.prototype.keydown)}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show(),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)}))},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('<div class="modal-backdrop '+c+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focus",i="hover"==g?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show),void 0):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide),void 0):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d="function"==typeof this.options.placement?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m="body"==this.options.container?window.innerWidth:j.outerWidth(),n="body"==this.options.container?window.innerHeight:j.outerHeight(),o="body"==this.options.container?0:j.offset().left;d="bottom"==d&&g.top+g.height+i-l>n?"top":"top"==d&&g.top-l-i<0?"bottom":"right"==d&&g.right+h>m?"left":"left"==d&&g.left-h<o?"right":d,c.removeClass(k).addClass(d)}var p=this.getCalculatedOffset(d,g,h,i);this.applyPlacement(p,d),this.$element.trigger("shown.bs."+this.type)}},b.prototype.applyPlacement=function(a,b){var c,d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),a.top=a.top+g,a.left=a.left+h,d.offset(a).addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;if("top"==b&&j!=f&&(c=!0,a.top=a.top+f-j),/bottom|top/.test(b)){var k=0;a.left<0&&(k=-2*a.left,a.left=0,d.offset(a),i=d[0].offsetWidth,j=d[0].offsetHeight),this.replaceArrow(k-e+i,i,"left")}else this.replaceArrow(j-f,j,"top");c&&d.offset(a)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach()}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,b).emulateTransitionEnd(150):b(),this.$element.trigger("hidden.bs."+this.type),this)},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof c&&c;e||d.data("bs.tooltip",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery);
|