flipper-ui 0.2.0.beta2 → 0.2.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +12 -11
  3. data/README.md +5 -7
  4. data/examples/basic.ru +27 -26
  5. data/flipper-ui.gemspec +5 -3
  6. data/lib/flipper-ui.rb +1 -0
  7. data/lib/flipper/ui.rb +11 -2
  8. data/lib/flipper/ui/action.rb +45 -4
  9. data/lib/flipper/ui/actions/actors_gate.rb +48 -0
  10. data/lib/flipper/ui/actions/add_feature.rb +20 -0
  11. data/lib/flipper/ui/actions/boolean_gate.rb +26 -0
  12. data/lib/flipper/ui/actions/feature.rb +32 -0
  13. data/lib/flipper/ui/actions/features.rb +23 -3
  14. data/lib/flipper/ui/actions/file.rb +1 -1
  15. data/lib/flipper/ui/actions/gate.rb +11 -117
  16. data/lib/flipper/ui/actions/groups_gate.rb +43 -0
  17. data/lib/flipper/ui/actions/{index.rb → home.rb} +3 -3
  18. data/lib/flipper/ui/actions/percentage_of_actors_gate.rb +27 -0
  19. data/lib/flipper/ui/actions/percentage_of_time_gate.rb +27 -0
  20. data/lib/flipper/ui/actor.rb +13 -0
  21. data/lib/flipper/ui/assets/javascripts/application.coffee +0 -305
  22. data/lib/flipper/ui/assets/stylesheets/_bootstrap-compass.scss +9 -0
  23. data/lib/flipper/ui/assets/stylesheets/_bootstrap-mincer.scss +19 -0
  24. data/lib/flipper/ui/assets/stylesheets/_bootstrap-sprockets.scss +9 -0
  25. data/lib/flipper/ui/assets/stylesheets/_bootstrap.scss +50 -0
  26. data/lib/flipper/ui/assets/stylesheets/application.scss +33 -216
  27. data/lib/flipper/ui/assets/stylesheets/bootstrap/_alerts.scss +73 -0
  28. data/lib/flipper/ui/assets/stylesheets/bootstrap/_badges.scss +68 -0
  29. data/lib/flipper/ui/assets/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
  30. data/lib/flipper/ui/assets/stylesheets/bootstrap/_button-groups.scss +243 -0
  31. data/lib/flipper/ui/assets/stylesheets/bootstrap/_buttons.scss +160 -0
  32. data/lib/flipper/ui/assets/stylesheets/bootstrap/_carousel.scss +269 -0
  33. data/lib/flipper/ui/assets/stylesheets/bootstrap/_close.scss +36 -0
  34. data/lib/flipper/ui/assets/stylesheets/bootstrap/_code.scss +69 -0
  35. data/lib/flipper/ui/assets/stylesheets/bootstrap/_component-animations.scss +37 -0
  36. data/lib/flipper/ui/assets/stylesheets/bootstrap/_dropdowns.scss +214 -0
  37. data/lib/flipper/ui/assets/stylesheets/bootstrap/_forms.scss +578 -0
  38. data/lib/flipper/ui/assets/stylesheets/bootstrap/_glyphicons.scss +305 -0
  39. data/lib/flipper/ui/assets/stylesheets/bootstrap/_grid.scss +84 -0
  40. data/lib/flipper/ui/assets/stylesheets/bootstrap/_input-groups.scss +166 -0
  41. data/lib/flipper/ui/assets/stylesheets/bootstrap/_jumbotron.scss +50 -0
  42. data/lib/flipper/ui/assets/stylesheets/bootstrap/_labels.scss +66 -0
  43. data/lib/flipper/ui/assets/stylesheets/bootstrap/_list-group.scss +124 -0
  44. data/lib/flipper/ui/assets/stylesheets/bootstrap/_media.scss +61 -0
  45. data/lib/flipper/ui/assets/stylesheets/bootstrap/_mixins.scss +39 -0
  46. data/lib/flipper/ui/assets/stylesheets/bootstrap/_modals.scss +150 -0
  47. data/lib/flipper/ui/assets/stylesheets/bootstrap/_navbar.scss +662 -0
  48. data/lib/flipper/ui/assets/stylesheets/bootstrap/_navs.scss +242 -0
  49. data/lib/flipper/ui/assets/stylesheets/bootstrap/_normalize.scss +427 -0
  50. data/lib/flipper/ui/assets/stylesheets/bootstrap/_pager.scss +54 -0
  51. data/lib/flipper/ui/assets/stylesheets/bootstrap/_pagination.scss +88 -0
  52. data/lib/flipper/ui/assets/stylesheets/bootstrap/_panels.scss +265 -0
  53. data/lib/flipper/ui/assets/stylesheets/bootstrap/_popovers.scss +135 -0
  54. data/lib/flipper/ui/assets/stylesheets/bootstrap/_print.scss +107 -0
  55. data/lib/flipper/ui/assets/stylesheets/bootstrap/_progress-bars.scss +87 -0
  56. data/lib/flipper/ui/assets/stylesheets/bootstrap/_responsive-embed.scss +35 -0
  57. data/lib/flipper/ui/assets/stylesheets/bootstrap/_responsive-utilities.scss +177 -0
  58. data/lib/flipper/ui/assets/stylesheets/bootstrap/_scaffolding.scss +162 -0
  59. data/lib/flipper/ui/assets/stylesheets/bootstrap/_tables.scss +234 -0
  60. data/lib/flipper/ui/assets/stylesheets/bootstrap/_theme.scss +273 -0
  61. data/lib/flipper/ui/assets/stylesheets/bootstrap/_thumbnails.scss +38 -0
  62. data/lib/flipper/ui/assets/stylesheets/bootstrap/_tooltip.scss +102 -0
  63. data/lib/flipper/ui/assets/stylesheets/bootstrap/_type.scss +298 -0
  64. data/lib/flipper/ui/assets/stylesheets/bootstrap/_utilities.scss +55 -0
  65. data/lib/flipper/ui/assets/stylesheets/bootstrap/_variables.scss +866 -0
  66. data/lib/flipper/ui/assets/stylesheets/bootstrap/_wells.scss +29 -0
  67. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_alerts.scss +14 -0
  68. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_background-variant.scss +11 -0
  69. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_border-radius.scss +18 -0
  70. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_buttons.scss +52 -0
  71. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_center-block.scss +7 -0
  72. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_clearfix.scss +22 -0
  73. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_forms.scss +88 -0
  74. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_gradients.scss +58 -0
  75. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +81 -0
  76. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_grid.scss +122 -0
  77. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_hide-text.scss +21 -0
  78. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_image.scss +33 -0
  79. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_labels.scss +12 -0
  80. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_list-group.scss +31 -0
  81. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +10 -0
  82. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss +9 -0
  83. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_opacity.scss +8 -0
  84. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_pagination.scss +23 -0
  85. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_panels.scss +24 -0
  86. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_progress-bar.scss +10 -0
  87. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_reset-filter.scss +8 -0
  88. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_resize.scss +6 -0
  89. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss +21 -0
  90. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_size.scss +10 -0
  91. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_tab-focus.scss +9 -0
  92. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_table-row.scss +28 -0
  93. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +11 -0
  94. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_text-overflow.scss +8 -0
  95. data/lib/flipper/ui/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +222 -0
  96. data/lib/flipper/ui/assets/stylesheets/primer/.scss-lint.yml +446 -0
  97. data/lib/flipper/ui/assets/stylesheets/primer/_alerts.scss +106 -0
  98. data/lib/flipper/ui/assets/stylesheets/primer/_avatars.scss +36 -0
  99. data/lib/flipper/ui/assets/stylesheets/primer/_base.scss +40 -0
  100. data/lib/flipper/ui/assets/stylesheets/primer/_blankslate.scss +96 -0
  101. data/lib/flipper/ui/assets/stylesheets/primer/_buttons.scss +404 -0
  102. data/lib/flipper/ui/assets/stylesheets/primer/_counter.scss +10 -0
  103. data/lib/flipper/ui/assets/stylesheets/primer/_filter-list.scss +68 -0
  104. data/lib/flipper/ui/assets/stylesheets/primer/_flex-table.scss +20 -0
  105. data/lib/flipper/ui/assets/stylesheets/primer/_forms.scss +756 -0
  106. data/lib/flipper/ui/assets/stylesheets/primer/_layout.scss +69 -0
  107. data/lib/flipper/ui/assets/stylesheets/primer/_menu.scss +113 -0
  108. data/lib/flipper/ui/assets/stylesheets/primer/_mixins.scss +53 -0
  109. data/lib/flipper/ui/assets/stylesheets/primer/_normalize.scss +425 -0
  110. data/lib/flipper/ui/assets/stylesheets/primer/_states.scss +32 -0
  111. data/lib/flipper/ui/assets/stylesheets/primer/_tabnav.scss +65 -0
  112. data/lib/flipper/ui/assets/stylesheets/primer/_tooltips.scss +255 -0
  113. data/lib/flipper/ui/assets/stylesheets/primer/_truncate.scss +27 -0
  114. data/lib/flipper/ui/assets/stylesheets/primer/_type.scss +92 -0
  115. data/lib/flipper/ui/assets/stylesheets/primer/_utility.scss +73 -0
  116. data/lib/flipper/ui/assets/stylesheets/primer/_variables.scss +34 -0
  117. data/lib/flipper/ui/assets/stylesheets/primer/primer.scss +39 -0
  118. data/lib/flipper/ui/decorators/feature.rb +37 -4
  119. data/lib/flipper/ui/middleware.rb +12 -3
  120. data/lib/flipper/ui/public/css/application.css +2563 -144
  121. data/lib/flipper/ui/public/css/primer.css +1 -0
  122. data/lib/flipper/ui/public/css/primer/primer.css +1933 -0
  123. data/lib/flipper/ui/public/css/scss/primer.css +1933 -0
  124. data/lib/flipper/ui/public/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  125. data/lib/flipper/ui/public/fonts/bootstrap/glyphicons-halflings-regular.svg +288 -0
  126. data/lib/flipper/ui/public/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  127. data/lib/flipper/ui/public/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  128. data/lib/flipper/ui/public/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  129. data/lib/flipper/ui/public/js/application.js +0 -539
  130. data/lib/flipper/ui/public/js/bootstrap-sprockets.js +12 -0
  131. data/lib/flipper/ui/public/js/bootstrap.js +2317 -0
  132. data/lib/flipper/ui/public/js/bootstrap.min.js +7 -0
  133. data/lib/flipper/ui/public/js/bootstrap/affix.js +162 -0
  134. data/lib/flipper/ui/public/js/bootstrap/alert.js +94 -0
  135. data/lib/flipper/ui/public/js/bootstrap/button.js +116 -0
  136. data/lib/flipper/ui/public/js/bootstrap/carousel.js +237 -0
  137. data/lib/flipper/ui/public/js/bootstrap/collapse.js +211 -0
  138. data/lib/flipper/ui/public/js/bootstrap/dropdown.js +161 -0
  139. data/lib/flipper/ui/public/js/bootstrap/modal.js +339 -0
  140. data/lib/flipper/ui/public/js/bootstrap/popover.js +108 -0
  141. data/lib/flipper/ui/public/js/bootstrap/scrollspy.js +172 -0
  142. data/lib/flipper/ui/public/js/bootstrap/tab.js +153 -0
  143. data/lib/flipper/ui/public/js/bootstrap/tooltip.js +476 -0
  144. data/lib/flipper/ui/public/js/bootstrap/transition.js +59 -0
  145. data/lib/flipper/ui/public/octicons/LICENSE.txt +9 -0
  146. data/lib/flipper/ui/public/octicons/README.md +1 -0
  147. data/lib/flipper/ui/public/octicons/octicons-local.ttf +0 -0
  148. data/lib/flipper/ui/public/octicons/octicons.css +236 -0
  149. data/lib/flipper/ui/public/octicons/octicons.eot +0 -0
  150. data/lib/flipper/ui/public/octicons/octicons.less +235 -0
  151. data/lib/flipper/ui/public/octicons/octicons.svg +200 -0
  152. data/lib/flipper/ui/public/octicons/octicons.ttf +0 -0
  153. data/lib/flipper/ui/public/octicons/octicons.woff +0 -0
  154. data/lib/flipper/ui/public/octicons/sprockets-octicons.scss +232 -0
  155. data/lib/flipper/ui/util.rb +4 -0
  156. data/lib/flipper/ui/version.rb +1 -1
  157. data/lib/flipper/ui/views/add_actor.erb +22 -0
  158. data/lib/flipper/ui/views/add_feature.erb +18 -0
  159. data/lib/flipper/ui/views/add_group.erb +31 -0
  160. data/lib/flipper/ui/views/feature.erb +209 -0
  161. data/lib/flipper/ui/views/features.erb +46 -0
  162. data/lib/flipper/ui/views/layout.erb +31 -149
  163. data/script/release +15 -0
  164. data/spec/flipper/ui/actions/actors_gate_spec.rb +68 -0
  165. data/spec/flipper/ui/actions/add_feature_spec.rb +17 -0
  166. data/spec/flipper/ui/actions/boolean_gate_spec.rb +41 -0
  167. data/spec/flipper/ui/actions/feature_spec.rb +59 -0
  168. data/spec/flipper/ui/actions/features_spec.rb +37 -0
  169. data/spec/flipper/ui/actions/file_spec.rb +43 -0
  170. data/spec/flipper/ui/actions/gate_spec.rb +24 -0
  171. data/spec/flipper/ui/actions/groups_gate_spec.rb +80 -0
  172. data/spec/flipper/ui/actions/home_spec.rb +16 -0
  173. data/spec/flipper/ui/actions/percentage_of_actors_gate_spec.rb +40 -0
  174. data/spec/flipper/ui/actions/percentage_of_time_gate_spec.rb +39 -0
  175. data/spec/flipper/ui/decorators/feature_spec.rb +38 -1
  176. data/spec/flipper/ui/decorators/gate_spec.rb +1 -1
  177. data/spec/flipper/ui_spec.rb +18 -441
  178. data/spec/helper.rb +22 -7
  179. metadata +199 -52
  180. data/examples/flipper.html +0 -14
  181. data/examples/flipper.png +0 -0
  182. data/lib/flipper/ui/assets/javascripts/spine/ajax.coffee +0 -223
  183. data/lib/flipper/ui/assets/javascripts/spine/list.coffee +0 -43
  184. data/lib/flipper/ui/assets/javascripts/spine/local.coffee +0 -16
  185. data/lib/flipper/ui/assets/javascripts/spine/manager.coffee +0 -83
  186. data/lib/flipper/ui/assets/javascripts/spine/relation.coffee +0 -148
  187. data/lib/flipper/ui/assets/javascripts/spine/route.coffee +0 -146
  188. data/lib/flipper/ui/assets/javascripts/spine/spine.coffee +0 -542
  189. data/lib/flipper/ui/assets/javascripts/spine/version +0 -1
  190. data/lib/flipper/ui/public/css/images/animated-overlay.gif +0 -0
  191. data/lib/flipper/ui/public/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  192. data/lib/flipper/ui/public/css/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  193. data/lib/flipper/ui/public/css/images/ui-bg_flat_10_000000_40x100.png +0 -0
  194. data/lib/flipper/ui/public/css/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  195. data/lib/flipper/ui/public/css/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  196. data/lib/flipper/ui/public/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  197. data/lib/flipper/ui/public/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  198. data/lib/flipper/ui/public/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  199. data/lib/flipper/ui/public/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  200. data/lib/flipper/ui/public/css/images/ui-icons_222222_256x240.png +0 -0
  201. data/lib/flipper/ui/public/css/images/ui-icons_228ef1_256x240.png +0 -0
  202. data/lib/flipper/ui/public/css/images/ui-icons_ef8c08_256x240.png +0 -0
  203. data/lib/flipper/ui/public/css/images/ui-icons_ffd27a_256x240.png +0 -0
  204. data/lib/flipper/ui/public/css/images/ui-icons_ffffff_256x240.png +0 -0
  205. data/lib/flipper/ui/public/css/jquery-ui-1.10.3.slider.min.css +0 -5
  206. data/lib/flipper/ui/public/js/handlebars.js +0 -1992
  207. data/lib/flipper/ui/public/js/jquery-ui-1.10.3.slider.min.js +0 -6
  208. data/lib/flipper/ui/public/js/jquery.js +0 -9555
  209. data/lib/flipper/ui/public/js/jquery.min.js +0 -4
  210. data/lib/flipper/ui/public/js/jquery.min.map +0 -1
  211. data/lib/flipper/ui/public/js/spine/ajax.js +0 -320
  212. data/lib/flipper/ui/public/js/spine/list.js +0 -72
  213. data/lib/flipper/ui/public/js/spine/local.js +0 -29
  214. data/lib/flipper/ui/public/js/spine/manager.js +0 -157
  215. data/lib/flipper/ui/public/js/spine/relation.js +0 -260
  216. data/lib/flipper/ui/public/js/spine/route.js +0 -223
  217. data/lib/flipper/ui/public/js/spine/spine.js +0 -927
  218. data/lib/flipper/ui/views/index.erb +0 -9
@@ -0,0 +1,22 @@
1
+ <% if params.key?("error") %>
2
+ <div class="flash flash-error">
3
+ <%= params["error"] %>
4
+ </div>
5
+ <% end %>
6
+
7
+ <div class="panel panel-default">
8
+ <div class="panel-heading">
9
+ <h3 class="panel-title">Enable Actor for <%= @feature.key %></h3>
10
+ </div>
11
+ <div class="panel-body">
12
+ <p>
13
+ Turn on this feature for an individual actor.
14
+ </p>
15
+ <form action="<%= script_name %>/features/<%= @feature.key %>/actors" method="post">
16
+ <%== csrf_input_tag %>
17
+ <input type="hidden" name="operation" value="enable">
18
+ <input type="text" name="value" placeholder="ie: User:6">
19
+ <input type="submit" value="Add Actor" class="btn">
20
+ </form>
21
+ </div>
22
+ </div>
@@ -0,0 +1,18 @@
1
+ <% if params.key?("error") %>
2
+ <div class="flash flash-error">
3
+ <%= params["error"] %>
4
+ </div>
5
+ <% end %>
6
+
7
+ <div class="panel panel-default">
8
+ <div class="panel-heading">
9
+ <h3 class="panel-title">Add Feature</h3>
10
+ </div>
11
+ <div class="panel-body">
12
+ <form action="<%= script_name %>/features" method="post">
13
+ <%== csrf_input_tag %>
14
+ <input type="text" name="value" placeholder="ie: admins, orgs_next, etc.">
15
+ <input type="submit" value="Add Feature" class="btn">
16
+ </form>
17
+ </div>
18
+ </div>
@@ -0,0 +1,31 @@
1
+ <% if params.key?("error") %>
2
+ <div class="flash flash-error">
3
+ <%= params["error"] %>
4
+ </div>
5
+ <% end %>
6
+
7
+ <div class="panel panel-default">
8
+ <div class="panel-heading">
9
+ <h3 class="panel-title">Enable Group for <%= @feature.key %></h3>
10
+ </div>
11
+ <div class="panel-body">
12
+ <% if @feature.disabled_groups.empty? %>
13
+ <p>All groups are enabled for this feature which means there is nothing to add.</p>
14
+ <% else %>
15
+ <p>
16
+ Turn on this feature for an entire group of actors.
17
+ </p>
18
+ <form action="<%= script_name %>/features/<%= @feature.key %>/groups" method="post">
19
+ <%== csrf_input_tag %>
20
+ <input type="hidden" name="operation" value="enable">
21
+ <select name="value">
22
+ <option value="">Select a group...</option>
23
+ <% @feature.disabled_groups.each do |group| %>
24
+ <option value="<%= group.name %>"><%= group.name %></option>
25
+ <% end %>
26
+ </select>
27
+ <input type="submit" value="Add Group" class="btn">
28
+ </form>
29
+ <% end %>
30
+ </div>
31
+ </div>
@@ -0,0 +1,209 @@
1
+ <% if params.key?("error") %>
2
+ <div class="flash flash-error">
3
+ <%= params["error"] %>
4
+ </div>
5
+ <% end %>
6
+
7
+ <div class="panel panel-default">
8
+ <div class="panel-heading">
9
+ <h3 class="panel-title">
10
+ <span class="octicon octicon-squirrel <%= @feature.color_class %>"></span>
11
+ <%= @feature.key %>
12
+ </h3>
13
+ </div>
14
+ <div class="panel-body">
15
+ <p>
16
+ <% if @feature.on? %>
17
+ The feature is enabled for <strong>everyone</strong>. Disable this feature with one click.
18
+ <% else %>
19
+ Enable or disable this feature for <strong>everyone</strong> with one click.
20
+ <% end %>
21
+ </p>
22
+
23
+ <form action="<%= script_name %>/features/<%= @feature.key %>/boolean" method="post">
24
+ <%== csrf_input_tag %>
25
+
26
+ <% unless @feature.on? %>
27
+ <button type="submit" name="action" value="Enable" class="btn btn-danger tooltipped tooltipped-n" aria-label="Enable for everyone">Enable</button>
28
+ <% end %>
29
+
30
+ <button type="submit" name="action" value="Disable" class="btn tooltipped tooltipped-n" <% if @feature.off? %>disabled aria-label="Already disabled for everyone"<% else %>aria-label="Disable for everyone by clearing all percentages, groups and actors."<% end %>>Disable</button>
31
+ </form>
32
+ </div>
33
+ </div>
34
+
35
+ <% unless @feature.on? %>
36
+ <div class="container">
37
+ <div class="columns">
38
+ <div class="column one-half">
39
+ <div class="panel panel-default">
40
+ <div class="panel-heading">
41
+ <h3 class="panel-title">Percentage of Actors</h3>
42
+ </div>
43
+ <div class="panel-body">
44
+ <form action="<%= script_name %>/features/<%= @feature.key %>/percentage_of_actors" method="post">
45
+ <%== csrf_input_tag %>
46
+ <div class="btn-group">
47
+ <% @percentages.each do |number| %>
48
+ <input type="submit" name="value" value="<%= number %>%" class="btn" <% if number == @feature.percentage_of_actors_value %>disabled<% end %>>
49
+ <% end %>
50
+ </div>
51
+ </form>
52
+
53
+ <h4>- or -</h4>
54
+
55
+ <form action="<%= script_name %>/features/<%= @feature.key %>/percentage_of_actors" method="post">
56
+ <%== csrf_input_tag %>
57
+ <input type="text" name="value" <% if @feature.percentage_of_actors_value > 0 %>value="<%= @feature.percentage_of_actors_value %>"<% end %> placeholder="custom (ie: 26, 32, etc.)" class="input-mini">
58
+ <input type="submit" name="action" value="Enable" class="btn btn-sm">
59
+ </form>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ <div class="column one-half">
64
+ <div class="panel panel-default">
65
+ <div class="panel-heading">
66
+ <h3 class="panel-title">Percentage of Time</h3>
67
+ </div>
68
+ <div class="panel-body">
69
+ <form action="<%= script_name %>/features/<%= @feature.key %>/percentage_of_time" method="post">
70
+ <%== csrf_input_tag %>
71
+ <div class="btn-group">
72
+ <% @percentages.each do |number| %>
73
+ <input type="submit" name="value" value="<%= number %>%" class="btn" <% if number == @feature.percentage_of_time_value %>disabled<% end %>>
74
+ <% end %>
75
+ </div>
76
+ </form>
77
+
78
+ <h4>- or -</h4>
79
+
80
+ <form action="<%= script_name %>/features/<%= @feature.key %>/percentage_of_time" method="post">
81
+ <%== csrf_input_tag %>
82
+ <input type="text" name="value" <% if @feature.percentage_of_time_value > 0 %>value="<%= @feature.percentage_of_time_value %>"<% end %> placeholder="custom (ie: 26, 32, etc.)" class="input-mini">
83
+ <input type="submit" name="action" value="Enable" class="btn btn-sm">
84
+ </form>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </div>
89
+ </div>
90
+
91
+ <div class="container">
92
+ <div class="columns">
93
+ <div class="column one-half">
94
+ <div class="panel panel-default">
95
+ <div class="panel-heading">
96
+ <% if @feature.disabled_groups.empty? %>
97
+ <p class="right">All groups enabled.</p>
98
+ <% else %>
99
+ <form action="<%= script_name %>/features/<%= @feature.key %>/groups" method="post" class="right">
100
+ <%== csrf_input_tag %>
101
+ <input type="hidden" name="operation" value="enable">
102
+ <select name="value">
103
+ <option value="">Select a group...</option>
104
+ <% @feature.disabled_groups.each do |group| %>
105
+ <option value="<%= group.name %>"><%= group.name %></option>
106
+ <% end %>
107
+ </select>
108
+ <input type="submit" value="Add Group" class="btn btn-sm">
109
+ </form>
110
+ <% end %>
111
+ <h3 class="panel-title">Groups</h3>
112
+ </div>
113
+ <% if @feature.groups_value.empty? %>
114
+ <div class="blankslate">
115
+ <span class="mega-octicon octicon-organization"></span>
116
+ <span class="mega-octicon octicon-squirrel"></span>
117
+ <span class="mega-octicon octicon-zap"></span>
118
+ <h3>No Enabled Groups</h3>
119
+ <p>Enable groups using the form above.</p>
120
+ </div>
121
+ <% else %>
122
+ <ul class="list-group">
123
+ <% @feature.groups_value.each do |item| %>
124
+ <li class="list-group-item">
125
+ <div class="flex-table">
126
+ <div class="flex-table-item flex-table-item-primary">
127
+ <%= item %>
128
+ </div>
129
+ <div class="flex-table-item">
130
+ <form action="<%= script_name %>/features/<%= @feature.key %>/groups" method="post">
131
+ <%== csrf_input_tag %>
132
+ <input type="hidden" name="operation" value="disable">
133
+ <input type="hidden" name="value" value="<%= item %>">
134
+ <button type="submit" value="Disable" class="button-inv danger tooltipped tooltipped-w" aria-label="Disable <%= item %>">
135
+ <span class="octicon octicon-trashcan"></span>
136
+ </button>
137
+ </form>
138
+ </div>
139
+ </div>
140
+ </li>
141
+ <% end %>
142
+ </ul>
143
+ <% end %>
144
+ </div>
145
+ </div>
146
+ <div class="column one-half">
147
+ <div class="panel panel-default">
148
+ <div class="panel-heading">
149
+ <form action="<%= script_name %>/features/<%= @feature.key %>/actors" method="post" class="right">
150
+ <%== csrf_input_tag %>
151
+ <input type="hidden" name="operation" value="enable">
152
+ <input type="text" name="value" placeholder="ie: User:6" class="input-mini">
153
+ <input type="submit" value="Add Actor" class="btn btn-sm">
154
+ </form>
155
+ <h3 class="panel-title">Actors</h3>
156
+ </div>
157
+ <% if @feature.actors_value.empty? %>
158
+ <div class="blankslate">
159
+ <span class="mega-octicon octicon-person"></span>
160
+ <span class="mega-octicon octicon-squirrel"></span>
161
+ <span class="mega-octicon octicon-zap"></span>
162
+ <h3>No Enabled Actors</h3>
163
+ <p>Enable actors using the form above.</p>
164
+ </div>
165
+ <% else %>
166
+ <ul class="list-group">
167
+ <% @feature.actors_value.each do |item| %>
168
+ <li class="list-group-item">
169
+ <div class="flex-table">
170
+ <div class="flex-table-item flex-table-item-primary">
171
+ <%= item %>
172
+ </div>
173
+ <div class="flex-table-item">
174
+ <form action="<%= script_name %>/features/<%= @feature.key %>/actors" method="post">
175
+ <%== csrf_input_tag %>
176
+ <input type="hidden" name="operation" value="disable">
177
+ <input type="hidden" name="value" value="<%= item %>">
178
+ <button type="submit" value="Disable" class="button-inv danger tooltipped tooltipped-w" aria-label="Disable <%= item %>">
179
+ <span class="octicon octicon-trashcan"></span>
180
+ </button>
181
+ </form>
182
+ </div>
183
+ </div>
184
+ </li>
185
+ <% end %>
186
+ </ul>
187
+ <% end %>
188
+ </div>
189
+ </div>
190
+ </div>
191
+ </div>
192
+ <% end %>
193
+
194
+ <div class="panel panel-danger">
195
+ <div class="panel-heading">
196
+ <h3 class="panel-title">Danger Zone</h3>
197
+ </div>
198
+ <div class="panel-body">
199
+ <p>
200
+ Deleting a feature removes it from the list of features and disables it for everyone.
201
+ </p>
202
+
203
+ <form action="<%= script_name %>/features/<%= @feature.key %>" method="post">
204
+ <%== csrf_input_tag %>
205
+ <input type="hidden" name="_method" value="DELETE">
206
+ <button type="submit" name="action" value="Delete" class="btn btn-danger tooltipped tooltipped-ne" aria-label="Remove feature from list of features and disable it.">Delete</button>
207
+ </form>
208
+ </div>
209
+ </div>
@@ -0,0 +1,46 @@
1
+ <% if @show_blank_slate %>
2
+ <div class="blankslate">
3
+ <span class="mega-octicon octicon-plus"></span>
4
+ <span class="mega-octicon octicon-list-unordered"></span>
5
+ <span class="mega-octicon octicon-zap"></span>
6
+ <h3>But I've got a blank space baby...</h3>
7
+ <p>And I'll flip your features.</p>
8
+ <div class="embed-responsive embed-responsive-16by9">
9
+ <iframe class="embed-responsive-item" width="560" height="315" src="https://www.youtube.com/embed/e-ORhEE9VVg" frameborder="0" allowfullscreen></iframe>
10
+ </div>
11
+ </div>
12
+ <% else %>
13
+ <div class="panel panel-default">
14
+ <div class="panel-heading">
15
+ <h3 class="panel-title">Features</h3>
16
+ </div>
17
+
18
+ <table class="table">
19
+ <thead>
20
+ <tr>
21
+ <th class="feature-state">
22
+ <span class="octicon octicon-squirrel"></span>
23
+ </th>
24
+ <th>Feature</th>
25
+ <th class="feature-enabled-gates">Enabled Gates</th>
26
+ </tr>
27
+ </thead>
28
+ <tbody>
29
+ <% @features.each do |feature| %>
30
+ <tr>
31
+ <td class="feature-state">
32
+ <span class="octicon octicon-squirrel <%= feature.color_class %>"></span>
33
+ </td>
34
+ <td>
35
+ <a href="<%= "#{script_name}/features/#{feature.key}" %>">
36
+ <%= feature.key %></a>
37
+ </td>
38
+ <td class="feature-enabled-gates">
39
+ <%= feature.enabled_gate_names %>
40
+ </td>
41
+ </tr>
42
+ <% end %>
43
+ </tbody>
44
+ </table>
45
+ </div>
46
+ <% end %>
@@ -1,161 +1,43 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>Flipper</title>
5
- <link rel="stylesheet" type="text/css" href="<%= script_name %>/css/application.css">
6
- <link rel="stylesheet" type="text/css" href="<%= script_name %>/css/jquery-ui-1.10.3.slider.min.css">
7
-
8
- <script>
9
- var Flipper = {};
10
- Flipper.Config = {
11
- url: "<%= script_name %>"
12
- }
13
- </script>
14
- <script src="<%= script_name %>/js/jquery.min.js"></script>
15
- <script src="<%= script_name %>/js/jquery-ui-1.10.3.slider.min.js"></script>
16
-
17
- <script src="<%= script_name %>/js/handlebars.js"></script>
18
- <script src="<%= script_name %>/js/spine/spine.js"></script>
19
- <script src="<%= script_name %>/js/spine/ajax.js"></script>
20
- <script src="<%= script_name %>/js/spine/route.js"></script>
21
- <script src="<%= script_name %>/js/spine/manager.js"></script>
22
- <script src="<%= script_name %>/js/application.js"></script>
4
+ <title><%= @page_title ? "#{@page_title} // " : "" %>Flipper</title>
5
+ <meta charset="utf-8">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+
9
+ <link rel="stylesheet" href="<%= script_name %>/octicons/octicons.css">
10
+ <link rel="stylesheet" href="<%= script_name %>/css/application.css">
11
+
12
+ <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
13
+ <!--[if lt IE 9]>
14
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
15
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
16
+ <![endif]-->
23
17
  </head>
24
18
  <body>
25
- <div id="app">
26
- <div id="header">
27
- <h1>
28
- <a href="<%= script_name %>/">
29
- <img src="<%= script_name %>/images/logo.png" alt="Flipper" />
30
- </a>
31
- </h1>
32
- </div>
19
+ <div class="container header">
20
+ <a class="btn btn-sm right" href="<%= script_name %>/features/new">Add Feature</a>
21
+
22
+ <ol class="breadcrumb">
23
+ <% @breadcrumbs.each do |breadcrumb| %>
24
+ <li<% if breadcrumb.active? %> class="active"<% end %>>
25
+ <% if breadcrumb.active? %>
26
+ <%= breadcrumb.text %>
27
+ <% else %>
28
+ <a href="<%= script_name %><%= breadcrumb.href %>"><%= breadcrumb.text %></a>
29
+ <% end %>
30
+ </li>
31
+ <% end %>
32
+ </ol>
33
33
 
34
- <div id="content">
34
+ <div>
35
35
  <%== yield %>
36
36
  </div>
37
37
  </div>
38
38
 
39
- <script id="feature-template" type="text/x-handlebars-template">
40
- <div class="feature" id="feature-{{id}}">
41
- <div class="show">
42
- <h3>
43
- <span class="state {{state}}"></span>
44
- {{name}}
45
- <span class="description">{{description}}</span>
46
- </h3>
47
-
48
- <div class="actions">
49
- <a href="#" class="show-settings">Change Settings</a>
50
- </div>
51
- </div>
52
-
53
- <div class="edit">
54
- <h3>
55
- {{name}}
56
- <span class="description">Settings</span>
57
- </h3>
58
-
59
- <div class="actions">
60
- <a href="#" class="hide-settings">Cancel</a>
61
- </div>
62
-
63
- <div class="tabs">
64
- <ul>
65
- <li><a href="#" data-tab="boolean">All On/All Off</a></li>
66
- <li><a href="#" data-tab="group">Groups</a></li>
67
- <li><a href="#" data-tab="actor">Actors</a></li>
68
- <li><a href="#" data-tab="percentage_of_actors">
69
- Percentage Of Actors</a></li>
70
- <li><a href="#" data-tab="percentage_of_time">
71
- Percentage Of Time</a></li>
72
- </ul>
73
- </div>
74
-
75
- <div class="gates"></div>
76
- </div>
77
- </div>
78
- </script>
79
-
80
- <script id="gate-boolean-template" type="text/x-handlebars-template">
81
- <form action="/features/{{feature_id}}/boolean" method="POST">
82
- <input type="radio" name="value" value="true" {{#value}}checked="checked"{{/value}} /> On
83
- <input type="radio" name="value" value="false" {{^value}}checked="checked"{{/value}} /> Off
84
- <button>Save Settings</button>
85
- </form>
86
- </script>
87
-
88
- <script id="gate-member-template" type="text/x-handlebars-template">
89
- <li class="member" data-value="{{this}}">
90
- <a href="#" class="disable">
91
- <img src="<%= script_name %>/images/remove.png">
92
- </a>
93
- {{this}}
94
- </li>
95
- </script>
96
-
97
- <script id="gate-group-template" type="text/x-handlebars-template">
98
- <form action="/features/{{feature_id}}/group" method="POST">
99
- <input type="hidden" name="operation" value="enable" />
100
- <label>
101
- Group Name
102
- <select name="value">
103
- <option value="">Select the group...</option>
104
- <% Flipper.group_names.each do |name| %>
105
- <option value="<%= name %>"><%= name %></option>
106
- <% end %>
107
- </select>
108
- </label>
109
- <button>Enable Group</button>
110
- </form>
111
- <ul class="members">
112
- {{#each value}}
113
- <li class="member" data-value="{{this}}">
114
- <a href="#" class="disable">
115
- <img src="<%= script_name %>/images/remove.png">
116
- </a>
117
- {{this}}
118
- </li>
119
- {{/each}}
120
- </ul>
121
- </script>
122
-
123
- <script id="gate-actor-template" type="text/x-handlebars-template">
124
- <form action="/features/{{feature_id}}/actor" method="POST">
125
- <input type="hidden" name="operation" value="enable" />
126
- <label>
127
- Flipper Id
128
- <input type="text" name="value" value="" />
129
- </label>
130
- <button>Enable Actor</button>
131
- </form>
132
- <ul class="members">
133
- {{#each value}}
134
- <li class="member" data-value="{{this}}">
135
- <a href="#" class="disable">
136
- <img src="<%= script_name %>/images/remove.png">
137
- </a>
138
- {{this}}
139
- </li>
140
- {{/each}}
141
- </ul>
142
- </script>
143
-
144
- <script id="gate-percentage-of-actors-template" type="text/x-handlebars-template">
145
- <form action="/features/{{feature_id}}/percentage_of_actors" method="POST">
146
- <div class="slider-range"></div>
147
- <input type="text" name="value" value="{{value}}" /> %
148
- <button>Save Settings</button>
149
- </form>
150
- </script>
151
-
152
- <script id="gate-percentage-of-time-template" type="text/x-handlebars-template">
153
- <form action="/features/{{feature_id}}/percentage_of_time" method="POST">
154
- <div class="slider-range"></div>
155
- <input type="text" name="value" value="{{value}}" /> %
156
- <button>Save Settings</button>
157
- </form>
158
- </script>
159
-
39
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
40
+ <script src="<%= script_name %>/js/bootstrap.min.js"></script>
41
+ <script src="<%= script_name %>/js/application.js"></script>
160
42
  </body>
161
43
  </html>