alchemy_cms 2.0.rc2 → 2.0.rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. data/app/controllers/admin/attachments_controller.rb +47 -21
  2. data/app/controllers/admin/clipboard_controller.rb +2 -0
  3. data/app/controllers/admin/elements_controller.rb +2 -0
  4. data/app/controllers/admin/essence_files_controller.rb +7 -6
  5. data/app/controllers/admin/languages_controller.rb +1 -0
  6. data/app/controllers/admin/pictures_controller.rb +49 -34
  7. data/app/controllers/admin/users_controller.rb +2 -0
  8. data/app/controllers/admin_controller.rb +1 -0
  9. data/app/controllers/alchemy_controller.rb +9 -0
  10. data/app/helpers/alchemy_helper.rb +8 -2
  11. data/app/models/attachment.rb +5 -0
  12. data/app/models/element.rb +4 -0
  13. data/app/sweepers/pictures_sweeper.rb +2 -1
  14. data/app/views/admin/attachments/_archive_overlay.html.erb +25 -0
  15. data/app/views/admin/attachments/_file_to_assign.html.erb +2 -2
  16. data/app/views/admin/attachments/create.js.erb +4 -2
  17. data/app/views/admin/contents/create.js.erb +16 -7
  18. data/app/views/admin/elements/_add_content.html.erb +1 -3
  19. data/app/views/admin/essence_files/edit.html.erb +5 -5
  20. data/app/views/admin/essence_pictures/destroy.js.erb +6 -3
  21. data/app/views/admin/pages/edit.html.erb +1 -1
  22. data/app/views/admin/partials/_remote_search_form.html.erb +4 -3
  23. data/app/views/admin/partials/_upload_form.html.erb +1 -3
  24. data/app/views/admin/pictures/_archive_overlay.html.erb +18 -0
  25. data/app/views/admin/pictures/_filter_and_size_bar.html.erb +6 -17
  26. data/app/views/admin/pictures/_picture.html.erb +14 -16
  27. data/app/views/admin/pictures/_picture_to_assign.html.erb +27 -29
  28. data/app/views/admin/pictures/create.js.erb +10 -10
  29. data/app/views/admin/pictures/index.html.erb +35 -5
  30. data/app/views/essences/_essence_file_editor.html.erb +4 -4
  31. data/app/views/essences/_essence_picture_editor.html.erb +2 -2
  32. data/app/views/essences/_essence_picture_tools.html.erb +1 -3
  33. data/assets/javascripts/alchemy.js +2 -2
  34. data/assets/stylesheets/alchemy.css +127 -132
  35. data/assets/stylesheets/elements.css +19 -39
  36. data/config/routes.rb +6 -8
  37. data/lib/alchemy/remote_pagination_link_renderer.rb +12 -1
  38. data/lib/alchemy/version.rb +1 -1
  39. data/spec/dummy/public/stylesheets/alchemy/alchemy.css +197 -173
  40. data/spec/dummy/public/stylesheets/alchemy/elements.css +6 -6
  41. metadata +6 -8
  42. data/app/views/admin/attachments/archive_overlay.html.erb +0 -8
  43. data/app/views/admin/pictures/_archive_overlay_images.html.erb +0 -16
  44. data/app/views/admin/pictures/archive_overlay.html.erb +0 -3
  45. data/app/views/admin/pictures/update.js.erb +0 -11
data/config/routes.rb CHANGED
@@ -14,7 +14,7 @@ Rails.application.routes.draw do
14
14
  :as => :leave_admin
15
15
  match '/admin/logout' => 'admin#logout',
16
16
  :as => :logout
17
- match '/attachment/:id/download' => 'attachments#download',
17
+ match '/attachment/:id/download/:name' => 'attachments#download',
18
18
  :as => :download_attachment
19
19
  match '/attachment/:id/show' => 'attachments#show',
20
20
  :as => :show_attachment
@@ -85,8 +85,6 @@ Rails.application.routes.draw do
85
85
 
86
86
  resources :pictures do
87
87
  collection do
88
- get :archive_overlay
89
- get :add_upload_form
90
88
  post :flush
