adhoq 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +80 -0
  4. data/Rakefile +28 -0
  5. data/app/assets/javascripts/adhoq/application.js +19 -0
  6. data/app/assets/javascripts/adhoq/bootstrap-sprockets.js +12 -0
  7. data/app/assets/javascripts/adhoq/bootstrap.js +2107 -0
  8. data/app/assets/javascripts/adhoq/bootstrap/affix.js +142 -0
  9. data/app/assets/javascripts/adhoq/bootstrap/alert.js +92 -0
  10. data/app/assets/javascripts/adhoq/bootstrap/button.js +110 -0
  11. data/app/assets/javascripts/adhoq/bootstrap/carousel.js +223 -0
  12. data/app/assets/javascripts/adhoq/bootstrap/collapse.js +170 -0
  13. data/app/assets/javascripts/adhoq/bootstrap/dropdown.js +151 -0
  14. data/app/assets/javascripts/adhoq/bootstrap/modal.js +280 -0
  15. data/app/assets/javascripts/adhoq/bootstrap/popover.js +113 -0
  16. data/app/assets/javascripts/adhoq/bootstrap/scrollspy.js +170 -0
  17. data/app/assets/javascripts/adhoq/bootstrap/tab.js +128 -0
  18. data/app/assets/javascripts/adhoq/bootstrap/tooltip.js +457 -0
  19. data/app/assets/javascripts/adhoq/bootstrap/transition.js +59 -0
  20. data/app/assets/javascripts/adhoq/previewer.js.coffee +25 -0
  21. data/app/assets/stylesheets/adhoq/_bootstrap-compass.scss +7 -0
  22. data/app/assets/stylesheets/adhoq/_bootstrap-mincer.scss +17 -0
  23. data/app/assets/stylesheets/adhoq/_bootstrap-sprockets.scss +7 -0
  24. data/app/assets/stylesheets/adhoq/adhoq.css.sass +57 -0
  25. data/app/assets/stylesheets/adhoq/application.css +16 -0
  26. data/app/assets/stylesheets/adhoq/bootstrap.scss +50 -0
  27. data/app/assets/stylesheets/adhoq/bootstrap/_alerts.scss +68 -0
  28. data/app/assets/stylesheets/adhoq/bootstrap/_badges.scss +57 -0
  29. data/app/assets/stylesheets/adhoq/bootstrap/_breadcrumbs.scss +26 -0
  30. data/app/assets/stylesheets/adhoq/bootstrap/_button-groups.scss +240 -0
  31. data/app/assets/stylesheets/adhoq/bootstrap/_buttons.scss +157 -0
  32. data/app/assets/stylesheets/adhoq/bootstrap/_carousel.scss +243 -0
  33. data/app/assets/stylesheets/adhoq/bootstrap/_close.scss +35 -0
  34. data/app/assets/stylesheets/adhoq/bootstrap/_code.scss +68 -0
  35. data/app/assets/stylesheets/adhoq/bootstrap/_component-animations.scss +35 -0
  36. data/app/assets/stylesheets/adhoq/bootstrap/_dropdowns.scss +215 -0
  37. data/app/assets/stylesheets/adhoq/bootstrap/_forms.scss +538 -0
  38. data/app/assets/stylesheets/adhoq/bootstrap/_glyphicons.scss +237 -0
  39. data/app/assets/stylesheets/adhoq/bootstrap/_grid.scss +84 -0
  40. data/app/assets/stylesheets/adhoq/bootstrap/_input-groups.scss +166 -0
  41. data/app/assets/stylesheets/adhoq/bootstrap/_jumbotron.scss +48 -0
  42. data/app/assets/stylesheets/adhoq/bootstrap/_labels.scss +66 -0
  43. data/app/assets/stylesheets/adhoq/bootstrap/_list-group.scss +131 -0
  44. data/app/assets/stylesheets/adhoq/bootstrap/_media.scss +56 -0
  45. data/app/assets/stylesheets/adhoq/bootstrap/_mixins.scss +39 -0
  46. data/app/assets/stylesheets/adhoq/bootstrap/_modals.scss +150 -0
  47. data/app/assets/stylesheets/adhoq/bootstrap/_navbar.scss +659 -0
  48. data/app/assets/stylesheets/adhoq/bootstrap/_navs.scss +242 -0
  49. data/app/assets/stylesheets/adhoq/bootstrap/_normalize.scss +425 -0
  50. data/app/assets/stylesheets/adhoq/bootstrap/_pager.scss +55 -0
  51. data/app/assets/stylesheets/adhoq/bootstrap/_pagination.scss +88 -0
  52. data/app/assets/stylesheets/adhoq/bootstrap/_panels.scss +243 -0
  53. data/app/assets/stylesheets/adhoq/bootstrap/_popovers.scss +133 -0
  54. data/app/assets/stylesheets/adhoq/bootstrap/_print.scss +101 -0
  55. data/app/assets/stylesheets/adhoq/bootstrap/_progress-bars.scss +105 -0
  56. data/app/assets/stylesheets/adhoq/bootstrap/_responsive-embed.scss +34 -0
  57. data/app/assets/stylesheets/adhoq/bootstrap/_responsive-utilities.scss +174 -0
  58. data/app/assets/stylesheets/adhoq/bootstrap/_scaffolding.scss +150 -0
  59. data/app/assets/stylesheets/adhoq/bootstrap/_tables.scss +233 -0
  60. data/app/assets/stylesheets/adhoq/bootstrap/_theme.scss +258 -0
  61. data/app/assets/stylesheets/adhoq/bootstrap/_thumbnails.scss +38 -0
  62. data/app/assets/stylesheets/adhoq/bootstrap/_tooltip.scss +95 -0
  63. data/app/assets/stylesheets/adhoq/bootstrap/_type.scss +304 -0
  64. data/app/assets/stylesheets/adhoq/bootstrap/_utilities.scss +57 -0
  65. data/app/assets/stylesheets/adhoq/bootstrap/_variables.scss +850 -0
  66. data/app/assets/stylesheets/adhoq/bootstrap/_wells.scss +29 -0
  67. data/app/assets/stylesheets/adhoq/bootstrap/bootstrap.scss +50 -0
  68. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_alerts.scss +14 -0
  69. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_background-variant.scss +11 -0
  70. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_border-radius.scss +18 -0
  71. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_buttons.scss +50 -0
  72. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_center-block.scss +7 -0
  73. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_clearfix.scss +22 -0
  74. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_forms.scss +84 -0
  75. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_gradients.scss +58 -0
  76. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_grid-framework.scss +81 -0
  77. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_grid.scss +122 -0
  78. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_hide-text.scss +21 -0
  79. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_image.scss +34 -0
  80. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_labels.scss +12 -0
  81. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_list-group.scss +31 -0
  82. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_nav-divider.scss +10 -0
  83. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  84. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_opacity.scss +8 -0
  85. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_pagination.scss +23 -0
  86. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_panels.scss +24 -0
  87. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_progress-bar.scss +10 -0
  88. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_reset-filter.scss +8 -0
  89. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_resize.scss +6 -0
  90. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_responsive-visibility.scss +21 -0
  91. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_size.scss +10 -0
  92. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_tab-focus.scss +9 -0
  93. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_table-row.scss +28 -0
  94. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_text-emphasis.scss +11 -0
  95. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_text-overflow.scss +8 -0
  96. data/app/assets/stylesheets/adhoq/bootstrap/mixins/_vendor-prefixes.scss +219 -0
  97. data/app/controllers/adhoq/application_controller.rb +5 -0
  98. data/app/controllers/adhoq/authorization_methods.rb +36 -0
  99. data/app/controllers/adhoq/executions_controller.rb +25 -0
  100. data/app/controllers/adhoq/previews_controller.rb +13 -0
  101. data/app/controllers/adhoq/queries_controller.rb +38 -0
  102. data/app/helpers/adhoq/application_helper.rb +11 -0
  103. data/app/models/adhoq/execution.rb +29 -0
  104. data/app/models/adhoq/query.rb +14 -0
  105. data/app/models/adhoq/report.rb +42 -0
  106. data/app/models/adhoq/time_based_orders.rb +9 -0
  107. data/app/views/adhoq/application/_global_nav.html.slim +11 -0
  108. data/app/views/adhoq/application/_sidebar_queries_index.html.slim +10 -0
  109. data/app/views/adhoq/previews/create.html.slim +12 -0
  110. data/app/views/adhoq/previews/statement_invalid.html.slim +5 -0
  111. data/app/views/adhoq/queries/_form.html.slim +38 -0
  112. data/app/views/adhoq/queries/_query.html.slim +43 -0
  113. data/app/views/adhoq/queries/edit.html.slim +2 -0
  114. data/app/views/adhoq/queries/index.html.slim +1 -0
  115. data/app/views/adhoq/queries/new.html.slim +2 -0
  116. data/app/views/adhoq/queries/show.html.slim +1 -0
  117. data/app/views/layouts/adhoq/application.html.slim +18 -0
  118. data/config/routes.rb +9 -0
  119. data/db/migrate/20141003095645_create_adhoq_queries.rb +11 -0
  120. data/db/migrate/20141006014750_create_adhoq_executions.rb +13 -0
  121. data/db/migrate/20141007052308_create_adhoq_reports.rb +12 -0
  122. data/lib/adhoq.rb +13 -0
  123. data/lib/adhoq/configuration.rb +21 -0
  124. data/lib/adhoq/engine.rb +15 -0
  125. data/lib/adhoq/error.rb +4 -0
  126. data/lib/adhoq/executor.rb +27 -0
  127. data/lib/adhoq/global_variable.rb +34 -0
  128. data/lib/adhoq/reporter.rb +5 -0
  129. data/lib/adhoq/reporter/xlsx.rb +32 -0
  130. data/lib/adhoq/result.rb +18 -0
  131. data/lib/adhoq/storage.rb +5 -0
  132. data/lib/adhoq/storage/local_file.rb +45 -0
  133. data/lib/adhoq/version.rb +3 -0
  134. data/lib/tasks/adhoq_tasks.rake +4 -0
  135. data/spec/adhoq/executor_spec.rb +11 -0
  136. data/spec/adhoq/storage_spec.rb +19 -0
  137. data/spec/factories/adhoq_queries.rb +29 -0
  138. data/spec/models/adhoq/execution_spec.rb +4 -0
  139. data/spec/models/adhoq/query_spec.rb +4 -0
  140. data/spec/models/adhoq/report_spec.rb +25 -0
  141. data/spec/spec_helper.rb +36 -0
  142. data/spec/support/have_values_in_xlsx_sheet_matcher.rb +20 -0
  143. metadata +375 -0
