adhoq 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
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,48 @@
1
+ //
2
+ // Jumbotron
3
+ // --------------------------------------------------
4
+
5
+
6
+ .jumbotron {
7
+ padding: $jumbotron-padding;
8
+ margin-bottom: $jumbotron-padding;
9
+ color: $jumbotron-color;
10
+ background-color: $jumbotron-bg;
11
+
12
+ h1,
13
+ .h1 {
14
+ color: $jumbotron-heading-color;
15
+ }
16
+ p {
17
+ margin-bottom: ($jumbotron-padding / 2);
18
+ font-size: $jumbotron-font-size;
19
+ font-weight: 200;
20
+ }
21
+
22
+ > hr {
23
+ border-top-color: darken($jumbotron-bg, 10%);
24
+ }
25
+
26
+ .container & {
27
+ border-radius: $border-radius-large; // Only round corners at higher resolutions if contained in a container
28
+ }
29
+
30
+ .container {
31
+ max-width: 100%;
32
+ }
33
+
34
+ @media screen and (min-width: $screen-sm-min) {
35
+ padding-top: ($jumbotron-padding * 1.6);
36
+ padding-bottom: ($jumbotron-padding * 1.6);
37
+
38
+ .container & {
39
+ padding-left: ($jumbotron-padding * 2);
40
+ padding-right: ($jumbotron-padding * 2);
41
+ }
42
+
43
+ h1,
44
+ .h1 {
45
+ font-size: ($font-size-base * 4.5);
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,66 @@
1
+ //
2
+ // Labels
3
+ // --------------------------------------------------
4
+
5
+ .label {
6
+ display: inline;
7
+ padding: .2em .6em .3em;
8
+ font-size: 75%;
9
+ font-weight: bold;
10
+ line-height: 1;
11
+ color: $label-color;
12
+ text-align: center;
13
+ white-space: nowrap;
14
+ vertical-align: baseline;
15
+ border-radius: .25em;
16
+
17
+ // [converter] extracted a& to a.label
18
+
19
+ // Empty labels collapse automatically (not available in IE8)
20
+ &:empty {
21
+ display: none;
22
+ }
23
+
24
+ // Quick fix for labels in buttons
25
+ .btn & {
26
+ position: relative;
27
+ top: -1px;
28
+ }
29
+ }
30
+
31
+ // Add hover effects, but only for links
32
+ a.label {
33
+ &:hover,
34
+ &:focus {
35
+ color: $label-link-hover-color;
36
+ text-decoration: none;
37
+ cursor: pointer;
38
+ }
39
+ }
40
+
41
+ // Colors
42
+ // Contextual variations (linked labels get darker on :hover)
43
+
44
+ .label-default {
45
+ @include label-variant($label-default-bg);
46
+ }
47
+
48
+ .label-primary {
49
+ @include label-variant($label-primary-bg);
50
+ }
51
+
52
+ .label-success {
53
+ @include label-variant($label-success-bg);
54
+ }
55
+
56
+ .label-info {
57
+ @include label-variant($label-info-bg);
58
+ }
59
+
60
+ .label-warning {
61
+ @include label-variant($label-warning-bg);
62
+ }
63
+
64
+ .label-danger {
65
+ @include label-variant($label-danger-bg);
66
+ }
@@ -0,0 +1,131 @@
1
+ //
2
+ // List groups
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base class
7
+ //
8
+ // Easily usable on <ul>, <ol>, or <div>.
9
+
10
+ .list-group {
11
+ // No need to set list-style: none; since .list-group-item is block level
12
+ margin-bottom: 20px;
13
+ padding-left: 0; // reset padding because ul and ol
14
+ }
15
+
16
+
17
+ // Individual list items
18
+ //
19
+ // Use on `li`s or `div`s within the `.list-group` parent.
20
+
21
+ .list-group-item {
22
+ position: relative;
23
+ display: block;
24
+ padding: 10px 15px;
25
+ // Place the border on the list items and negative margin up for better styling
26
+ margin-bottom: -1px;
27
+ background-color: $list-group-bg;
28
+ border: 1px solid $list-group-border;
29
+
30
+ // Round the first and last items
31
+ &:first-child {
32
+ @include border-top-radius($list-group-border-radius);
33
+ }
34
+ &:last-child {
35
+ margin-bottom: 0;
36
+ @include border-bottom-radius($list-group-border-radius);
37
+ }
38
+
39
+ // Align badges within list items
40
+ > .badge {
41
+ float: right;
42
+ }
43
+ > .badge + .badge {
44
+ margin-right: 5px;
45
+ }
46
+ }
47
+
48
+
49
+ // Linked list items
50
+ //
51
+ // Use anchor elements instead of `li`s or `div`s to create linked list items.
52
+ // Includes an extra `.active` modifier class for showing selected items.
53
+
54
+ a.list-group-item {
55
+ color: $list-group-link-color;
56
+
57
+ .list-group-item-heading {
58
+ color: $list-group-link-heading-color;
59
+ }
60
+
61
+ // Hover state
62
+ &:hover,
63
+ &:focus {
64
+ text-decoration: none;
65
+ color: $list-group-link-hover-color;
66
+ background-color: $list-group-hover-bg;
67
+ }
68
+ }
69
+
70
+ .list-group-item {
71
+ // Disabled state
72
+ &.disabled,
73
+ &.disabled:hover,
74
+ &.disabled:focus {
75
+ background-color: $list-group-disabled-bg;
76
+ color: $list-group-disabled-color;
77
+
78
+ // Force color to inherit for custom content
79
+ .list-group-item-heading {
80
+ color: inherit;
81
+ }
82
+ .list-group-item-text {
83
+ color: $list-group-disabled-text-color;
84
+ }
85
+ }
86
+
87
+ // Active class on item itself, not parent
88
+ &.active,
89
+ &.active:hover,
90
+ &.active:focus {
91
+ z-index: 2; // Place active items above their siblings for proper border styling
92
+ color: $list-group-active-color;
93
+ background-color: $list-group-active-bg;
94
+ border-color: $list-group-active-border;
95
+
96
+ // Force color to inherit for custom content
97
+ .list-group-item-heading,
98
+ .list-group-item-heading > small,
99
+ .list-group-item-heading > .small {
100
+ color: inherit;
101
+ }
102
+ .list-group-item-text {
103
+ color: $list-group-active-text-color;
104
+ }
105
+ }
106
+ }
107
+
108
+
109
+ // Contextual variants
110
+ //
111
+ // Add modifier classes to change text and background color on individual items.
112
+ // Organizationally, this must come after the `:hover` states.
113
+
114
+ @include list-group-item-variant(success, $state-success-bg, $state-success-text);
115
+ @include list-group-item-variant(info, $state-info-bg, $state-info-text);
116
+ @include list-group-item-variant(warning, $state-warning-bg, $state-warning-text);
117
+ @include list-group-item-variant(danger, $state-danger-bg, $state-danger-text);
118
+
119
+
120
+ // Custom content options
121
+ //
122
+ // Extra classes for creating well-formatted content within `.list-group-item`s.
123
+
124
+ .list-group-item-heading {
125
+ margin-top: 0;
126
+ margin-bottom: 5px;
127
+ }
128
+ .list-group-item-text {
129
+ margin-bottom: 0;
130
+ line-height: 1.3;
131
+ }
@@ -0,0 +1,56 @@
1
+ // Media objects
2
+ // Source: http://stubbornella.org/content/?p=497
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Common styles
7
+ // -------------------------
8
+
9
+ // Clear the floats
10
+ .media,
11
+ .media-body {
12
+ overflow: hidden;
13
+ zoom: 1;
14
+ }
15
+
16
+ // Proper spacing between instances of .media
17
+ .media,
18
+ .media .media {
19
+ margin-top: 15px;
20
+ }
21
+ .media:first-child {
22
+ margin-top: 0;
23
+ }
24
+
25
+ // For images and videos, set to block
26
+ .media-object {
27
+ display: block;
28
+ }
29
+
30
+ // Reset margins on headings for tighter default spacing
31
+ .media-heading {
32
+ margin: 0 0 5px;
33
+ }
34
+
35
+
36
+ // Media image alignment
37
+ // -------------------------
38
+
39
+ .media {
40
+ > .pull-left {
41
+ margin-right: 10px;
42
+ }
43
+ > .pull-right {
44
+ margin-left: 10px;
45
+ }
46
+ }
47
+
48
+
49
+ // Media list variation
50
+ // -------------------------
51
+
52
+ // Undo default ul/ol styles
53
+ .media-list {
54
+ padding-left: 0;
55
+ list-style: none;
56
+ }
@@ -0,0 +1,39 @@
1
+ // Mixins
2
+ // --------------------------------------------------
3
+
4
+ // Utilities
5
+ @import "mixins/hide-text";
6
+ @import "mixins/opacity";
7
+ @import "mixins/image";
8
+ @import "mixins/labels";
9
+ @import "mixins/reset-filter";
10
+ @import "mixins/resize";
11
+ @import "mixins/responsive-visibility";
12
+ @import "mixins/size";
13
+ @import "mixins/tab-focus";
14
+ @import "mixins/text-emphasis";
15
+ @import "mixins/text-overflow";
16
+ @import "mixins/vendor-prefixes";
17
+
18
+ // Components
19
+ @import "mixins/alerts";
20
+ @import "mixins/buttons";
21
+ @import "mixins/panels";
22
+ @import "mixins/pagination";
23
+ @import "mixins/list-group";
24
+ @import "mixins/nav-divider";
25
+ @import "mixins/forms";
26
+ @import "mixins/progress-bar";
27
+ @import "mixins/table-row";
28
+
29
+ // Skins
30
+ @import "mixins/background-variant";
31
+ @import "mixins/border-radius";
32
+ @import "mixins/gradients";
33
+
34
+ // Layout
35
+ @import "mixins/clearfix";
36
+ @import "mixins/center-block";
37
+ @import "mixins/nav-vertical-align";
38
+ @import "mixins/grid-framework";
39
+ @import "mixins/grid";
@@ -0,0 +1,150 @@
1
+ //
2
+ // Modals
3
+ // --------------------------------------------------
4
+
5
+ // .modal-open - body class for killing the scroll
6
+ // .modal - container to scroll within
7
+ // .modal-dialog - positioning shell for the actual modal
8
+ // .modal-content - actual modal w/ bg and corners and shit
9
+
10
+ // Kill the scroll on the body
11
+ .modal-open {
12
+ overflow: hidden;
13
+ }
14
+
15
+ // Container that the modal scrolls within
16
+ .modal {
17
+ display: none;
18
+ overflow: hidden;
19
+ position: fixed;
20
+ top: 0;
21
+ right: 0;
22
+ bottom: 0;
23
+ left: 0;
24
+ z-index: $zindex-modal;
25
+ -webkit-overflow-scrolling: touch;
26
+
27
+ // Prevent Chrome on Windows from adding a focus outline. For details, see
28
+ // https://github.com/twbs/bootstrap/pull/10951.
29
+ outline: 0;
30
+
31
+ // When fading in the modal, animate it to slide down
32
+ &.fade .modal-dialog {
33
+ @include translate3d(0, -25%, 0);
34
+ @include transition-transform(0.3s ease-out);
35
+ }
36
+ &.in .modal-dialog { @include translate3d(0, 0, 0) }
37
+ }
38
+ .modal-open .modal {
39
+ overflow-x: hidden;
40
+ overflow-y: auto;
41
+ }
42
+
43
+ // Shell div to position the modal with bottom padding
44
+ .modal-dialog {
45
+ position: relative;
46
+ width: auto;
47
+ margin: 10px;
48
+ }
49
+
50
+ // Actual modal
51
+ .modal-content {
52
+ position: relative;
53
+ background-color: $modal-content-bg;
54
+ border: 1px solid $modal-content-fallback-border-color; //old browsers fallback (ie8 etc)
55
+ border: 1px solid $modal-content-border-color;
56
+ border-radius: $border-radius-large;
57
+ @include box-shadow(0 3px 9px rgba(0,0,0,.5));
58
+ background-clip: padding-box;
59
+ // Remove focus outline from opened modal
60
+ outline: 0;
61
+ }
62
+
63
+ // Modal background
64
+ .modal-backdrop {
65
+ position: fixed;
66
+ top: 0;
67
+ right: 0;
68
+ bottom: 0;
69
+ left: 0;
70
+ z-index: $zindex-modal-background;
71
+ background-color: $modal-backdrop-bg;
72
+ // Fade for backdrop
73
+ &.fade { @include opacity(0); }
74
+ &.in { @include opacity($modal-backdrop-opacity); }
75
+ }
76
+
77
+ // Modal header
78
+ // Top section of the modal w/ title and dismiss
79
+ .modal-header {
80
+ padding: $modal-title-padding;
81
+ border-bottom: 1px solid $modal-header-border-color;
82
+ min-height: ($modal-title-padding + $modal-title-line-height);
83
+ }
84
+ // Close icon
85
+ .modal-header .close {
86
+ margin-top: -2px;
87
+ }
88
+
89
+ // Title text within header
90
+ .modal-title {
91
+ margin: 0;
92
+ line-height: $modal-title-line-height;
93
+ }
94
+
95
+ // Modal body
96
+ // Where all modal content resides (sibling of .modal-header and .modal-footer)
97
+ .modal-body {
98
+ position: relative;
99
+ padding: $modal-inner-padding;
100
+ }
101
+
102
+ // Footer (for actions)
103
+ .modal-footer {
104
+ padding: $modal-inner-padding;
105
+ text-align: right; // right align buttons
106
+ border-top: 1px solid $modal-footer-border-color;
107
+ @include clearfix(); // clear it in case folks use .pull-* classes on buttons
108
+
109
+ // Properly space out buttons
110
+ .btn + .btn {
111
+ margin-left: 5px;
112
+ margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
113
+ }
114
+ // but override that for button groups
115
+ .btn-group .btn + .btn {
116
+ margin-left: -1px;
117
+ }
118
+ // and override it for block buttons as well
119
+ .btn-block + .btn-block {
120
+ margin-left: 0;
121
+ }
122
+ }
123
+
124
+ // Measure scrollbar width for padding body during modal show/hide
125
+ .modal-scrollbar-measure {
126
+ position: absolute;
127
+ top: -9999px;
128
+ width: 50px;
129
+ height: 50px;
130
+ overflow: scroll;
131
+ }
132
+
133
+ // Scale up the modal
134
+ @media (min-width: $screen-sm-min) {
135
+ // Automatically set modal's width for larger viewports
136
+ .modal-dialog {
137
+ width: $modal-md;
138
+ margin: 30px auto;
139
+ }
140
+ .modal-content {
141
+ @include box-shadow(0 5px 15px rgba(0,0,0,.5));
142
+ }
143
+
144
+ // Modal sizes
145
+ .modal-sm { width: $modal-sm; }
146
+ }
147
+
148
+ @media (min-width: $screen-md-min) {
149
+ .modal-lg { width: $modal-lg; }
150
+ }