91
89
  end
92
90
  member do
@@ -96,10 +94,6 @@ Rails.application.routes.draw do
96
94
  end
97
95
 
98
96
  resources :attachments do
99
- collection do
100
- get :archive_overlay
101
- get :add_upload_form
102
- end
103
97
  member do
104
98
  get :download
105
99
  end
@@ -114,7 +108,11 @@ Rails.application.routes.draw do
114
108
  end
115
109
  end
116
110
 
117
- resources :essence_files
111
+ resources :essence_files, :only => [:edit, :update] do
112
+ collection do
113
+ put :assign
114
+ end
115
+ end
118
116
 
119
117
  resources :essence_videos
120
118
 
@@ -13,7 +13,18 @@ module Alchemy
13
13
 
14
14
  def link(text, target, attributes = {})
15
15
  attributes["data-remote"] = "true" if @remote
16
- super(text, target, attributes)
16
+ @template.link_to(text.to_s.html_safe, clean_params.merge({:page => target}), attributes)
17
+ end
18
+
19
+ # Cleaning params from some post data, if we uploaded a picture
20
+ def clean_params
21
+ @template.params.delete_if { |k, v|
22
+ ['Filename', 'Upload', 'Filedata', 'authenticity_token', Rails.configuration.session_options[:key]].include?(k)
23
+ }
24
+ if @template.params[:options].is_a?(String)
25
+ @template.params[:options] = Rack::Utils.parse_query(@template.params[:options])
26
+ end
27
+ @template.params
17
28
  end
18
29
 
19
30
  end
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
2
 
3
- VERSION = "2.0.rc2"
3
+ VERSION = "2.0.rc3"
4
4
 
5
5
  end
@@ -40,8 +40,7 @@ div#flash_notices {
40
40
  top: 0;
41
41
  }
42
42
 
43
- div#flash_notices div.flash {
44
- width: 300px;
43
+ div.flash {
45
44
  padding: 8px 8px 8px 30px;
46
45
  font-weight: bold;
47
46
  border-width: 1px;
@@ -57,31 +56,32 @@ div#flash_notices div.flash {
57
56
  max-height: 64px;
58
57
  }
59
58
 
60
- div#flash_notices div.flash span.icon {
59
+ div.flash span.icon {
61
60
  position: absolute;
62
61
  top: 8px;
63
62
  left: 8px;
64
63
  }
65
64
 
66
- div#flash_notices div.flash.notice {
65
+ div.flash.notice {
67
66
  border-color: #9cc4a1;
68
67
  color: #2e5934;
69
68
  background-color: #e2efd3;
70
69
  }
71
70
 
72
- div#flash_notices div.flash.error {
71
+ div.flash.error {
73
72
  border-color: #c49c9c;
74
73
  color: #592e2e;
75
74
  background-color: #efd3d3;
76
75
  }
77
76
 
78
- div#flash_notices div.flash.info {
77
+ div.flash.info {
79
78
  border-color: #8392b5;
80
79
  color: #233772;
81
80
  background-color: #cadbf3;
82
81
  }
83
82
 
