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
@@ -1,3 +0,0 @@
1
- <li class="list-group-item" data-klass="<%= object.name %>">
2
- <%= link_to "New #{object.short_name} Element", new_element_path(type: object.name, step_id: @step.id), remote: true %>
3
- </li>
@@ -1,2 +0,0 @@
1
- <%= f.label :text %>
2
- <%= f.text_area :text %>
@@ -1,3 +0,0 @@
1
- <li class="list-group-item" data-klass="<%= object.name %>">
2
- <%= link_to "New #{object.short_name} Element", new_element_path(type: object.name, step_id: @step.id), remote: true %>
3
- </li>
@@ -1,5 +0,0 @@
1
- <h4>Step Preview</h4>
2
-
3
- <pre>
4
- <%= JSON.pretty_generate preview.definition_hash %>
5
- </pre>
@@ -1,20 +0,0 @@
1
- class CreateRiddlerAdminSteps < ActiveRecord::Migration[5.2]
2
- def change
3
- create_table :riddler_steps, id: false do |t|
4
- t.primary_key :id, :string, index: true
5
- t.timestamps
6
- t.string :type, null: false
7
- t.string :name
8
- end
9
-
10
- create_table :riddler_elements, id: false do |t|
11
- t.primary_key :id, :string, index: true
12
- t.timestamps
13
- t.string :type, null: false
14
- t.string :name
15
- t.references :container, polymorphic: true, index: true, type: :string
16
- t.integer :position
17
- t.string :text
18
- end
19
- end
20
- end