xing-framework 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/default_configuration/base_app/API_DOC/README +23 -0
  3. data/default_configuration/base_app/API_DOC/admin-menus +167 -0
  4. data/default_configuration/base_app/API_DOC/admin-pages +173 -0
  5. data/default_configuration/base_app/API_DOC/content-block +10 -0
  6. data/default_configuration/base_app/API_DOC/navigation +54 -0
  7. data/default_configuration/base_app/API_DOC/page +38 -0
  8. data/default_configuration/base_app/CHANGELOG.md +122 -0
  9. data/default_configuration/base_app/Capfile +26 -0
  10. data/default_configuration/base_app/Gemfile +7 -0
  11. data/default_configuration/base_app/Gemfile.lock +155 -0
  12. data/default_configuration/base_app/README.md +24 -0
  13. data/default_configuration/base_app/Rakefile +25 -0
  14. data/default_configuration/base_app/backend/Gemfile +45 -0
  15. data/default_configuration/base_app/backend/Gemfile.lock +292 -0
  16. data/default_configuration/base_app/backend/README +12 -0
  17. data/default_configuration/base_app/backend/Rakefile +10 -0
  18. data/default_configuration/base_app/backend/app/controllers/application_controller.rb +3 -0
  19. data/default_configuration/base_app/backend/app/controllers/confirmations_controller.rb +3 -0
  20. data/default_configuration/base_app/backend/app/controllers/passwords_controller.rb +3 -0
  21. data/default_configuration/base_app/backend/app/controllers/registrations_controller.rb +15 -0
  22. data/default_configuration/base_app/backend/app/models/ability.rb +13 -0
  23. data/default_configuration/base_app/backend/app/models/role/admin.rb +8 -0
  24. data/default_configuration/base_app/backend/app/models/user.rb +43 -0
  25. data/default_configuration/base_app/backend/autotest/discover.rb +2 -0
  26. data/default_configuration/base_app/backend/bin/bundle +3 -0
  27. data/default_configuration/base_app/backend/bin/rails +4 -0
  28. data/default_configuration/base_app/backend/bin/rake +4 -0
  29. data/default_configuration/base_app/backend/config.ru +6 -0
  30. data/default_configuration/base_app/backend/config/application.rb +71 -0
  31. data/default_configuration/base_app/backend/config/boot.rb +4 -0
  32. data/default_configuration/base_app/backend/config/database.yml.ci +9 -0
  33. data/default_configuration/base_app/backend/config/database.yml.example +22 -0
  34. data/default_configuration/base_app/backend/config/environment.rb +5 -0
  35. data/default_configuration/base_app/backend/config/environments/development.rb +45 -0
  36. data/default_configuration/base_app/backend/config/environments/production.rb +78 -0
  37. data/default_configuration/base_app/backend/config/environments/staging.rb +48 -0
  38. data/default_configuration/base_app/backend/config/environments/test.rb +47 -0
  39. data/default_configuration/base_app/backend/config/initializers/assets.rb +8 -0
  40. data/default_configuration/base_app/backend/config/initializers/backtrace_silencers.rb +7 -0
  41. data/default_configuration/base_app/backend/config/initializers/constants.rb +1 -0
  42. data/default_configuration/base_app/backend/config/initializers/cookies_serializer.rb +3 -0
  43. data/default_configuration/base_app/backend/config/initializers/devise.rb +241 -0
  44. data/default_configuration/base_app/backend/config/initializers/devise_token_auth.rb +22 -0
  45. data/default_configuration/base_app/backend/config/initializers/filter_parameter_logging.rb +4 -0
  46. data/default_configuration/base_app/backend/config/initializers/inflections.rb +16 -0
  47. data/default_configuration/base_app/backend/config/initializers/mime_types.rb +4 -0
  48. data/default_configuration/base_app/backend/config/initializers/session_store.rb +3 -0
  49. data/default_configuration/base_app/backend/config/initializers/smtp.rb +25 -0
  50. data/default_configuration/base_app/backend/config/initializers/time_formats.rb +12 -0
  51. data/default_configuration/base_app/backend/config/initializers/wrap_parameters.rb +14 -0
  52. data/default_configuration/base_app/backend/config/locales/en.yml +23 -0
  53. data/default_configuration/base_app/backend/config/locales/json.yml +29 -0
  54. data/default_configuration/base_app/backend/config/routes.rb +33 -0
  55. data/default_configuration/base_app/backend/config/secrets.yml.ci +22 -0
  56. data/default_configuration/base_app/backend/config/secrets.yml.example +57 -0
  57. data/default_configuration/base_app/backend/config/sidekiq.yml +4 -0
  58. data/default_configuration/base_app/backend/db/sample_data/users.rake +10 -0
  59. data/default_configuration/base_app/backend/db/seeds.rb +14 -0
  60. data/default_configuration/base_app/backend/lib/static-app.rb +15 -0
  61. data/default_configuration/base_app/backend/public/404.html +26 -0
  62. data/default_configuration/base_app/backend/public/422.html +26 -0
  63. data/default_configuration/base_app/backend/public/500.html +26 -0
  64. data/default_configuration/base_app/backend/public/favicon.ico +0 -0
  65. data/default_configuration/base_app/backend/public/index.html +0 -0
  66. data/default_configuration/base_app/backend/public/robots.txt +5 -0
  67. data/default_configuration/base_app/backend/script/rails +6 -0
  68. data/default_configuration/base_app/backend/spec/factories/user_sessions_factory.rb +6 -0
  69. data/default_configuration/base_app/backend/spec/factories/users_factory.rb +35 -0
  70. data/default_configuration/base_app/backend/spec/features/user_sends_reset_password_email_spec.rb +30 -0
  71. data/default_configuration/base_app/backend/spec/features/user_signs_up_spec.rb +32 -0
  72. data/default_configuration/base_app/backend/spec/models/role/admin_spec.rb +12 -0
  73. data/default_configuration/base_app/backend/spec/models/role_spec.rb +48 -0
  74. data/default_configuration/base_app/backend/spec/models/user_spec.rb +59 -0
  75. data/default_configuration/base_app/backend/spec/requests/resources_index_spec.rb +22 -0
  76. data/default_configuration/base_app/backend/spec/spec_helper.rb +65 -0
  77. data/default_configuration/base_app/backend/spec/support/devise_helper.rb +78 -0
  78. data/default_configuration/base_app/backend/spec/support/log_tests.rb +5 -0
  79. data/default_configuration/base_app/backend/spec/support/session_helpers.rb +67 -0
  80. data/default_configuration/base_app/backend/spec/tasks/sample_data_rake_spec.rb +17 -0
  81. data/default_configuration/base_app/backend/static-app.ru +3 -0
  82. data/default_configuration/base_app/codeclimate.yml +7 -0
  83. data/default_configuration/base_app/config/compass.rb +21 -0
  84. data/default_configuration/base_app/config/deploy.rb +157 -0
  85. data/default_configuration/base_app/config/deploy/bundle-config +4 -0
  86. data/default_configuration/base_app/config/deploy/production.rb +7 -0
  87. data/default_configuration/base_app/config/deploy/staging.rb +6 -0
  88. data/default_configuration/base_app/doc/01_fail_resources.txt +173 -0
  89. data/default_configuration/base_app/doc/02_fail_auth.txt +165 -0
  90. data/default_configuration/base_app/doc/03_fail_menus.txt +174 -0
  91. data/default_configuration/base_app/dummy-api/admin/menu_items/10.json +15 -0
  92. data/default_configuration/base_app/dummy-api/admin/menu_items/11.json +15 -0
  93. data/default_configuration/base_app/dummy-api/admin/menu_items/12.json +15 -0
  94. data/default_configuration/base_app/dummy-api/admin/menu_items/13.json +15 -0
  95. data/default_configuration/base_app/dummy-api/admin/menu_items/14.json +15 -0
  96. data/default_configuration/base_app/dummy-api/admin/menu_items/15.json +15 -0
  97. data/default_configuration/base_app/dummy-api/admin/menu_items/16.json +15 -0
  98. data/default_configuration/base_app/dummy-api/admin/menus.json +23 -0
  99. data/default_configuration/base_app/dummy-api/admin/menus/1.json +118 -0
  100. data/default_configuration/base_app/dummy-api/admin/menus/2.json +8 -0
  101. data/default_configuration/base_app/dummy-api/admin/pages.json +105 -0
  102. data/default_configuration/base_app/dummy-api/admin/pages/about_us.json +45 -0
  103. data/default_configuration/base_app/dummy-api/admin/pages/contact_us.json +36 -0
  104. data/default_configuration/base_app/dummy-api/admin/pages/gallery.json +36 -0
  105. data/default_configuration/base_app/dummy-api/admin/pages/home.json +36 -0
  106. data/default_configuration/base_app/dummy-api/admin/pages/homepage.json +18 -0
  107. data/default_configuration/base_app/dummy-api/admin/pages/links.json +36 -0
  108. data/default_configuration/base_app/dummy-api/admin/pages/newsletter.json +54 -0
  109. data/default_configuration/base_app/dummy-api/homepage.json +14 -0
  110. data/default_configuration/base_app/dummy-api/navigation/main.json +119 -0
  111. data/default_configuration/base_app/dummy-api/pages/about_us.json +41 -0
  112. data/default_configuration/base_app/dummy-api/pages/contact_us.json +32 -0
  113. data/default_configuration/base_app/dummy-api/pages/gallery.json +32 -0
  114. data/default_configuration/base_app/dummy-api/pages/home.json +32 -0
  115. data/default_configuration/base_app/dummy-api/pages/homepage.json +14 -0
  116. data/default_configuration/base_app/dummy-api/pages/links.json +32 -0
  117. data/default_configuration/base_app/dummy-api/pages/newsletter.json +50 -0
  118. data/default_configuration/base_app/dump.rdb +0 -0
  119. data/default_configuration/base_app/example-lrd-dev-tmux.conf +17 -0
  120. data/default_configuration/base_app/frontend/CHANGELOG.md +125 -0
  121. data/default_configuration/base_app/frontend/Gemfile +5 -0
  122. data/default_configuration/base_app/frontend/Gemfile.lock +34 -0
  123. data/default_configuration/base_app/frontend/Gruntfile.js +3 -0
  124. data/default_configuration/base_app/frontend/LICENSE +19 -0
  125. data/default_configuration/base_app/frontend/README.md +5 -0
  126. data/default_configuration/base_app/frontend/bin/index.html +0 -0
  127. data/default_configuration/base_app/frontend/build.config.js +110 -0
  128. data/default_configuration/base_app/frontend/changelog.tpl +23 -0
  129. data/default_configuration/base_app/frontend/config/compass.rb +33 -0
  130. data/default_configuration/base_app/frontend/config/environments/development.js +4 -0
  131. data/default_configuration/base_app/frontend/config/environments/integration.js +4 -0
  132. data/default_configuration/base_app/frontend/config/environments/production.js +3 -0
  133. data/default_configuration/base_app/frontend/config/environments/test.js +4 -0
  134. data/default_configuration/base_app/frontend/create +0 -0
  135. data/default_configuration/base_app/frontend/karma/karma-unit.tpl.js +80 -0
  136. data/default_configuration/base_app/frontend/module.prefix +1 -0
  137. data/default_configuration/base_app/frontend/module.suffix +1 -0
  138. data/default_configuration/base_app/frontend/npm-shrinkwrap.json +4334 -0
  139. data/default_configuration/base_app/frontend/package.json +75 -0
  140. data/default_configuration/base_app/frontend/sprockets/index.tpl.js +2 -0
  141. data/default_configuration/base_app/frontend/src/README.md +48 -0
  142. data/default_configuration/base_app/frontend/src/app/README.md +68 -0
  143. data/default_configuration/base_app/frontend/src/app/app.js +47 -0
  144. data/default_configuration/base_app/frontend/src/app/appConfig.js +19 -0
  145. data/default_configuration/base_app/frontend/src/app/auth/auth.js +66 -0
  146. data/default_configuration/base_app/frontend/src/app/auth/config.js +22 -0
  147. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmations-success.tpl.html +1 -0
  148. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmations.js +8 -0
  149. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmationsStates.js +12 -0
  150. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-request-success.tpl.html +3 -0
  151. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-request.tpl.html +16 -0
  152. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-update-success.tpl.html +3 -0
  153. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-update.tpl.html +21 -0
  154. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords.js +11 -0
  155. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwordsControllers.js +47 -0
  156. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwordsStates.js +38 -0
  157. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations-success.tpl.html +1 -0
  158. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations.js +14 -0
  159. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations.tpl.html +37 -0
  160. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrationsControllers.js +25 -0
  161. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrationsStates.js +18 -0
  162. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions-success.tpl.html +1 -0
  163. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions.js +18 -0
  164. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions.tpl.html +25 -0
  165. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js +26 -0
  166. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessionsStates.js +20 -0
  167. data/default_configuration/base_app/frontend/src/app/homepage/homepage-show.tpl.html +2 -0
  168. data/default_configuration/base_app/frontend/src/app/homepage/homepage.js +10 -0
  169. data/default_configuration/base_app/frontend/src/app/homepage/homepage.tpl.html +13 -0
  170. data/default_configuration/base_app/frontend/src/app/homepage/homepageControllers.js +9 -0
  171. data/default_configuration/base_app/frontend/src/app/homepage/homepageStates.js +22 -0
  172. data/default_configuration/base_app/frontend/src/app/inner.tpl.html +16 -0
  173. data/default_configuration/base_app/frontend/src/app/root.tpl.html +2 -0
  174. data/default_configuration/base_app/frontend/src/app/rootController.js +8 -0
  175. data/default_configuration/base_app/frontend/src/app/rootStates.js +20 -0
  176. data/default_configuration/base_app/frontend/src/assets/README.md +4 -0
  177. data/default_configuration/base_app/frontend/src/assets/icons/alert.svg +1 -0
  178. data/default_configuration/base_app/frontend/src/common/README.md +19 -0
  179. data/default_configuration/base_app/frontend/src/common/components/OnLoginDirective/OnLoginDirective.js +17 -0
  180. data/default_configuration/base_app/frontend/src/common/components/adminOnly/admin-only.tpl.html +4 -0
  181. data/default_configuration/base_app/frontend/src/common/components/adminOnly/adminOnly.js +23 -0
  182. data/default_configuration/base_app/frontend/src/common/components/sessionLinks/session-links.tpl.html +5 -0
  183. data/default_configuration/base_app/frontend/src/common/components/sessionLinks/sessionLinks.js +25 -0
  184. data/default_configuration/base_app/frontend/src/common/components/signOut/signOut.js +19 -0
  185. data/default_configuration/base_app/frontend/src/common/config.js +27 -0
  186. data/default_configuration/base_app/frontend/src/index.html +86 -0
  187. data/default_configuration/base_app/frontend/src/styles/_constants.sass +14 -0
  188. data/default_configuration/base_app/frontend/src/styles/main.sass +52 -0
  189. data/default_configuration/base_app/frontend/src/styles/partials/_footer.sass +18 -0
  190. data/default_configuration/base_app/frontend/src/styles/partials/_forms.sass +9 -0
  191. data/default_configuration/base_app/frontend/src/styles/partials/_layout.sass +17 -0
  192. data/default_configuration/base_app/frontend/src/styles/partials/_navbar.sass +10 -0
  193. data/default_configuration/base_app/frontend/src/styles/partials/_typography.sass +18 -0
  194. data/default_configuration/base_app/frontend/src/styles/states/_errorFallback.sass +7 -0
  195. data/default_configuration/base_app/frontend/src/styles/states/_root_homepage.sass +8 -0
  196. data/default_configuration/base_app/frontend/test-help/xpath.js +9 -0
  197. data/default_configuration/base_app/frontend/test/app.js +24 -0
  198. data/default_configuration/base_app/frontend/test/auth/confirmations/confirmationsStates.js +46 -0
  199. data/default_configuration/base_app/frontend/test/auth/passwords/passwordsControllers.js +193 -0
  200. data/default_configuration/base_app/frontend/test/auth/passwords/passwordsStates.js +108 -0
  201. data/default_configuration/base_app/frontend/test/auth/registrations/registrationsControllers.js +117 -0
  202. data/default_configuration/base_app/frontend/test/auth/registrations/registrationsStates.js +64 -0
  203. data/default_configuration/base_app/frontend/test/auth/sessions/sessionsControllers.js +95 -0
  204. data/default_configuration/base_app/frontend/test/auth/sessions/sessionsStates.js +67 -0
  205. data/default_configuration/base_app/frontend/test/specHelper.js +33 -0
  206. data/default_configuration/base_app/frontend/test/support/mockDirective.js +13 -0
  207. data/default_configuration/base_app/frontend/test/support/stateResolveFn.js +3 -0
  208. data/default_configuration/base_app/frontend/test/support/testStates.js +20 -0
  209. data/default_configuration/base_app/frontend/tools.md +223 -0
  210. data/default_configuration/base_app/lib/capistrano/tasks/sidekiq.rake +218 -0
  211. data/default_configuration/base_app/static-app.ru +3 -0
  212. data/default_configuration/base_app/tmux-windows +68 -0
  213. data/default_configuration/base_app/tmux-windows.txt +53 -0
  214. data/lib/xing/cli.rb +8 -3
  215. data/lib/xing/cli/generators/new_project.rb +48 -13
  216. metadata +219 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: addc27df560e0f0aed4ccfe54fa7840a6a4af6d0