84
- div#flash_notices div.flash.warn {
83
+ div.flash.warn,
84
+ div.flash.warning {
85
85
  border-color: #c4c19c;
86
86
  color: #726d23;
87
87
  background-color: #f3f0c1;
@@ -103,6 +103,124 @@ div.login_signup_box {
103
103
  margin: 2em auto;
104
104
  }
105
105
 
106
+ /* @group Pagination */
107
+
108
+ div.archive_pagination_links {
109
+ position: relative;
110
+ margin-bottom: 16px;
111
+ margin-top: 8px;
112
+ height: 19px;
113
+ text-align: center;
114
+ line-height: 21px;
115
+ }
116
+
117
+ div.archive_pagination_links span.pagination_current_page {
118
+ background-position: 0 -21px;
119
+ font-weight: bold;
120
+ color: #333;
121
+ }
122
+
123
+ div.archive_pagination_links .first_page {
124
+ position: absolute;
125
+ left: 8px;
126
+ top: -2px;
127
+ }
128
+
129
+ .archive_pagination_links .last_page {
130
+ position: absolute;
131
+ right: 8px;
132
+ top: -2px;
133
+ }
134
+
135
+ .archive_pagination_links .previous_page {
136
+ position: absolute;
137
+ left: 32px;
138
+ top: -2px;
139
+ }
140
+
141
+ .archive_pagination_links .next_page {
142
+ position: absolute;
143
+ right: 32px;
144
+ top: -2px;
145
+ }
146
+
147
+ .archive_pagination_links span, .archive_pagination_links a {
148
+ padding: 0;
149
+ color: #333;
150
+ -webkit-border-radius: 3px;
151
+ -moz-border-radius: 3px;
152
+ border-radius: 3px;
153
+ width: 21px;
154
+ height: 21px;
155
+ display: inline-block;
156
+ background: url(/images/alchemy/gui/button_background.png) no-repeat 0 0;
157
+ }
158
+
159
+ .archive_pagination_links span {
160
+ color: #9a9a9a;
161
+ }
162
+
163
+ div.archive_pagination_links a:active {
164
+ text-decoration: none;
165
+ background-position: 0 -21px;
166
+ }
167
+
168
+ div.pagination {
169
+ text-align: center;
170
+ line-height: 24px;
171
+ height: 24px;
172
+ width: 100%;
173
+ margin-bottom: 16px;
174
+ }
175
+
176
+ div.pagination a,
177
+ div.pagination span,
178
+ div.pagination em {
179
+ padding: 4px 8px;
180
+ border: 1px solid #c0c0c0;
181
+ -webkit-border-radius: 3px;
182
+ -moz-border-radius: 3px;
183
+ -o-border-radius: 3px;
184
+ border-radius: 3px;
185
+ background: white url(/images/alchemy/gui/shading.png) repeat-x 0 -75px;
186
+ height: 23px;
187
+ line-height: 23px;
188
+ font-style: normal;
189
+ }
190
+
191
+ div.pagination a:hover {
192
+ background-color: #e6f0f5;
193
+ color: #333;
194
+ border: 1px solid #888;
195
+ text-shadow: 0 1px 1px #fff;
196
+ text-decoration: none;
197
+ }
198
+
199
+ div.pagination .current {
200
+ background-color: #e6f0f5;
201
+ color: #333;
202
+ border: 1px solid #888;
203
+ text-shadow: 0px 1px 1px #fff;
204
+ }
205
+
206
+ div.pagination .previous_page {
207
+ margin-right: 16px;
208
+ }
209
+
210
+ div.pagination .next_page {
211
+ margin-left: 16px;
212
+ }
213
+
214
+ div.pagination .disabled {
215
+ color: #c0c0c0;
216
+ }
217
+
218
+ #assign_image_list div.pagination {
219
+ margin-bottom: 8px;
220
+ }
221
+
222
+ /* @end */
223
+
106
224
  #login table tbody tr td.label {
107
225
  width: 155px;
108
226
  }
@@ -598,7 +716,7 @@ div#page {
598
716
  height: 16px;
599
717
  position: absolute;
600
718
  background-color: white;
601
- top: 4px;
719
+ top: 3px;
602
720
  right: 4px;
603
721
  padding: 1px;
604
722
  z-index: 1;
@@ -1740,24 +1858,12 @@ button.button {
1740
1858
  font-size: 1em;
1741
1859
  }
1742
1860
 
1743
- button.button img {
1861
+ .button img {
1744
1862
  margin-right: 0;
1745
1863
  width: 20px;
1746
1864
  height: 20px;
1747
1865
  }
1748
1866
 
1749
- button.button.disabled,
1750
- button.button.disabled:hover,
1751
- button.button.disabled:active {
1752
- color: #333;
1753
- text-shadow: none;
1754
- border-color: #ccc;
1755
- cursor: default;
1756
- background-image: none;
1757
- background-color: #f5f5f5;
1758
- padding: 1px 0 0;
1759
- }
1760
-
1761
1867
  #new_page_form tbody tr td.second_row .button {
1762
1868
  float: right;
1763
1869
  }
