asset_host_core 2.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.markdown +138 -0
  3. data/Rakefile +11 -0
  4. data/app/assets/images/asset_host_core/alert-overlay.png +0 -0
  5. data/app/assets/images/asset_host_core/arrow-left.gif +0 -0
  6. data/app/assets/images/asset_host_core/arrow-right.gif +0 -0
  7. data/app/assets/images/asset_host_core/fallback-img-rect.png +0 -0
  8. data/app/assets/images/asset_host_core/videoplayer-play.png +0 -0
  9. data/app/assets/images/asset_host_core/x.png +0 -0
  10. data/app/assets/javascripts/asset_host_core/admin/assets.js.coffee +221 -0
  11. data/app/assets/javascripts/asset_host_core/application.js +20 -0
  12. data/app/assets/javascripts/asset_host_core/assetadmin.js.coffee +56 -0
  13. data/app/assets/javascripts/asset_host_core/assethost.js.coffee.erb +17 -0
  14. data/app/assets/javascripts/asset_host_core/browserui.js.coffee +139 -0
  15. data/app/assets/javascripts/asset_host_core/chooserui.js.coffee +381 -0
  16. data/app/assets/javascripts/asset_host_core/client.js.coffee +29 -0
  17. data/app/assets/javascripts/asset_host_core/clients/BrightcoveVideo.js.coffee +64 -0
  18. data/app/assets/javascripts/asset_host_core/clients/templates/brightcove_embed.jst.eco +18 -0
  19. data/app/assets/javascripts/asset_host_core/clients/templates/vimeo_embed.jst.eco +1 -0
  20. data/app/assets/javascripts/asset_host_core/clients/templates/youtube_embed.jst.eco +1 -0
  21. data/app/assets/javascripts/asset_host_core/clients/vimeo_video.js.coffee +21 -0
  22. data/app/assets/javascripts/asset_host_core/clients/youtube_video.js.coffee +21 -0
  23. data/app/assets/javascripts/asset_host_core/cmsplugin.js.coffee +235 -0
  24. data/app/assets/javascripts/asset_host_core/models.js.coffee +586 -0
  25. data/app/assets/javascripts/asset_host_core/railsCMS.js.coffee +141 -0
  26. data/app/assets/javascripts/asset_host_core/slideshow.js.coffee +428 -0
  27. data/app/assets/javascripts/asset_host_core/templates/after_upload_button.jst.eco +3 -0
  28. data/app/assets/javascripts/asset_host_core/templates/asset_drop_asset.jst.eco +4 -0
  29. data/app/assets/javascripts/asset_host_core/templates/asset_modal.jst.eco +13 -0
  30. data/app/assets/javascripts/asset_host_core/templates/asset_preview.jst.eco +35 -0
  31. data/app/assets/javascripts/asset_host_core/templates/asset_search.jst.eco +2 -0
  32. data/app/assets/javascripts/asset_host_core/templates/browser_asset.jst.eco +1 -0
  33. data/app/assets/javascripts/asset_host_core/templates/browser_asset_tip.jst.eco +3 -0
  34. data/app/assets/javascripts/asset_host_core/templates/edit_modal.jst.eco +40 -0
  35. data/app/assets/javascripts/asset_host_core/templates/import_help.jst.eco +59 -0
  36. data/app/assets/javascripts/asset_host_core/templates/pagination_link.jst.eco +1 -0
  37. data/app/assets/javascripts/asset_host_core/templates/pagination_links.jst.eco +13 -0
  38. data/app/assets/javascripts/asset_host_core/templates/queued_file.jst.eco +11 -0
  39. data/app/assets/javascripts/asset_host_core/templates/save_and_close_view.jst.eco +4 -0
  40. data/app/assets/javascripts/asset_host_core/templates/upload_all_button.jst.eco +4 -0
  41. data/app/assets/javascripts/asset_host_core/templates/url_input.jst.eco +8 -0
  42. data/app/assets/stylesheets/asset_host_core/application.css.scss +384 -0
  43. data/app/assets/stylesheets/asset_host_core/jquery-ui.css +105 -0
  44. data/app/assets/stylesheets/asset_host_core/public.css.scss +204 -0
  45. data/app/assets/stylesheets/asset_host_core/slidetest.css.scss +93 -0
  46. data/app/controllers/asset_host_core/admin/api_users_controller.rb +72 -0
  47. data/app/controllers/asset_host_core/admin/assets_controller.rb +140 -0
  48. data/app/controllers/asset_host_core/admin/base_controller.rb +36 -0
  49. data/app/controllers/asset_host_core/admin/home_controller.rb +13 -0
  50. data/app/controllers/asset_host_core/admin/outputs_controller.rb +55 -0
  51. data/app/controllers/asset_host_core/api/assets_controller.rb +110 -0
  52. data/app/controllers/asset_host_core/api/base_controller.rb +43 -0
  53. data/app/controllers/asset_host_core/api/outputs_controller.rb +33 -0
  54. data/app/controllers/asset_host_core/application_controller.rb +43 -0
  55. data/app/controllers/asset_host_core/public_controller.rb +104 -0
  56. data/app/models/asset_host_core/api_user.rb +44 -0
  57. data/app/models/asset_host_core/api_user_permission.rb +6 -0
  58. data/app/models/asset_host_core/asset.rb +265 -0
  59. data/app/models/asset_host_core/asset_output.rb +69 -0
  60. data/app/models/asset_host_core/brightcove_video.rb +20 -0
  61. data/app/models/asset_host_core/output.rb +52 -0
  62. data/app/models/asset_host_core/permission.rb +19 -0
  63. data/app/models/asset_host_core/video.rb +8 -0
  64. data/app/models/asset_host_core/vimeo_video.rb +17 -0
  65. data/app/models/asset_host_core/youtube_video.rb +17 -0
  66. data/app/views/asset_host_core/admin/api_users/_form_fields.html.erb +5 -0
  67. data/app/views/asset_host_core/admin/api_users/edit.html.erb +26 -0
  68. data/app/views/asset_host_core/admin/api_users/index.html.erb +31 -0
  69. data/app/views/asset_host_core/admin/api_users/new.html.erb +17 -0
  70. data/app/views/asset_host_core/admin/api_users/show.html.erb +23 -0
  71. data/app/views/asset_host_core/admin/assets/index.html.erb +19 -0
  72. data/app/views/asset_host_core/admin/assets/metadata.html.erb +24 -0
  73. data/app/views/asset_host_core/admin/assets/show.html.erb +86 -0
  74. data/app/views/asset_host_core/admin/home/chooser.html.erb +49 -0
  75. data/app/views/asset_host_core/admin/outputs/_form_fields.html.erb +5 -0
  76. data/app/views/asset_host_core/admin/outputs/edit.html.erb +26 -0
  77. data/app/views/asset_host_core/admin/outputs/index.html.erb +27 -0
  78. data/app/views/asset_host_core/admin/outputs/new.html.erb +13 -0
  79. data/app/views/asset_host_core/admin/outputs/show.html.erb +17 -0
  80. data/app/views/asset_host_core/shared/_footerjs.html.erb +3 -0
  81. data/app/views/asset_host_core/shared/_navbar.html.erb +28 -0
  82. data/app/views/kaminari/_first_page.html.erb +3 -0
  83. data/app/views/kaminari/_gap.html.erb +3 -0
  84. data/app/views/kaminari/_last_page.html.erb +3 -0
  85. data/app/views/kaminari/_next_page.html.erb +3 -0
  86. data/app/views/kaminari/_page.html.erb +3 -0
  87. data/app/views/kaminari/_paginator.html.erb +17 -0
  88. data/app/views/kaminari/_prev_page.html.erb +3 -0
  89. data/app/views/layouts/asset_host_core/application.html.erb +54 -0
  90. data/app/views/layouts/asset_host_core/full_width.html.erb +32 -0
  91. data/app/views/layouts/asset_host_core/minimal.html.erb +45 -0
  92. data/config/initializers/simple_form.rb +142 -0
  93. data/config/initializers/simple_form_bootstrap.rb +45 -0
  94. data/config/locales/simple_form.en.yml +26 -0
  95. data/config/routes.rb +49 -0
  96. data/lib/asset_host_core.rb +38 -0
  97. data/lib/asset_host_core/config.rb +39 -0
  98. data/lib/asset_host_core/engine.rb +94 -0
  99. data/lib/asset_host_core/loaders.rb +34 -0
  100. data/lib/asset_host_core/loaders/asset_host.rb +30 -0
  101. data/lib/asset_host_core/loaders/base.rb +22 -0
  102. data/lib/asset_host_core/loaders/brightcove.rb +67 -0
  103. data/lib/asset_host_core/loaders/flickr.rb +114 -0
  104. data/lib/asset_host_core/loaders/url.rb +59 -0
  105. data/lib/asset_host_core/loaders/vimeo.rb +76 -0
  106. data/lib/asset_host_core/loaders/youtube.rb +90 -0
  107. data/lib/asset_host_core/model_methods.rb +61 -0
  108. data/lib/asset_host_core/paperclip.rb +4 -0
  109. data/lib/asset_host_core/paperclip/asset_thumbnail.rb +92 -0
  110. data/lib/asset_host_core/paperclip/attachment.rb +206 -0
  111. data/lib/asset_host_core/paperclip/trimmer.rb +33 -0
  112. data/lib/asset_host_core/resque_job.rb +13 -0
  113. data/lib/asset_host_core/version.rb +3 -0
  114. data/lib/tasks/asset_host_core_tasks.rake +4 -0
  115. data/spec/controllers/admin/api_users_controller_spec.rb +21 -0
  116. data/spec/controllers/admin/assets_controller_spec.rb +59 -0
  117. data/spec/controllers/admin/home_controller_spec.rb +4 -0
  118. data/spec/controllers/admin/outputs_controller_spec.rb +4 -0
  119. data/spec/controllers/api/assets_controller_spec.rb +133 -0
  120. data/spec/controllers/api/outputs_controller_spec.rb +51 -0
  121. data/spec/controllers/public_controller_spec.rb +4 -0
  122. data/spec/factories.rb +39 -0
  123. data/spec/features/api_users_spec.rb +78 -0
  124. data/spec/fixtures/api/brightcove/video.json +137 -0
  125. data/spec/fixtures/api/flickr/photos_getInfo.json +78 -0
  126. data/spec/fixtures/api/flickr/photos_getSizes.json +82 -0
  127. data/spec/fixtures/api/flickr/photos_licenses_getInfo.json +52 -0
  128. data/spec/fixtures/api/vimeo/video.json +28 -0
  129. data/spec/fixtures/api/youtube/discovery.json +5190 -0
  130. data/spec/fixtures/api/youtube/video.json +44 -0
  131. data/spec/fixtures/images/chipmunk.jpg +0 -0
  132. data/spec/fixtures/images/dude.jpg +0 -0
  133. data/spec/fixtures/images/ernie.jpg +0 -0
  134. data/spec/fixtures/images/fry.png +0 -0
  135. data/spec/fixtures/images/hat.jpg +0 -0
  136. data/spec/fixtures/images/spongebob.png +0 -0
  137. data/spec/fixtures/images/stars.jpg +0 -0
  138. data/spec/internal/app/controllers/application_controller.rb +16 -0
  139. data/spec/internal/app/controllers/sessions_controller.rb +24 -0
  140. data/spec/internal/app/models/user.rb +10 -0
  141. data/spec/internal/app/views/sessions/new.html.erb +14 -0
  142. data/spec/internal/config/database.yml +3 -0
  143. data/spec/internal/config/initializers/assethost_config.rb +57 -0
  144. data/spec/internal/config/routes.rb +7 -0
  145. data/spec/internal/db/combustion_test.sqlite +0 -0
  146. data/spec/internal/db/schema.rb +106 -0
  147. data/spec/internal/log/test.log +14769 -0
  148. data/spec/internal/public/favicon.ico +0 -0
  149. data/spec/internal/public/images/1_27f7745237849975ca90591c1fba5934_original. +0 -0
  150. data/spec/internal/public/images/1_7d33319deca787d5bb3f62ff06563ad2_original. +0 -0
  151. data/spec/internal/public/images/1_b6d48c8b1286104ce76649731e09645f_original. +0 -0
  152. data/spec/internal/public/images/1_b6d48c8b1286104ce76649731e09645f_original.jpg +0 -0
  153. data/spec/internal/public/images/1_b6d48c8b1286104ce76649731e09645f_original.txt +0 -0
  154. data/spec/internal/public/images/1_e179cbd27e07cb55042d0db36cdac095_original. +0 -0
  155. data/spec/internal/public/images/1_e669edd3dfd74be66fc38416e82e3a37_original. +0 -0
  156. data/spec/lib/asset_host_core/loaders/asset_host_spec.rb +33 -0
  157. data/spec/lib/asset_host_core/loaders/brightcove_spec.rb +51 -0
  158. data/spec/lib/asset_host_core/loaders/flickr_spec.rb +72 -0
  159. data/spec/lib/asset_host_core/loaders/url_spec.rb +42 -0
  160. data/spec/lib/asset_host_core/loaders/vimeo_spec.rb +51 -0
  161. data/spec/lib/asset_host_core/loaders/youtube_spec.rb +73 -0
  162. data/spec/lib/asset_host_core/loaders_spec.rb +4 -0
  163. data/spec/lib/asset_host_core/model_methods_spec.rb +4 -0
  164. data/spec/lib/asset_host_core/paperclip/asset_thumbnail_spec.rb +4 -0
  165. data/spec/lib/asset_host_core/paperclip/attachment_spec.rb +4 -0
  166. data/spec/lib/asset_host_core/resque_job_spec.rb +4 -0
  167. data/spec/lib/asset_host_core_spec.rb +4 -0
  168. data/spec/models/api_user_spec.rb +58 -0
  169. data/spec/models/asset_output_spec.rb +4 -0
  170. data/spec/models/asset_spec.rb +4 -0
  171. data/spec/models/output_spec.rb +4 -0
  172. data/spec/models/permission_spec.rb +4 -0
  173. data/spec/spec_helper.rb +30 -0
  174. data/spec/support/fixture_loader.rb +9 -0
  175. data/spec/support/param_helper.rb +14 -0
  176. data/spec/support/permission_matcher.rb +17 -0
  177. data/vendor/assets/images/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  178. data/vendor/assets/images/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  179. data/vendor/assets/images/jquery-ui/ui-bg_flat_10_000000_40x100.png +0 -0
  180. data/vendor/assets/images/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  181. data/vendor/assets/images/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  182. data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  183. data/vendor/assets/images/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  184. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  185. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  186. data/vendor/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
  187. data/vendor/assets/images/jquery-ui/ui-icons_228ef1_256x240.png +0 -0
  188. data/vendor/assets/images/jquery-ui/ui-icons_ef8c08_256x240.png +0 -0
  189. data/vendor/assets/images/jquery-ui/ui-icons_ffd27a_256x240.png +0 -0
  190. data/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  191. data/vendor/assets/javascripts/backbone.js +1158 -0
  192. data/vendor/assets/javascripts/backbone.modelbinding.js +475 -0
  193. data/vendor/assets/javascripts/exif.js +695 -0
  194. data/vendor/assets/javascripts/jquery-ui.js +5614 -0
  195. data/vendor/assets/javascripts/simplemodal.js +698 -0
  196. data/vendor/assets/javascripts/spin.jquery.js +81 -0
  197. data/vendor/assets/javascripts/spin.min.js +1 -0
  198. data/vendor/assets/javascripts/underscore.min.js +1 -0
  199. metadata +658 -0
