alchemy_cms 2.0.2 → 2.0.3
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.
- data/README.md +2 -2
- data/app/controllers/admin/elements_controller.rb +4 -20
- data/app/helpers/contents_helper.rb +2 -2
- data/app/models/page.rb +1 -1
- data/app/views/admin/elements/update.js.erb +14 -0
- data/app/views/admin/partials/_upload_form.html.erb +2 -2
- data/app/views/essences/_essence_picture_editor.html.erb +1 -1
- data/config/alchemy/config.yml +3 -3
- data/config/alchemy/elements.yml +10 -5
- data/lib/alchemy/version.rb +1 -1
- data/spec/models/page_spec.rb +3 -3
- metadata +2 -2
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Alchemy CMS
|
|
6
6
|
About
|
7
7
|
-----
|
8
8
|
|
9
|
-
Alchemy is a
|
9
|
+
Alchemy is a powerful Content Management System (CMS) with an extremly flexible content storing architecture.
|
10
10
|
|
11
11
|
Features
|
12
12
|
--------
|
@@ -108,7 +108,7 @@ Resources
|
|
108
108
|
---------
|
109
109
|
|
110
110
|
* Homepage: <http://alchemy-cms.com>
|
111
|
-
* Live-Demo: <http://demo.alchemy-cms.com>
|
111
|
+
* Live-Demo: <http://demo.alchemy-cms.com> (user: demo, password: demo)
|
112
112
|
* Wiki: <http://wiki.alchemy-cms.com>
|
113
113
|
* API Documentation: <http://api.alchemy-cms.com>
|
114
114
|
* Issue-Tracker: <http://issues.alchemy-cms.com>
|
@@ -71,28 +71,12 @@ class Admin::ElementsController < AlchemyController
|
|
71
71
|
@element.public = !params[:public].nil?
|
72
72
|
@element.save
|
73
73
|
else
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
page << "jQuery('#element_#{@element.id}_errors').html('#{error_message}<ul><li>#{@element.essence_error_messages.join('</li><li>')}</li></ul>')"
|
78
|
-
page.show("element_#{@element.id}_errors")
|
79
|
-
selector = @element.contents_with_errors.map { |content| '#' + content_dom_id(content) }.join(', ')
|
80
|
-
page << "jQuery('div.content_editor').removeClass('validation_failed')"
|
81
|
-
page << "jQuery('#{selector}').addClass('validation_failed')"
|
82
|
-
page << "Alchemy.enableButton('#element_#{@element.id} button.button')"
|
83
|
-
end
|
74
|
+
@element_validated = false
|
75
|
+
@notice = _('Validation failed.')
|
76
|
+
@error_message = "<h2>#{@notice}</h2><p>#{_('Please check contents below.')}</p>".html_safe
|
84
77
|
end
|
85
78
|
rescue Exception => e
|
86
|
-
|
87
|
-
if e.class == Ferret::FileNotFoundError
|
88
|
-
EssenceText.rebuild_index
|
89
|
-
EssenceRichtext.rebuild_index
|
90
|
-
render :update do |page|
|
91
|
-
page << "Alchemy.growl('#{_("Index Error after saving Element. Please try again!")}', 'error')"
|
92
|
-
end
|
93
|
-
else
|
94
|
-
show_error_notice(e)
|
95
|
-
end
|
79
|
+
exception_handler(e)
|
96
80
|
end
|
97
81
|
|
98
82
|
# Trashes the Element instead of deleting it.
|
@@ -23,9 +23,9 @@ module ContentsHelper
|
|
23
23
|
if content.description.blank?
|
24
24
|
warning("Content #{content.name} is missing its description")
|
25
25
|
title = _("Warning: Content '%{contentname}' is missing its description.") % {:contentname => content.name}
|
26
|
-
content_name = %(<span class="warning icon" title="#{title}"></span> ) + content_name
|
26
|
+
content_name = %(<span class="warning icon" title="#{title}"></span> ) + content_name.html_safe
|
27
27
|
end
|
28
|
-
content.has_validations? ? "#{content_name}<span class='validation_indicator'>*</span>" : content_name
|
28
|
+
content.has_validations? ? "#{content_name}<span class='validation_indicator'>*</span>".html_safe : content_name
|
29
29
|
end
|
30
30
|
|
31
31
|
# Renders a link to show the new content overlay
|
data/app/models/page.rb
CHANGED
@@ -37,7 +37,7 @@ class Page < ActiveRecord::Base
|
|
37
37
|
scope :all_locked, where(:locked => true)
|
38
38
|
scope :not_locked, where(:locked => false)
|
39
39
|
scope :visible, where(:visible => true)
|
40
|
-
scope :
|
40
|
+
scope :published, where(:public => true)
|
41
41
|
scope :accessable, where(:restricted => false)
|
42
42
|
scope :restricted, where(:restricted => true)
|
43
43
|
scope :public_language_roots, lambda {
|
@@ -1,4 +1,6 @@
|
|
1
1
|
(function($) {
|
2
|
+
<%- if @element_validated -%>
|
3
|
+
|
2
4
|
$('div#element_<%= @element.id -%> div.element_handle span.icon').removeClass('element_<%= @element.public? ? "draft" : "public" -%>').addClass('element_<%= @element.public? ? "public" : "draft" -%>');
|
3
5
|
$('.element_editor[data-element-id="<%= @element.id -%>"] .element_heading .preview_text_element_name').text('<%= @element.display_name -%>');
|
4
6
|
$('.element_editor[data-element-id="<%= @element.id -%>"] .element_heading .preview_text_quote').text('<%= escape_javascript(@element.preview_text) -%>');
|
@@ -7,4 +9,16 @@
|
|
7
9
|
Alchemy.setElementSaved('#element_<%= @element.id -%>');
|
8
10
|
Alchemy.growl('<%= _("element_saved") -%>');
|
9
11
|
Alchemy.PreviewWindow.refresh();
|
12
|
+
|
13
|
+
<%- else -%>
|
14
|
+
|
15
|
+
Alchemy.growl('<%= escape_javascript(@notice) %>', 'warn');
|
16
|
+
$('#element_<%= @element.id %>_errors').html('<%= @error_message %><ul><li><%= @element.essence_error_messages.join("</li><li>") %></li></ul>');
|
17
|
+
$("#element_<%= @element.id %>_errors").show();
|
18
|
+
$('div.content_editor').removeClass('validation_failed');
|
19
|
+
$('<%= @element.contents_with_errors.map { |content| "#" + content_dom_id(content) }.join(", ") %>').addClass('validation_failed');
|
20
|
+
Alchemy.enableButton('#element_<%= @element.id %> button.button');
|
21
|
+
|
22
|
+
<%- end -%>
|
23
|
+
|
10
24
|
})(jQuery);
|
@@ -74,10 +74,10 @@
|
|
74
74
|
flash9_url : "/javascripts/alchemy/swfupload/swfupload.swf",
|
75
75
|
upload_url: '<%= new_asset_path_with_session_information(model_name) %>',
|
76
76
|
post_params: <%= post_params.html_safe %>,
|
77
|
-
file_size_limit : "<%= configuration(:uploader)[:file_size_limit] -%> MB",
|
77
|
+
file_size_limit : "<%= configuration(:uploader)[:file_size_limit] || 100 -%> MB",
|
78
78
|
file_types : '<%= file_types.map{ |f| "*.#{f}" }.join(";") %>',
|
79
79
|
file_types_description : "<%= file_types_description %>",
|
80
|
-
file_upload_limit : <%= configuration(:uploader)[:upload_limit] -%>,
|
80
|
+
file_upload_limit : <%= configuration(:uploader)[:upload_limit] || 50 -%>,
|
81
81
|
file_queue_limit : 0,
|
82
82
|
custom_settings : {
|
83
83
|
progressTarget : "uploadProgressContainer",
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<div class="missing_image">
|
19
19
|
<p>
|
20
20
|
<%= image_tag('alchemy/placeholder.png') %><br>
|
21
|
-
<%= _('Image missing') %><%= '<span class="validation_indicator">*</span>' if content.has_validations? %>
|
21
|
+
<%= _('Image missing') %><%= '<span class="validation_indicator">*</span>'.html_safe if content.has_validations? %>
|
22
22
|
</p>
|
23
23
|
</div>
|
24
24
|
<%- else -%>
|
data/config/alchemy/config.yml
CHANGED
@@ -117,12 +117,12 @@ default_language:
|
|
117
117
|
:user_roles: [registered, author, editor, admin]
|
118
118
|
|
119
119
|
# === Uploader Settings
|
120
|
-
# Set an upload limit
|
121
|
-
# Set a file size limit in megabytes for a per file limit.
|
120
|
+
# upload_limit: Integer Set an amount of files upload limit of files which can be uploaded at once. Set 0 for unlimited.
|
121
|
+
# file_size_limit: Integer Set a file size limit in megabytes for a per file limit.
|
122
122
|
# Allow filetypes to upload.
|
123
123
|
# Pass * to allow all kind of files.
|
124
124
|
:uploader:
|
125
|
-
:upload_limit:
|
125
|
+
:upload_limit: 50
|
126
126
|
:file_size_limit: 100
|
127
127
|
:allowed_filetypes:
|
128
128
|
:pictures: [jpg, jpeg, gif, png, psd, pdf]
|
data/config/alchemy/elements.yml
CHANGED
@@ -98,7 +98,8 @@
|
|
98
98
|
# contents:
|
99
99
|
# - name: intro
|
100
100
|
# type: EssenceText
|
101
|
-
# validate:
|
101
|
+
# validate:
|
102
|
+
# - presence
|
102
103
|
#
|
103
104
|
# Now the user has to enter a value inside of the intro EssenceText textfield to save the element.
|
104
105
|
# Currently supported validations are:
|
@@ -209,13 +210,17 @@
|
|
209
210
|
contents:
|
210
211
|
- name: mail_from
|
211
212
|
type: EssenceText
|
212
|
-
validate:
|
213
|
+
validate:
|
214
|
+
- presence
|
213
215
|
- name: mail_to
|
214
216
|
type: EssenceText
|
215
|
-
validate:
|
217
|
+
validate:
|
218
|
+
- presence
|
216
219
|
- name: subject
|
217
220
|
type: EssenceText
|
218
|
-
validate:
|
221
|
+
validate:
|
222
|
+
- presence
|
219
223
|
- name: success_page
|
220
224
|
type: EssenceText
|
221
|
-
validate:
|
225
|
+
validate:
|
226
|
+
- presence
|
data/lib/alchemy/version.rb
CHANGED
data/spec/models/page_spec.rb
CHANGED
@@ -113,13 +113,13 @@ describe Page do
|
|
113
113
|
it "all pages except the rootpage must have a parent_id" do
|
114
114
|
page = Factory.build(:page, :page_layout => "anypage", :parent_id => nil, :language => @language)
|
115
115
|
page.valid?
|
116
|
-
page.
|
116
|
+
page.should have(1).error_on(:parent_id)
|
117
117
|
end
|
118
118
|
|
119
119
|
it "must not be created if the page_layout is set to 'rootpage' and a page already exists with this page_layout and parent_id = nil" do
|
120
120
|
page = Factory.build(:page, :name => "anypage", :page_layout => "rootpage", :parent_id => @language_root.id, :language => @language)
|
121
121
|
page.valid?
|
122
|
-
page.
|
122
|
+
page.should have(1).error_on(:page_layout)
|
123
123
|
end
|
124
124
|
|
125
125
|
it "should get a webfriendly urlname on create" do
|
@@ -165,7 +165,7 @@ describe Page do
|
|
165
165
|
it "should return 2 pages that are public" do
|
166
166
|
Factory(:public_page, :name => 'First Public Child', :parent_id => @language_root.id, :language => @language)
|
167
167
|
Factory(:public_page, :name => 'Second Public Child', :parent_id => @language_root.id, :language => @language)
|
168
|
-
Page.
|
168
|
+
Page.published.should have(2).pages
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.0.
|
5
|
+
version: 2.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Thomas von Deyen
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2011-11-
|
15
|
+
date: 2011-11-08 00:00:00 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|