@@ -1782,6 +1888,36 @@ a.button:active {
1782
1888
  background-color: #e5e5e5;
1783
1889
  }
1784
1890
 
1891
+ a.button.disabled,
1892
+ a.button.disabled:hover,
1893
+ a.button.disabled:active,
1894
+ input.button.disabled,
1895
+ input.button.disabled:hover,
1896
+ input.button.disabled:active,
1897
+ button.button.disabled,
1898
+ button.button.disabled:hover,
1899
+ button.button.disabled:active {
1900
+ color: #333;
1901
+ text-shadow: none;
1902
+ border-color: #ccc;
1903
+ cursor: default;
1904
+ background-image: none;
1905
+ background-color: #f5f5f5;
1906
+ padding: 1px 0 0;
1907
+ }
1908
+
1909
+ a.button.disabled img {
1910
+ display: inline-block;
1911
+ float: none;
1912
+ }
1913
+
1914
+ a.button.disabled,
1915
+ a.button.disabled:hover,
1916
+ a.button.disabled:active {
1917
+ padding: 2px !important;
1918
+ text-align: center;
1919
+ }
1920
+
1785
1921
  label {
1786
1922
  line-height: 23px;
1787
1923
  }
@@ -1899,7 +2035,8 @@ td.role {
1899
2035
  padding: 1px 0 1px 1px;
1900
2036
  }
1901
2037
 
