padrino-admin 0.10.7 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +22 -1
  3. data/lib/padrino-admin.rb +8 -1
  4. data/lib/padrino-admin/access_control.rb +6 -4
  5. data/lib/padrino-admin/bootstrap-less/accordion.less +34 -0
  6. data/lib/padrino-admin/bootstrap-less/alerts.less +98 -0
  7. data/lib/padrino-admin/bootstrap-less/badges.less +58 -0
  8. data/lib/padrino-admin/bootstrap-less/bootstrap.less +62 -0
  9. data/lib/padrino-admin/bootstrap-less/breadcrumbs.less +25 -0
  10. data/lib/padrino-admin/bootstrap-less/button-groups.less +166 -0
  11. data/lib/padrino-admin/bootstrap-less/buttons.less +175 -0
  12. data/lib/padrino-admin/bootstrap-less/carousel.less +192 -0
  13. data/lib/padrino-admin/bootstrap-less/close.less +32 -0
  14. data/lib/padrino-admin/bootstrap-less/code.less +61 -0
  15. data/lib/padrino-admin/bootstrap-less/component-animations.less +32 -0
  16. data/lib/padrino-admin/bootstrap-less/dropdowns.less +223 -0
  17. data/lib/padrino-admin/bootstrap-less/font-awesome-ie7.less +350 -0
  18. data/lib/padrino-admin/bootstrap-less/font-awesome.less +537 -0
  19. data/lib/padrino-admin/bootstrap-less/forms.less +543 -0
  20. data/lib/padrino-admin/bootstrap-less/glyphicons.less +200 -0
  21. data/lib/padrino-admin/bootstrap-less/grid.less +49 -0
  22. data/lib/padrino-admin/bootstrap-less/jumbotron.less +32 -0
  23. data/lib/padrino-admin/bootstrap-less/labels.less +46 -0
  24. data/lib/padrino-admin/bootstrap-less/media.less +54 -0
  25. data/lib/padrino-admin/bootstrap-less/mixins.less +530 -0
  26. data/lib/padrino-admin/bootstrap-less/modals.less +136 -0
  27. data/lib/padrino-admin/bootstrap-less/navbar.less +379 -0
  28. data/lib/padrino-admin/bootstrap-less/navs.less +277 -0
  29. data/lib/padrino-admin/bootstrap-less/normalize.less +396 -0
  30. data/lib/padrino-admin/bootstrap-less/padrino-admin.less +16 -0
  31. data/lib/padrino-admin/bootstrap-less/pager.less +43 -0
  32. data/lib/padrino-admin/bootstrap-less/pagination.less +100 -0
  33. data/lib/padrino-admin/bootstrap-less/popovers.less +133 -0
  34. data/lib/padrino-admin/bootstrap-less/print.less +74 -0
  35. data/lib/padrino-admin/bootstrap-less/progress-bars.less +118 -0
  36. data/lib/padrino-admin/bootstrap-less/responsive-utilities.less +59 -0
  37. data/lib/padrino-admin/bootstrap-less/scaffolding.less +90 -0
  38. data/lib/padrino-admin/bootstrap-less/tables.less +231 -0
  39. data/lib/padrino-admin/bootstrap-less/thumbnails.less +42 -0
  40. data/lib/padrino-admin/bootstrap-less/tooltip.less +71 -0
  41. data/lib/padrino-admin/bootstrap-less/type.less +252 -0
  42. data/lib/padrino-admin/bootstrap-less/utilities.less +42 -0
  43. data/lib/padrino-admin/bootstrap-less/variables.less +316 -0
  44. data/lib/padrino-admin/bootstrap-less/wells.less +29 -0
  45. data/lib/padrino-admin/generators/actions.rb +18 -2
  46. data/lib/padrino-admin/generators/admin_app.rb +38 -26
  47. data/lib/padrino-admin/generators/admin_page.rb +8 -1
  48. data/lib/padrino-admin/generators/orm.rb +58 -11
  49. data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +1 -1
  50. data/lib/padrino-admin/generators/templates/account/{mini_record.rb.tt → minirecord.rb.tt} +0 -0
  51. data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +1 -1
  52. data/lib/padrino-admin/generators/templates/account/ohm.rb.tt +61 -0
  53. data/lib/padrino-admin/generators/templates/account/sequel.rb.tt +1 -1
  54. data/lib/padrino-admin/generators/templates/app.rb.tt +36 -29
  55. data/lib/padrino-admin/generators/templates/app/controllers/{base.rb → base.rb.tt} +1 -2
  56. data/lib/padrino-admin/generators/templates/app/controllers/sessions.rb.tt +6 -3
  57. data/lib/padrino-admin/generators/templates/assets/images/favicon.ico +0 -0
  58. data/lib/padrino-admin/generators/templates/assets/images/font/FontAwesome.otf +0 -0
  59. data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.eot +0 -0
  60. data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.svg +284 -0
  61. data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.ttf +0 -0
  62. data/lib/padrino-admin/generators/templates/assets/images/font/fontawesome-webfont.woff +0 -0
  63. data/lib/padrino-admin/generators/templates/assets/images/logo.png +0 -0
  64. data/lib/padrino-admin/generators/templates/assets/javascripts/application.js +117 -0
  65. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-affix.js +117 -0
  66. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-alert.js +99 -0
  67. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-button.js +105 -0
  68. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-carousel.js +207 -0
  69. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-collapse.js +167 -0
  70. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-dropdown.js +165 -0
  71. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-modal.js +251 -0
  72. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-popover.js +114 -0
  73. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-scrollspy.js +162 -0
  74. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-tab.js +144 -0
  75. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-tooltip.js +361 -0
  76. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-transition.js +60 -0
  77. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap-typeahead.js +335 -0
  78. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +6 -0
  79. data/lib/padrino-admin/generators/templates/assets/javascripts/jquery-1.9.0.min.js +4 -0
  80. data/lib/padrino-admin/generators/templates/assets/stylesheets/application.css +346 -0
  81. data/lib/padrino-admin/generators/templates/assets/stylesheets/bootstrap.css +952 -0
  82. data/lib/padrino-admin/generators/templates/erb/app/base/index.erb.tt +13 -15
  83. data/lib/padrino-admin/generators/templates/erb/app/errors/403.erb.tt +3 -0
  84. data/lib/padrino-admin/generators/templates/erb/app/errors/404.erb.tt +3 -0
  85. data/lib/padrino-admin/generators/templates/erb/app/errors/500.erb.tt +3 -0
  86. data/lib/padrino-admin/generators/templates/erb/app/layouts/application.erb.tt +59 -39
  87. data/lib/padrino-admin/generators/templates/erb/app/layouts/error.erb.tt +23 -0
  88. data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +41 -53
  89. data/lib/padrino-admin/generators/templates/erb/page/_form.erb.tt +16 -9
  90. data/lib/padrino-admin/generators/templates/erb/page/edit.erb.tt +9 -17
  91. data/lib/padrino-admin/generators/templates/erb/page/index.erb.tt +73 -31
  92. data/lib/padrino-admin/generators/templates/erb/page/new.erb.tt +8 -16
  93. data/lib/padrino-admin/generators/templates/haml/app/base/index.haml.tt +11 -24
  94. data/lib/padrino-admin/generators/templates/haml/app/errors/403.haml.tt +3 -0
  95. data/lib/padrino-admin/generators/templates/haml/app/errors/404.haml.tt +3 -0
  96. data/lib/padrino-admin/generators/templates/haml/app/errors/500.haml.tt +3 -0
  97. data/lib/padrino-admin/generators/templates/haml/app/layouts/application.haml.tt +47 -29
  98. data/lib/padrino-admin/generators/templates/haml/app/layouts/error.haml.tt +18 -0
  99. data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +33 -28
  100. data/lib/padrino-admin/generators/templates/haml/page/_form.haml.tt +13 -9
  101. data/lib/padrino-admin/generators/templates/haml/page/edit.haml.tt +7 -14
  102. data/lib/padrino-admin/generators/templates/haml/page/index.haml.tt +56 -27
  103. data/lib/padrino-admin/generators/templates/haml/page/new.haml.tt +6 -13
  104. data/lib/padrino-admin/generators/templates/page/controller.rb.tt +57 -12
  105. data/lib/padrino-admin/generators/templates/slim/app/base/index.slim.tt +11 -24
  106. data/lib/padrino-admin/generators/templates/slim/app/errors/403.slim.tt +3 -0
  107. data/lib/padrino-admin/generators/templates/slim/app/errors/404.slim.tt +3 -0
  108. data/lib/padrino-admin/generators/templates/slim/app/errors/500.slim.tt +3 -0
  109. data/lib/padrino-admin/generators/templates/slim/app/layouts/application.slim.tt +43 -26
  110. data/lib/padrino-admin/generators/templates/slim/app/layouts/error.slim.tt +19 -0
  111. data/lib/padrino-admin/generators/templates/slim/app/sessions/new.slim.tt +31 -27
  112. data/lib/padrino-admin/generators/templates/slim/page/_form.slim.tt +13 -11
  113. data/lib/padrino-admin/generators/templates/slim/page/edit.slim.tt +7 -15
  114. data/lib/padrino-admin/generators/templates/slim/page/index.slim.tt +54 -28
  115. data/lib/padrino-admin/generators/templates/slim/page/new.slim.tt +6 -14
  116. data/lib/padrino-admin/helpers/authentication_helpers.rb +6 -4
  117. data/lib/padrino-admin/helpers/view_helpers.rb +27 -5
  118. data/lib/padrino-admin/locale/admin/cs.yml +53 -13
  119. data/lib/padrino-admin/locale/admin/da.yml +53 -13
  120. data/lib/padrino-admin/locale/admin/de.yml +53 -13
  121. data/lib/padrino-admin/locale/admin/en.yml +53 -13
  122. data/lib/padrino-admin/locale/admin/es.yml +53 -13
  123. data/lib/padrino-admin/locale/admin/fr.yml +53 -13
  124. data/lib/padrino-admin/locale/admin/hu.yml +53 -13
  125. data/lib/padrino-admin/locale/admin/it.yml +53 -13
  126. data/lib/padrino-admin/locale/admin/ja.yml +54 -13
  127. data/lib/padrino-admin/locale/admin/lv.yml +53 -13
  128. data/lib/padrino-admin/locale/admin/nl.yml +53 -13
  129. data/lib/padrino-admin/locale/admin/no.yml +53 -13
  130. data/lib/padrino-admin/locale/admin/pl.yml +53 -13
  131. data/lib/padrino-admin/locale/admin/pt_br.yml +53 -13
  132. data/lib/padrino-admin/locale/admin/ro.yml +53 -13
  133. data/lib/padrino-admin/locale/admin/ru.yml +54 -13
  134. data/lib/padrino-admin/locale/admin/sv.yml +53 -13
  135. data/lib/padrino-admin/locale/admin/tr.yml +53 -13
  136. data/lib/padrino-admin/locale/admin/uk.yml +53 -13
  137. data/lib/padrino-admin/locale/admin/zh_cn.yml +53 -13
  138. data/lib/padrino-admin/locale/admin/zh_tw.yml +53 -13
  139. data/lib/padrino-admin/locale/orm/fr.yml +8 -8
  140. data/padrino-admin.gemspec +2 -0
  141. data/test/fixtures/data_mapper.rb +0 -4
  142. data/test/generators/test_account_model_generator.rb +88 -18
  143. data/test/generators/test_admin_app_generator.rb +120 -165
  144. data/test/generators/test_admin_page_generator.rb +53 -56
  145. data/test/helper.rb +4 -0
  146. data/test/test_admin_application.rb +5 -5
  147. data/test/test_locale.rb +3 -3
  148. metadata +119 -35
  149. data/lib/padrino-admin/generators/templates/assets/stylesheets/base.css +0 -95
  150. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/amro/style.css +0 -364
  151. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec-green/style.css +0 -290
  152. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/bec/style.css +0 -301
  153. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/blue/style.css +0 -287
  154. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/default/style.css +0 -373
  155. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/djime-cerulean/style.css +0 -305
  156. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/kathleene/style.css +0 -279
  157. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/olive/style.css +0 -345
  158. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/orange/style.css +0 -269
  159. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/reidb-greenish/style.css +0 -302
  160. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/ruby/style.css +0 -281
  161. data/lib/padrino-admin/generators/templates/assets/stylesheets/themes/warehouse/style.css +0 -391
  162. data/lib/padrino-admin/generators/templates/erb/app/base/_sidebar.erb.tt +0 -13
  163. data/lib/padrino-admin/generators/templates/haml/app/base/_sidebar.haml.tt +0 -11
  164. data/lib/padrino-admin/generators/templates/slim/app/base/_sidebar.slim.tt +0 -11
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 99fdaf933e9592ed00be6c4a5ca46e18adb57a89
4
+ data.tar.gz: e0ef38549f1b52a2df95f709b63c85ab5eb02139
5
+ SHA512:
6
+ metadata.gz: 53407d617810c9c02e2f7882f0e906cd3b5a0c94309f0b74e9814562e22f42bc258dff28932ca3cc1ff7f9c88896621c3295da30aa43d6ed40ce0b337135e7ef
7
+ data.tar.gz: 28f25d8233edc3f87c1a8dd377fe77a57f801abde3b15fd77e755faa3ef3a908bae8983448690e119740cda12ddf08085e177e7ae4a72389d08d1c8bfb821212
data/Rakefile CHANGED
@@ -2,4 +2,25 @@
2
2
  RAKE_ROOT = __FILE__
