alchemy_cms 2.4.1 → 2.5.0.b2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/README.md +18 -17
- data/alchemy_cms.gemspec +5 -10
- data/app/assets/images/alchemy/icons.png +0 -0
- data/app/assets/stylesheets/alchemy/archive.scss +27 -0
- data/app/assets/stylesheets/alchemy/base.scss +0 -51
- data/app/assets/stylesheets/alchemy/elements.scss +37 -2
- data/app/assets/stylesheets/alchemy/icons.scss +4 -0
- data/app/assets/stylesheets/alchemy/modules.scss +4 -0
- data/app/assets/stylesheets/alchemy/sitemap.scss +1 -1
- data/app/assets/stylesheets/alchemy/tables.scss +1 -1
- data/app/assets/stylesheets/alchemy/variables.scss +1 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -0
- data/app/controllers/alchemy/admin/pictures_controller.rb +22 -8
- data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
- data/app/controllers/alchemy/admin/sites_controller.rb +6 -0
- data/app/controllers/alchemy/base_controller.rb +8 -0
- data/app/controllers/alchemy/elements_controller.rb +33 -3
- data/app/controllers/alchemy/messages_controller.rb +47 -40
- data/app/controllers/alchemy/pages_controller.rb +8 -31
- data/app/controllers/alchemy/pictures_controller.rb +64 -30
- data/app/helpers/alchemy/admin/base_helper.rb +7 -0
- data/app/helpers/alchemy/admin/pages_helper.rb +12 -0
- data/app/helpers/alchemy/elements_helper.rb +2 -0
- data/app/helpers/alchemy/pages_helper.rb +30 -10
- data/app/helpers/alchemy/url_helper.rb +1 -0
- data/app/models/alchemy/content.rb +1 -2
- data/app/models/alchemy/element.rb +47 -2
- data/app/models/alchemy/language.rb +27 -14
- data/app/models/alchemy/page.rb +1 -1
- data/app/models/alchemy/picture.rb +46 -41
- data/app/models/alchemy/site.rb +44 -0
- data/app/views/alchemy/admin/elements/_element_head.html.erb +1 -0
- data/app/views/alchemy/admin/languages/index.html.erb +23 -0
- data/app/views/alchemy/admin/pages/edit.html.erb +27 -1
- data/app/views/alchemy/admin/pages/fold.js.erb +1 -0
- data/app/views/alchemy/admin/partials/_upload_form.html.erb +2 -0
- data/app/views/alchemy/admin/pictures/_picture.html.erb +24 -2
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +5 -4
- data/app/views/alchemy/admin/pictures/create.js.erb +1 -9
- data/app/views/alchemy/admin/pictures/info.html.erb +42 -0
- data/app/views/alchemy/admin/resources/_form.html.erb +0 -2
- data/app/views/alchemy/admin/resources/_resource.html.erb +2 -1
- data/app/views/alchemy/admin/resources/index.html.erb +2 -1
- data/app/views/alchemy/elements/show.html.erb +1 -6
- data/app/views/alchemy/elements/show.js.erb +4 -10
- data/app/views/alchemy/essences/_essence_link_view.html.erb +1 -0
- data/app/views/alchemy/search/_form.html.erb +9 -6
- data/app/views/alchemy/search/_result.html.erb +1 -1
- data/bin/alchemy +13 -120
- data/config/alchemy/config.yml +7 -11
- data/config/alchemy/modules.yml +24 -12
- data/config/authorization_rules.rb +6 -2
- data/config/initializers/dragonfly.rb +20 -0
- data/config/locales/alchemy.de.yml +57 -28
- data/config/locales/alchemy.en.yml +18 -4
- data/config/routes.rb +4 -2
- data/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +21 -0
- data/db/migrate/20121205155004_create_alchemy_sites.rb +14 -0
- data/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +6 -0
- data/lib/alchemy/capistrano.rb +7 -2
- data/lib/alchemy/ferret_search.rb +84 -0
- data/lib/alchemy/picture_attributes.rb +29 -0
- data/lib/alchemy/seeder.rb +10 -16
- data/lib/alchemy/upgrader.rb +59 -8
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +7 -4
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +3 -0
- data/lib/rails/generators/alchemy/elements/elements_generator.rb +5 -1
- data/lib/rails/generators/alchemy/page_layouts/page_layouts_generator.rb +1 -0
- data/lib/rails/generators/alchemy/scaffold/files/{pages.html.erb → application.html.erb} +0 -0
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +11 -20
- data/lib/rails/templates/alchemy.rb +1 -7
- data/lib/tasks/{database.rake → alchemy/db.rake} +1 -1
- data/lib/tasks/{install.rake → alchemy/install.rake} +9 -14
- data/lib/tasks/{upgrade.rake → alchemy/upgrade.rake} +1 -1
- data/spec/controllers/elements_controller_spec.rb +24 -9
- data/spec/controllers/pictures_controller_spec.rb +11 -8
- data/{app → spec/dummy/app}/views/alchemy/elements/_article_editor.html.erb +0 -0
- data/{app → spec/dummy/app}/views/alchemy/elements/_article_view.html.erb +0 -0
- data/{app → spec/dummy/app}/views/alchemy/elements/_headline_view.html.erb +0 -0
- data/{app → spec/dummy/app}/views/alchemy/elements/_news_view.html.erb +0 -0
- data/{app → spec/dummy/app}/views/alchemy/elements/_searchresult_view.html.erb +0 -0
- data/{app → spec/dummy/app}/views/alchemy/page_layouts/_standard.html.erb +0 -0
- data/spec/dummy/config/alchemy/elements.yml +86 -0
- data/spec/dummy/config/alchemy/page_layouts.yml +26 -0
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/db/migrate/20121121162313_switch_from_fleximage_to_dragonfly.rb +21 -0
- data/spec/dummy/db/migrate/20121205155004_create_alchemy_sites.rb +14 -0
- data/spec/dummy/db/migrate/20121211163003_add_public_to_alchemy_sites.rb +6 -0
- data/spec/dummy/db/schema.rb +21 -6
- data/spec/factories.rb +6 -2
- data/spec/integration/translation_integration_spec.rb +4 -18
- data/spec/models/element_spec.rb +4 -4
- data/spec/models/picture_spec.rb +37 -20
- data/spec/models/site_spec.rb +69 -0
- data/spec/routing_spec.rb +115 -115
- data/spec/spec_helper.rb +1 -3
- data/spec/support/alchemy/specs_helpers.rb +4 -4
- data/vendor/assets/javascripts/jquery_plugins/jquery.html5uploader.js +1 -1
- metadata +72 -96
- data/app/assets/stylesheets/alchemy/standard_set.css +0 -440
- data/app/views/alchemy/elements/_bild_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_bild_text_editor.html.erb +0 -7
- data/app/views/alchemy/elements/_bild_text_view.html.erb +0 -9
- data/app/views/alchemy/elements/_bild_view.html.erb +0 -9
- data/app/views/alchemy/elements/_claim_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_claim_view.html.erb +0 -1
- data/app/views/alchemy/elements/_contactform_editor.html.erb +0 -4
- data/app/views/alchemy/elements/_contactform_view.html.erb +0 -78
- data/app/views/alchemy/elements/_download_editor.html.erb +0 -4
- data/app/views/alchemy/elements/_download_view.html.erb +0 -7
- data/app/views/alchemy/elements/_footnote_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_footnote_view.html.erb +0 -5
- data/app/views/alchemy/elements/_header_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_header_view.html.erb +0 -1
- data/app/views/alchemy/elements/_headline_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +0 -3
- data/app/views/alchemy/elements/_image_mosaic_view.html.erb +0 -14
- data/app/views/alchemy/elements/_intro_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_intro_image_text_editor.html.erb +0 -3
- data/app/views/alchemy/elements/_intro_image_text_view.html.erb +0 -16
- data/app/views/alchemy/elements/_intro_view.html.erb +0 -3
- data/app/views/alchemy/elements/_news_editor.html.erb +0 -3
- data/app/views/alchemy/elements/_searchresult_editor.html.erb +0 -4
- data/app/views/alchemy/elements/_sitemap_editor.html.erb +0 -3
- data/app/views/alchemy/elements/_sitemap_view.html.erb +0 -38
- data/app/views/alchemy/elements/_sitename_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_sitename_view.html.erb +0 -1
- data/app/views/alchemy/elements/_subheadline_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_subheadline_view.html.erb +0 -5
- data/app/views/alchemy/elements/_text_editor.html.erb +0 -1
- data/app/views/alchemy/elements/_text_view.html.erb +0 -3
- data/app/views/alchemy/page_layouts/_contact.html.erb +0 -14
- data/app/views/alchemy/page_layouts/_external.html.erb +0 -0
- data/app/views/alchemy/page_layouts/_intro.html.erb +0 -14
- data/app/views/alchemy/page_layouts/_layout_footer.html.erb +0 -14
- data/app/views/alchemy/page_layouts/_layout_header.html.erb +0 -14
- data/app/views/alchemy/page_layouts/_news.html.erb +0 -14
- data/app/views/alchemy/page_layouts/_newsletter_layout.html.erb +0 -1
- data/app/views/alchemy/page_layouts/_search.html.erb +0 -14
- data/app/views/alchemy/pictures/show.gif.flexi +0 -19
- data/app/views/alchemy/pictures/show.jpg.flexi +0 -19
- data/app/views/alchemy/pictures/show.png.flexi +0 -19
- data/app/views/alchemy/pictures/thumbnail.png.flexi +0 -13
- data/app/views/alchemy/pictures/zoom.jpg.flexi +0 -3
- data/app/views/alchemy/pictures/zoom.png.flexi +0 -3
- data/app/views/layouts/alchemy/pages.html.erb +0 -51
- data/config/alchemy/elements.yml +0 -274
- data/config/alchemy/page_layouts.yml +0 -75
- data/config/asset_packages.yml +0 -30
- data/config/initializers/localeapp.rb +0 -9
- data/lib/rails/generators/alchemy/plugin/files/translation.pot +0 -3
- data/lib/rails/generators/alchemy/plugin/files/translation_de.po +0 -3
- data/lib/rails/generators/alchemy/plugin/files/translation_en.po +0 -3
- data/lib/rails/generators/alchemy/plugin/plugin_generator.rb +0 -37
- data/lib/rails/generators/alchemy/plugin/templates/authorization_rules.rb +0 -34
- data/lib/rails/generators/alchemy/plugin/templates/config.yml +0 -30
- data/lib/rails/generators/alchemy/plugin/templates/init.rb +0 -1
- data/lib/rails/generators/alchemy/plugin/templates/plugin.rb +0 -0
- data/lib/rails/generators/alchemy/plugin/templates/routes.rb +0 -10
- data/lib/tasks/fleximage.rake +0 -154
- data/spec/dummy/app/views/layouts/.gitkeep +0 -0
@@ -11,6 +11,7 @@
|
|
11
11
|
<span class="preview_text_element_name"><%= element.display_name %></span>
|
12
12
|
<span class="preview_text_quote"><%= sanitize(element.preview_text) %></span>
|
13
13
|
</span>
|
14
|
+
<%= render_hint_for(element) %>
|
14
15
|
<span class="ajax_folder" <%= element.trashed? ? 'style="display: none"'.html_safe : '' %>>
|
15
16
|
<%= image_tag(
|
16
17
|
"alchemy/ajax_loader.gif",
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%- label_title = t("Create #{resource_model_name}", :default => t('Create')) -%>
|
2
|
+
|
3
|
+
<%- toolbar(
|
4
|
+
:buttons => [
|
5
|
+
{
|
6
|
+
:icon => 'create',
|
7
|
+
:label => label_title,
|
8
|
+
:url => new_resource_path,
|
9
|
+
:title => label_title,
|
10
|
+
:overlay_options => {
|
11
|
+
:title => label_title,
|
12
|
+
:size => "430x400"
|
13
|
+
},
|
14
|
+
:if_permitted_to => [:new, resource_permission_scope]
|
15
|
+
}
|
16
|
+
],
|
17
|
+
:search => true,
|
18
|
+
:search_url => resources_path
|
19
|
+
) -%>
|
20
|
+
|
21
|
+
<div id="archive_all">
|
22
|
+
<%= render 'table' %>
|
23
|
+
</div>
|
@@ -65,6 +65,10 @@
|
|
65
65
|
<% end %>
|
66
66
|
</div>
|
67
67
|
<% end %>
|
68
|
+
<div class="button_with_label">
|
69
|
+
<%= select_tag('preview_size', preview_sizes_for_select, :class => 'alchemy_selectbox short') %>
|
70
|
+
<label><%= t :preview_size %></label>
|
71
|
+
</div>
|
68
72
|
</div>
|
69
73
|
<div id="toolbar_buttons_right">
|
70
74
|
<div class="button_with_label" id="show_preview_window">
|
@@ -160,10 +164,14 @@
|
|
160
164
|
}
|
161
165
|
}
|
162
166
|
jQuery('#cells').tabs().tabs('paging', { follow: true, followOnSelect: true } );
|
167
|
+
|
168
|
+
if (window.location.hash) {
|
169
|
+
$(window.location.hash).trigger('Alchemy.SelectElementEditor');
|
170
|
+
}
|
163
171
|
});
|
164
172
|
}
|
165
173
|
|
166
|
-
jQuery(
|
174
|
+
jQuery(function($) {
|
167
175
|
var texts = {
|
168
176
|
title: '<%= t("Warning!") %>',
|
169
177
|
message: '<%= t(:element_dirty_page_leave_warning) %>',
|
@@ -178,6 +186,24 @@
|
|
178
186
|
Alchemy.PageLeaveObserver(texts);
|
179
187
|
Alchemy.openElementsWindow();
|
180
188
|
Alchemy.openPreviewWindow();
|
189
|
+
|
190
|
+
$('#preview_size').bind('open.selectBoxIt', function (e) {
|
191
|
+
$('#top_menu').css('z-index', 5000);
|
192
|
+
});
|
193
|
+
|
194
|
+
$('#preview_size').bind('blur.selectBoxIt', function (e) {
|
195
|
+
$('#top_menu').css('z-index', 5);
|
196
|
+
});
|
197
|
+
|
198
|
+
Alchemy.PreviewWindow.currentWidth = Alchemy.PreviewWindow.currentWindow.dialog('widget').width();
|
199
|
+
|
200
|
+
$('select#preview_size').on('change', function(e) {
|
201
|
+
var width = this.value;
|
202
|
+
if (this.value === 'auto') {
|
203
|
+
width = Alchemy.PreviewWindow.currentWidth;
|
204
|
+
}
|
205
|
+
Alchemy.PreviewWindow.currentWindow.dialog('widget').css('width', width);
|
206
|
+
});
|
181
207
|
});
|
182
208
|
|
183
209
|
</script>
|
@@ -53,9 +53,11 @@
|
|
53
53
|
file_upload_limit: <%= configuration(:uploader)['upload_limit'] || 50 -%>,
|
54
54
|
locale: "<%= ::I18n.locale || 'en' %>",
|
55
55
|
onQueueComplete: function() {
|
56
|
+
// While assigning picture in page edit mode
|
56
57
|
<% if @while_assigning && model_name == 'picture' %>
|
57
58
|
var url = '<%= alchemy.admin_pictures_path(:size => params[:size], :filter => :last_upload, :element_id => @element.id, :content_id => @content ? @content.id : nil, :options => @options).html_safe %>';
|
58
59
|
$.get(url, null, null, 'script');
|
60
|
+
// While uploading picture in library
|
59
61
|
<% elsif controller.class.name == 'Alchemy::Admin::PicturesController' %>
|
60
62
|
var url = '<%= alchemy.admin_pictures_path(:size => params[:size], :filter => :last_upload).html_safe %>';
|
61
63
|
Alchemy.pleaseWaitOverlay();
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<span class="picture_tool select">
|
3
3
|
<%= check_box_tag "picture_ids[]", picture.id %>
|
4
4
|
</span>
|
5
|
-
<% permitted_to?(:destroy, :alchemy_admin_pictures)
|
5
|
+
<% if permitted_to?(:destroy, :alchemy_admin_pictures) && picture.deletable? %>
|
6
6
|
<span class="picture_tool delete">
|
7
7
|
<%= link_to_confirmation_window(
|
8
8
|
"",
|
@@ -43,6 +43,28 @@
|
|
43
43
|
) -%>
|
44
44
|
</span>
|
45
45
|
<% end %>
|
46
|
+
<% permitted_to?(:info, :alchemy_admin_pictures) do %>
|
47
|
+
<span class="picture_tool info">
|
48
|
+
<%= link_to_overlay_window(
|
49
|
+
"",
|
50
|
+
alchemy.info_admin_picture_path(
|
51
|
+
:id => picture,
|
52
|
+
:query => params[:query],
|
53
|
+
:page => params[:page],
|
54
|
+
:tagged_with => params[:tagged_with],
|
55
|
+
:size => params[:size],
|
56
|
+
:filter => params[:filter]
|
57
|
+
),
|
58
|
+
{
|
59
|
+
:title => t('Picture infos'),
|
60
|
+
:size => "400x300"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
:title => t('Show picture infos')
|
64
|
+
}
|
65
|
+
) -%>
|
66
|
+
</span>
|
67
|
+
<% end %>
|
46
68
|
<div class="image_spinner spinner">
|
47
69
|
<%= image_tag("alchemy/image_loader.gif", :alt => '') %>
|
48
70
|
</div>
|
@@ -55,7 +77,7 @@
|
|
55
77
|
:style => "display: none;"
|
56
78
|
),
|
57
79
|
'#',
|
58
|
-
:onclick => "Alchemy.zoomImage('#{show_in_window_admin_picture_path(:id => picture.id, :sh => picture.security_token)}', '#{picture.name}', #{picture.
|
80
|
+
:onclick => "Alchemy.zoomImage('#{show_in_window_admin_picture_path(:id => picture.id, :sh => picture.security_token)}', '#{picture.name}', #{picture.image_file_width || 320}, #{picture.image_file_height || 240})",
|
59
81
|
:class => 'thumbnail_background',
|
60
82
|
:id => 'show_in_window'
|
61
83
|
) %>
|
@@ -1,12 +1,13 @@
|
|
1
|
+
<% p = params.dup %>
|
1
2
|
<h2><%= t("Filter by tag") %></h2>
|
2
3
|
<ul>
|
3
4
|
<% Alchemy::Picture.tag_counts.each do |t| %>
|
4
5
|
<% picture_tags = pictures_filtered_by_tag?(t) ? picture_tag_filter(:remove => t) : picture_tag_filter(:add => t) %>
|
5
|
-
<%= content_tag 'li', :class =>
|
6
|
+
<%= content_tag 'li', :class => p[:tagged_with].try(:split, ',').try(:include?, t.name) ? 'active' : nil do %>
|
6
7
|
<%= link_to(
|
7
8
|
"#{t.name} (#{t.count})",
|
8
9
|
url_for(
|
9
|
-
|
10
|
+
p.delete_if { |k, v| k == "page" }.merge(
|
10
11
|
:action => :index,
|
11
12
|
:tagged_with => picture_tags
|
12
13
|
)
|
@@ -17,10 +18,10 @@
|
|
17
18
|
<% end %>
|
18
19
|
<% end %>
|
19
20
|
</ul>
|
20
|
-
<% if
|
21
|
+
<% if p[:tagged_with].present? %>
|
21
22
|
<%= link_to(
|
22
23
|
render_icon('delete-small') + t('Remove tag filter'),
|
23
|
-
url_for(
|
24
|
+
url_for(p.delete_if { |k, v| k == "tagged_with" }.merge(:action => :index)),
|
24
25
|
:remote => request.xhr?,
|
25
26
|
:class => 'button small with_icon please_wait'
|
26
27
|
) %>
|
@@ -1,11 +1,3 @@
|
|
1
1
|
(function($) {
|
2
|
-
<%- if @while_assigning -%>
|
3
|
-
$('#alchemy_window_body').replaceWith('<%= escape_javascript(render(:partial => "archive_overlay")) -%>');
|
4
|
-
<%- else -%>
|
5
|
-
$('#picture_archive').html("<%= escape_javascript(render :partial => 'archive') %>");
|
6
|
-
Alchemy.pictureSelector();
|
7
|
-
Alchemy.overlayObserver('#picture_archive');
|
8
|
-
Alchemy.SelectBox('#filter_bar');
|
9
|
-
<%- end -%>
|
10
2
|
Alchemy.growl('<%= @message -%>');
|
11
|
-
})(jQuery);
|
3
|
+
})(jQuery);
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<div class="with_padding">
|
2
|
+
<table>
|
3
|
+
<tr>
|
4
|
+
<td class="label"><%= Alchemy::Picture.human_attribute_name :name %></td>
|
5
|
+
<td class="value"><p><%= @picture.name %></p></td>
|
6
|
+
</tr>
|
7
|
+
<tr>
|
8
|
+
<td class="label"><%= Alchemy::Picture.human_attribute_name :image_file_name %></td>
|
9
|
+
<td class="value"><p><%= @picture.image_file_name %></p></td>
|
10
|
+
</tr>
|
11
|
+
<tr>
|
12
|
+
<td class="label"><%= Alchemy::Picture.human_attribute_name :image_file_dimensions %></td>
|
13
|
+
<td class="value"><p><%= @picture.image_file_dimensions %> px</p></td>
|
14
|
+
</tr>
|
15
|
+
<tr>
|
16
|
+
<td class="label"><%= Alchemy::Picture.human_attribute_name :image_file_size %></td>
|
17
|
+
<td class="value"><p><%= number_to_human_size @picture.image_file_size %></p></td>
|
18
|
+
</tr>
|
19
|
+
</table>
|
20
|
+
</div>
|
21
|
+
<div id="pictures_page_list">
|
22
|
+
<% if @picture.deletable? %>
|
23
|
+
<h2><%= t :this_picture_is_not_used_on_any_page %></h2>
|
24
|
+
<% else %>
|
25
|
+
<h2><%= t :this_picture_is_used_on_these_pages %>:</h2>
|
26
|
+
<ul class="list">
|
27
|
+
<% @picture.essence_pictures.group_by(&:page).each do |page, essence_pictures| %>
|
28
|
+
<li>
|
29
|
+
<h3><%= link_to page.name, edit_admin_page_path(page) %></h3>
|
30
|
+
<ul>
|
31
|
+
<% essence_pictures.group_by(&:element).each do |element, essence_pictures| %>
|
32
|
+
<li class="<%= cycle('even', 'odd') %>">
|
33
|
+
<%= link_to element.display_name_with_preview_text, edit_admin_page_path(page, :anchor => "element_#{element.id}") %> in
|
34
|
+
<%= essence_pictures.collect { |e| e.content.name_for_label }.to_sentence %>
|
35
|
+
</li>
|
36
|
+
<% end %>
|
37
|
+
</ul>
|
38
|
+
</li>
|
39
|
+
<% end %>
|
40
|
+
</ul>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
@@ -1,5 +1,4 @@
|
|
1
1
|
<%= form_for resource_instance_variable, :url => resource_path(resource_instance_variable), :remote => true do |f| %>
|
2
|
-
<% if resource_instance_variable.errors.any? %>
|
3
2
|
<div id="errors">
|
4
3
|
<ul>
|
5
4
|
<% resource_instance_variable.errors.full_messages.each do |error| %>
|
@@ -7,7 +6,6 @@
|
|
7
6
|
<% end %>
|
8
7
|
</ul>
|
9
8
|
</div>
|
10
|
-
<% end %>
|
11
9
|
<table>
|
12
10
|
<%- resource_handler.attributes.each do |attribute| -%>
|
13
11
|
<tr>
|
@@ -1,11 +1,5 @@
|
|
1
1
|
(function($) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
:element => @element,
|
7
|
-
:options => @options
|
8
|
-
}
|
9
|
-
)) -%>');
|
10
|
-
|
11
|
-
})(jQuery);
|
2
|
+
$('#<%= @container_id -%>').html('<%= escape_javascript(
|
3
|
+
render @element, :element => @element, :options => @options
|
4
|
+
) -%>');
|
5
|
+
})(jQuery);
|
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<% search_result_page ||= find_search_result_page %>
|
2
|
+
<% if search_result_page %>
|
3
|
+
<%= form_tag show_alchemy_page_path(search_result_page), :method => :get, :id => options[:id], :class => options[:class] do %>
|
4
|
+
<% if options[:html5] %>
|
5
|
+
<%= search_field_tag(:query, params[:query], :placeholder => t('search query')) %>
|
6
|
+
<% else %>
|
7
|
+
<%= text_field_tag(:query, params[:query]) %>
|
8
|
+
<% end %>
|
9
|
+
<%= submit_tag(t("search"), :name => nil) %>
|
6
10
|
<% end %>
|
7
|
-
<%= submit_tag(t("search"), :name => nil) %>
|
8
11
|
<% end %>
|
data/bin/alchemy
CHANGED
@@ -13,147 +13,40 @@ begin
|
|
13
13
|
end
|
14
14
|
|
15
15
|
class AlchemyInstaller < Thor
|
16
|
-
|
17
16
|
include Thor::Actions
|
18
17
|
|
19
18
|
map "-v" => :version
|
20
19
|
map "--version" => :version
|
21
|
-
|
22
20
|
desc "version", "Prints current Alchemy CMS version", :hide => true
|
23
21
|
def version
|
24
22
|
puts Alchemy::VERSION
|
25
23
|
end
|
26
24
|
|
27
25
|
desc "new PROJECT", "Creates a new Alchemy CMS project."
|
28
|
-
method_option :scm, :type => :string, :aliases => "-s", :desc => "Type of scm (git or svn) to use for this project. Leave blank for none."
|
29
26
|
method_option :database, :type => :string, :default => 'mysql', :aliases => "-d", :desc => "Type of database to use for this project. Default mysql."
|
30
27
|
def new(project)
|
31
|
-
results = []
|
32
28
|
@application = project.downcase.strip.gsub(/ /, '_')
|
33
|
-
|
34
|
-
say "Generating new Rails App...", :yellow
|
35
|
-
|
36
|
-
if system("rails new #{@application} -m #{File.join(File.dirname(__FILE__), '..', 'lib', 'rails', 'templates', 'alchemy.rb')} -d #{options[:database]} -JT --old-style-hash #{options[:scm].nil? || options[:scm].empty? || options[:scm] == 'svn' ? '--skip-git' : ''}")
|
37
|
-
|
29
|
+
if system("rails new #{@application} -m #{File.join(File.dirname(__FILE__), '..', 'lib', 'rails', 'templates', 'alchemy.rb')} -d #{options[:database]} -JT")
|
38
30
|
create_database_yml if options[:database] == 'mysql'
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
with_standard_set = yes?("\nDo you want to copy the files of Alchemy´s Standardset into your App? (y/N)")
|
43
|
-
|
44
|
-
if with_standard_set
|
45
|
-
sentinel = /::Application\.configure do\s*$/
|
46
|
-
inject_into_file "#{@application}/config/environments/production.rb", "\n config.assets.precompile += %w( alchemy/standard_set.css )\n", { :after => sentinel, :verbose => true }
|
47
|
-
end
|
48
|
-
|
49
|
-
results << system("cd ./#{@application} && rake db:create alchemy:install:migrations db:migrate alchemy:db:seed")
|
50
|
-
results << system("cd ./#{@application} && rails g alchemy:scaffold#{' --with-standard-set' if with_standard_set}")
|
51
|
-
|
52
|
-
%x[
|
53
|
-
cd ./#{@application}
|
54
|
-
rm ./public/index.html
|
55
|
-
rm ./app/assets/images/rails.png
|
56
|
-
]
|
57
|
-
|
58
|
-
if !options[:scm].nil? && !options[:scm].empty?
|
59
|
-
|
60
|
-
clean_mountpoint = mountpoint.gsub('/', '')
|
61
|
-
|
62
|
-
%x[
|
63
|
-
cd ./#{@application}
|
64
|
-
rm -rf ./tmp/*
|
65
|
-
rm -rf ./log/*
|
66
|
-
mkdir -p ./index
|
67
|
-
mkdir -p ./uploads
|
68
|
-
]
|
69
|
-
|
70
|
-
if yes?("\nDo you want to generate a deploy script for Capistrano? (y/N)")
|
71
|
-
system "cd #{@application} && rails g alchemy:deploy_script --scm=#{options[:scm]} --db=#{options[:database]}"
|
72
|
-
say "\nCapifying...", :yellow
|
73
|
-
system "cd #{@application} && capify ."
|
74
|
-
end
|
75
|
-
|
76
|
-
case options[:scm]
|
77
|
-
when 'svn'
|
78
|
-
server = ask("\nURL of your svn server:")
|
79
|
-
repository = ask("\nName of the repository (#{@application}):")
|
80
|
-
repository = @application if repository.empty?
|
81
|
-
|
82
|
-
say "\nImporting #{@application} into #{server}/#{repository} ...", :yellow
|
83
|
-
output = %x[svn import ./#{@application} #{server}/#{repository} -m 'initial import by Alchemy installer']; imported = $?.success?
|
84
|
-
|
85
|
-
if imported
|
86
|
-
|
87
|
-
say "Removing and checking out again...", :yellow
|
88
|
-
%x[
|
89
|
-
rm -rf ./#{@application}
|
90
|
-
svn co #{server}/#{repository} #{@application}
|
91
|
-
]
|
92
|
-
|
93
|
-
say "Committing ignores...", :yellow
|
94
|
-
%x[
|
95
|
-
cd ./#{@application}
|
96
|
-
svn propset svn:ignore '*' tmp/ log/ index/ uploads/
|
97
|
-
svn propset svn:ignore '#{clean_mountpoint.empty? ? 'pictures' : clean_mountpoint}' ./public
|
98
|
-
svn propset svn:ignore 'assets' ./public
|
99
|
-
svn propset svn:ignore 'database.yml' ./config
|
100
|
-
svn commit -m 'set ignores'
|
101
|
-
]
|
102
|
-
|
103
|
-
else
|
104
|
-
say "Error while importing!", :red
|
105
|
-
end
|
106
|
-
|
107
|
-
when 'git'
|
108
|
-
gitignore = <<-GIT
|
31
|
+
system("cd ./#{@application} && rake alchemy:install")
|
32
|
+
gitignore = <<-GIT
|
109
33
|
log/*
|
110
34
|
tmp/*
|
111
35
|
.DS_Store
|
112
36
|
upload/*
|
113
37
|
index/*
|
114
|
-
public/#{clean_mountpoint.empty? ? 'pictures' : clean_mountpoint}
|
115
|
-
public/assets
|
116
38
|
config/database.yml
|
117
39
|
GIT
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
end
|
129
|
-
|
130
|
-
end
|
131
|
-
|
132
|
-
readme = <<-EOF
|
133
|
-
|
134
|
-
Successfully installed Alchemy CMS into ./#{@application}
|
135
|
-
|
136
|
-
Next steps:
|
137
|
-
|
138
|
-
1. Go into your projects folder:
|
139
|
-
|
140
|
-
cd ./#{@application}
|
141
|
-
|
142
|
-
2. Start your local Rails server:
|
143
|
-
|
144
|
-
rails server
|
145
|
-
|
146
|
-
3. Open a browser and enter the following URL:
|
147
|
-
|
148
|
-
http://localhost:3000
|
149
|
-
|
150
|
-
4. Follow the instructions to complete the installation!
|
151
|
-
|
152
|
-
Thank you for using Alchemy CMS!
|
153
|
-
http://alchemy-cms.com
|
154
|
-
|
155
|
-
EOF
|
156
|
-
say readme, :green if results.detect { |r| r == false }.nil?
|
40
|
+
%x[
|
41
|
+
cd ./#{@application}
|
42
|
+
rm ./public/index.html
|
43
|
+
rm ./app/assets/images/rails.png
|
44
|
+
mkdir -p ./index
|
45
|
+
mkdir -p ./uploads
|
46
|
+
touch ./index/.gitkeep
|
47
|
+
touch ./uploads/.gitkeep
|
48
|
+
echo "#{gitignore}" > .gitignore
|
49
|
+
]
|
157
50
|
else
|
158
51
|
say "\nError while installation!\n", :red
|
159
52
|
end
|