1902
- div#archive_all .picture_detail {
2038
+ div#archive_all .div.picture_thumbnail.small,
2039
+ picture_thumbnail {
1903
2040
  padding: 2px 0 0;
1904
2041
  margin: 0 16px 16px 0;
1905
2042
  height: 118px;
@@ -1979,14 +2116,19 @@ div.spinner {
1979
2116
  left: 0;
1980
2117
  }
1981
2118
 
1982
- div.archive_image_spinner img {
2119
+ div.image_spinner {
2120
+ background-color: #666;
2121
+ }
2122
+
2123
+ div.image_spinner img {
1983
2124
  position: absolute;
1984
2125
  z-index: 0;
1985
- top: 35px;
2126
+ top: 32px;
1986
2127
  left: 40px;
1987
2128
  }
1988
2129
 
1989
- .picture_detail {
2130
+ .div.picture_thumbnail.small,
2131
+ picture_thumbnail {
1990
2132
  width: 118px;
1991
2133
  height: 118px;
1992
2134
  padding: 2px 0 0;
@@ -2000,13 +2142,10 @@ div.archive_image_spinner img {
2000
2142
  -moz-border-radius: 3px;
2001
2143
  -o-border-radius: 3px;
2002
2144
  border-radius: 3px;
2003
- -webkit-box-shadow: #999 0px 1px 3px;
2004
- -moz-box-shadow: #999 0px 1px 3px;
2005
- -o-box-shadow: #999 0px 1px 3px;
2006
- box-shadow: #999 0px 1px 3px;
2007
2145
  }
2008
2146
 
2009
- .picture_detail .picture_image {
2147
+ .div.picture_thumbnail.small,
2148
+ picture_thumbnail .picture_image {
2010
2149
  text-align: center;
2011
2150
  margin-left: 3px;
2012
2151
  margin-bottom: 2px;
@@ -2021,7 +2160,8 @@ div.archive_image_spinner img {
2021
2160
  height: 93px;
2022
2161
  }
2023
2162
 
2024
- #archive_all .picture_detail:hover .picture_tool_delete {
2163
+ #archive_all .div.picture_thumbnail.small,
2164
+ picture_thumbnail:hover .picture_tool_delete {
2025
2165
  display: block;
2026
2166
  }
2027
2167
 
@@ -2097,66 +2237,6 @@ div.archive_image_spinner img {
2097
2237
  border: 1px dashed;
2098
2238
  }
2099
2239
 
2100
- div.archive_pagination_links {
2101
- position: relative;
2102
- margin-bottom: 16px;
2103
- margin-top: 8px;
2104
- height: 19px;
2105
- text-align: center;
2106
- line-height: 21px;
2107
- }
2108
-
2109
- div.archive_pagination_links span.pagination_current_page {
2110
- background-position: 0 -21px;
2111
- font-weight: bold;
2112
- color: #333;
2113
- }
2114
-
2115
- div.archive_pagination_links .first_page {
2116
- position: absolute;
2117
- left: 8px;
2118
- top: -2px;
2119
- }
2120
-
2121
- .archive_pagination_links .last_page {
2122
- position: absolute;
2123
- right: 8px;
2124
- top: -2px;
2125
- }
2126
-
2127
- .archive_pagination_links .previous_page {
2128
- position: absolute;
2129
- left: 32px;
2130
- top: -2px;
2131
- }
2132
-
2133
- .archive_pagination_links .next_page {
2134
- position: absolute;
2135
- right: 32px;
2136
- top: -2px;
2137
- }
2138
-
2139
- .archive_pagination_links span, .archive_pagination_links a {
2140
- padding: 0;
2141
- color: #333;
2142
- -webkit-border-radius: 3px;
2143
- -moz-border-radius: 3px;
2144
- border-radius: 3px;
2145
- width: 21px;
2146
- height: 21px;
2147
- display: inline-block;
2148
- background: url(/images/alchemy/gui/button_background.png) no-repeat 0 0;
2149
- }
2150
-
2151
- .archive_pagination_links span {
2152
- color: #9a9a9a;
2153
- }
2154
-
2155
- div.archive_pagination_links a:active {
2156
- text-decoration: none;
2157
- background-position: 0 -21px;
2158
- }
2159
-
2160
2240
  a.rename_link {
2161
2241
  background: url(/images/alchemy/icons/edit.png) 0 0;
2162
2242
  }
@@ -2587,54 +2667,6 @@ div#images {
2587
2667
  overflow: visible;
2588
2668
  }
2589
2669
 
2590
- div.pagination {
2591
- text-align: center;
2592
- line-height: 24px;
2593
- height: 24px;
2594
- width: 100%;
2595
- margin-bottom: 16px;
2596
- }
2597
-
2598
- div.pagination .prev_page {
2599
- margin-right: 16px;
2600
- }
2601
-
2602
- div.pagination .next_page {
2603
- margin-left: 16px;
2604
- }
2605
-
2606
- div.pagination a,
2607
- div.pagination span {
2608
- padding: 4px 8px;
2609
- border: 1px solid #c0c0c0;
2610
- -webkit-border-radius: 3px;
2611
- -moz-border-radius: 3px;
2612
- -o-border-radius: 3px;
2613
- border-radius: 3px;
2614
- background: white url(/images/alchemy/gui/shading.png) repeat-x 0 -75px;
2615
- height: 23px;
2616
- line-height: 23px;
2617
- }
2618
-
2619
- div.pagination a:hover {
2620
- background-color: #e6f0f5;
2621
- color: #333;
2622
- border: 1px solid #888;
2623
- text-shadow: 0 1px 1px #fff;
2624
- text-decoration: none;
2625
- }
2626
-
2627
- div.pagination .disabled {
2628
- color: #c0c0c0;
2629
- }
2630
-
2631
- div.pagination .current {
2632
- background-color: #e6f0f5;
2633
- color: #333;
2634
- border: 1px solid #888;
2635
- text-shadow: 0px 1px 1px #fff;
2636
- }
2637
-
2638
2670
  #toolbar_links {
2639
2671
  line-height: 21px;
2640
2672
  margin-left: 8px;
@@ -2893,10 +2925,6 @@ div.assign_image_list_detail {
2893
2925
  -moz-border-radius: 3px;
2894
2926
  -o-border-radius: 3px;
2895
2927
  border-radius: 3px;
2896
- -webkit-box-shadow: #999 0px 1px 3px;
2897
- -moz-box-shadow: #999 0px 1px 3px;
2898
- -o-box-shadow: #999 0px 1px 3px;
2899
- box-shadow: #999 0px 1px 3px;
2900
2928
  }
2901
2929
 
2902
2930
  #assign_image_list {
@@ -2920,47 +2948,52 @@ div.assign_image_list_detail {
2920
2948
  }
2921
2949
 
2922
2950
  div.assign_image_list_image {
2923
- background-color: #ededed;
2924
2951
  text-align: center;
2925
2952
  overflow: hidden;
2953
+ position: relative;
2926
2954
  }
2927
2955
 
2928
- div.overlay_image_spinner img {
2929
- position: absolute;
2930
- z-index: 0;
2956
+ .assign_image_list_detail.small div.image_spinner img {
2957
+ top: 14px;
2958
+ left: 25px;
2931
2959
  }
2932
2960
 
2933
- .assign_image_list_detail.small div.overlay_image_spinner img {
2934
- top: 19px;
2935
- left: 26px;
2961
+ .assign_image_list_detail.medium div.image_spinner img {
2962
+ top: 42px;
2963
+ left: 64px;
2936
2964
  }
2937
2965
 
2938
- .assign_image_list_detail.medium div.overlay_image_spinner img {
2939
- top: 48px;
2940
- left: 67px;
2966
+ .assign_image_list_detail.large div.image_spinner img {
2967
+ top: 74px;
2968
+ left: 108px;
2941
2969
  }
2942
2970
 
2943
- .assign_image_list_detail.large div.overlay_image_spinner img {
2944
- top: 80px;
2945
- left: 103px;
2971
+ #assign_image_list div.assign_image_list_image a {
2972
+ width: 160px;
2973
+ height: 120px;
2946
2974
  }
2947
2975
 
2948
- #assign_image_list div.assign_image_list_detail.small div.assign_image_list_image {
2976
+ div.picture_thumbnail.small,
2977
+ #assign_image_list div.assign_image_list_detail.small div.assign_image_list_image,
2978
+ #assign_image_list div.assign_image_list_detail.small div.assign_image_list_image a {
2979
+ width: 80px;
2949
2980
  height: 60px;
2950
2981
  }
2951
2982
 
2952
- #assign_image_list div.assign_image_list_detail.medium div.assign_image_list_image {
2983
+ div.picture_thumbnail.medium,
2984
+ #assign_image_list div.assign_image_list_detail.medium div.assign_image_list_image,
2985
+ #assign_image_list div.assign_image_list_detail.medium div.assign_image_list_image a {
2986
+ width: 160px;
2953
2987
  height: 120px;
2954
2988
  }
2955
2989
 
2956
- #assign_image_list div.assign_image_list_detail.large div.assign_image_list_image {
2990
+ div.picture_thumbnail.large,
2991
+ #assign_image_list div.assign_image_list_detail.large div.assign_image_list_image,
2992
+ #assign_image_list div.assign_image_list_detail.large div.assign_image_list_image a {
2993
+ width: 240px;
2957
2994
  height: 180px;
2958
2995
  }
2959
2996
 
2960
- #assign_image_list div.assign_image_list_image a {
2961
- display: block;
2962
- }
2963
-
2964
2997
  #assign_image_list div.assign_image_list_image img {
2965
2998
  border-style: none;
2966
2999
  }
@@ -3059,11 +3092,7 @@ input#user_admin {
3059
3092
  font: 12px "Courier New", Courier, mono;
3060
3093
  }
3061
3094
 
3062
- #assign_image_list div.pagination {
3063
- margin-bottom: 8px;
3064
- }
3065
-
3066
- div#image_assign_filter_and_image_sizing form {
3095
+ #alchemy div#overlay_toolbar div#image_assign_filter_and_image_sizing form {
3067
3096
  float: right;
3068
3097
  width: 290px;
3069
3098
  height: 25px;
@@ -3462,11 +3491,6 @@ div#overlay_toolbar {
3462
3491
  padding: 8px;
3463
3492
  }
3464
3493
 
3465
- #overlay_toolbar div.js_filter_field_box {
3466
- margin-top: 6px;
3467
- margin-right: 8px;
3468
- }
3469
-
3470
3494
  div#overlay_toolbar div.toolbar_spacer {
3471
3495
  float: left;
3472
3496
  width: 1px;