cambium 0.3.0 → 1.0.0

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/LICENSE.txt +1 -1
  3. data/README.md +339 -15
  4. data/{lib/generators/cambium/templates/app/assets/javascripts/admin/admin.js.coffee → app/assets/javascripts/cambium/admin/application.js.coffee} +4 -10
  5. data/app/assets/javascripts/cambium/admin/routers/router.js.coffee +25 -0
  6. data/app/assets/javascripts/cambium/admin/users.js +2 -0
  7. data/app/assets/javascripts/cambium/admin/views/dropdown_menu.js.coffee +24 -0
  8. data/app/assets/javascripts/cambium/admin/views/pickadate.js.coffee +15 -0
  9. data/app/assets/stylesheets/cambium/admin/application.scss +27 -0
  10. data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_colors.scss +7 -7
  11. data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones.scss +18 -18
  12. data/app/assets/stylesheets/cambium/admin/partials/_globals.scss +21 -0
  13. data/app/assets/stylesheets/cambium/admin/partials/activity.scss +52 -0
  14. data/app/assets/stylesheets/cambium/admin/partials/components.scss +64 -0
  15. data/app/assets/stylesheets/cambium/admin/partials/dashboard.scss +48 -0
  16. data/app/assets/stylesheets/cambium/admin/partials/forms.scss +107 -0
  17. data/app/assets/stylesheets/cambium/admin/partials/header.scss +113 -0
  18. data/app/assets/stylesheets/cambium/admin/partials/page_title.scss +42 -0
  19. data/app/assets/stylesheets/cambium/admin/partials/sidebar.scss +41 -0
  20. data/app/assets/stylesheets/cambium/admin/partials/tables.scss +80 -0
  21. data/app/assets/stylesheets/cambium/admin/partials/typography.scss +5 -0
  22. data/app/assets/stylesheets/cambium/admin/partials/wireframe.scss +52 -0
  23. data/app/assets/stylesheets/cambium/admin/users.css +4 -0
  24. data/app/controllers/cambium/admin/dashboard_controller.rb +12 -0
  25. data/app/controllers/cambium/admin/search_controller.rb +9 -0
  26. data/app/controllers/cambium/admin/users_controller.rb +30 -0
  27. data/app/controllers/cambium/admin_controller.rb +90 -0
  28. data/app/helpers/cambium/cambium_helper.rb +205 -0
  29. data/app/presenters/cambium/admin_presenter.rb +127 -0
  30. data/app/views/cambium/admin/_activity.html.erb +6 -0
  31. data/app/views/cambium/admin/_header.html.erb +41 -0
  32. data/app/views/cambium/admin/_sidebar.html.erb +19 -0
  33. data/app/views/cambium/admin/_status.html.erb +5 -0
  34. data/app/views/cambium/admin/dashboard/show.html.erb +5 -0
  35. data/app/views/cambium/admin/edit.html.erb +7 -0
  36. data/app/views/cambium/admin/index.html.erb +7 -0
  37. data/app/views/cambium/admin/new.html.erb +7 -0
  38. data/app/views/cambium/admin/paper_trail/versions/_version.html.erb +20 -0
  39. data/app/views/cambium/admin/search/index.html.erb +38 -0
  40. data/app/views/layouts/admin.html.erb +25 -0
  41. data/bin/rails +12 -0
  42. data/cambium.gemspec +19 -15
  43. data/config/routes.rb +10 -0
  44. data/lib/cambium/configuration.rb +28 -0
  45. data/lib/cambium/engine.rb +2 -1
  46. data/lib/cambium/version.rb +1 -1
  47. data/lib/cambium.rb +12 -1
  48. data/lib/generators/cambium/admin_generator.rb +104 -0
  49. data/lib/generators/cambium/app_generator.rb +205 -0
  50. data/lib/generators/cambium/controller_generator.rb +81 -0
  51. data/lib/generators/cambium/gemfile_generator.rb +36 -0
  52. data/lib/generators/cambium/install_generator.rb +19 -0
  53. data/lib/generators/cambium/user_generator.rb +40 -0
  54. data/lib/generators/{cambium/helpers → helpers}/generators_helper.rb +32 -24
  55. data/lib/generators/templates/Gemfile.erb +79 -0
  56. data/lib/generators/{cambium/templates/app/assets/javascripts/backbone/app.js.coffee → templates/app/assets/javascripts/application.js.coffee} +9 -1
  57. data/lib/generators/templates/app/assets/javascripts/views/default_helpers.js.coffee +16 -0
  58. data/lib/generators/templates/app/assets/stylesheets/admin/admin.scss +3 -0
  59. data/lib/generators/templates/app/controllers/admin/controller.rb.erb +2 -0
  60. data/lib/generators/{cambium/templates → templates}/app/controllers/application_controller.rb +1 -5
  61. data/lib/generators/{cambium/templates → templates}/app/models/user.rb +4 -4
  62. data/lib/generators/templates/app/views/application/_status.html.erb +3 -0
  63. data/lib/generators/{cambium/templates → templates}/app/views/layouts/application.html.erb +1 -1
  64. data/lib/generators/templates/config/admin/controller.yml.erb +24 -0
  65. data/lib/generators/templates/config/admin/sidebar.yml +9 -0
  66. data/lib/generators/templates/config/admin/users.yml +31 -0
  67. data/lib/generators/{cambium/templates → templates}/config/application.rb +6 -4
  68. data/lib/generators/templates/config/initializers/_hash.rb +23 -0
  69. data/lib/generators/templates/config/initializers/_settings.rb +18 -0
  70. data/lib/generators/templates/config/initializers/assets.rb +1 -0
  71. data/lib/generators/templates/config/initializers/cambium.rb +16 -0
  72. data/lib/generators/templates/config/private.yml +16 -0
  73. data/lib/generators/templates/config/routes.rb +54 -0
  74. data/lib/generators/templates/config/settings.yml +16 -0
  75. data/lib/generators/{cambium/templates → templates}/gitignore +1 -1
  76. data/lib/help/cambium_prereqs.txt +13 -0
  77. data/lib/help/pg_search_post_install.txt +13 -0
  78. data/lib/{generators/cambium/templates/lib/tasks → tasks}/db.rake +2 -2
  79. data/lib/{generators/cambium/templates/lib/tasks → tasks}/rename.rake +1 -1
  80. data/test/controllers/cambium/admin/dashboard_controller_test.rb +9 -0
  81. data/test/controllers/cambium/admin/users_controller_test.rb +9 -0
  82. data/test/controllers/cambium/admin_controller_test.rb +9 -0
  83. metadata +192 -152
  84. data/bin/cambium +0 -16
  85. data/lib/generators/cambium/helpers/dependencies_helper.rb +0 -58
  86. data/lib/generators/cambium/install/admin_generator.rb +0 -110
  87. data/lib/generators/cambium/install/app_generator.rb +0 -162
  88. data/lib/generators/cambium/install/config_generator.rb +0 -182
  89. data/lib/generators/cambium/install/utilities_generator.rb +0 -57
  90. data/lib/generators/cambium/model/image_generator.rb +0 -67
  91. data/lib/generators/cambium/model/page_generator.rb +0 -131
  92. data/lib/generators/cambium/model/post_generator.rb +0 -71
  93. data/lib/generators/cambium/model/tag_generator.rb +0 -40
  94. data/lib/generators/cambium/model/user_generator.rb +0 -78
  95. data/lib/generators/cambium/templates/Gemfile +0 -43
  96. data/lib/generators/cambium/templates/Gemfile.erb +0 -40
  97. data/lib/generators/cambium/templates/_partials/pages/admin_icon.rb +0 -6
  98. data/lib/generators/cambium/templates/app/assets/javascripts/.DS_Store +0 -0
  99. data/lib/generators/cambium/templates/app/assets/javascripts/admin/collections/.gitkeep +0 -0
  100. data/lib/generators/cambium/templates/app/assets/javascripts/admin/models/.gitkeep +0 -0
  101. data/lib/generators/cambium/templates/app/assets/javascripts/admin/models/image.js.coffee +0 -14
  102. data/lib/generators/cambium/templates/app/assets/javascripts/admin/models/tag.js.coffee +0 -14
  103. data/lib/generators/cambium/templates/app/assets/javascripts/admin/parser_rules/custom.js +0 -552
  104. data/lib/generators/cambium/templates/app/assets/javascripts/admin/routers/router.js.coffee +0 -37
  105. data/lib/generators/cambium/templates/app/assets/javascripts/admin/tag.jst.ejs +0 -7
  106. data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/image.jst.ejs +0 -3
  107. data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/paginator_controls.jst.ejs +0 -8
  108. data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/paginator_nav.jst.ejs +0 -11
  109. data/lib/generators/cambium/templates/app/assets/javascripts/admin/templates/post_tag.jst.ejs +0 -1
  110. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/accordion.js.coffee +0 -33
  111. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/counter.js.coffee +0 -25
  112. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/dropdown_toggle.js.coffee +0 -16
  113. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/image_upload.js.coffee +0 -28
  114. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/init_counter.js.coffee +0 -13
  115. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/paginator.js.coffee +0 -86
  116. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/publishable.js.coffee +0 -12
  117. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/tags.js.coffee +0 -158
  118. data/lib/generators/cambium/templates/app/assets/javascripts/admin/views/wysiwyg.js.coffee +0 -87
  119. data/lib/generators/cambium/templates/app/assets/javascripts/admin/wysihtml5.js +0 -9521
  120. data/lib/generators/cambium/templates/app/assets/javascripts/application.js +0 -10
  121. data/lib/generators/cambium/templates/app/assets/javascripts/backbone/templates/.keep +0 -0
  122. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/admin.scss +0 -14
  123. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_content.scss +0 -88
  124. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_form.scss +0 -470
  125. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_globals.scss +0 -39
  126. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_header.scss +0 -121
  127. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_nav.scss +0 -45
  128. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/partials/_wireframe.scss +0 -24
  129. data/lib/generators/cambium/templates/app/assets/stylesheets/admin/wysihtml5.css +0 -7
  130. data/lib/generators/cambium/templates/app/controllers/admin/images_controller.rb +0 -45
  131. data/lib/generators/cambium/templates/app/controllers/admin/pages_controller.rb +0 -42
  132. data/lib/generators/cambium/templates/app/controllers/admin/posts_controller.rb +0 -39
  133. data/lib/generators/cambium/templates/app/controllers/admin/taggings_controller.rb +0 -69
  134. data/lib/generators/cambium/templates/app/controllers/admin/tags_controller.rb +0 -11
  135. data/lib/generators/cambium/templates/app/controllers/admin/users_controller.rb +0 -13
  136. data/lib/generators/cambium/templates/app/controllers/admin_controller.rb +0 -97
  137. data/lib/generators/cambium/templates/app/controllers/images_controller.rb +0 -45
  138. data/lib/generators/cambium/templates/app/controllers/pages_controller.rb +0 -12
  139. data/lib/generators/cambium/templates/app/controllers/posts_controller.rb +0 -11
  140. data/lib/generators/cambium/templates/app/helpers/admin/pages_controller.rb +0 -47
  141. data/lib/generators/cambium/templates/app/helpers/admin_helper.rb +0 -121
  142. data/lib/generators/cambium/templates/app/models/concerns/name.rb +0 -7
  143. data/lib/generators/cambium/templates/app/models/concerns/title.rb +0 -7
  144. data/lib/generators/cambium/templates/app/models/image.rb +0 -43
  145. data/lib/generators/cambium/templates/app/models/page.rb +0 -81
  146. data/lib/generators/cambium/templates/app/models/post.rb +0 -45
  147. data/lib/generators/cambium/templates/app/models/tag.rb +0 -33
  148. data/lib/generators/cambium/templates/app/models/tagging.rb +0 -20
  149. data/lib/generators/cambium/templates/app/uploaders/image_uploader.rb +0 -91
  150. data/lib/generators/cambium/templates/app/views/admin/_buttons.html.erb +0 -5
  151. data/lib/generators/cambium/templates/app/views/admin/_form.html.erb +0 -11
  152. data/lib/generators/cambium/templates/app/views/admin/_title.html.erb +0 -1
  153. data/lib/generators/cambium/templates/app/views/admin/edit.html.erb +0 -2
  154. data/lib/generators/cambium/templates/app/views/admin/images/_image.html.erb +0 -1
  155. data/lib/generators/cambium/templates/app/views/admin/images/create.js.erb +0 -7
  156. data/lib/generators/cambium/templates/app/views/admin/images/index.json.jbuilder +0 -4
  157. data/lib/generators/cambium/templates/app/views/admin/index.html.erb +0 -50
  158. data/lib/generators/cambium/templates/app/views/admin/new.html.erb +0 -2
  159. data/lib/generators/cambium/templates/app/views/admin/pages/_form.html.erb +0 -26
  160. data/lib/generators/cambium/templates/app/views/admin/posts/_form.html.erb +0 -40
  161. data/lib/generators/cambium/templates/app/views/admin/shared/_footer.html.erb +0 -2
  162. data/lib/generators/cambium/templates/app/views/admin/shared/_header.html.erb +0 -2
  163. data/lib/generators/cambium/templates/app/views/admin/shared/_insert_image.html.erb +0 -12
  164. data/lib/generators/cambium/templates/app/views/admin/shared/_nav.html.erb +0 -12
  165. data/lib/generators/cambium/templates/app/views/admin/shared/_status.html.erb +0 -3
  166. data/lib/generators/cambium/templates/app/views/admin/shared/forms/_editor.html.erb +0 -54
  167. data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_column_left.html.erb +0 -9
  168. data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_column_right.html.erb +0 -9
  169. data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_page.html.erb +0 -22
  170. data/lib/generators/cambium/templates/app/views/admin/shared/forms/_form_section.html.erb +0 -8
  171. data/lib/generators/cambium/templates/app/views/admin/shared/forms/_publishable.html.erb +0 -33
  172. data/lib/generators/cambium/templates/app/views/admin/users/_form.html.erb +0 -11
  173. data/lib/generators/cambium/templates/app/views/application/_status.html.erb +0 -3
  174. data/lib/generators/cambium/templates/app/views/layouts/.DS_Store +0 -0
  175. data/lib/generators/cambium/templates/app/views/layouts/admin.html.erb +0 -44
  176. data/lib/generators/cambium/templates/app/views/page_templates/default.html.erb +0 -2
  177. data/lib/generators/cambium/templates/app/views/posts/_post.html.erb +0 -4
  178. data/lib/generators/cambium/templates/app/views/posts/index.html.erb +0 -1
  179. data/lib/generators/cambium/templates/app/views/posts/show.html.erb +0 -10
  180. data/lib/generators/cambium/templates/config/app_routes.rb +0 -77
  181. data/lib/generators/cambium/templates/config/database.mysql2.yml.erb +0 -15
  182. data/lib/generators/cambium/templates/config/database.pg.yml.erb +0 -14
  183. data/lib/generators/cambium/templates/config/database.sqlite3.yml.erb +0 -18
  184. data/lib/generators/cambium/templates/config/initializers/_settings.rb +0 -11
  185. data/lib/generators/cambium/templates/config/initializers/assets.rb +0 -1
  186. data/lib/generators/cambium/templates/config/routes.rb.erb +0 -42
  187. data/lib/generators/cambium/templates/config/settings.yml +0 -15
  188. data/lib/generators/cambium/templates/config/settings_private.sample.yml +0 -15
  189. data/lib/generators/cambium/templates/config/settings_private.yml +0 -13
  190. data/lib/generators/cambium/templates/db/migrate/create_pages.rb.erb +0 -24
  191. data/lib/generators/cambium/templates/db/migrate/create_posts.rb +0 -19
  192. data/lib/generators/cambium/templates/lib/.DS_Store +0 -0
  193. data/lib/help/cambium +0 -7
  194. /data/{lib/generators/cambium/templates/app/assets/javascripts/backbone/collections → app/assets/javascripts/cambium/admin/templates}/.keep +0 -0
  195. /data/{lib/generators/cambium/templates/app/assets/javascripts/backbone → app/assets/javascripts/cambium/admin}/views/default_helpers.js.coffee +0 -0
  196. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/__default.scss +0 -0
  197. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_buttons.scss +0 -0
  198. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_components.scss +0 -0
  199. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_forms.scss +0 -0
  200. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_helpers.scss +0 -0
  201. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_images.scss +0 -0
  202. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_nav.scss +0 -0
  203. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_tables.scss +0 -0
  204. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_typography.scss +0 -0
  205. /data/{lib/generators/cambium/templates/app/assets/stylesheets → app/assets/stylesheets/cambium}/admin/bones/bones-config/_wireframe.scss +0 -0
  206. /data/{lib/generators/cambium/templates/app → app}/models/concerns/idx.rb +0 -0
  207. /data/{lib/generators/cambium/templates/app → app}/models/concerns/image_cropper.rb +0 -0
  208. /data/{lib/generators/cambium/templates/app → app}/models/concerns/publishable.rb +0 -0
  209. /data/{lib/generators/cambium/templates/app → app}/models/concerns/slug.rb +0 -0
  210. /data/{lib/generators/cambium/templates/app → app}/models/concerns/tags.rb +0 -0
  211. /data/lib/generators/{cambium/helpers → helpers}/_autoloader.rb +0 -0
  212. /data/lib/generators/{cambium/templates/app/assets/javascripts/backbone → templates/app/assets/javascripts}/routers/router.js.coffee +0 -0
  213. /data/lib/generators/{cambium/templates/app/assets/javascripts/backbone/models → templates/app/assets/javascripts/templates}/.keep +0 -0
  214. /data/lib/generators/{cambium/templates → templates}/app/assets/stylesheets/application.scss +0 -0
  215. /data/lib/generators/{cambium/templates → templates}/app/views/home/index.html.erb +0 -0
  216. /data/lib/generators/{cambium/templates → templates}/db/seeds.rb +0 -0
  217. /data/{lib/generators/cambium/templates/vendor → vendor}/assets/javascripts/modernizr.js +0 -0
  218. /data/{lib/generators/cambium/templates/vendor → vendor}/assets/stylesheets/normalize.scss +0 -0