4
- data.tar.gz: d395393a30e21f2a1125c8f868c14f551e4d6ba9
3
+ metadata.gz: 879d64c43c902f12cb4d78e72dbabe7d4ce5e648
4
+ data.tar.gz: db30c463cf52332bdc71228345888239bbf730bb
5
5
  SHA512:
6
- metadata.gz: 60304c5cc7a007f7e90c2a6eefe5d875bea53134870fd92870432179f3b3e31455eeec8d55ef77e6f9001d8c1df30452f19bde2b61188902eff3278edf5f6865
7
- data.tar.gz: 8d662f73c833321248963beb49c828beffec7ac3623ffc68092a6c673ae81d3474b20773bd0a0a6bdb72eec14b84909a0581c6c11437613cf41f6cc3f213a209
6
+ metadata.gz: f7eda3ea85360c6b40a0797741cc350c2b8b5e14909fdc29b903314a9e6f38d7053c5439f8418f61c30ea720f418e2bdf1ebab695346716b684f4921ca7567e2
7
+ data.tar.gz: 4ec5dba6a578d2e0dafae1bbc048242c79d6ec332371d363375cd0c227a3207a7d5711ee9b6b4cf570fcda6a84cd58d2aa10144297b5bd44fd8116ebe258a5c6
@@ -0,0 +1,23 @@
1
+
2
+ All requests and responses are JSON. Client should send Accept:
3
+ "application/json" on all requests, and Content-Type: "application/json" on
4
+ requests with bodies (i.e. POST, PUT).
5
+
6
+ OPEN QUESTIONS:
7
+ PATCH? Only makes sense if the body somehow represents a change rather than a replacement.
8
+ All link relations? Or just self-links and use resource embed for
9
+ relationships?
10
+
11
+ Server responses should represent resources as a JSON object with two fields:
12
+ `links` and `data`. Both fields should contain an object. The links object
13
+ should have fields equivalent to HTML "rel" attributes. Importantly the self
14
+ link, but we should define link types internal to the application.
15
+
16
+ The data object is more free form. Some commonality of fields is worthwhile,
17
+ but whatever most sensibly represents the resource is the best choice.
18
+
19
+ Where a resource refers to another, include a subset of the other resource in
20
+ the data object.
21
+
22
+ Examples: #with ruby style comments
23
+
@@ -0,0 +1,167 @@
1
+ # list of menus
2
+ # This is the serialized output of Menu.list (class method)
3
+ #
4
+ # GET /admin/menus
5
+ {
6
+ links; {
7
+ self: "/admin/menus"
8
+ },
9
+ data: [
10
+ { links: {
11
+ self: 'admin/menus/:id1'
12
+ },
13
+ data: {
14
+ name: 'Menu 1'
15
+ }
16
+ },
17
+ { links: {
18
+ self: 'admin/menus/:id2'
19
+ },
20
+ data: {
21
+ name: 'Menu 2'
22
+ }
23
+ },
24
+ { links: {
25
+ self: 'admin/menus/:id3'
26
+ },
27
+ data: {
28
+ name: 'Menu 3'
29
+ }
30
+ }
31
+ ]
32
+ }
33
+
34
+
35
+ # GET /admin/menu/:id
36
+ #
37
+ # Just like /navigation/main but takes the ID of one of the menus returned
38
+ # in admin/menus, gives the full list *with* admin links for individual
39
+ # menu items
40
+ {
41
+ links: {
42
+ self: "/admin/menu/:id"
43
+ },
44
+ data: [
45
+
46
+ # a top-level menu item
47
+ {
48
+ links : {
49
+ self: 'admin/menu-item/:id'
50
+ }
51
+ data : {
52
+ name: "Services",
53
+ path: # IF type == 'raw url', this is included and contains the url
54
+ page: { links: { self: "pages/:url_slug", #IF type == 'page', this is the URL of the page resource
55
+ type: [ 'page' | 'raw_url' ]
56
+ children: [
57
+
58
+ # a sub-menu item under "Services", with a page link
59
+ {
60
+ links: {
61
+ self: 'admin/menu-item/:id'
62
+ },
63
+ data: {
64
+ type: 'page',
65
+ name: "Startup MVPs",
66
+ page: { links: { self: '/pages/startup-mvps' }} ,
67
+ # no children - key omitted
68
+ }
69
+ },
70
+
71
+ # a second sub-menu item under "Services", with a page link
72
+ {
73
+ links: {
74
+ self: 'admin/menu-item/:id'
75
+ },
76
+ data: {
77
+ type: 'page'
78
+ name: "Code Rescue",
79
+ page: { links: { self: '/pages/code-rescue' }} ,
80
+ # no children - key omitted
81
+ }
82
+ },
83
+
84
+ ]
85
+ }
86
+ },
87
+
88
+ # a top-level menu item with an external link
89
+ {
90
+ links : {
91
+ self: 'admin/menu-item/:id'
92
+ }
93
+ data: {
94
+ type: 'raw_url',
95
+ name: "About Web Security",
96
+ path: 'https://www.owasp.org/index.php/Main_Page',
97
+ # no children - key omitted
98
+ }
99
+ }
100
+ ]
101
+ }
102
+
103
+
104
+
105
+
106
+
107
+ # GET /admin/menu-items/:id
108
+ # For an item that liks to an external URL
109
+ {
110
+ links : {
111
+ self: 'admin/menu-items/:id'
112
+ }
113
+ data: {
114
+ type: 'raw_url',
115
+ name: 'Services',
116
+ path: 'https://www.owasp.org/index.php/Main_Page',
117
+ parent_id: <integer>
118
+ }
119
+ }
120
+ # GET /admin/menu-items/:id
121
+ # For an item that liks to a page
122
+ {
123
+ links : {
124
+ self: 'admin/menu-items/:id'
125
+ }
126
+ data: {
127
+ type: 'page',
128
+ name: 'Services',
129
+ page: { links: { self: '/pages/:url_slug' }},
130
+ page_id: <integer>,
131
+ parent_id: <integer>
132
+ }
133
+ }
134
+
135
+ #
136
+ # POST /admin/menu-items
137
+ #
138
+
139
+ {
140
+ # links omitted
141
+
142
+ data : {
143
+ name: "Services", # REQUIRED
144
+ path: '/services', # optional if links to page
145
+ page_url_slug: '/page_url_slug' # optional if links to external website
146
+ type: [ 'page' | 'raw_url' ] # REQUIRED
147
+ parent_id: <integer> # optional
148
+ }
149
+ }
150
+
151
+ #
152
+ # PUT /admin/menu-items/:id
153
+ #
154
+
155
+ {
156
+ # links omitted
157
+
158
+ data : {
159
+ name: "Services", # optional
160
+ path: '/services', # optional
161
+ page_url_slug: '/page_url_slug' # optional
162
+ type: [ 'page' | 'raw_url' ] # optional
163
+ parent_id: <integer> # optional
164
+ }
165
+ }
166
+
167
+
@@ -0,0 +1,173 @@
1
+ # NOTE: public has no view of list of pages
2
+ # This endpoint will NOT include blog posts: this is the list
3
+ # of pages to appear in the "Edit Pages" tool for admin users.
4
+ #
5
+ # RFC: Is 'self' link the public view of the page, or the admin
6
+ # view of the page? I'd think the latter
7
+ #
8
+ # GET /admin/pages
9
+ {
10
+ links {
11
+ self: '/admin/pages'
12
+ },
13
+ data: [
14
+ { links: {
15
+ self: '/admin/pages/:slug1'
16
+ public: '/pages/:slug1'
17
+ },
18
+ data: {
19
+ title: 'Page 1',
20
+ layout: "one_column",
21
+ url_slug: "url_slug",
22
+ published: [true | false],
23
+ publish_start: <date/time>,
24
+ publish_end: <date/time>
25
+ }
26
+ },
27
+ { links: {
28
+ self: '/admin/pages/:slug2' ,
29
+ public: '/pages/:slug2'
30
+ },
31
+ data: {
32
+ title: 'Page 2'
33
+ layout: "one_column",
34
+ url_slug: "url_slug",
35
+ published: [true | false],
36
+ publish_start: <date/time>,
37
+ publish_end: <date/time>
38
+ }
39
+ },
40
+ { links: {
41
+ self: '/admin/pages/:slug3'
42
+ public: '/pages/:slug3'
43
+ },
44
+ data: {
45
+ title: 'Page 3',
46
+ layout: "two_column",
47
+ url_slug: "url_slug",
48
+ published: [true | false],
49
+ publish_start: <date/time>,
50
+ publish_end: <date/time>
51
+ }
52
+ }
53
+ ]
54
+ }
55
+
56
+ # RFP: I think this one is ready to go.
57
+ #
58
+ # GET /admin/pages/:url_slug
59
+ {
60
+ links: {
61
+ self: "/admin/pages/:slug",
62
+ public: "/pages/:slug"
63
+ },
64
+
65
+ data: {
66
+ url_slug: 'some-url-slug',
67
+ title: "string",
68
+ keywords: "string",
69
+ description: "string",
70
+ layout: "one_column",
71
+ url_slug: "url_slug",
72
+ published: "boolean",
73
+ publish_start: "datetime",
74
+ publish_end: "datetime",
75
+ contents: {
76
+ main: {
77
+ links: { self: "/content-blocks/:id" }
78
+ data: {
79
+ content_type: 'text/html',
80
+ body: 'Four score and <em>seven</em> years'
81
+ }
82
+ },
83
+ headline: {
84
+ links: { self: "/content-blocks/:id" },
85
+ data: {
86
+ content_type: 'text/html',
87
+ body: 'The Gettysburg Address'
88
+ }
89
+ },
90
+ styles: {
91
+ links: { self: "/content-blocks/:id" },
92
+ data: {
93
+ content_type: 'text/css',
94
+ body: 'p { font-weight: bold; }'
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+
101
+
102
+ # POST /admin/pages
103
+ # creates a page with the supplied content
104
+ {
105
+ # links omitted
106
+ data: {
107
+ url_slug: "string", # optional
108
+ title: "string", # REQUIRED
109
+ keywords: "string", # optional
110
+ description: "string", # optional
111
+ layout: "", # REQUIRED - options are an ENUM per project
112
+
113
+ published: <boolean>, # optional - default true
114
+ publish_start: <datetime>, # optional - default nil
115
+ publish_end: <datetime>, # optional - default nil
116
+
117
+ contents: {
118
+ main: {
119
+ data: {
120
+ # NOTE: content-type omitted because that's specified in the back-end
121
+ # specification for this Page layout
122
+ body: 'Four score and <em>seven</em> years'
123
+ }
124
+ },
125
+ headline: {
126
+ data: {
127
+ body: 'The Gettysburg Address'
128
+ }
129
+ },
130
+ styles: {
131
+ data: {
132
+ body: 'p { font-weight: bold; }'
133
+ }
134
+ }
135
+ }
136
+ }
137
+ }
138
+
139
+ # PUT /admin/pages/:url_slug
140
+ # exactly like POST except that all fields are now optional, existing
141
+ # values will be retained
142
+ {
143
+ # links omitted
144
+ data: {
145
+ url_slug: "string", # optional
146
+ title: "string", # optional
147
+ keywords: "string", # optional
148
+ description: "string", # optional
149
+ layout: "", # optional
150
+
151
+ published: <boolean>, # optional - default true
152
+ publish_start: <datetime>, # optional - default nil
153
+ publish_end: <datetime>, # optional - default nil
154
+
155
+ contents: {
156
+ main: {
157
+ data: {
158
+ body: 'Four score and <em>seven</em> years'
159
+ }
160
+ },
161
+ headline: {
162
+ data: {
163
+ body: 'The Gettysburg Address'
164
+ }
165
+ },
166
+ styles: {
167
+ data: {
168
+ body: 'p { font-weight: bold; }'
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
@@ -0,0 +1,10 @@
1
+ # There is no POST or GET for content-block. They should be created and fetched via the page
2
+ # resource. However, in order to support in-line / AJAXY editing, the front-end may update
3
+ # an individual content block resource.
4
+
5
+ # PUT /admin/content-blocks/:id
6
+ {
7
+ data: {
8
+ body: "New value for this content block's body"
9
+ }
10
+ }
@@ -0,0 +1,54 @@
1
+
2
+
3
+ #GET /navigation/main:
4
+ {
5
+ links: {
6
+ self: "/navigation/main"
7
+ },
8
+ data: [
9
+
10
+ # a top-level menu item
11
+ {
12
+ links : {}
13
+ data : {
14
+ name: "Services",
15
+ url: 'services',
16
+ type: [ 'page' | 'raw_url' ]
17
+ children: [
18
+
19
+ # a sub-menu item under "Services"
20
+ {
21
+ links: {},
22
+ data: {
23
+ name: "Startup MVPs",
24
+ url: '/startup-mvps',
25
+ type: [ 'page' | 'raw_url' ],
26
+ # no children - key omitted
27
+ }
28
+ },
29
+ {
30
+ links: {},
31
+ data: {
32
+ name: "Code Rescue",
33
+ url: '/code-rescue'
34
+ type: [ 'page' | 'raw_url' ]
35
+ # no children - key omitted
36
+ }
37
+ },
38
+
39
+ ]
40
+ }
41
+ },
42
+
43
+ # a top-level menu item with an external link
44
+ {
45
+ links : {}
46
+ data : {
47
+ name: "About Web Security",
48
+ url: 'https://www.owasp.org/index.php/Main_Page',
49
+ type: 'raw_url',
50
+ # no children - key ommitted
51
+ }
52
+ }
53
+ ]
54
+ }
@@ -0,0 +1,38 @@
1
+
2
+ # an individual page
3
+ GET /pages/:slug
4
+ {
5
+ links: {
6
+ self: "/pages/:slug",
7
+ admin: "admin/pages/:slug"
8
+ },
9
+ data: {
10
+ title: "string",
11
+ keywords: "string",
12
+ description: "string",
13
+ layout: "one_column",
14
+ contents: {
15
+ main: {
16
+ links: { self: "/content-blocks/:id" }
17
+ data: {
18
+ content_type: 'text/html',
19
+ body: 'Four score and <em>seven</em> years'
20
+ }
21
+ },
22
+ headline: {
23
+ links: { self: "/content-blocks/:id" },
24
+ data: {
25
+ content_type: 'text/html',
26
+ body: 'The Gettysburg Address'
27
+ }
28
+ },
29
+ styles: {
30
+ links: { self: "/content-blocks/:id" },
31
+ data: {
32
+ content_type: 'text/css',
33
+ body: 'p { font-weight: bold; }'
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }