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
@@ -1,121 +0,0 @@
1
- header {
2
- position: relative;
3
- background: $color-light-dark;
4
- margin: 0 0 25px 0;
5
- padding: 25px;
6
- @include media(tablet) {
7
- margin-bottom: 0;
8
- }
9
-
10
- h1 {
11
- margin: 0;
12
- font-weight: 200;
13
- }
14
-
15
- a.new {
16
- margin: -5px 0 0 25px;
17
- padding: 20px;
18
- font-size: 22px;
19
- span, i {
20
- color: $color-light;
21
- font-size: 22px;
22
- }
23
- }
24
-
25
- div.dropdown-toggle {
26
- a.trigger {
27
- &.active {
28
- background: $color-1-darker;
29
- }
30
- }
31
- ul {
32
- display: none;
33
- position: absolute;
34
- top: 46px;
35
- right: -3px;
36
- min-width: 200px;
37
- padding: 0;
38
- list-style: none;
39
- border-right: 3px solid white;
40
- border-bottom: 3px solid white;
41
- border-left: 3px solid white;
42
- li {
43
- a {
44
- display: block;
45
- padding: 10px;
46
- font-size: 16px;
47
- color: $color-light;
48
- background: $color-1;
49
- &:hover {
50
- color: $color-light;
51
- background: $color-1-light;
52
- }
53
- }
54
- }
55
- }
56
- }
57
-
58
- div.button-toggle {
59
- float: right;
60
- position: relative;
61
- }
62
-
63
- div.title-toggle {
64
- display: inline-block;
65
- position: relative;
66
- h1 a {
67
- padding: 7.5px 10px;
68
- background: $color-1;
69
- &.trigger {
70
- display: inline-block;
71
- vertical-align: middle;
72
- }
73
- i {
74
- font-size: 28px;
75
- color: $color-light;
76
- }
77
- }
78
- ul {
79
- top: 39px;
80
- }
81
- }
82
-
83
- .breadcrumbs {
84
- margin-bottom: 15px;
85
- a {
86
- &.disabled {
87
- color: $shade-4;
88
- &:hover {
89
- cursor: default;
90
- }
91
- }
92
- }
93
- span {
94
- color: $shade-3;
95
- margin: 0 5px;
96
- }
97
- }
98
-
99
- .published-toggle {
100
- position: absolute;
101
- top: 40px;
102
- right: 30px;
103
- padding: 10px 15px;
104
- background: $color-danger;
105
- span, i {
106
- color: $color-light;
107
- }
108
- i {
109
- margin-right: 10px;
110
- }
111
- &:hover {
112
- color: $color-danger-dark;
113
- }
114
- &.published {
115
- background: $color-success;
116
- &:hover {
117
- background: $color-success-dark;
118
- }
119
- }
120
- }
121
- }
@@ -1,45 +0,0 @@
1
- nav#sidebar {
2
-
3
- ul {
4
-
5
- li {
6
-
7
- a {
8
- box-sizing: border-box;
9
- width: $sidebar-width;
10
- padding: 12.5px 0;
11
- text-align: center;
12
-
13
- span {
14
- display: block;
15
- margin: 5px 0;
16
- color: $color-light-darkest;
17
- }
18
-
19
- i {
20
- font-size: 28px;
21
- color: $color-light-darkest;
22
- }
23
-
24
- &:hover {
25
- background: $color-1;
26
-
27
- span, i {
28
- color: $color-light;
29
- }
30
- }
31
- }
32
-
33
- &.active {
34
-
35
- a {
36
- background: $color-1;
37
-
38
- span, i {
39
- color: $color-light;
40
- }
41
- }
42
- }
43
- }
44
- }
45
- }
@@ -1,24 +0,0 @@
1
- #admin {
2
- position: relative;
3
- min-height: 100%;
4
-
5
- //////////////////////////////// nav
6
-
7
- aside.nav {
8
- position: fixed;
9
- top: 0;
10
- left: 0;
11
- width: $sidebar-width;
12
- height: 100%;
13
- background: $color-dark-lighter;
14
- }
15
-
16
- //////////////////////////////// content
17
-
18
- section.container {
19
- box-sizing: border-box;
20
- max-width: none;
21
- margin-left: $sidebar-width;
22
- padding: 0;
23
- }
24
- }
@@ -1,7 +0,0 @@
1
- a {
2
- color: #00ade2;
3
- text-decoration: none;
4
- }
5
- a:hover {
6
- text-decoration: underline;
7
- }
@@ -1,45 +0,0 @@
1
- class Admin::ImagesController < ApplicationController
2
-
3
- def index
4
- @images = Image.all
5
- respond_to do |format|
6
- format.json { render :json => @images }
7
- end
8
- end
9
-
10
- def edit
11
- @url = @show
12
- @image = Image.find(params[:id])
13
- end
14
-
15
- def create
16
- @image = Image.new(create_params)
17
- @image.save
18
- end
19
-
20
- def update
21
- if @image.update_attributes(create_params)
22
- redirect_to @project_edit, notice: 'Image was successfully updated.'
23
- else
24
- render action: "edit"
25
- end
26
- end
27
-
28
- def destroy
29
- @image = Image.find(params[:id])
30
- @image.destroy
31
- respond_to do |format|
32
- format.json { render :nothing => true }
33
- end
34
- end
35
-
36
-
37
- private
38
-
39
- def create_params
40
- params.require(:image).permit(
41
- :filename, :crop_x, :crop_y, :crop_w, :crop_h
42
- )
43
- end
44
-
45
- end
@@ -1,42 +0,0 @@
1
- class Admin::PagesController < AdminController
2
-
3
- def index
4
- @items = @model.all.unscoped.order(:title)
5
- end
6
-
7
- def new
8
- @image = Image.new
9
- @image_url = admin_images_path(@image)
10
- super
11
- end
12
-
13
- def edit
14
- @image = Image.new
15
- @image_url = admin_images_path(@image)
16
- super
17
- end
18
-
19
- def update
20
- update_params ||= create_params
21
- if @item.update(update_params)
22
- @item.update_column(:slug, @item.create_slug)
23
- redirect_to edit_admin_page_path(@item), :notice => "#{@model.to_s} was updated successfully."
24
- else
25
- render :action => "edit"
26
- end
27
- end
28
-
29
-
30
- private
31
- def set_defaults
32
- super
33
- @model = Page
34
- end
35
-
36
- def create_params
37
- params.require(:page).permit(:title, :body, :slug, :position, :template,
38
- :description, :active_date, :active_time, :inactive_date, :in_top_nav,
39
- :inactive_time, :parent_id)
40
- end
41
-
42
- end
@@ -1,39 +0,0 @@
1
- class Admin::PostsController < AdminController
2
-
3
- def new
4
- @image = Image.new
5
- @image_url = admin_images_path(@image)
6
- super
7
- @item.user = current_user
8
- end
9
-
10
- def edit
11
- @image = Image.new
12
- @image_url = admin_images_path(@image)
13
- super
14
- end
15
-
16
- private
17
- def set_defaults
18
- super
19
- @model = Post
20
- end
21
-
22
- def create_params
23
- params.require(:post).permit(
24
- :title,
25
- :body,
26
- :slug,
27
- :active_date,
28
- :active_time,
29
- :inactive_date,
30
- :inactive_time,
31
- :main_image,
32
- :remove_main_image,
33
- :is_featured,
34
- :user_id,
35
- :tag_list
36
- )
37
- end
38
-
39
- end
@@ -1,69 +0,0 @@
1
- class Admin::TaggingsController < ApplicationController
2
- before_filter :get_params
3
-
4
- def index
5
- respond_to do |format|
6
- format.json # { render json: @taggings }
7
- end
8
- end
9
-
10
- def edit
11
- end
12
-
13
- def create
14
- tags = Tag.where("lower(name) = ?", params[:tag_title].downcase)
15
- if tags.count > 0
16
- @tag = tags.first
17
- else
18
- @tag = Tag.create(name: params[:tag_title])
19
- end
20
-
21
- @taggable = params[:taggable].constantize.find(params[:taggable_id])
22
- logger.debug @taggable.inspect
23
- Tagging.where(tag_id: @tag.id, taggable_type: @taggable.class.name, taggable_id: @taggable.id).first_or_create
24
- render nothing: true
25
- end
26
-
27
- def update
28
- respond_to do |format|
29
- if @tagging.update_attributes(params[:tagging])
30
- format.json { head :no_content }
31
- else
32
- format.json { render json: @tagging.errors, status: :unprocessable_entity }
33
- end
34
- end
35
- end
36
-
37
- def destroy
38
- @tagging = Tagging.find(params[:id])
39
- @tagging.destroy
40
- render :nothing => true
41
- end
42
-
43
- private
44
- def get_params
45
- if params[:page_id]
46
- @page = Page.find(params[:page_id])
47
- @index = admin_page_taggings_path(@page)
48
- @taggings = @page.taggings
49
- elsif params[:post_id]
50
- @post = Post.find_by_slug(params[:post_id])
51
- @index = admin_post_taggings_path(@post)
52
- @taggings = @post.taggings
53
- elsif params[:image_id]
54
- @image = Image.find(params[:image_id])
55
- @project = Project.find(params[:project_id])
56
- @index = admin_project_image_taggings_path(@project,@image)
57
- @taggings = @image.taggings
58
- elsif params[:project_id]
59
- @project = Project.find(params[:project_id])
60
- @index = admin_project_taggings_path(@project)
61
- @taggings = @project.taggings
62
- end
63
- if params[:id]
64
- @tagging = Tagging.find(params[:id])
65
- @show = admin_page_tagging_path(@tagging)
66
- end
67
- end
68
-
69
- end
@@ -1,11 +0,0 @@
1
- class Admin::TagsController < ApplicationController
2
-
3
- def index
4
- @tags = Tag.all
5
- respond_to do |format|
6
- format.json { render :json => @tags }
7
- end
8
- end
9
-
10
-
11
- end
@@ -1,13 +0,0 @@
1
- class Admin::UsersController < AdminController
2
-
3
- private
4
- def set_defaults
5
- super
6
- @model = User
7
- @columns = ['email']
8
- end
9
-
10
- def create_params
11
- params.require(:user).permit(:email, :password, :password_confirmation)
12
- end
13
- end
@@ -1,97 +0,0 @@
1
- class AdminController < ActionController::Base
2
-
3
- include AdminHelper
4
-
5
- before_filter :authenticate_admin
6
- before_action :set_defaults, :except => [:dashboard]
7
- before_action :set_routes, :except => [:dashboard]
8
- protect_from_forgery :with => :exception
9
-
10
- def dashboard
11
- redirect_to admin_users_path
12
- end
13
-
14
- def index
15
- @items = @model.all
16
- end
17
-
18
- def new
19
- @item = @model.new
20
- @url = @routes[:index]
21
- end
22
-
23
- def edit
24
- @url = @routes[:show]
25
- end
26
-
27
- def create
28
- @item = @model.new(create_params)
29
- convert_dates if @item.attributes.has_key?('active_at')
30
- @item = @model.new(create_params)
31
- if @item.attributes.has_key? 'slug' && !create_params[:slug].blank?
32
- @item.slug = @item.make_slug_unique(create_params[:slug])
33
- end
34
- if @item.save
35
- @routes[:edit] = send("edit_admin_#{model_table_singular}_path", @item)
36
- redirect_to @routes[:edit], :notice => "#{@model.to_s} was successfully created."
37
- else
38
- @url = @routes[:index]
39
- render :action => "new"
40
- end
41
- end
42
-
43
- def update
44
- convert_dates if @item.attributes.has_key?('active_at')
45
- if @item.attributes.has_key? 'slug' && !update_params[:slug].blank?
46
- update_params[:slug] = @item.make_slug_unique(update_params[:slug])
47
- end
48
- if @item.update(update_params)
49
- @routes[:edit] = send("edit_admin_#{model_table_singular}_path", @item)
50
- redirect_to @routes[:edit], :notice => "#{@model.to_s} was updated successfully."
51
- else
52
- @url = @routes[:show]
53
- render :action => "edit"
54
- end
55
- end
56
-
57
- def destroy
58
- @item.destroy
59
- redirect_to @routes[:index], :notice => "#{@model.to_s} was deleted successfully."
60
- end
61
-
62
- private
63
-
64
- def authenticate_admin
65
- authenticate_user!
66
- redirect_to root_path unless current_user.is_admin?
67
- end
68
-
69
- def set_defaults
70
- @columns = ['title']
71
- @actions = [:edit, :delete]
72
- end
73
-
74
- def convert_dates
75
- p = params[@model.to_s.downcase.to_sym]
76
- p[:active_time] = Time.now.strftime("%l:%M %p") if p[:active_date].blank?
77
- p[:inactive_time] = '12:00 AM' if p[:active_time].blank?
78
- if p[:active_date].blank?
79
- p[:active_at] = nil
80
- else
81
- p[:active_at] = DateTime.parse("#{p[:active_date]} #{p[:active_time]}")
82
- end
83
- if p[:inactive_date].blank?
84
- p[:inactive_at] = nil
85
- else
86
- p[:inactive_at] = DateTime.parse("#{p[:inactive_date]} #{p[:inactive_time]}")
87
- end
88
- end
89
-
90
- def create_params
91
- end
92
-
93
- def update_params
94
- create_params
95
- end
96
-
97
- end
@@ -1,45 +0,0 @@
1
- class Admin::ImagesController < ApplicationController
2
-
3
- def index
4
- @images = Image.all
5
- respond_to do |format|
6
- format.json { render :json => @images }
7
- end
8
- end
9
-
10
- def edit
11
- @url = @show
12
- @image = Image.find(params[:id])
13
- end
14
-
15
- def create
16
- @image = Image.new(create_params)
17
- @image.save
18
- end
19
-
20
- def update
21
- if @image.update_attributes(create_params)
22
- redirect_to @project_edit, notice: 'Image was successfully updated.'
23
- else
24
- render action: "edit"
25
- end
26
- end
27
-
28
- def destroy
29
- @image = Image.find(params[:id])
30
- @image.destroy
31
- respond_to do |format|
32
- format.json { render :nothing => true }
33
- end
34
- end
35
-
36
-
37
- private
38
-
39
- def create_params
40
- params.require(:image).permit(
41
- :filename, :crop_x, :crop_y, :crop_w, :crop_h
42
- )
43
- end
44
-
45
- end
@@ -1,12 +0,0 @@
1
- class PagesController < ApplicationController
2
-
3
- def show
4
- @page = Page.find_by_slug(params[:slug]) if @page.nil?
5
- if @page
6
- render "#{Rails.application.config.template_directory}/#{@page.template}"
7
- else
8
- raise ActionController::RoutingError.new('Not Found')
9
- end
10
- end
11
-
12
- end
@@ -1,11 +0,0 @@
1
- class PostsController < ApplicationController
2
-
3
- def index
4
- end
5
-
6
- def show
7
- @post = Post.find_by_slug(params[:slug])
8
- raise ActionController::RoutingError.new('Not Found') unless @post.present?
9
- end
10
-
11
- end
@@ -1,47 +0,0 @@
1
- module Admin::PagesHelper
2
-
3
- def link_to_delete_page(page)
4
- link_to 'Delete', admin_page_path(page), :method => :delete,
5
- :data => { :confirm => SETTINGS['pages']['delete_warning'] }
6
- end
7
-
8
- def link_to_edit_page(page)
9
- link_to 'Edit', edit_admin_page_path(page)
10
- end
11
-
12
- def page_template_field(type, name)
13
- value = @page.template_data.nil? ? '' : @page.template_data[name]
14
- html_output = ''
15
- case type
16
- when 'string'
17
- html_output << <<-eos
18
- <div class="control-group string required page_title">
19
- <label class="string control-label" for="page_#{name}">
20
- #{name.titleize}
21
- </label>
22
- <div class="controls">
23
- <input class="string required"
24
- id="page_#{name}"
25
- name="page[template_data][#{name}]"
26
- type="text"
27
- value="#{value}">
28
- </div>
29
- </div>
30
- eos
31
- when 'text'
32
- html_output << <<-eos
33
- <div class="control-group string required page_title">
34
- <label class="string control-label" for="page_#{name}">
35
- #{name.titleize}
36
- </label>
37
- <div class="controls">
38
- <textarea class="text required" id="page_#{name}"
39
- name="page[template_data][#{name}]">#{value}</textarea>
40
- </div>
41
- </div>
42
- eos
43
- end
44
- html_output
45
- end
46
-
47
- end