riddler_admin 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/riddler_admin/application.js +0 -1
  3. data/app/assets/javascripts/riddler_admin/preview_contexts.js +2 -0
  4. data/app/assets/javascripts/riddler_admin/publish_requests.js +2 -0
  5. data/app/assets/javascripts/riddler_admin/steps.js +36 -22
  6. data/app/assets/stylesheets/riddler_admin/application.scss +3 -0
  7. data/app/assets/stylesheets/riddler_admin/preview_contexts.css +4 -0
  8. data/app/assets/stylesheets/riddler_admin/publish_requests.css +4 -0
  9. data/app/controllers/riddler_admin/application_controller.rb +24 -2
  10. data/app/controllers/riddler_admin/dashboard_controller.rb +8 -0
  11. data/app/controllers/riddler_admin/elements_controller.rb +6 -2
  12. data/app/controllers/riddler_admin/preview_contexts_controller.rb +60 -0
  13. data/app/controllers/riddler_admin/publish_requests_controller.rb +90 -0
  14. data/app/controllers/riddler_admin/slugs_controller.rb +67 -0
  15. data/app/controllers/riddler_admin/steps_controller.rb +73 -20
  16. data/app/helpers/riddler_admin/application_helper.rb +19 -0
  17. data/app/helpers/riddler_admin/preview_contexts_helper.rb +4 -0
  18. data/app/helpers/riddler_admin/publish_requests_helper.rb +4 -0
  19. data/app/models/riddler_admin/application_record.rb +4 -4
  20. data/app/models/riddler_admin/content_definition.rb +87 -0
  21. data/app/models/riddler_admin/element.rb +52 -10
  22. data/app/models/riddler_admin/elements/heading.rb +6 -0
  23. data/app/models/riddler_admin/elements/image.rb +18 -0
  24. data/app/models/riddler_admin/elements/link.rb +18 -0
  25. data/app/models/riddler_admin/elements/{copy.rb → text.rb} +7 -1
  26. data/app/models/riddler_admin/elements/variant.rb +19 -0
  27. data/app/models/riddler_admin/preview_context.rb +83 -0
  28. data/app/models/riddler_admin/publish_request.rb +57 -0
  29. data/app/models/riddler_admin/slug.rb +90 -0
  30. data/app/models/riddler_admin/step.rb +66 -4
  31. data/app/models/riddler_admin/steps/variant.rb +19 -0
  32. data/app/validators/parseable_predicate_validator.rb +8 -0
  33. data/app/views/layouts/riddler_admin/application.html.erb +11 -4
  34. data/app/views/riddler_admin/_element.html.erb +14 -10
  35. data/app/views/riddler_admin/_element_container.html.erb +11 -0
  36. data/app/views/riddler_admin/_navbar.html.erb +29 -0
  37. data/app/views/riddler_admin/_preview_step.html.erb +39 -0
  38. data/app/views/riddler_admin/_step.html.erb +35 -0
  39. data/app/views/riddler_admin/_step_container.html.erb +11 -0
  40. data/app/views/riddler_admin/dashboard/index.html.erb +44 -0
  41. data/app/views/riddler_admin/elements/_form.html.erb +37 -0
  42. data/app/views/riddler_admin/elements/_new.html.erb +41 -8
  43. data/app/views/riddler_admin/elements/_show.html.erb +3 -1
  44. data/app/views/riddler_admin/elements/edit.js.erb +2 -0
  45. data/app/views/riddler_admin/elements/heading/_detail.html.erb +0 -0
  46. data/app/views/riddler_admin/elements/heading/_form.html.erb +8 -2
  47. data/app/views/riddler_admin/elements/image/_detail.html.erb +0 -0
  48. data/app/views/riddler_admin/elements/image/_form.html.erb +12 -0
  49. data/app/views/riddler_admin/elements/link/_detail.html.erb +0 -0
  50. data/app/views/riddler_admin/elements/link/_form.html.erb +12 -0
  51. data/app/views/riddler_admin/elements/show.js.erb +2 -2
  52. data/app/views/riddler_admin/elements/text/_detail.html.erb +0 -0
  53. data/app/views/riddler_admin/elements/text/_form.html.erb +4 -0
  54. data/app/views/riddler_admin/elements/variant/_detail.html.erb +6 -0
  55. data/app/views/riddler_admin/elements/variant/_form.html.erb +1 -0
  56. data/app/views/riddler_admin/preview_contexts/_form.html.erb +44 -0
  57. data/app/views/riddler_admin/preview_contexts/edit.html.erb +10 -0
  58. data/app/views/riddler_admin/preview_contexts/index.html.erb +43 -0
  59. data/app/views/riddler_admin/preview_contexts/new.html.erb +10 -0
  60. data/app/views/riddler_admin/preview_contexts/show.html.erb +45 -0
  61. data/app/views/riddler_admin/publish_requests/_actions.html.erb +19 -0
  62. data/app/views/riddler_admin/publish_requests/_form.html.erb +53 -0
  63. data/app/views/riddler_admin/publish_requests/approve.js.erb +2 -0
  64. data/app/views/riddler_admin/publish_requests/edit.html.erb +10 -0
  65. data/app/views/riddler_admin/publish_requests/index.html.erb +62 -0
  66. data/app/views/riddler_admin/publish_requests/new.html.erb +10 -0
  67. data/app/views/riddler_admin/publish_requests/publish.js.erb +2 -0
  68. data/app/views/riddler_admin/publish_requests/show.html.erb +25 -0
  69. data/app/views/riddler_admin/slugs/_form.html.erb +48 -0
  70. data/app/views/riddler_admin/slugs/edit.html.erb +10 -0
  71. data/app/views/riddler_admin/slugs/index.html.erb +44 -0
  72. data/app/views/riddler_admin/slugs/new.html.erb +10 -0
  73. data/app/views/riddler_admin/slugs/show.html.erb +18 -0
  74. data/app/views/riddler_admin/steps/_definition.html.erb +11 -0
  75. data/app/views/riddler_admin/steps/_form.html.erb +45 -17
  76. data/app/views/riddler_admin/steps/_new_sub_step.html.erb +56 -0
  77. data/app/views/riddler_admin/steps/_visual_preview.html.erb +24 -0
  78. data/app/views/riddler_admin/steps/content/_show.html.erb +53 -25
  79. data/app/views/riddler_admin/steps/edit.html.erb +15 -4
  80. data/app/views/riddler_admin/steps/index.html.erb +24 -10
  81. data/app/views/riddler_admin/steps/internal_preview.js.erb +5 -0
  82. data/app/views/riddler_admin/steps/new.html.erb +10 -5
  83. data/app/views/riddler_admin/steps/new.js.erb +3 -0
  84. data/app/views/riddler_admin/steps/preview.json.erb +1 -0
  85. data/app/views/riddler_admin/steps/show.html.erb +26 -11
  86. data/app/views/riddler_admin/steps/show.js.erb +4 -0
  87. data/app/views/riddler_admin/steps/variant/_show.html.erb +59 -0
  88. data/config/routes.rb +20 -1
  89. data/db/migrate/20181124201519_riddler_admin_genesis.rb +72 -0
  90. data/lib/riddler_admin.rb +29 -2
  91. data/lib/riddler_admin/configuration.rb +44 -0
  92. data/lib/riddler_admin/version.rb +1 -1
  93. metadata +75 -30
  94. data/app/views/riddler_admin/elements/copy/_class.html.erb +0 -3
  95. data/app/views/riddler_admin/elements/copy/_form.html.erb +0 -2
  96. data/app/views/riddler_admin/elements/heading/_class.html.erb +0 -3
  97. data/app/views/riddler_admin/steps/_preview.html.erb +0 -5
  98. data/db/migrate/20181124201519_create_riddler_admin_steps.rb +0 -20