@@ -0,0 +1,59 @@
1
+ /* ========================================================================
2
+ * Bootstrap: transition.js v3.2.0
3
+ * http://getbootstrap.com/javascript/#transitions
4
+ * ========================================================================
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
14
+ // ============================================================
15
+
16
+ function transitionEnd() {
17
+ var el = document.createElement('bootstrap')
18
+
19
+ var transEndEventNames = {
20
+ WebkitTransition : 'webkitTransitionEnd',
21
+ MozTransition : 'transitionend',
22
+ OTransition : 'oTransitionEnd otransitionend',
23
+ transition : 'transitionend'
24
+ }
25
+
26
+ for (var name in transEndEventNames) {
27
+ if (el.style[name] !== undefined) {
28
+ return { end: transEndEventNames[name] }
29
+ }
30
+ }
31
+
32
+ return false // explicit for ie8 ( ._.)
33
+ }
34
+
35
+ // http://blog.alexmaccaw.com/css-transitions
36
+ $.fn.emulateTransitionEnd = function (duration) {
37
+ var called = false
38
+ var $el = this
39
+ $(this).one('bsTransitionEnd', function () { called = true })
40
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
41
+ setTimeout(callback, duration)
42
+ return this
43
+ }
44
+
45
+ $(function () {
46
+ $.support.transition = transitionEnd()
47
+
48
+ if (!$.support.transition) return
49
+
50
+ $.event.special.bsTransitionEnd = {
51
+ bindType: $.support.transition.end,
52
+ delegateType: $.support.transition.end,
53
+ handle: function (e) {
54
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
55
+ }
56
+ }
57
+ })
58
+
59
+ }(jQuery);
@@ -0,0 +1,25 @@
1
+ class Previewer
2
+ constructor: (@el)->
3
+
4
+ init: ->
5
+ @el.on 'click', =>
6
+ @update()
7
+ false
8
+
9
+ update: ->
10
+ jQuery.ajax(
11
+ type: @el.data('method'),
12
+ url: @el.attr('href'),
13
+ data: {query: @source()},
14
+ complete: (xhr)=>
15
+ @result().html(xhr.responseText)
16
+ )
17
+
18
+ source: ->
19
+ $(@el.data('source')).val()
20
+
21
+ result: ->
22
+ $(@el.data('result'))
23
+
24
+ Adhoq.enablePreview = ($el)->
25
+ (new Previewer($el)).init()
@@ -0,0 +1,7 @@
1
+ @function twbs-font-path($path) {
2
+ @return font-url($path, true);
3
+ }
4
+
5
+ @function twbs-image-path($path) {
6
+ @return image-url($path, true);
7
+ }
@@ -0,0 +1,17 @@
1
+ // Mincer asset helper functions
2
+ //
3
+ // This must be imported into a .css.ejs.scss file.
4
+ // Then, <% %>-interpolations will be parsed as strings by Sass, and evaluated by EJS after Sass compilation.
5
+
6
+
7
+ @function twbs-font-path($path) {
8
+ // do something like following
9
+ // from "path/to/font.ext#suffix" to "<%- asset_path(path/to/font.ext)) + #suffix %>"
10
+ // from "path/to/font.ext?#suffix" to "<%- asset_path(path/to/font.ext)) + ?#suffix %>"
11
+ // or from "path/to/font.ext" just "<%- asset_path(path/to/font.ext)) %>"
12
+ @return "<%- asset_path('#{$path}'.replace(/[#?].*$/, '')) + '#{$path}'.replace(/(^[^#?]*)([#?]?.*$)/, '$2') %>";
13
+ }
14
+
15
+ @function twbs-image-path($file) {
16
+ @return "<%- asset_path('#{$file}') %>";
17
+ }
@@ -0,0 +1,7 @@
1
+ @function twbs-font-path($path) {
2
+ @return font-path($path);
3
+ }
4
+
5
+ @function twbs-image-path($path) {
6
+ @return image-path($path);
7
+ }
@@ -0,0 +1,57 @@
1
+ @import "bootstrap/_variables"
2
+ @import "font-awesome-sprockets"
3
+ @import "font-awesome"
4
+
5
+ $mid-span: $font-size-base * 1.5
6
+ $short-span: $font-size-base / 2
7
+
8
+ // engine styles
9
+
10
+ .new-execution form.form-inline
11
+ .form-group.report_format
12
+ margin-right: $font-size-base
13
+
14
+ label
15
+ margin-right: $short-span
16
+
17
+ #main > section > .page-header, #main > section > form.query-form .page-header
18
+ margin-top: 0
19
+
20
+ small
21
+ margin: 0 10px
22
+ font-size: $font-size-base
23
+
24
+ #sidebar
25
+ h2 a.new-query
26
+ float: right
27
+
28
+ ul.queries
29
+ li.panel
30
+ margin-bottom: $short-span
31
+
32
+ .panel-heading h2
33
+ margin: 0
34
+ font-size: $font-size-base
35
+
36
+ p.panel-body.description
37
+ margin-bottom: 0
38
+
39
+ form.query-form
40
+ textarea#query_query
41
+ font-family: monospace
42
+
43
+ .btn-in-header
44
+ display: inline-block
45
+ margin-left: $short-span
46
+
47
+ .btn
48
+ margin-left: $short-span
49
+
50
+ .preview .js-preview-result
51
+ overflow: scroll
52
+
53
+ .fa-pad-r
54
+ padding-right: $short-span / 2
55
+
56
+ .fa-pad-l
57
+ padding-left: $short-span / 2
@@ -0,0 +1,16 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require ./bootstrap
14
+ *= require ./adhoq
15
+ *= require_self
16
+ */
@@ -0,0 +1,50 @@
1
+ // Core variables and mixins
2
+ @import "bootstrap/variables";
3
+ @import "bootstrap/mixins";
4
+
5
+ // Reset and dependencies
6
+ @import "bootstrap/normalize";
7
+ @import "bootstrap/print";
8
+ @import "bootstrap/glyphicons";
9
+
10
+ // Core CSS
11
+ @import "bootstrap/scaffolding";
12
+ @import "bootstrap/type";
13
+ @import "bootstrap/code";
14
+ @import "bootstrap/grid";
15
+ @import "bootstrap/tables";
16
+ @import "bootstrap/forms";
17
+ @import "bootstrap/buttons";
18
+
19
+ // Components
20
+ @import "bootstrap/component-animations";
21
+ @import "bootstrap/dropdowns";
22
+ @import "bootstrap/button-groups";
23
+ @import "bootstrap/input-groups";
24
+ @import "bootstrap/navs";
25
+ @import "bootstrap/navbar";
26
+ @import "bootstrap/breadcrumbs";
27
+ @import "bootstrap/pagination";
28
+ @import "bootstrap/pager";
29
+ @import "bootstrap/labels";
30
+ @import "bootstrap/badges";
31
+ @import "bootstrap/jumbotron";
32
+ @import "bootstrap/thumbnails";
33
+ @import "bootstrap/alerts";
34
+ @import "bootstrap/progress-bars";
35
+ @import "bootstrap/media";
36
+ @import "bootstrap/list-group";
37
+ @import "bootstrap/panels";
38
+ @import "bootstrap/responsive-embed";
39
+ @import "bootstrap/wells";
40
+ @import "bootstrap/close";
41
+
42
+ // Components w/ JavaScript
43
+ @import "bootstrap/modals";
44
+ @import "bootstrap/tooltip";
45
+ @import "bootstrap/popovers";
46
+ @import "bootstrap/carousel";
47
+
48
+ // Utility classes
49
+ @import "bootstrap/utilities";
50
+ @import "bootstrap/responsive-utilities";
@@ -0,0 +1,68 @@
1
+ //
2
+ // Alerts
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base styles
7
+ // -------------------------
8
+
9
+ .alert {
10
+ padding: $alert-padding;
11
+ margin-bottom: $line-height-computed;
12
+ border: 1px solid transparent;
13
+ border-radius: $alert-border-radius;
14
+
15
+ // Headings for larger alerts
16
+ h4 {
17
+ margin-top: 0;
18
+ // Specified for the h4 to prevent conflicts of changing $headings-color
19
+ color: inherit;
20
+ }
21
+ // Provide class for links that match alerts
22
+ .alert-link {
23
+ font-weight: $alert-link-font-weight;
24
+ }
25
+
26
+ // Improve alignment and spacing of inner content
27
+ > p,
28
+ > ul {
29
+ margin-bottom: 0;
30
+ }
31
+ > p + p {
32
+ margin-top: 5px;
33
+ }
34
+ }
35
+
36
+ // Dismissible alerts
37
+ //
38
+ // Expand the right padding and account for the close button's positioning.
39
+
40
+ .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.
41
+ .alert-dismissible {
42
+ padding-right: ($alert-padding + 20);
43
+
44
+ // Adjust close link position
45
+ .close {
46
+ position: relative;
47
+ top: -2px;
48
+ right: -21px;
49
+ color: inherit;
50
+ }
51
+ }
52
+
53
+ // Alternate styles
54
+ //
55
+ // Generate contextual modifier classes for colorizing the alert.
56
+
57
+ .alert-success {
58
+ @include alert-variant($alert-success-bg, $alert-success-border, $alert-success-text);
59
+ }
60
+ .alert-info {
61
+ @include alert-variant($alert-info-bg, $alert-info-border, $alert-info-text);
62
+ }
63
+ .alert-warning {
64
+ @include alert-variant($alert-warning-bg, $alert-warning-border, $alert-warning-text);
65
+ }
66
+ .alert-danger {
67
+ @include alert-variant($alert-danger-bg, $alert-danger-border, $alert-danger-text);
68
+ }
@@ -0,0 +1,57 @@
1
+ //
2
+ // Badges
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base class
7
+ .badge {
8
+ display: inline-block;
9
+ min-width: 10px;
10
+ padding: 3px 7px;
11
+ font-size: $font-size-small;
12
+ font-weight: $badge-font-weight;
13
+ color: $badge-color;
14
+ line-height: $badge-line-height;
15
+ vertical-align: baseline;
16
+ white-space: nowrap;
17
+ text-align: center;
18
+ background-color: $badge-bg;
19
+ border-radius: $badge-border-radius;
20
+
21
+ // Empty badges collapse automatically (not available in IE8)
22
+ &:empty {
23
+ display: none;
24
+ }
25
+
26
+ // Quick fix for badges in buttons
27
+ .btn & {
28
+ position: relative;
29
+ top: -1px;
30
+ }
31
+ .btn-xs & {
32
+ top: 0;
33
+ padding: 1px 5px;
34
+ }
35
+
36
+ // [converter] extracted a& to a.badge
37
+
38
+ // Account for badges in navs
39
+ a.list-group-item.active > &,
40
+ .nav-pills > .active > a > & {
41
+ color: $badge-active-color;
42
+ background-color: $badge-active-bg;
43
+ }
44
+ .nav-pills > li > a > & {
45
+ margin-left: 3px;
46
+ }
47
+ }
48
+
49
+ // Hover state, but only for links
50
+ a.badge {
51
+ &:hover,
52
+ &:focus {
53
+ color: $badge-link-hover-color;
54
+ text-decoration: none;
55
+ cursor: pointer;
56
+ }
57
+ }
@@ -0,0 +1,26 @@
1
+ //
2
+ // Breadcrumbs
3
+ // --------------------------------------------------
4
+
5
+
6
+ .breadcrumb {
7
+ padding: $breadcrumb-padding-vertical $breadcrumb-padding-horizontal;
8
+ margin-bottom: $line-height-computed;
9
+ list-style: none;
10
+ background-color: $breadcrumb-bg;
11
+ border-radius: $border-radius-base;
12
+
13
+ > li {
14
+ display: inline-block;
15
+
16
+ + li:before {
17
+ content: "#{$breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space
18
+ padding: 0 5px;
19
+ color: $breadcrumb-color;
20
+ }
21
+ }
22
+
23
+ > .active {
24
+ color: $breadcrumb-active-color;
25
+ }
26
+ }
@@ -0,0 +1,240 @@
1
+ //
2
+ // Button groups
3
+ // --------------------------------------------------
4
+
5
+ // Make the div behave like a button
6
+ .btn-group,
7
+ .btn-group-vertical {
8
+ position: relative;
9
+ display: inline-block;
10
+ vertical-align: middle; // match .btn alignment given font-size hack above
11
+ > .btn {
12
+ position: relative;
13
+ float: left;
14
+ // Bring the "active" button to the front
15
+ &:hover,
16
+ &:focus,
17
+ &:active,
18
+ &.active {
19
+ z-index: 2;
20
+ }
21
+ &:focus {
22
+ // Remove focus outline when dropdown JS adds it after closing the menu
23
+ outline: 0;
24
+ }
25
+ }
26
+ }
27
+
28
+ // Prevent double borders when buttons are next to each other
29
+ .btn-group {
30
+ .btn + .btn,
31
+ .btn + .btn-group,
32
+ .btn-group + .btn,
33
+ .btn-group + .btn-group {
34
+ margin-left: -1px;
35
+ }
36
+ }
37
+
38
+ // Optional: Group multiple button groups together for a toolbar
39
+ .btn-toolbar {
40
+ margin-left: -5px; // Offset the first child's margin
41
+ @include clearfix();
42
+
43
+ .btn-group,
44
+ .input-group {
45
+ float: left;
46
+ }
47
+ > .btn,
48
+ > .btn-group,
49
+ > .input-group {
50
+ margin-left: 5px;
51
+ }
52
+ }
53
+
54
+ .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
55
+ border-radius: 0;
56
+ }
57
+
58
+ // 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
59
+ .btn-group > .btn:first-child {
60
+ margin-left: 0;
61
+ &:not(:last-child):not(.dropdown-toggle) {
62
+ @include border-right-radius(0);
63
+ }
64
+ }
65
+ // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
66
+ .btn-group > .btn:last-child:not(:first-child),
67
+ .btn-group > .dropdown-toggle:not(:first-child) {
68
+ @include border-left-radius(0);
69
+ }
70
+
71
+ // Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)
72
+ .btn-group > .btn-group {
73
+ float: left;
74
+ }
75
+ .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
76
+ border-radius: 0;
77
+ }
78
+ .btn-group > .btn-group:first-child {
79
+ > .btn:last-child,
80
+ > .dropdown-toggle {
81
+ @include border-right-radius(0);
82
+ }
83
+ }
84
+ .btn-group > .btn-group:last-child > .btn:first-child {
85
+ @include border-left-radius(0);
86
+ }
87
+
88
+ // On active and open, don't show outline
89
+ .btn-group .dropdown-toggle:active,
90
+ .btn-group.open .dropdown-toggle {
91
+ outline: 0;
92
+ }
93
+
94
+
95
+ // Sizing
96
+ //
97
+ // Remix the default button sizing classes into new ones for easier manipulation.
98
+
99
+ .btn-group-xs > .btn { @extend .btn-xs; }
100
+ .btn-group-sm > .btn { @extend .btn-sm; }
101
+ .btn-group-lg > .btn { @extend .btn-lg; }
102
+
103
+
104
+ // Split button dropdowns
105
+ // ----------------------
106
+
107
+ // Give the line between buttons some depth
108
+ .btn-group > .btn + .dropdown-toggle {
109
+ padding-left: 8px;
110
+ padding-right: 8px;
111
+ }
112
+ .btn-group > .btn-lg + .dropdown-toggle {
113
+ padding-left: 12px;
114
+ padding-right: 12px;
115
+ }
116
+
117
+ // The clickable button for toggling the menu
118
+ // Remove the gradient and set the same inset shadow as the :active state
119
+ .btn-group.open .dropdown-toggle {
120
+ @include box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
121
+
122
+ // Show no shadow for `.btn-link` since it has no other button styles.
123
+ &.btn-link {
124
+ @include box-shadow(none);
125
+ }
126
+ }
127
+
128
+
129
+ // Reposition the caret
130
+ .btn .caret {
131
+ margin-left: 0;
132
+ }
133
+ // Carets in other button sizes
134
+ .btn-lg .caret {
135
+ border-width: $caret-width-large $caret-width-large 0;
136
+ border-bottom-width: 0;
137
+ }
138
+ // Upside down carets for .dropup
139
+ .dropup .btn-lg .caret {
140
+ border-width: 0 $caret-width-large $caret-width-large;
141
+ }
142
+
143
+
144
+ // Vertical button groups
145
+ // ----------------------
146
+
147
+ .btn-group-vertical {
148
+ > .btn,
149
+ > .btn-group,
150
+ > .btn-group > .btn {
151
+ display: block;
152
+ float: none;
153
+ width: 100%;
154
+ max-width: 100%;
155
+ }
156
+
157
+ // Clear floats so dropdown menus can be properly placed
158
+ > .btn-group {
159
+ @include clearfix();
160
+ > .btn {
161
+ float: none;
162
+ }
163
+ }
164
+
165
+ > .btn + .btn,
166
+ > .btn + .btn-group,
167
+ > .btn-group + .btn,
168
+ > .btn-group + .btn-group {
169
+ margin-top: -1px;
170
+ margin-left: 0;
171
+ }
172
+ }
173
+
174
+ .btn-group-vertical > .btn {
175
+ &:not(:first-child):not(:last-child) {
176
+ border-radius: 0;
177
+ }
178
+ &:first-child:not(:last-child) {
179
+ border-top-right-radius: $border-radius-base;
180
+ @include border-bottom-radius(0);
181
+ }
182
+ &:last-child:not(:first-child) {
183
+ border-bottom-left-radius: $border-radius-base;
184
+ @include border-top-radius(0);
185
+ }
186
+ }
187
+ .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
188
+ border-radius: 0;
189
+ }
190
+ .btn-group-vertical > .btn-group:first-child:not(:last-child) {
191
+ > .btn:last-child,
192
+ > .dropdown-toggle {
193
+ @include border-bottom-radius(0);
194
+ }
195
+ }
196
+ .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
197
+ @include border-top-radius(0);
198
+ }
199
+
200
+
201
+
202
+ // Justified button groups
203
+ // ----------------------
204
+
205
+ .btn-group-justified {
206
+ display: table;
207
+ width: 100%;
208
+ table-layout: fixed;
209
+ border-collapse: separate;
210
+ > .btn,
211
+ > .btn-group {
212
+ float: none;
213
+ display: table-cell;
214
+ width: 1%;
215
+ }
216
+ > .btn-group .btn {
217
+ width: 100%;
218
+ }
219
+
220
+ > .btn-group .dropdown-menu {
221
+ left: auto;
222
+ }
223
+ }
224
+
225
+
226
+ // Checkbox and radio options
227
+ //
228
+ // In order to support the browser's form validation feedback, powered by the
229
+ // `required` attribute, we have to "hide" the inputs via `opacity`. We cannot
230
+ // use `display: none;` or `visibility: hidden;` as that also hides the popover.
231
+ // This way, we ensure a DOM element is visible to position the popover from.
232
+ //
233
+ // See https://github.com/twbs/bootstrap/pull/12794 for more.
234
+
235
+ [data-toggle="buttons"] > .btn > input[type="radio"],
236
+ [data-toggle="buttons"] > .btn > input[type="checkbox"] {
237
+ position: absolute;
238
+ z-index: -1;
239
+ @include opacity(0);
240
+ }