3
3
 
4
4
  require 'rubygems'
5
- require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
5
+ require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
6
+
7
+ namespace :bootstrap do
8
+ desc 'Compile bootstrap assets'
9
+ task :compile do
10
+ puts "Implement"
11
+ end
12
+
13
+ desc 'Compile css'
14
+ task :css do
15
+ require 'less'
16
+ src = File.join(File.dirname(__FILE__), 'lib', 'padrino-admin', 'bootstrap-less', 'padrino-admin.less')
17
+ out = File.join(File.dirname(__FILE__), 'lib', 'padrino-admin', 'generators', 'templates', 'assets', 'stylesheets', 'bootstrap.css')
18
+ css = Less::Parser.new(:paths => [File.dirname(src)]).parse(File.read(src)).to_css(:compress => true)
19
+ File.open(out, 'w') { |file| file.write css }
20
+ puts "Generated #{out}"
21
+ end
22
+
23
+ desc 'Compile js'
24
+ task :js do
25
+ end
26
+ end
data/lib/padrino-admin.rb CHANGED
@@ -1,14 +1,21 @@
1
1
  require 'padrino-core'
2
2
  require 'padrino-helpers'
3
+ require 'active_support/core_ext/array/conversions'
3
4
 
4
5
  FileSet.glob_require('padrino-admin/*.rb', __FILE__)