@@ -0,0 +1,62 @@
1
+ <div class="row">
2
+ <% if notice %>
3
+ <div class="col-sm">
4
+ <span id="notice"><%= notice %></span>
5
+ </div>
6
+ <% end %>
7
+ <% if flash[:error] %>
8
+ <div class="col-sm">
9
+ <span id="error"><%= flash[:error] %></span>
10
+ </div>
11
+ <% end %>
12
+ </div>
13
+
14
+ <div class="row">
15
+ <div class="col-sm-6">
16
+ <h1>Publish Requests</h1>
17
+ </div>
18
+ </div>
19
+
20
+ <table class="table">
21
+ <thead>
22
+ <tr>
23
+ <th>Title</th>
24
+ <th>Status</th>
25
+ <th>Content</th>
26
+ <th>Approval</th>
27
+ <th>Published</th>
28
+
29
+ <th colspan="3"></th>
30
+ </tr>
31
+ </thead>
32
+
33
+ <tbody>
34
+ <% @publish_requests.each do |publish_request| %>
35
+ <tr>
36
+ <td><%= link_to publish_request.title, publish_request %></td>
37
+ <td><%= publish_request.status %></td>
38
+ <td><%= publish_request.content.title %></td>
39
+ <td>
40
+ <% if publish_request.approved_at.present? %>
41
+ <%= time_ago_in_words publish_request.approved_at %> ago
42
+ by
43
+ <%= publish_request.approved_by_name %>
44
+ <% end %>
45
+ </td>
46
+ <td>
47
+ <% if publish_request.published_at.present? %>
48
+ <%= time_ago_in_words publish_request.published_at %> ago
49
+ <% end %>
50
+ </td>
51
+
52
+ <td>
53
+ <% unless publish_request.approved? %>
54
+ <%= link_to "Delete", publish_request, method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-light" %>
55
+ <% end %>
56
+ </td>
57
+ </tr>
58
+ <% end %>
59
+ </tbody>
60
+ </table>
61
+
62
+ <br>
@@ -0,0 +1,10 @@
1
+ <div class="card">
2
+ <div class="card-body">
3
+ <div class="row">
4
+ <div class="col-sm">
5
+ <h1>New Publish Request</h1>
6
+ </div>
7
+ </div>
8
+ <%= render 'form', publish_request: @publish_request %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,2 @@
1
+ $("#<%= @publish_request.id %>-actions")
2
+ .html("<%= j render partial: "riddler_admin/publish_requests/actions", locals: { publish_request: @publish_request } %>")
@@ -0,0 +1,25 @@
1
+ <div class="row">
2
+ <div class="col-sm">
3
+ <% if notice %>
4
+ <div class="alert alert-success">
5
+ <span id="notice"><%= notice %></span>
6
+ </div>
7
+ <% end %>
8
+ </div>
9
+ </div>
10
+
11
+ <div class="row" style="margin-bottom: 32px;">
12
+ <div class="col-sm-6">
13
+ <h1><%= @publish_request.title %></h1>
14
+ </div>
15
+ <div id="<%= @publish_request.id %>-actions" class="col-sm-6">
16
+ <%= render partial: "riddler_admin/publish_requests/actions", locals: { publish_request: @publish_request } %>
17
+ </div>
18
+ </div>
19
+ <div class="row" style="margin-bottom: 32px;">
20
+ <div class="col-sm-6">
21
+ <%= @publish_request.description %>
22
+ </div>
23
+ </div>
24
+
25
+ <%= render partial: "riddler_admin/preview_step", locals: { preview_contexts: @preview_contexts, step: @publish_request.content } %>
@@ -0,0 +1,48 @@
1
+ <%= form_with model: slug, local: true do |form| %>
2
+ <div class="row">
3
+ <% if slug.errors.any? %>
4
+ <div id="error_explanation">
5
+ <h2><%= pluralize(slug.errors.count, "error") %> prohibited this slug from being saved:</h2>
6
+
7
+ <ul>
8
+ <% slug.errors.full_messages.each do |message| %>
9
+ <li><%= message %></li>
10
+ <% end %>
11
+ </ul>
12
+ </div>
13
+ <% end %>
14
+ </div>
15
+
16
+ <div class="form-row">
17
+ <div class="form-group col">
18
+ <%= form.label :name %>
19
+ <%= form.text_field :name, class:"form-control" %>
20
+ </div>
21
+ <div class="form-group col">
22
+ <%= form.label :status %>
23
+ <%= form.select :status, options_for_select([["Live", "LIVE"], ["Paused", "PAUSED"]], slug.status), {}, class:"form-control" %>
24
+ </div>
25
+ <div class="form-group col">
26
+ <%= form.label :content_definition %>
27
+ <%= form.collection_select :content_definition_id, RiddlerAdmin::ContentDefinition.all, :id, :title, {prompt: true}, {class:"form-control"} %>
28
+ </div>
29
+ </div>
30
+ <div class="form-row">
31
+ <div class="form-group col">
32
+ <%= form.label :interaction_identity %>
33
+ <%= form.text_field :interaction_identity, class:"form-control", placeholder: "e.g. user_id:{{ ids.user_id }}" %>
34
+ <small class="form-text text-muted">This liquid string will determine when an interaction is used again (can only use <code>ids</code>).</small>
35
+ </div>
36
+ <div class="form-group col">
37
+ <%= form.label :target_predicate %>
38
+ <%= form.text_field :target_predicate, class: "form-control", placeholder: "e.g. params.user_id is present" %>
39
+ <small class="form-text text-muted">Use data from the context that evaluates to <code>true</code> or <code>false</code></small>
40
+ </div>
41
+ </div>
42
+ <div class="form-row">
43
+ <div class="form-group col">
44
+ <%= form.submit "Save slug", class: "btn btn-primary" %>
45
+ <%= link_to "Cancel", slugs_path, class: "btn btn-light" %>
46
+ </div>
47
+ </div>
48
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <div class="card">
2
+ <div class="card-body">
3
+ <div class="row">
4
+ <div class="col-sm">
5
+ <h1>Edit Slug</h1>
6
+ </div>
7
+ </div>
8
+ <%= render "form", slug: @slug %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,44 @@
1
+ <div class="row">
2
+ <% if notice %>
3
+ <div class="col-sm">
4
+ <div class="alert alert-success">
5
+ <span id="notice"><%= notice %></span>
6
+ </div>
7
+ </div>
8
+ <% end %>
9
+ </div>
10
+
11
+ <div class="row">
12
+ <div class="col-sm-6">
13
+ <h1>Slugs</h1>
14
+ </div>
15
+ <div class="col-sm-6">
16
+ <%= link_to "New slug", new_slug_path, class: "btn btn-primary float-right"%>
17
+ </div>
18
+ </div>
19
+
20
+ <table class="table">
21
+ <thead>
22
+ <tr>
23
+ <th>Name</th>
24
+ <th>ContentDefinition</th>
25
+ <th>Status</th>
26
+ <th>Events (last day)</th>
27
+ </tr>
28
+ </thead>
29
+
30
+ <tbody>
31
+ <% @slugs.each do |slug| %>
32
+ <tr>
33
+ <td><%= link_to slug.name, edit_slug_path(slug) %></td>
34
+ <td><%= slug.content_definition.title %></td>
35
+ <td><%= slug.status.titleize %></td>
36
+ <td>
37
+ <% slug.daily_stats.each do |event_counts| %>
38
+ <%= event_counts.event_name.titleize %>: <%= event_counts.count %>
39
+ <% end %>
40
+ </td>
41
+ </tr>
42
+ <% end %>
43
+ </tbody>
44
+ </table>
@@ -0,0 +1,10 @@
1
+ <div class="card">
2
+ <div class="card-body">
3
+ <div class="row">
4
+ <div class="col-sm">
5
+ <h1>New Slug</h1>
6
+ </div>
7
+ </div>
8
+ <%= render "form", slug: @slug %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,18 @@
1
+ <div class="row">
2
+ <div class="col-sm">
3
+ <% if notice %>
4
+ <div class="alert alert-success">
5
+ <span id="notice"><%= notice %></span>
6
+ </div>
7
+ <% end %>
8
+ </div>
9
+ </div>
10
+
11
+ <div class="row" style="margin-bottom: 32px;">
12
+ <div class="col-sm-6">
13
+ <h1><%= @slug.name %> slug</h1>
14
+ </div>
15
+ <div class="col-sm-6">
16
+ <%= link_to "Edit", edit_slug_path(@slug), class: "btn btn-primary float-right" %>
17
+ </div>
18
+ </div>
@@ -0,0 +1,11 @@
1
+ <div class="row">
2
+ <div class="col-sm">
3
+ <h4>Step Definition</h4>
4
+ </div>
5
+ </div>
6
+
7
+ <div class="row">
8
+ <div class="col-sm">
9
+ <pre><%= definition.definition_hash.to_yaml %></pre>
10
+ </div>
11
+ </div>
@@ -1,22 +1,50 @@
1
- <%= form_with(model: step, local: true) do |form| %>
2
- <% if step.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(step.errors.count, "error") %> prohibited this step from being saved:</h2>
1
+ <%= form_with model: step, local: true do |form| %>
2
+ <div class="row">
3
+ <% if step.errors.any? %>
4
+ <div id="error_explanation">
5
+ <h2><%= pluralize(step.errors.count, "error") %> prohibited this step from being saved:</h2>
5
6
 