@@ -0,0 +1,105 @@
1
+ /*! jQuery UI - v1.10.3 - 2013-05-22
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.progressbar.css
4
+ * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
5
+
6
+ /* Layout helpers
7
+ ----------------------------------*/
8
+ .ui-helper-hidden {
9
+ display: none;
10
+ }
11
+ .ui-helper-hidden-accessible {
12
+ border: 0;
13
+ clip: rect(0 0 0 0);
14
+ height: 1px;
15
+ margin: -1px;
16
+ overflow: hidden;
17
+ padding: 0;
18
+ position: absolute;
19
+ width: 1px;
20
+ }
21
+ .ui-helper-reset {
22
+ margin: 0;
23
+ padding: 0;
24
+ border: 0;
25
+ outline: 0;
26
+ line-height: 1.3;
27
+ text-decoration: none;
28
+ font-size: 100%;
29
+ list-style: none;
30
+ }
31
+ .ui-helper-clearfix:before,
32
+ .ui-helper-clearfix:after {
33
+ content: "";
34
+ display: table;
35
+ border-collapse: collapse;
36
+ }
37
+ .ui-helper-clearfix:after {
38
+ clear: both;
39
+ }
40
+ .ui-helper-clearfix {
41
+ min-height: 0; /* support: IE7 */
42
+ }
43
+ .ui-helper-zfix {
44
+ width: 100%;
45
+ height: 100%;
46
+ top: 0;
47
+ left: 0;
48
+ position: absolute;
49
+ opacity: 0;
50
+ filter:Alpha(Opacity=0);
51
+ }
52
+
53
+ .ui-front {
54
+ z-index: 100;
55
+ }
56
+
57
+
58
+ /* Interaction Cues
59
+ ----------------------------------*/
60
+ .ui-state-disabled {
61
+ cursor: default !important;
62
+ }
63
+
64
+
65
+ /* Icons
66
+ ----------------------------------*/
67
+
68
+ /* states and images */
69
+ .ui-icon {
70
+ display: block;
71
+ text-indent: -99999px;
72
+ overflow: hidden;
73
+ background-repeat: no-repeat;
74
+ }
75
+
76
+
77
+ /* Misc visuals
78
+ ----------------------------------*/
79
+
80
+ /* Overlays */
81
+ .ui-widget-overlay {
82
+ position: fixed;
83
+ top: 0;
84
+ left: 0;
85
+ width: 100%;
86
+ height: 100%;
87
+ }
88
+ .ui-progressbar {
89
+ height: 2em;
90
+ text-align: left;
91
+ overflow: hidden;
92
+ }
93
+ .ui-progressbar .ui-progressbar-value {
94
+ margin: -1px;
95
+ height: 100%;
96
+ }
97
+ .ui-progressbar .ui-progressbar-overlay {
98
+ background: url("images/animated-overlay.gif");
99
+ height: 100%;
100
+ filter: alpha(opacity=25);
101
+ opacity: 0.25;
102
+ }
103
+ .ui-progressbar-indeterminate .ui-progressbar-value {
104
+ background-image: none;
105
+ }
@@ -0,0 +1,204 @@
1
+ /*
2
+ public
3
+ */
4
+
5
+ #saveAndClose {
6
+ margin: 16px auto;
7
+ }
8
+
9
+ #assets_loading {
10
+ position: absolute;
11
+ height: 490px;
12
+ width: 620px;
13
+ background: #fcc;
14
+ }
15
+
16
+ ul.assets, ul.uploads li {
17
+ overflow: auto;
18
+
19
+ p {
20
+ margin: 2px 0;
21
+ }
22
+
23
+ img {
24
+ max-width: 100px;
25
+ max-height: 100px;
26
+ }
27
+ }
28
+
29
+ #my_assets {
30
+ height: 430px;
31
+ overflow: auto;
32
+ background: #ffc;
33
+
34
+ ul {
35
+ margin: 0;
36
+ padding: 0;
37
+ list-style-type: none;
38
+
39
+ li {
40
+ clear: both;
41
+ background: #eee;
42
+ border: 1px solid #aaa;
43
+ padding: 2px;
44
+ margin-bottom: 4px;
45
+
46
+ button {
47
+ display: inline;
48
+ float: right;
49
+ }
50
+
51
+ img {
52
+ display: inline;
53
+ float: left;
54
+ margin: -2px 4px 0 -2px;
55
+ }
56
+ }
57
+ }
58
+
59
+ ul.assets li {
60
+ min-height: 86px;
61
+ }
62
+
63
+ ul.uploads li {
64
+ min-height: 32px;
65
+ }
66
+
67
+ ul.uploads li.uploading {
68
+ background: #cfc;
69
+ }
70
+
71
+ ul.uploads li.pending {
72
+ background: #afc;
73
+ }
74
+
75
+ ul.uploads li.complete {
76
+ background: #afa;
77
+ }
78
+ }
79
+
80
+ ul.pages {
81
+ clear: both;
82
+ list-style-type: none;
83
+ margin: 0;
84
+ padding: 0;
85
+
86
+ li {
87
+ display: inline;
88
+ float: left;
89
+ border: 1px solid #666;
90
+ padding: 8px;
91
+ margin: 4px;
92
+ cursor: pointer;
93
+ }
94
+
95
+ li.current {
96
+ border: 1px solid #ffc;
97
+ background: #ddd;
98
+ font-weight: bold;
99
+ }
100
+
101
+ li.spacer {
102
+ cursor: inherit;
103
+ border: none;
104
+ }
105
+ }
106
+
107
+ span.asset_tip {
108
+ background: #fff;
109
+ padding: 12px;
110
+ min-width: 200px;
111
+ }
112
+
113
+ .page_prev {
114
+ display: inline;
115
+ float: left;
116
+ width: 160px;
117
+ }
118
+
119
+ .page_info {
120
+ text-align: center;
121
+ }
122
+
123
+ .page_next {
124
+ display: inline;
125
+ float: right;
126
+ width: 160px;
127
+ text-align: right;
128
+ margin-right: 12px;
129
+ }
130
+
131
+ .ah_asset_browse {
132
+ img {
133
+ display: inline;
134
+ float: right;
135
+ padding-left: 8px;
136
+ padding-bottom: 8px;
137
+ }
138
+
139
+ h1 {
140
+ font: 18px/24px normal Arial, Helvetica, sans-serif;
141
+ }
142
+
143
+ h2 {
144
+ font: 14px/18px normal Arial, Helvetica, sans-serif;
145
+ color: #444;
146
+ margin: 0;
147
+ }
148
+
149
+ .simplemodal-data {
150
+ padding:8px;
151
+ }
152
+
153
+ a.modalCloseImg {
154
+ background:image_url("asset_host_core/x.png") no-repeat;
155
+ width:25px;
156
+ height:29px;
157
+ display:inline;
158
+ z-index:3200;
159
+ position:absolute;
160
+ top:-15px;
161
+ right:-16px;
162
+ cursor:pointer;
163
+ }
164
+ h3 {
165
+ color:#84b8d9;
166
+ }
167
+ }
168
+
169
+
170
+ .awesome, .awesome:visited {
171
+ background: #222 image_url("asset_host_core/alert-overlay.png") repeat-x;
172
+ display: inline-block;
173
+ padding: 5px 10px 6px;
174
+ color: #fff;
175
+ text-decoration: none;
176
+ -moz-border-radius: 5px;
177
+ -webkit-border-radius: 5px;
178
+ -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
179
+ -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
180
+ text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
181
+ border-bottom: 1px solid rgba(0,0,0,0.25);
182
+ position: relative;
183
+ cursor: pointer;
184
+ }
185
+
186
+ .awesome:hover { background-color: #111; color: #fff; }
187
+ .awesome:active { top: 1px; }
188
+ .small.awesome, .small.awesome:visited { font-size: 11px; }
189
+ .awesome, .awesome:visited,
190
+ .medium.awesome, .medium.awesome:visited { font-size: 13px; font-weight: bold; line-height: 1; text-shadow: 0 -1px 1px rgba(0,0,0,0.25); }
191
+ .large.awesome, .large.awesome:visited { font-size: 14px; padding: 8px 14px 9px; }
192
+
193
+ .green.awesome, .green.awesome:visited { background-color: #91bd09; }
194
+ .green.awesome:hover { background-color: #749a02; }
195
+ .blue.awesome, .blue.awesome:visited { background-color: #2daebf; }
196
+ .blue.awesome:hover { background-color: #007d9a; }
197
+ .red.awesome, .red.awesome:visited { background-color: #e33100; }
198
+ .red.awesome:hover { background-color: #872300; }
199
+ .magenta.awesome, .magenta.awesome:visited { background-color: #a9014b; }
200
+ .magenta.awesome:hover { background-color: #630030; }
201
+ .orange.awesome, .orange.awesome:visited { background-color: #ff5c00; }
202
+ .orange.awesome:hover { background-color: #d45500; }
203
+ .yellow.awesome, .yellow.awesome:visited { background-color: #ffb515; }
204
+ .yellow.awesome:hover { background-color: #fc9200; }
@@ -0,0 +1,93 @@
1
+ //= require ./public
2
+
3
+ #slidetest {
4
+ width: 620px;
5
+ margin: 20px auto;
6
+ border: 1px solid #aaa;
7
+ padding: 8px;
8
+
9
+ #lead_photo {
10
+ font: 12px normal Arial, Helvetica, sans-serif;
11
+ margin: 4px 0;
12
+ padding-bottom: 4px;
13
+ }
14
+ }
15
+
16
+ .slideview {
17
+ position: relative;
18
+ background: #fff;
19
+ overflow: hidden;
20
+ margin: 0 auto;
21
+
22
+ font: 12px normal Arial, Helvetica, sans-serif;
23
+
24
+ ul {
25
+ margin: 0;
26
+ padding: 0;
27
+ list-style-type: none;
28
+ }
29
+
30
+ li {
31
+ position: absolute;
32
+ margin: 0;
33
+ padding: 0;
34
+ }
35
+
36
+ .nav {
37
+ padding-top: 8px;
38
+ padding-bottom: 4px;
39
+
40
+ div {
41
+ display: inline;
42
+ float: left;
43
+ text-align: center;
44
+ }
45
+
46
+ button {
47
+ background: none;
48
+ display: inline-block;
49
+ padding: 3px 5px;
50
+ color: #555;
51
+ text-decoration: none;
52
+ border: none;
53
+ position: relative;
54
+ cursor: pointer;
55
+ }
56
+
57
+ button.prev-arrow {
58
+ background: image_url("arrow-left.gif") no-repeat 0 4px;
59
+ padding-left: 20px;
60
+ }
61
+
62
+ button.next-arrow {
63
+ background: image_url("arrow-right.gif") no-repeat 100% 4px;
64
+ padding-right: 20px;
65
+ }
66
+
67
+ button.disabled {
68
+ color: #bbb;
69
+ }
70
+
71
+ button.current {
72
+ border: 1px solid #ea6;
73
+ }
74
+ }
75
+ }
76
+
77
+ .slideview:focus {
78
+ border: inherit;
79
+ outline: none;
80
+ }
81
+
82
+ .slide {
83
+ .credit {
84
+ font-size: 10px;
85
+ text-align: right;
86
+ color: #777;
87
+ }
88
+
89
+ p {
90
+ margin: 0;
91
+ padding: 4px 4px;
92
+ }
93
+ }
@@ -0,0 +1,72 @@
1
+ module AssetHostCore
2
+ module Admin
3
+ class ApiUsersController < BaseController
4
+ layout 'asset_host_core/full_width'
5
+
6
+ before_filter :authorize_admin
7
+ before_filter :get_api_user, only: [
8
+ :show, :edit, :update, :reset_token, :destroy
9
+ ]
10
+
11
+ layout 'asset_host_core/full_width'
12
+
13
+ def index
14
+ @api_users = ApiUser.page(params[:page]).per(20)
15
+ end
16
+
17
+
18
+ def edit
19
+ end
20
+
21
+
22
+ def show
23
+ end
24
+
25
+
26
+ def new
27
+ @api_user = ApiUser.new
28
+ end
29
+
30
+
31
+ def create
32
+ @api_user = ApiUser.new(params[:api_user])
33
+
34
+ if @api_user.save
35
+ flash[:notice] = "Created API User"
36
+ redirect_to [:a, :api_users]
37
+ else
38
+ render :new
39
+ end
40
+ end
41
+
42
+
43
+ def update
44
+ if @api_user.update_attributes(params[:api_user])
45
+ flash[:notice] = "Updated API User"
46
+ redirect_to [:a, :api_users]
47
+ else
48
+ render :edit
49
+ end
50
+ end
51
+
52
+ def reset_token
53
+ @api_user.generate_auth_token!
54
+ flash[:notice] = "Reset API Token for #{@api_user.name}"
55
+ redirect_to [:a, :api_users]
56
+ end
57
+
58
+ def destroy
59
+ @api_user.destroy
60
+ flash[:notice] = "Destroyed API User"
61
+ redirect_to [:a, :api_users]
62
+ end
63
+
64
+
65
+ private
66
+
67
+ def get_api_user
68
+ @api_user = ApiUser.find(params[:id])
69
+ end
70
+ end
71
+ end
72
+ end