@@ -0,0 +1,64 @@
1
+ div.status{
2
+ position: fixed;
3
+ bottom: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ z-index: 99999;
7
+ text-align: center;
8
+ @include box-sizing(border-box);
9
+ p.notice, p.alert {
10
+ margin: 0;
11
+ padding: 25px 0;
12
+ background: rgba($color-2, 0.93);
13
+ color: $color-dark;
14
+ font-size: 25px;
15
+ line-height: 32px;
16
+ &.alert {
17
+ background: rgba($color-danger, 0.93);
18
+ }
19
+ }
20
+ }
21
+
22
+ .dropdown-container {
23
+ position: relative;
24
+ .dropdown-menu {
25
+ display: none;
26
+ position: absolute;
27
+ top: 100%;
28
+ left: 0;
29
+ width: 100%;
30
+ z-index: 9999;
31
+ &.active {
32
+ display: block;
33
+ }
34
+ ul {
35
+ @include clear-list;
36
+ }
37
+ }
38
+ }
39
+
40
+ .button {
41
+ &.new, &.export {
42
+ &:before {
43
+ font-family: 'icomoon';
44
+ font-size: inherit;
45
+ line-height: inherit;
46
+ margin: 0 5px 0 0;
47
+ }
48
+ }
49
+ &.new:before { content: "\e702"; }
50
+ &.export:before { content: "\e65e"; }
51
+ }
52
+
53
+ .avatar-container {
54
+ display: inline-block;
55
+ width: 36px;
56
+ height: 36px;
57
+ border-radius: 100%;
58
+ border: 2px solid white;
59
+ overflow: hidden;
60
+ background: white;
61
+ img {
62
+ width: 100%;
63
+ }
64
+ }
@@ -0,0 +1,48 @@
1
+ #page-content.dashboard {
2
+ > section {
3
+ article {
4
+ margin: 0 0 30px 0;
5
+ &:last-child {
6
+ margin-bottom: 0;
7
+ }
8
+ .avatar-container {
9
+ margin: 0 10px 0 0;
10
+ border-color: $color-light-darker;
11
+ vertical-align: middle;
12
+ }
13
+ .content {
14
+ display: inline-block;
15
+ width: auto;
16
+ vertical-align: middle;
17
+ p {
18
+ margin: 0;
19
+ font-size: 15px;
20
+ line-height: 20px;
21
+ &.action {
22
+ margin-top: 5px;
23
+ }
24
+ &.date {
25
+ color: darken($color-light-darkest, 10%);
26
+ font-weight: 400;
27
+ font-size: 14px;
28
+ line-height: 14px;
29
+ }
30
+ strong {
31
+ font-size: inherit;
32
+ line-height: inherit;
33
+ a {
34
+ font-size: inherit;
35
+ line-height: inherit;
36
+ font-weight: inherit;
37
+ color: inherit;
38
+ @include transition-all;
39
+ &:hover {
40
+ color: $color-dark-lightest;
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,107 @@
1
+ section.form {
2
+ form {
3
+
4
+ div.input {
5
+ font-size: 0;
6
+ padding: 20px 0;
7
+ label {
8
+ position: relative;
9
+ display: inline-block;
10
+ width: 25%;
11
+ margin-top: 5px;
12
+ vertical-align: top;
13
+ font-size: 16px;
14
+ font-weight: 600;
15
+ text-transform: uppercase;
16
+ &.boolean {
17
+ margin: 0;
18
+ }
19
+ &.radio_buttons, &.check_boxes {
20
+ float: left;
21
+ margin-top: 0;
22
+ }
23
+ input.boolean {
24
+ position: absolute;
25
+ left: 100%;
26
+ top: 3px;
27
+ }
28
+ }
29
+ input, textarea, select, div.markdown {
30
+ position: relative;
31
+ display: inline-block;
32
+ width: 75%;
33
+ margin: 0;
34
+ padding: 5px;
35
+ vertical-align: bottom;
36
+ font-size: 16px;
37
+ border: none;
38
+ }
39
+ input {
40
+ border-bottom: 1px solid $color-light-darker;
41
+ &.pickadatetime-date {
42
+ width: 37%;
43
+ margin-right: 1%;
44
+ }
45
+ &.pickadatetime-time {
46
+ width: 37%;
47
+ + div.picker {
48
+ left: 62%;
49
+ }
50
+ }
51
+ }
52
+ textarea {
53
+ height: 200px;
54
+ border: 1px solid $color-light-darker;
55
+ }
56
+ select {}
57
+ div.markdown {
58
+ padding: 0;
59
+ }
60
+ span.radio, span.checkbox {
61
+ display: block;
62
+ width: 75%;
63
+ margin-left: 25%;
64
+ &:last-child {
65
+ label {
66
+ margin-bottom: 0;
67
+ }
68
+ }
69
+ label {
70
+ display: block;
71
+ margin: 0 0 12px 0;
72
+ line-height: 14px;
73
+ }
74
+ input {
75
+ width: auto;
76
+ margin: 0 5px 0 0;
77
+ }
78
+ }
79
+ div.picker {
80
+ left: 25%;
81
+ .picker__weekday {
82
+ color: $color-light;
83
+ }
84
+ .picker__button--today, .picker__button--clear, .picker__button--close {
85
+ color: $color-dark;
86
+ }
87
+ }
88
+ }
89
+
90
+ input[type=submit] {
91
+ display: block;
92
+ width: 100%;
93
+ margin: 15px 0 0 0;
94
+ @include box-sizing(border-box);
95
+ @include transition(all 0.35s linear);
96
+ font-size: 16px;
97
+ font-weight: 600;
98
+ text-transform: uppercase;
99
+ &:hover, &:active, &:focus {
100
+ border: none;
101
+ outline: none;
102
+ background: $color-2;
103
+ color: $color-dark;
104
+ }
105
+ }
106
+ }
107
+ }
@@ -0,0 +1,113 @@
1
+ header {
2
+ background: $color-5;
3
+
4
+ .logo {
5
+ display: inline-block;
6
+ width: 250px;
7
+ text-align: center;
8
+ border-right: 1px solid $color-5-dark;
9
+ a {
10
+ display: block;
11
+ padding: 15px 25px;
12
+ font-size: 24px;
13
+ font-weight: 600;
14
+ text-transform: uppercase;
15
+ color: $color-light;
16
+ @include transition-all;
17
+ &:hover {
18
+ background: $color-5-light;
19
+ }
20
+ }
21
+ }
22
+
23
+ .search-box{
24
+ display: inline-block;
25
+ padding: 0;
26
+ vertical-align: top;
27
+ input {
28
+ margin: 0;
29
+ padding: 16px 15px;
30
+ width: 150px;
31
+ border: none;
32
+ color: $color-light;
33
+ background: transparent;
34
+ font-size: 22px;
35
+ @include transition(width 0.25s ease-in-out);
36
+ border: none;
37
+ outline: none;
38
+ @include placeholder {
39
+ color: $color-light-darker;
40
+ }
41
+ &:focus {
42
+ border: none;
43
+ outline: none;
44
+ width: 300px;
45
+ }
46
+ }
47
+ }
48
+
49
+ .user {
50
+ float: right;
51
+ height: 60px;
52
+ padding: 0;
53
+ @include box-sizing(border-box);
54
+ // border-left: 1px solid $color-5-dark;
55
+ @include transition-all;
56
+ &:hover {
57
+ cursor: pointer;
58
+ }
59
+ a {
60
+ display: block;
61
+ padding: 10px 25px;
62
+ .name {
63
+ display: inline-block;
64
+ vertical-align: middle;
65
+ margin: 0 10px 0 0;
66
+ color: $color-light;
67
+ // &:after {
68
+ // display: inline-block;
69
+ // position: absolute;
70
+ // margin: 2px 0 0 5px;
71
+ // font-family: 'icomoon';
72
+ // content: "\e734";
73
+ // }
74
+ }
75
+ .avatar-container {
76
+ display: inline-block;
77
+ vertical-align: middle;
78
+ height: 40px;
79
+ width: 40px;
80
+ overflow: hidden;
81
+ border-radius: 100%;
82
+ border: 2px solid $color-light;
83
+ background: $color-light;
84
+ img {
85
+ width: 100%;
86
+ }
87
+ }
88
+ }
89
+ .dropdown-menu {
90
+ background: $color-dark;
91
+ // border: 1px solid $color-5;
92
+ // border-top: none;
93
+ ul {
94
+ li {
95
+ display: block;
96
+ a {
97
+ display: block;
98
+ padding: 10px 15px;
99
+ font-weight: 400;
100
+ font-size: 15px;
101
+ color: $color-light-darkest;
102
+ @include transition-all;
103
+ &:hover, &:active, &:focus {
104
+ color: $color-light;
105
+ background: $color-dark-light;
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+
112
+ }
113
+ }
@@ -0,0 +1,42 @@
1
+ #title-bar {
2
+ position: fixed;
3
+ width: 100%;
4
+ top: 60px;
5
+ left: 0;
6
+ padding: 0 275px;
7
+ z-index: 4;
8
+ background: $color-light;
9
+ border-bottom: 1px solid $color-light-darker;
10
+ .page-title {
11
+ display: inline-block;
12
+ margin: 0;
13
+ padding: 10px 0;
14
+ text-transform: uppercase;
15
+ font-size: 26px;
16
+ line-height: 26px;
17
+ }
18
+ .button {
19
+ display: inline-block;
20
+ background: $color-1;
21
+ margin: 10px 5px;
22
+ padding: 6px 10px;
23
+ font-size: 15px;
24
+ font-weight: 400;
25
+ color: $color-dark;
26
+ vertical-align: top;
27
+ &.new, &.export {
28
+ margin: 12px 0 0 10px;
29
+ padding: 3px 8px;
30
+ font-size: 13px;
31
+ &:before {
32
+ font-size: 10px;
33
+ }
34
+ }
35
+ &.new {
36
+ background: $color-2;
37
+ }
38
+ &.export {
39
+ float: right;
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,41 @@
1
+ aside#nav {
2
+ background: $color-dark;
3
+ nav {
4
+ ul {
5
+ float: none;
6
+ margin: 25px 0 0 0;
7
+ li {
8
+ display: block;
9
+ a {
10
+ display: block;
11
+ margin: 0;
12
+ padding: 15px 0 15px 25px;
13
+ font-size: 16px;
14
+ font-weight: 400;
15
+ border-left: 1px solid transparent;
16
+ border-bottom: none;
17
+ color: $color-light-darkest;
18
+ @include transition-all;
19
+ &:hover, &:active, &:focus {
20
+ color: $color-light;
21
+ background: $color-dark-light;
22
+ border-left-color: $color-1;
23
+ border-bottom: none;
24
+ }
25
+ &.active {
26
+ color: $color-dark;
27
+ background: $color-2;
28
+ border-left-color: $color-2;
29
+ }
30
+ i {
31
+ display: inline-block;
32
+ margin: 0 7.5px 0 0;
33
+ font-size: inherit;
34
+ font-weight: inherit;
35
+ color: inherit;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,80 @@
1
+ section.data-table {
2
+ table {
3
+ border: none;
4
+ thead {
5
+ tr {
6
+ background: transparent;
7
+ border-bottom: 1px solid $color-light-darker;
8
+ th {
9
+ padding: 5px 15px;
10
+ text-align: left;
11
+ font-size: 18px;
12
+ font-weight: 400;
13
+ text-transform: uppercase;
14
+ color: $color-1;
15
+ }
16
+ }
17
+ }
18
+ tbody {
19
+ tr {
20
+ position: relative;
21
+ @include transition-all;
22
+ border-bottom: 1px solid $color-light-dark;
23
+ td {
24
+ padding: 10px 15px;
25
+ &.search-type {
26
+ font-weight: 400;
27
+ text-transform: uppercase;
28
+ }
29
+ &.no-results {
30
+ text-align: center;
31
+ font-weight: 400;
32
+ color: $color-dark-lighter;
33
+ font-size: 22px;
34
+ line-height: 26px;
35
+ font-style: italic;
36
+ }
37
+ &.actions {
38
+ width: 25px;
39
+ text-align: center;
40
+ a {
41
+ &:before {
42
+ font-family: 'icomoon';
43
+ content: "\e732";
44
+ }
45
+ &:hover {
46
+ color: $color-1;
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ .pagination {
56
+ text-align: right;
57
+ &:first-child {
58
+ margin: 0 0 15px 0;
59
+ }
60
+ &:last-child {
61
+ margin: 15px 0 0 0;
62
+ }
63
+ span {
64
+ display: inline-block;
65
+ margin: 0;
66
+ padding: 0;
67
+ font-weight: 400;
68
+ &.current {
69
+ padding: 3px;
70
+ font-weight: 600;
71
+ }
72
+ a {
73
+ margin: 0;
74
+ padding: 3px;
75
+ font-size: inherit;
76
+ font-weight: inherit;
77
+ }
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,5 @@
1
+ a {
2
+ &:focus, &:active {
3
+ outline: none;
4
+ }
5
+ }
@@ -0,0 +1,52 @@
1
+ body.admin {
2
+ position: relative;
3
+ min-height: 100%;
4
+ background: $color-light-dark;
5
+
6
+ &.dashboard {
7
+ #container {
8
+ padding: 0 0 0 250px;
9
+ #title-bar {
10
+ padding: 0 0 0 275px;
11
+ }
12
+ }
13
+ }
14
+
15
+ > header {
16
+ position: fixed;
17
+ top: 0;
18
+ left: 0;
19
+ width: 100%;
20
+ height: 60px;
21
+ z-index: 99;
22
+ }
23
+ > aside {
24
+ position: fixed;
25
+ top: 0;
26
+ width: 250px;
27
+ height: 100%;
28
+ margin-top: 60px;
29
+ z-index: 9;
30
+ &#nav {
31
+ left: 0;
32
+ }
33
+ &#activity {
34
+ right: 0;
35
+ }
36
+ }
37
+ #container {
38
+ position: relative;
39
+ margin: 60px 0;
40
+ padding: 0 250px;
41
+ z-index: 0;
42
+ #page-content {
43
+ padding: 72px 25px 50px 25px;
44
+ section {
45
+ position: relative;
46
+ padding: 25px;
47
+ background: $color-light;
48
+ border: 1px solid $color-light-dark;
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,12 @@
1
+ module Cambium
2
+ class Admin::DashboardController < AdminController
3
+
4
+ def index
5
+ redirect_to admin_dashboard_path
6
+ end
7
+
8
+ def show
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ module Cambium
2
+ class Admin::SearchController < AdminController
3
+
4
+ def index
5
+ @collection = PgSearch.multisearch(params[:q]).includes(:searchable)
6
+ end
7
+
8
+ end
9
+ end
@@ -0,0 +1,30 @@
1
+ module Cambium
2
+ class Admin::UsersController < AdminController
3
+
4
+ def update
5
+ set_object
6
+ # To make this run smoothly, we remove the password
7
+ # fields from the update_params if they are both
8
+ # missing, that way we don't try to set a blank
9
+ # password.
10
+ p = update_params
11
+ if p[:password].blank? && p[:password_confirmation].blank?
12
+ p = p.except('password','password_confirmation')
13
+ end
14
+ # Now we use the cleansed params `p` and we're ready
15
+ # to try to save the user
16
+ if @object.update(p)
17
+ # If we have successfully saved the user, we're
18
+ # going to sign them back in automatically.
19
+ if @object == current_user
20
+ sign_in(@object, :bypass => true)
21
+ end
22
+ # And then we oome back to regular behavior
23
+ redirect_to(admin_routes.index, :notice => "#{admin_model.to_s} updated!")
24
+ else
25
+ render 'edit'
26
+ end
27
+ end
28
+
29
+ end
30
+ end
@@ -0,0 +1,90 @@
1
+ module Cambium
2
+ class AdminController < ActionController::Base
3
+
4
+ before_filter :authenticate_admin!
5
+ before_filter :set_activities
6
+
7
+ layout "admin"
8
+
9
+ include CambiumHelper
10
+
11
+ def index
12
+ respond_to do |format|
13
+ format.html do
14
+ @collection = admin_model.send(admin_table.scope)
15
+ .page(params[:page] || 1).per(15)
16
+ end
17
+ format.csv do
18
+ @collection = admin_model.send(admin_table.scope)
19
+ send_data admin.to_csv(@collection)
20
+ end
21
+ end
22
+ end
23
+
24
+ def show
25
+ set_object
26
+ redirect_to(admin_routes.edit)
27
+ end
28
+
29
+ def new
30
+ @object = admin_model.new
31
+ end
32
+
33
+ def create
34
+ set_object
35
+ @object = admin_model.new(create_params)
36
+ if @object.save
37
+ redirect_to(admin_routes.index, :notice => "#{admin_model.to_s} created!")
38
+ else
39
+ render 'new'
40
+ end
41
+ end
42
+
43
+ def edit
44
+ set_object
45
+ end
46
+
47
+ def update
48
+ set_object
49
+ if @object.update(update_params)
50
+ redirect_to(admin_routes.index, :notice => "#{admin_model.to_s} updated!")
51
+ else
52
+ render 'edit'
53
+ end
54
+ end
55
+
56
+ private
57
+
58
+ def set_object
59
+ if @object.respond_to?(:slug) && params[:slug]
60
+ @object = admin_model.find_by_slug(params[:slug])
61
+ else
62
+ @object = admin_model.find_by_id(params[:id])
63
+ end
64
+ @obj = @object
65
+ end
66
+
67
+ def authenticate_admin!
68
+ authenticate_user!
69
+ not_found unless current_user.is_admin?
70
+ end
71
+
72
+ def create_params
73
+ params
74
+ .require(admin_model.to_s.humanize.downcase.to_sym)
75
+ .permit(admin_form.fields.to_h.keys)
76
+ end
77
+
78
+ def update_params
79
+ create_params
80
+ end
81
+
82
+ def set_activities
83
+ @activities = PaperTrail::Version.order(:created_at => :desc)
84
+ .includes(:item).limit(20)
85
+ @users = User.where(:id => @activities.collect(&:whodunnit)
86
+ .reject(&:blank?).map(&:to_i))
87
+ end
88
+
89
+ end
90
+ end