6
- <ul>
7
- <% step.errors.full_messages.each do |message| %>
8
- <li><%= message %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="field">
15
- <%= form.label :name %>
16
- <%= form.text_field :name %>
7
+ <ul>
8
+ <% step.errors.full_messages.each do |message| %>
9
+ <li><%= message %></li>
10
+ <% end %>
11
+ </ul>
12
+ </div>
13
+ <% end %>
17
14
  </div>
18
15
 
19
- <div class="actions">
20
- <%= form.submit %>
16
+ <div class="form-group">
17
+ <div class="form-row">
18
+ <div class="col">
19
+ <%= form.label :title %>
20
+ <%= form.text_field :title, class:"form-control" %>
21
+ </div>
22
+ <div class="col">
23
+ <%= form.label :name %>
24
+ <%= form.text_field :name, class:"form-control" %>
25
+ <small class="form-text text-muted">This will be created based on the title if not provided</small>
26
+ </div>
27
+ </div>
28
+ <% unless @step.persisted? %>
29
+ <div class="form-row">
30
+ <div class="col">
31
+ <%= form.label :type %>
32
+ <%= form.select :type, options_for_select(::RiddlerAdmin::Step.available_classes.map{|klass| [klass.short_name, klass.name]}, step.type), {}, class:"form-control" %>
33
+ </div>
34
+ </div>
35
+ <% end %>
36
+ <div class="form-row">
37
+ <div class="col">
38
+ <%= form.label :include_predicate %>
39
+ <%= form.text_field :include_predicate, class: "form-control", placeholder: "e.g. params.user_id is present" %>
40
+ <small class="form-text text-muted">Use data from the context that evaluates to <code>true</code> or <code>false</code></small>
41
+ </div>
42
+ </div>
43
+ <div class="form-row">
44
+ <div class="actions">
45
+ <%= form.submit "Save step", class: "btn btn-primary" %>
46
+ <%= link_to "Cancel", steps_path, class: "btn btn-light" %>
47
+ </div>
48
+ </div>
21
49
  </div>
22
50
  <% end %>
@@ -0,0 +1,56 @@
1
+ <%= form_with model: step do |form| %>
2
+ <% if step.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(step.errors.count, "error") %> prohibited this step from being saved:</h2>
5
+
6
+ <ul>
7
+ <% step.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="card" style="margin-bottom: 32px;">
15
+ <div class="card-body">
16
+
17
+ <div class="card-title">
18
+ <h5>New <%= step.short_name %> Step</h5>
19
+ </div>
20
+
21
+ <%= form.hidden_field :type %>
22
+ <%= form.hidden_field :stepable_type %>
23
+ <%= form.hidden_field :stepable_id %>
24
+
25
+ <div class="form-group">
26
+ <div class="form-row">
27
+ <div class="col">
28
+ <%= form.label :title %>
29
+ <%= form.text_field :title, class:"form-control" %>
30
+ </div>
31
+ <div class="col">
32
+ <%= form.label :name %>
33
+ <%= form.text_field :name, class:"form-control" %>
34
+ <small class="form-text text-muted">This will be created based on the title if not provided</small>
35
+ </div>
36
+ </div>
37
+
38
+ <div class="form-row">
39
+ <div class="col">
40
+ <%= form.label :include_predicate %>
41
+ <%= form.text_field :include_predicate, class: "form-control", placeholder: "e.g. params.user_id is present" %>
42
+ <small class="form-text text-muted">Use data from the context that evaluates to <code>true</code> or <code>false</code></small>
43
+ </div>
44
+ </div>
45
+
46
+
47
+ <div class="form-row">
48
+ <div class="actions">
49
+ <%= form.submit "Add step", class: "btn btn-primary" %>
50
+ </div>
51
+ </div>
52
+ </div>
53
+
54
+ </div>
55
+ </div>
56
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <ul class="list-group">
2
+ <% if (data[:response_code] || "").to_s == "204" %>
3
+ <li class="list-group-item">
4
+ <%= data[:message] %>
5
+ </li>
6
+ <% else %>
7
+ <% data["elements"].each do |element| %>
8
+ <li class="list-group-item">
9
+ <% case element[:type] %>
10
+ <% when "link" %>
11
+ <a href="<%= element[:href] %>" target="_blank"><%= element[:text] %></a>
12
+ <% when "heading" %>
13
+ <h5><%= element[:text] %></h5>
14
+ <% when "image" %>
15
+ <img src="<%= element[:src] %>" alt="<%= element[:alt] %>" />
16
+ <% when "text" %>
17
+ <%= element[:text] %>
18
+ <% else %>
19
+ Unknown Element type "<%= element[:type] %>"
20
+ <% end %>
21
+ </li>
22
+ <% end %>
23
+ <% end %>
24
+ </ul>
@@ -1,31 +1,59 @@
1
- <ul id="step-tabs" class="nav nav-tabs">
2
- <li class="nav-item">
3
- <a class="nav-link active" id="elements-tab" data-toggle="tab" href="#elements" role="tab" aria-controls="elements" aria-selected="true">Elements</a>
4
- </li>
5
- <li class="nav-item">
6
- <a class="nav-link" id="step-preview-tab" data-toggle="tab" href="#step-preview" role="tab" aria-controls="step-preview" aria-selected="false">Preview</a>
7
- </li>
8
- </ul>
9
-
10
- <div class="tab-content" id="step-tabs-content">
11
- <div class="tab-pane fade show active" id="elements" role="tabpanel" aria-labelledby="elements-tab">
12
- <h4>Available Elements</h4>
13
- <ul class="list-group">
14
- <%- RiddlerAdmin::Element.available_classes.each do |klass| %>
15
- <%= render klass, object: klass, step: @step %>
16
- <%- end %>
17
- </ul>
18
-
19
- <div id="new-element">
20
- </div>
1
+ <div class="row" style="margin-bottom: 32px;">
2
+ <div class="col-sm">
21
3
 
22
- <h4>Elements</h4>
23
- <ul id="step-elements" class="list-group step-elements" data-step-id="<%= @step.id %>">
24
- <%= render partial: "riddler_admin/element", collection: @step.elements %>
4
+ <ul id="step-tabs" class="nav nav-tabs">
5
+ <li class="nav-item">
6
+ <a class="nav-link active" id="elements-tab" data-toggle="tab" href="#elements" role="tab" aria-controls="elements" aria-selected="true">Elements</a>
7
+ </li>
8
+ <li class="nav-item">
9
+ <a class="nav-link" id="step-definition-tab" data-toggle="tab" href="#step-definition" role="tab" aria-controls="step-definition" aria-selected="false">Definition</a>
10
+ </li>
11
+ <li class="nav-item">
12
+ <a class="nav-link" id="step-preview-tab" data-toggle="tab" href="#step-preview" role="tab" aria-controls="step-preview" aria-selected="false">Preview</a>
13
+ </li>
25
14
  </ul>
15
+
26
16
  </div>
17
+ </div>
18
+
19
+ <div class="row">
20
+ <div class="col-sm">
21
+
22
+ <div class="tab-content" id="step-tabs-content">
23
+ <div class="tab-pane fade show active" id="elements" role="tabpanel" aria-labelledby="elements-tab">
24
+
25
+ <div class="container">
26
+ <div class="row">
27
+ <div class="col-md-3">
28
+ <h4>Add an element type</h4>
29
+
30
+ <ul class="nav flex-column">
31
+ <% RiddlerAdmin::Element.available_classes.each do |klass| %>
32
+ <%= link_to "#{klass.short_name} Element", new_element_path(type: klass.name, step_id: @step.id), remote: true, class: 'nav-link' %>
33
+ <% end %>
34
+ </ul>
35
+
36
+ </div>
37
+ <div class="col-md-9">
38
+ <div id="new-element">
39
+ </div>
40
+
41
+ <%= render partial: "riddler_admin/element_container", locals: { container: @step } %>
42
+
43
+ </div>
44
+ </div>
45
+ </div>
46
+
47
+ </div>
48
+
49
+ <div class="tab-pane fade" id="step-definition" role="tabpanel" aria-labelledby="definition-tab">
50
+ <%= render partial: "definition", object: @step %>
51
+ </div>
52
+
53
+ <div class="tab-pane fade" id="step-preview" role="tabpanel" aria-labelledby="preview-tab">
54
+ <%= render partial: "riddler_admin/preview_step", locals: { preview_contexts: @preview_contexts, step: @step } %>
55
+ </div>
56
+ </div>
27
57
 
28
- <div class="tab-pane fade" id="step-preview" role="tabpanel" aria-labelledby="preview-tab">
29
- <%= render partial: "preview", object: @step %>
30
58
  </div>
31
59
  </div>