5
6
  FileSet.glob_require('padrino-admin/{helpers,utils}/*.rb', __FILE__)
6
7
 
8
+
9
+ ##
10
+ # Load our Padrino::Admin locales
11
+ #
12
+ # I18n.load_path = Dir["#{File.dirname(__FILE__)}/padrino-admin/locale/*.yml"]
13
+
7
14
  module Padrino
8
15
  ##
9
16
  # Padrino::Admin is beautiful Ajax Admin, with these fatures:
10
17
  #
11
- # Orm Agnostic:: Adapters for datamapper, activerecord, mongomapper, couchdb (now only: datamapper and activerecord)
18
+ # Orm Agnostic:: Adapters for datamapper, activerecord, mongomapper, couchdb (now only: datamapper and activerecord), ohm
12
19
  # Authentication:: Support for Account authentication, Account Permission managment
13
20
  # Scaffold:: You can simply create a new "admin interface" simply providing a Model
14
21
  # Ajax Uploads:: You can upload file, manage them and attach them to any model in a quick and simple way (coming soon)
@@ -102,11 +102,13 @@ module Padrino
102
102
  denied_paths = authorizations.map(&:denied).flatten.uniq
103
103
  if account
104
104
  denied_paths.clear
105
+ # explicit authorizations for the role associated with the given account
105
106
  authorizations = @authorizations.find_all { |auth| auth.roles.include?(role) }
106
107
  allowed_paths += authorizations.map(&:allowed).flatten.uniq
108
+ # other explicit authorizations
107
109
  authorizations = @authorizations.find_all { |auth| !auth.roles.include?(role) && !auth.roles.include?(:any) }
108
- denied_paths += authorizations.map(&:allowed).flatten.uniq
109
- denied_paths += authorizations.map(&:denied).flatten.uniq
110
+ denied_paths += authorizations.map(&:allowed).flatten.uniq # remove paths explicitly allowed for other roles
111
+ denied_paths += authorizations.map(&:denied).flatten.uniq # remove paths explicitly denied to other roles
110
112
  end
111
113
  return true if allowed_paths.any? { |p| path =~ /^#{p}/ }
112
114
  return false if denied_paths.any? { |p| path =~ /^#{p}/ }
@@ -162,10 +164,10 @@ module Padrino
162
164
  end
163
165
 
164
166
  ##
165
- # Returns the name of the project module. If a symbol it translate/humanize them for you.
167
+ # Returns the name of the project module humanize them for you.
166
168
  #
167
169
  def human_name
168
- @name.is_a?(Symbol) ? I18n.t("padrino.admin.menu.#{@name}", :default => @name.to_s.humanize) : @name
170
+ @name.to_s.humanize
169
171
  end
170
172
 
171
173
  ##
@@ -0,0 +1,34 @@
1
+ //
2
+ // Accordion
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Parent container
7
+ .accordion {
8
+ margin-bottom: @line-height-base;
9
+ }
10
+
11
+ // Group == heading + body
12
+ .accordion-group {
13
+ margin-bottom: 2px;
14
+ border: 1px solid #e5e5e5;
15
+ border-radius: @border-radius-base;
16
+ }
17
+ .accordion-heading {
18
+ border-bottom: 0;
19
+ }
20
+ .accordion-heading .accordion-toggle {
21
+ display: block;
22
+ padding: 8px 15px;
23
+ }
24
+
25
+ // General toggle styles
26
+ .accordion-toggle {
27
+ cursor: pointer;
28
+ }
29
+
30
+ // Inner needs the styles because you can't animate properly with any styles on the element
31
+ .accordion-inner {
32
+ padding: 9px 15px;
33
+ border-top: 1px solid #e5e5e5;
34
+ }
@@ -0,0 +1,98 @@
1
+ //
2
+ // Alerts
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base styles
7
+ // -------------------------
8
+
9
+ .alert {
10
+ padding: 8px 35px 8px 14px;
11
+ margin-bottom: @line-height-base;
12
+ color: @state-warning-text;
13
+ background-color: @state-warning-background;
14
+ border: 1px solid @state-warning-border;
15
+ border-radius: @border-radius-base;
16
+
17
+ // Headings for larger alerts
18
+ h4 {
19
+ margin-top: 0;
20
+ // Specified for the h4 to prevent conflicts of changing @headingsColor
21
+ color: inherit;
22
+ }
23
+ // Match the hr to the border of the alert
24
+ hr {
25
+ border-top-color: darken(@state-warning-border, 5%);
26
+ }
27
+ // Inherit color for immediate links and bolden them some
28
+ > a,
29
+ > p > a {
30
+ font-weight: 500;
31
+ color: darken(@state-warning-text, 10%);
32
+ }
33
+ }
34
+
35
+ // Adjust close link position
36
+ .close {
37
+ position: relative;
38
+ top: -2px;
39
+ right: -21px;
40
+ line-height: @line-height-base;
41
+ color: inherit;
42
+ }
43
+
44
+ // Alternate styles
45
+ // -------------------------
46
+
47
+ .alert-success {
48
+ background-color: @state-success-background;
49
+ border-color: @state-success-border;
50
+ color: @state-success-text;
51
+ hr {
52
+ border-top-color: darken(@state-success-border, 5%);
53
+ }
54
+ > a,
55
+ > p > a {
56
+ color: darken(@state-success-text, 10%);
57
+ }
58
+ }
59
+ .alert-danger,
60
+ .alert-error {
61
+ background-color: @state-error-background;
62
+ border-color: @state-error-border;
63
+ color: @state-error-text;
64
+ hr {
65
+ border-top-color: darken(@state-error-border, 5%);
66
+ }
67
+ > a,
68
+ > p > a {
69
+ color: darken(@state-error-text, 10%);
70
+ }
71
+ }
72
+ .alert-info {
73
+ background-color: @state-info-background;
74
+ border-color: @state-info-border;
75
+ color: @state-info-text;
76
+ hr {
77
+ border-top-color: darken(@state-info-border, 5%);
78
+ }
79
+ > a,
80
+ > p > a {
81
+ color: darken(@state-info-text, 10%);
82
+ }
83
+ }
84
+
85
+ // Block alerts
86
+ // -------------------------
87
+
88
+ .alert-block {
89
+ padding-top: 14px;
90
+ padding-bottom: 14px;
91
+ }
92
+ .alert-block > p,
93
+ .alert-block > ul {
94
+ margin-bottom: 0;
95
+ }
96
+ .alert-block p + p {
97
+ margin-top: 5px;
98
+ }
@@ -0,0 +1,58 @@
1
+ //
2
+ // Badges
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base classes
7
+ .badge {
8
+ display: inline-block;
9
+ min-width: 10px;
10
+ padding: 3px 7px;
11
+ font-size: 12px;
12
+ font-weight: bold;
13
+ color: #fff;
14
+ line-height: 1;
15
+ vertical-align: middle;
16
+ white-space: nowrap;
17
+ text-align: center;
18
+ background-color: @grayLight;
19
+ border-radius: 10px;
20
+
21
+ // Empty labels/badges collapse
22
+ &:empty {
23
+ display: none;
24
+ }
25
+ }
26
+
27
+ // Hover state, but only for links
28
+ a.badge {
29
+ &:hover,
30
+ &:focus {
31
+ color: #fff;
32
+ text-decoration: none;
33
+ cursor: pointer;
34
+ }
35
+ }
36
+
37
+ // Quick fix for labels/badges in buttons
38
+ .btn {
39
+ .badge {
40
+ position: relative;
41
+ top: -1px;
42
+ }
43
+ }
44
+ .btn-mini {
45
+ .badge {
46
+ top: 0;
47
+ }
48
+ }
49
+
50
+ // Account for counters in navs
51
+ .nav-list > .active > a > .badge,
52
+ .nav-pills > .active > a > .badge {
53
+ color: @link-color;
54
+ background-color: #fff;
55
+ }
56
+ .nav-pills > li > a > .badge {
57
+ margin-left: 3px;
58
+ }
@@ -0,0 +1,62 @@
1
+ /*!
2
+ * Bootstrap v3.0.0
3
+ *
4
+ * Copyright 2013 Twitter, Inc
5
+ * Licensed under the Apache License v2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Designed and built with all the love in the world by @mdo and @fat.
9
+ */
10
+
11
+ // Core variables and mixins
12
+ @import "variables.less";
13
+ @import "mixins.less";
14
+
15
+ // Reset
16
+ @import "normalize.less";
17
+ @import "print.less";
18
+
19
+ // Core CSS
20
+ @import "scaffolding.less";
21
+ @import "type.less";
22
+ @import "code.less";
23
+ @import "grid.less";
24
+
25
+ @import "tables.less";
26
+ @import "forms.less";
27
+ @import "buttons.less";
28
+
29
+ // Components: common
30
+ @import "component-animations.less";
31
+ @import "glyphicons.less";
32
+ @import "dropdowns.less";
33
+ @import "wells.less";
34
+ @import "close.less";
35
+
36
+ // Components: Nav
37
+ @import "navs.less";
38
+ @import "navbar.less";
39
+ @import "button-groups.less";
40
+ @import "breadcrumbs.less";
41
+ @import "pagination.less";
42
+ @import "pager.less";
43
+
44
+ // Components: Popovers
45
+ @import "modals.less";
46
+ @import "tooltip.less";
47
+ @import "popovers.less";
48
+
49
+ // Components: Misc
50
+ @import "alerts.less";
51
+ @import "thumbnails.less";
52
+ @import "media.less";
53
+ @import "labels.less";
54
+ @import "badges.less";
55
+ @import "progress-bars.less";
56
+ @import "accordion.less";
57
+ @import "carousel.less";
58
+ @import "jumbotron.less";
59
+
60
+ // Utility classes
61
+ @import "utilities.less"; // Has to be last to override when necessary
62
+ @import "responsive-utilities.less";
@@ -0,0 +1,25 @@
1
+ //
2
+ // Breadcrumbs
3
+ // --------------------------------------------------
4
+
5
+
6
+ .breadcrumb {
7
+ padding: 8px 15px;
8
+ margin: 0 0 @line-height-base;
9
+ list-style: none;
10
+ background-color: #f5f5f5;
11
+ border-radius: @border-radius-base;
12
+ > li {
13
+ display: inline-block;
14
+ text-shadow: 0 1px 0 #fff;
15
+ &:after {
16
+ display: inline-block;
17
+ content: "\00a0 /"; // Unicode space added since inline-block means non-collapsing white-space
18
+ padding: 0 5px;
19
+ color: #ccc;
20
+ }
21
+ }
22
+ > .active {
23
+ color: @grayLight;
24
+ }
25
+ }
@@ -0,0 +1,166 @@
1
+ //
2
+ // Button groups
3
+ // --------------------------------------------------
4
+
5
+ // Button carets
6
+ .btn .caret {
7
+ border-top-color: @btn-color;
8
+ }
9
+ .dropup .btn .caret {
10
+ border-bottom-color: @btn-color;
11
+ }
12
+
13
+ // Make the div behave like a button
14
+ .btn-group {
15
+ position: relative;
16
+ display: inline-block;
17
+ vertical-align: middle; // match .btn alignment given font-size hack above
18
+ > .btn {
19
+ position: relative;
20
+ float: left;
21
+ // Prevent double borders when buttons are next to each other
22
+ + btn {
23
+ margin-left: -1px;
24
+ }
25
+ // Bring the "active" button to the front
26
+ &:hover,
27
+ &:active {
28
+ z-index: 2;
29
+ }
30
+ }
31
+ }
32
+
33
+ // Optional: Group multiple button groups together for a toolbar
34
+ .btn-toolbar {
35
+ .clear_float();
36
+
37
+ .btn-group {
38
+ float: left;
39
+ }
40
+ // Space out series of button groups
41
+ > .btn + .btn,
42
+ > .btn-group + .btn,
43
+ > .btn + .btn-group,
44
+ > .btn-group + .btn-group {
45
+ margin-left: 5px;
46
+ }
47
+ }
48
+
49
+ // Float them, remove border radius, then re-add to first and last elements
50
+ .btn-group > .btn {
51
+ position: relative;
52
+ border-radius: 0;
53
+ }
54
+
55
+
56
+ // Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
57
+ .btn-group > .btn:first-child {
58
+ margin-left: 0;
59
+ .border-left-radius(@border-radius-base);
60
+ }
61
+ // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
62
+ .btn-group > .btn:last-child,
63
+ .btn-group > .dropdown-toggle {
64
+ .border-right-radius(@border-radius-base);
65
+ }
66
+ // Reset corners for large buttons
67
+ .btn-group > .btn.large:first-child {
68
+ margin-left: 0;
69
+ .border-left-radius(@border-radius-large);
70
+ }
71
+ .btn-group > .btn.large:last-child,
72
+ .btn-group > .large.dropdown-toggle {
73
+ .border-right-radius(@border-radius-large);
74
+ }
75
+
76
+ // On active and open, don't show outline
77
+ .btn-group .dropdown-toggle:active,
78
+ .btn-group.open .dropdown-toggle {
79
+ outline: 0;
80
+ }
81
+
82
+
83
+
84
+ // Split button dropdowns
85
+ // ----------------------
86
+
87
+ // Give the line between buttons some depth
88
+ .btn-group > .btn + .dropdown-toggle {
89
+ padding-left: 8px;
90
+ padding-right: 8px;
91
+ }
92
+ .btn-group > .btn-mini + .dropdown-toggle {
93
+ padding-left: 5px;
94
+ padding-right: 5px;
95
+ }
96
+ .btn-group > .btn-large + .dropdown-toggle {
97
+ padding-left: 12px;
98
+ padding-right: 12px;
99
+ }
100
+
101
+ // The clickable button for toggling the menu
102
+ // Remove the gradient and set the same inset shadow as the :active state
103
+ .btn-group.open .dropdown-toggle {
104
+ .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
105
+ }
106
+
107
+
108
+ // Reposition the caret
109
+ .btn .caret {
110
+ margin-top: 8px;
111
+ margin-left: 0;
112
+ }
113
+ // Carets in other button sizes
114
+ .btn-large .caret {
115
+ border-width: 5px;
116
+ }
117
+ // Upside down carets for .dropup
118
+ .dropup .btn-large .caret {
119
+ border-bottom-width: 5px;
120
+ }
121
+
122
+
123
+ // Vertical button groups
124
+ // ----------------------
125
+
126
+ .btn-group-vertical > .btn {
127
+ display: block;
128
+ float: none;
129
+ width: 100%;
130
+ max-width: 100%;
131
+ }
132
+ .btn-group-vertical .btn:first-child {
133
+ border-radius: 0; // Needs to be here for specificity since we're not zeroing them out again
134
+ .border-top-radius(@border-radius-base);
135
+ }
136
+ .btn-group-vertical .btn:last-child {
137
+ border-radius: 0; // Needs to be here for specificity since we're not zeroing them out again
138
+ .border-bottom-radius(@border-radius-base);
139
+ }
140
+ .btn-group-vertical .btn-large:first-child {
141
+ .border-top-radius(@border-radius-large);
142
+ }
143
+ .btn-group-vertical .btn-large:last-child {
144
+ .border-bottom-radius(@border-radius-large);
145
+ }
146
+
147
+
148
+ // Justified button groups
149
+ // ----------------------
150
+
151
+ .btn-group-justified {
152
+ display: table;
153
+ width: 100%;
154
+ .btn {
155
+ float: none;
156
+ display: table-cell;
157
+ width: 1%;
158
+ }
159
+ }
160
+
161
+
162
+ // Checkbox and radio options
163
+ .btn-group[data-toggle="buttons-radio"] > .btn > input[type="radio"],
164
+ .btn-group[data-toggle="buttons-checkbox"] > .btn > input[type="checkbox"] {
165
+ display: none;
166
+ }