alchemy_cms 2.1.beta5 → 2.1.beta6

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 (66) hide show
  1. data/Gemfile +1 -1
  2. data/README.md +14 -0
  3. data/alchemy_cms.gemspec +1 -1
  4. data/app/assets/javascripts/alchemy/alchemy.base.js +8 -2
  5. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.erb +1 -1
  6. data/app/assets/javascripts/alchemy/alchemy.link_overlay.js +1 -10
  7. data/app/assets/javascripts/alchemy/alchemy.routes.js.erb +9 -9
  8. data/app/assets/stylesheets/alchemy/base.css.scss +68 -66
  9. data/app/assets/stylesheets/alchemy/elements.css.scss +3 -2
  10. data/app/assets/stylesheets/alchemy/jquery-ui.alchemy.css.scss +1 -1
  11. data/app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss +1 -1
  12. data/app/assets/stylesheets/alchemy/jquery.sb.css.scss +1 -1
  13. data/app/assets/stylesheets/alchemy/tinymce_content.css.scss +1 -1
  14. data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +1 -1
  15. data/app/controllers/alchemy/admin/base_controller.rb +1 -1
  16. data/app/controllers/alchemy/admin/contents_controller.rb +1 -1
  17. data/app/controllers/alchemy/admin/elements_controller.rb +2 -1
  18. data/app/controllers/alchemy/admin/pages_controller.rb +18 -8
  19. data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
  20. data/app/controllers/alchemy/pages_controller.rb +14 -2
  21. data/app/helpers/alchemy/admin/base_helper.rb +2 -2
  22. data/app/helpers/alchemy/admin/elements_helper.rb +1 -1
  23. data/app/helpers/alchemy/admin/essences_helper.rb +1 -1
  24. data/app/helpers/alchemy/base_helper.rb +0 -8
  25. data/app/helpers/alchemy/essences_helper.rb +1 -2
  26. data/app/helpers/alchemy/pages_helper.rb +3 -3
  27. data/app/models/alchemy/content.rb +27 -3
  28. data/app/models/alchemy/element.rb +2 -2
  29. data/app/models/alchemy/page.rb +4 -4
  30. data/app/models/alchemy/user.rb +5 -1
  31. data/app/views/alchemy/admin/clipboard/insert.js.erb +9 -9
  32. data/app/views/alchemy/admin/dashboard/index.html.erb +1 -1
  33. data/app/views/alchemy/admin/elements/create.js.erb +26 -19
  34. data/app/views/alchemy/admin/essence_pictures/assign.js.erb +1 -1
  35. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +4 -4
  36. data/app/views/alchemy/admin/essence_pictures/update.js.erb +1 -1
  37. data/app/views/alchemy/admin/layoutpages/index.html.erb +1 -14
  38. data/app/views/alchemy/admin/pages/_external_link.html.erb +3 -13
  39. data/app/views/alchemy/admin/pages/index.html.erb +1 -14
  40. data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +22 -0
  41. data/app/views/alchemy/admin/partials/_pagination_links.html.erb +3 -1
  42. data/app/views/alchemy/admin/pictures/update.js.erb +2 -0
  43. data/app/views/alchemy/admin/trash/index.html.erb +1 -1
  44. data/app/views/alchemy/admin/users/_user.html.erb +1 -1
  45. data/config/locales/alchemy.de.yml +29 -17
  46. data/config/locales/alchemy.en.yml +5 -4
  47. data/lib/alchemy/capistrano.rb +5 -0
  48. data/lib/alchemy/i18n.rb +1 -1
  49. data/lib/alchemy/page_layout.rb +1 -1
  50. data/lib/alchemy/scoped_pagination_link_renderer.rb +27 -0
  51. data/lib/alchemy/version.rb +1 -1
  52. data/lib/alchemy_cms.rb +1 -1
  53. data/spec/controllers/admin/contents_controller_spec.rb +19 -0
  54. data/spec/controllers/admin/pages_controller_spec.rb +19 -0
  55. data/spec/controllers/base_controller_spec.rb +1 -1
  56. data/spec/controllers/pages_controller_spec.rb +62 -0
  57. data/spec/dummy/app/views/layouts/.gitkeep +0 -0
  58. data/spec/integration/admin/pages_controller_spec.rb +42 -13
  59. data/spec/integration/pages_controller_spec.rb +2 -2
  60. data/spec/models/content_spec.rb +40 -0
  61. data/spec/models/element_spec.rb +50 -0
  62. data/spec/models/page_spec.rb +45 -1
  63. data/spec/routing_spec.rb +27 -29
  64. data/spec/spec_helper.rb +2 -2
  65. metadata +40 -36
  66. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
@@ -18,7 +18,7 @@ module Alchemy
18
18
  else
19
19
  items = resource_model
20
20
  end
21
- instance_variable_set("@#{resources_name}", items.paginate(:page => params[:page] || 1, :per_page => 20))
21
+ instance_variable_set("@#{resources_name}", items.paginate(:page => params[:page] || 1, :per_page => per_page_value_for_screen_size))
22
22
  end
23
23
 
24
24
  def new
@@ -8,7 +8,7 @@ module Alchemy
8
8
 
9
9
  caches_action(
10
10
  :show,
11
- :cache_path => proc { url_for(:action => :show, :urlname => params[:urlname], :lang => multi_language? ? params[:lang] : nil) },
11
+ :cache_path => proc { show_page_url(:urlname => params[:urlname], :lang => multi_language? ? params[:lang] : nil) },
12
12
  :if => proc do
13
13
  if Alchemy::Config.get(:cache_pages)
14
14
  page = Page.find_by_urlname_and_language_id_and_public(
@@ -36,7 +36,7 @@ module Alchemy
36
36
  def show
37
37
  respond_to do |format|
38
38
  format.html {
39
- render :layout => params[:layout].blank? ? 'alchemy/pages' : params[:layout] == 'none' ? false : params[:layout]
39
+ render :layout => layout_for_page
40
40
  }
41
41
  format.rss {
42
42
  if @page.contains_feed?
@@ -165,5 +165,17 @@ module Alchemy
165
165
  end
166
166
  end
167
167
 
168
+ def layout_for_page
169
+ if params[:layout] == 'none'
170
+ false
171
+ elsif not params[:layout].blank?
172
+ params[:layout]
173
+ elsif File.exist?(Rails.root.join('app/views/layouts', 'application.html.erb'))
174
+ 'application'
175
+ else
176
+ 'alchemy/pages'
177
+ end
178
+ end
179
+
168
180
  end
169
181
  end
@@ -96,8 +96,8 @@ module Alchemy
96
96
 
97
97
  def link_to_confirmation_window(link_string = "", message = "", url = "", html_options = {})
98
98
  title = t("please_confirm")
99
- ok_lable = t("yes")
100
- cancel_lable = t("no")
99
+ ok_lable = t("Yes")
100
+ cancel_lable = t("No")
101
101
  link_to_function(
102
102
  link_string,
103
103
  "Alchemy.confirmToDeleteWindow('#{url}', '#{title}', '#{message}', '#{ok_lable}', '#{cancel_lable}');",
@@ -64,7 +64,7 @@ module Alchemy
64
64
  # The elements are returned as an array to be used in alchemy_selectbox form builder.
65
65
  def elements_for_select(elements)
66
66
  return [] if elements.nil?
67
- options = elements.collect{ |e| [t("alchemy.element_names.#{e['name']}", :default => e['name'].capitalize), e["name"]] }
67
+ options = elements.collect{ |e| [t("element_names.#{e['name']}", :default => e['name'].capitalize), e["name"]] }
68
68
  return options_for_select(options)
69
69
  end
70
70
 
@@ -29,7 +29,7 @@ module Alchemy
29
29
  :all => false
30
30
  }
31
31
  options = defaults.merge(options)
32
- essence_type = normalized_essence_type(essence_type)
32
+ essence_type = Alchemy::Content.normalize_essence_type(essence_type)
33
33
  return_string = ""
34
34
  if options[:all]
35
35
  contents = element.contents.find_all_by_essence_type_and_name(essence_type, options[:all])
@@ -53,13 +53,5 @@ module Alchemy
53
53
  content_tag('span', '', :class => "icon #{icon_class}")
54
54
  end
55
55
 
56
- def normalized_essence_type(essence_type)
57
- if not essence_type.match(/^Alchemy::/)
58
- essence_type.gsub!(/^Essence/, 'Alchemy::Essence')
59
- else
60
- essence_type
61
- end
62
- end
63
-
64
56
  end
65
57
  end
@@ -77,11 +77,10 @@ module Alchemy
77
77
  warning('Element is nil')
78
78
  return ""
79
79
  end
80
- type = normalized_essence_type(type)
81
80
  if position == 1
82
81
  content = element.content_by_type(type)
83
82
  else
84
- content = element.contents.find_by_essence_type_and_position(type, position)
83
+ content = element.contents.find_by_essence_type_and_position(Alchemy::Content.normalize_essence_type(type), position)
85
84
  end
86
85
  render_essence(content, :view, :for_view => options)
87
86
  end
@@ -510,7 +510,7 @@ module Alchemy
510
510
  :show_heading => true
511
511
  }
512
512
  options = default_options.merge(options)
513
- return content_tag :h2, t('alchemy.search.no_results') if @search_results.blank?
513
+ return content_tag :h2, t('search.no_results') if @search_results.blank?
514
514
  results = ""
515
515
  @search_results.each do |essence|
516
516
  result = essence.highlight(
@@ -520,8 +520,8 @@ module Alchemy
520
520
  results << render(:partial => options[:partial], :locals => {:result => result, :options => options, :page => essence.page}) if essence.page
521
521
  end
522
522
  output = ""
523
- output << content_tag(:h1, t("alchemy.search.result_heading", :query => h(params[:query])), :class => 'search_results_heading') if options[:show_heading]
524
- output << content_tag(:h2, t("alchemy.search.result_count", :result_count => @search_results.length), :class => 'search_result_count') if options[:show_result_count]
523
+ output << content_tag(:h1, t("search.result_heading", :query => h(params[:query])), :class => 'search_results_heading') if options[:show_heading]
524
+ output << content_tag(:h2, t("search.result_count", :result_count => @search_results.length), :class => 'search_result_count') if options[:show_result_count]
525
525
  output << content_tag(:ul, results.html_safe, :class => 'search_result_list')
526
526
  content_tag :div, :class => 'search_results' do
527
527
  output.html_safe
@@ -14,20 +14,26 @@ module Alchemy
14
14
 
15
15
  validates_uniqueness_of :position, :scope => [:element_id, :essence_type]
16
16
 
17
+ scope :essence_pictures, where(:essence_type => "Alchemy::EssencePicture")
18
+ scope :essence_texts, where(:essence_type => "Alchemy::EssenceText")
19
+ scope :essence_richtexts, where(:essence_type => "Alchemy::EssenceRichtext")
20
+
17
21
  # Creates a new Content as descriped in the elements.yml file
18
22
  def self.create_from_scratch(element, essences_hash)
19
23
  if essences_hash[:name].blank? && !essences_hash[:essence_type].blank?
20
- essences_of_same_type = element.contents.find_all_by_essence_type(essences_hash[:essence_type])
24
+ essences_of_same_type = element.contents.where(
25
+ :essence_type => Alchemy::Content.normalize_essence_type(essences_hash[:essence_type])
26
+ )
21
27
  description = {
22
28
  'type' => essences_hash[:essence_type],
23
- 'name' => "#{essences_hash[:essence_type].underscore}_#{essences_of_same_type.length + 1}"
29
+ 'name' => "#{essences_hash[:essence_type].classify.demodulize.underscore}_#{essences_of_same_type.count + 1}"
24
30
  }
25
31
  else
26
32
  description = element.content_description_for(essences_hash[:name])
27
33
  description = element.available_content_description_for(essences_hash[:name]) if description.blank?
28
34
  end
29
35
  raise "No description found in elements.yml for #{essences_hash.inspect} and #{element.inspect}" if description.blank?
30
- essence_class = "alchemy/#{description['type']}".classify.constantize
36
+ essence_class = Alchemy::Content.normalize_essence_type(description['type']).constantize
31
37
  content = self.new(:name => description['name'], :element_id => element.id)
32
38
  if description['type'] == "EssenceRichtext" || description['type'] == "EssenceText"
33
39
  essence = essence_class.create(:do_not_index => !description['do_not_index'].nil?)
@@ -51,6 +57,11 @@ module Alchemy
51
57
  settings.symbolize_keys
52
58
  end
53
59
 
60
+ def siblings
61
+ return [] if !element
62
+ self.element.contents
63
+ end
64
+
54
65
  # makes a copy of source and copies the polymorphic associated essence
55
66
  def self.copy(source, differences = {})
56
67
  differences[:position] = nil
@@ -159,5 +170,18 @@ module Alchemy
159
170
  essence.partial_name
160
171
  end
161
172
 
173
+ def normalized_essence_type
174
+ self.class.normalize_essence_type(self.essence_type)
175
+ end
176
+
177
+ def self.normalize_essence_type(essence_type)
178
+ essence_type = essence_type.classify
179
+ if not essence_type.match(/^Alchemy::/)
180
+ essence_type.gsub!(/^Essence/, 'Alchemy::Essence')
181
+ else
182
+ essence_type
183
+ end
184
+ end
185
+
162
186
  end
163
187
  end
@@ -74,7 +74,7 @@ module Alchemy
74
74
  end
75
75
 
76
76
  def content_by_type(essence_type)
77
- self.contents.find_by_essence_type(essence_type)
77
+ self.contents.find_by_essence_type(Content.normalize_essence_type(essence_type))
78
78
  end
79
79
 
80
80
  def all_contents_by_name(name)
@@ -82,7 +82,7 @@ module Alchemy
82
82
  end
83
83
 
84
84
  def all_contents_by_type(essence_type)
85
- self.contents.find_all_by_essence_type(essence_type)
85
+ self.contents.find_all_by_essence_type(Content.normalize_essence_type(essence_type))
86
86
  end
87
87
 
88
88
  # Returns the content that is marked as rss title.
@@ -43,15 +43,15 @@ module Alchemy
43
43
  scope :accessable, where(:restricted => false)
44
44
  scope :restricted, where(:restricted => true)
45
45
  scope :public_language_roots, lambda {
46
- where(:language_root => true).where("language_code IN ('#{Language.all_codes_for_published.join('\',\'')}')").where(:public => true)
46
+ where(:language_root => true).where("`alchemy_pages`.`language_code` IN ('#{Language.all_codes_for_published.join('\',\'')}')").where(:public => true)
47
47
  }
48
- scope :all_last_edited_from, lambda { |user| where(:updater_id => user.id).order('updated_at DESC').limit(5) }
48
+ scope :all_last_edited_from, lambda { |user| where(:updater_id => user.id).order('`alchemy_pages`.`updated_at` DESC').limit(5) }
49
49
  # Returns all pages that have the given language_id
50
50
  scope :with_language, lambda { |language_id| where(:language_id => language_id) }
51
51
  # Returns all pages that are not locked and public.
52
52
  # Used for flushing all page caches at once.
53
- scope :flushables, public.not_locked
54
- scope :contentpages, where("pages.layoutpage = 0 AND pages.parent_id IS NOT NULL")
53
+ scope :contentpages, where("`alchemy_pages`.`layoutpage` = 0 AND `alchemy_pages`.`parent_id` IS NOT NULL")
54
+ scope :flushables, not_locked.published.contentpages
55
55
 
56
56
  # Finds selected elements from page.
57
57
  #
@@ -48,7 +48,11 @@ module Alchemy
48
48
  end
49
49
  end
50
50
  alias :name :fullname
51
-
51
+
52
+ def human_role_name
53
+ self.class.human_rolename(self.role)
54
+ end
55
+
52
56
  def self.human_rolename(role)
53
57
  Alchemy::I18n.t("user_roles.#{role}")
54
58
  end
@@ -1,14 +1,14 @@
1
1
  (function($) {
2
-
2
+
3
3
  <%- if params[:remove] -%>
4
- $("#<%= @item.class.to_s.downcase -%>_<%= @item.id -%>").remove();
5
- <%- if @item.class.to_s == 'Element' -%>
6
- $('#element_area').sortable('refresh');
7
- <%- end -%>
8
- Alchemy.growl('<%= t("item moved to clipboard", :name => @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name) -%>');
4
+ $(".element_editor[data-element-id='<%= @item.id -%>']").remove();
5
+ <%- if @item.class.to_s == 'Element' -%>
6
+ $('#element_area').sortable('refresh');
7
+ <%- end -%>
8
+ Alchemy.growl('<%= escape_javascript t("item moved to clipboard", :name => @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name) -%>');
9
9
  <%- else -%>
10
- Alchemy.growl('<%= t("item copied to clipboard", :name => @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name) -%>')
10
+ Alchemy.growl('<%= escape_javascript t("item copied to clipboard", :name => @item.class.to_s == "Element" ? @item.display_name_with_preview_text : @item.name) -%>')
11
11
  <%- end -%>
12
- $('#clipboard_button .icon.clipboard').addClass('full');
13
-
12
+ $('#clipboard_button .icon.clipboard').addClass('full');
13
+
14
14
  })(jQuery);
@@ -46,7 +46,7 @@
46
46
  <%- else -%>
47
47
  <ul>
48
48
  <%- @online_users.each do |user| -%>
49
- <li class="<%= cycle('even', 'odd') %>"><%= user.name %> <small>(<%= Alchemy::I18n.t("alchemy.user_roles.#{user.role}") %>)</small></li>
49
+ <li class="<%= cycle('even', 'odd') %>"><%= user.name %> <small>(<%= user.human_role_name %>)</small></li>
50
50
  <%- end -%>
51
51
  </ul>
52
52
  <%- end -%>
@@ -1,24 +1,31 @@
1
1
  (function($) {
2
-
3
- <%- if @page.can_have_cells? -%>
4
- Alchemy.selectOrCreateCellTab('<%= @cell.nil? ? "for_other_elements" : @cell.name -%>', '<%= @cell.nil? ? t("other Elements") : @cell.name_for_label -%>');
5
- <%- end -%>
6
- $('#cell_<%= @cell.nil? ? "for_other_elements" : @cell.name -%>').append('<%= escape_javascript render(:partial => "element", :object => @element, :locals => {:draggable => true}) -%>');
7
- $('#cell_<%= @cell.nil? ? "for_other_elements" : @cell.name -%>').sortable('refresh');
8
- Alchemy.growl('<%= t("successfully_added_element") -%>');
9
- Alchemy.closeCurrentWindow();
10
- <%- @element.rtf_contents.each do |content| -%>
11
- Alchemy.Tinymce.addEditor('<%= content.form_field_id -%>');
12
- <%- end -%>
13
- Alchemy.PreviewWindow.refresh();
14
- Alchemy.ElementEditorSelector.init();
15
- $('.element_editor[data-element-id="<%= @element.id -%>"]').trigger('Alchemy.SelectElementEditor');
16
- Alchemy.ElementDirtyObserver('#element_<%= @element.id -%>');
17
- Alchemy.SelectBox('#element_<%= @element.id -%> select');
18
- Alchemy.ButtonObserver('#element_<%= @element.id -%> button.button');
19
2
 
20
- <%- if @clipboard.blank? -%>
21
- $('#clipboard_button .icon.clipboard').removeClass('full');
3
+ <% if @cutted_element_id %>
4
+ $('.element_editor[data-element-id="<%= @cutted_element_id %>"]').remove();
5
+ <% end %>
6
+
7
+ <%- if @page.can_have_cells? -%>
8
+ Alchemy.selectOrCreateCellTab('<%= @cell.nil? ? "for_other_elements" : @cell.name -%>', '<%= @cell.nil? ? t("other Elements") : @cell.name_for_label -%>');
9
+ <%- end -%>
10
+
11
+ $('#cell_<%= @cell.nil? ? "for_other_elements" : @cell.name -%>').append('<%= escape_javascript render(:partial => "element", :object => @element, :locals => {:draggable => true}) -%>');
12
+ $('#cell_<%= @cell.nil? ? "for_other_elements" : @cell.name -%>').sortable('refresh');
13
+ Alchemy.growl('<%= t("successfully_added_element") -%>');
14
+ Alchemy.closeCurrentWindow();
15
+
16
+ <%- @element.rtf_contents.each do |content| -%>
17
+ Alchemy.Tinymce.addEditor('<%= content.form_field_id -%>');
18
+ <%- end -%>
19
+
20
+ Alchemy.PreviewWindow.refresh();
21
+ Alchemy.ElementEditorSelector.init();
22
+ $('.element_editor[data-element-id="<%= @element.id -%>"]').trigger('Alchemy.SelectElementEditor');
23
+ Alchemy.ElementDirtyObserver('#element_<%= @element.id -%>');
24
+ Alchemy.SelectBox('#element_<%= @element.id -%> select');
25
+ Alchemy.ButtonObserver('#element_<%= @element.id -%> button.button');
26
+
27
+ <%- if @clipboard.blank? -%>
28
+ $('#clipboard_button .icon.clipboard').removeClass('full');
22
29
  <%- end -%>
23
30
 
24
31
  })(jQuery);
@@ -6,7 +6,7 @@
6
6
  :locals => {:content => @content, :options => params[:options]}
7
7
  )
8
8
  ) -%>');
9
- <%- if @content.element.contents.find_all_by_essence_type("Alchemy::EssencePicture").size > 1 -%>
9
+ <%- if @content.siblings.essence_pictures.count > 1 -%>
10
10
  Alchemy.SortableContents('#<%= @content.element.id -%>_contents', '<%= form_authenticity_token -%>');
11
11
  <%- end -%>
12
12
  Alchemy.closeCurrentWindow();
@@ -16,17 +16,17 @@
16
16
  </tr>
17
17
  <tr>
18
18
  <td class="label"><%= f.label "title" %></td>
19
- <td><%= f.text_field "title", :class => 'thin_border long' %></td>
19
+ <td class="input"><%= f.text_field "title", :class => 'thin_border long' %></td>
20
20
  </tr>
21
21
  <tr>
22
22
  <td class="label"><%= f.label "alt_tag" %></td>
23
- <td><%= f.text_field "alt_tag", :class => 'thin_border long' %></td>
23
+ <td class="input"><%= f.text_field "alt_tag", :class => 'thin_border long' %></td>
24
24
  </tr>
25
25
  <%# Have to use a Hash here, because Rails has a Hash.to_params bug with nested Arrays!!!! %>
26
26
  <%- if @options[:sizes].is_a?(HashWithIndifferentAccess) -%>
27
27
  <tr>
28
28
  <td class="label"><%= f.label "render_size" %></td>
29
- <td>
29
+ <td class="input">
30
30
  <%= f.select(
31
31
  "render_size",
32
32
  options_for_select(
@@ -66,7 +66,7 @@
66
66
  </tr>
67
67
  <%- end -%>
68
68
  <tr>
69
- <td colspan="2" style="text-align:right">
69
+ <td colspan="2" class="submit">
70
70
  <%= hidden_field_tag 'content_id', @content.id %>
71
71
  <%= f.button t("save"), :class => 'button' %>
72
72
  </td>
@@ -2,7 +2,7 @@
2
2
 
3
3
  $('#<%= content_dom_id(@content) -%>').replaceWith('<%= escape_javascript(
4
4
  render(
5
- :partial => "/essences/essence_picture_editor",
5
+ :partial => "alchemy/essences/essence_picture_editor",
6
6
  :locals => {:content => @content, :options => params[:options]}
7
7
  )
8
8
  ) -%>');
@@ -20,20 +20,7 @@
20
20
 
21
21
  <%- content_for :toolbar do -%>
22
22
  <div id="toolbar_buttons">
23
- <div class="button_with_label">
24
- <%= select_tag(
25
- 'language',
26
- options_for_select(@languages.map { |l| [l.name, l.id] }, session[:language_id]),
27
- :onchange => %(
28
- Alchemy.pleaseWaitOverlay();
29
- jQuery.get('/admin/pages/switch_language', {
30
- language_id: this.value,
31
- layoutpages: true
32
- });
33
- )
34
- ) %>
35
- <label><%= t("Language tree") %></label>
36
- </div>
23
+ <%= render :partial => 'alchemy/admin/partials/language_tree_select' %>
37
24
  <%= toolbar_button(
38
25
  :icon => 'add_page',
39
26
  :url => alchemy.new_admin_page_path(:parent_id => @layout_root.id, :layoutpage => true),
@@ -4,18 +4,8 @@
4
4
  </h2>
5
5
  <table class="window_form">
6
6
  <tr>
7
- <td>
8
- <%= select_tag(
9
- 'url_protocol',
10
- options_for_select([
11
- ['http://', 'http://'],
12
- ['mailto:', 'mailto:'],
13
- ['ftp://', 'ftp://'],
14
- ['https://', 'https://'],
15
- ['ftps://', 'ftps://']
16
- ]),
17
- :class => 'medium'
18
- ) %>
7
+ <td class="label long">
8
+ <%= label_tag 'external_url', 'URL', :for => 'external_url' %>
19
9
  </td>
20
10
  <td class="input">
21
11
  <%= text_field_tag 'external_url', '', :class => "thin_border auto_resize" %>
@@ -42,7 +32,7 @@
42
32
  %(
43
33
  Alchemy.LinkOverlay.createLink(
44
34
  'external',
45
- jQuery('#url_protocol').val() + jQuery('#external_url').val(),
35
+ jQuery('#external_url').val(),
46
36
  jQuery('#extern_link_title').val(),
47
37
  jQuery('#link_target').val()
48
38
  );
@@ -20,20 +20,7 @@
20
20
 
21
21
  <%- content_for :toolbar do -%>
22
22
  <div id="toolbar_buttons">
23
- <div class="button_with_label">
24
- <%= select_tag(
25
- 'language',
26
- options_for_select(@languages.map { |l| [l.name, l.id] }, session[:language_id]),
27
- :onchange => %(
28
- Alchemy.pleaseWaitOverlay();
29
- jQuery.get('/admin/pages/switch_language', {
30
- language_id: this.value
31
- });
32
- ),
33
- :class => 'short'
34
- ) %>
35
- <label><%= t("Language tree") %></label>
36
- </div>
23
+ <%= render :partial => 'alchemy/admin/partials/language_tree_select' %>
37
24
  <%- permitted_to?(:flush, :alchemy_admin_pages) do -%>
38
25
  <div class="button_with_label">
39
26
  <%= link_to(