alchemy_cms 2.6.0.rc5 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. data/.travis.yml +1 -1
  2. data/Gemfile +2 -1
  3. data/README.md +2 -4
  4. data/alchemy_cms.gemspec +1 -1
  5. data/app/assets/fonts/alchemy/icons.eot +0 -0
  6. data/app/assets/fonts/alchemy/icons.svg +71 -0
  7. data/app/assets/fonts/alchemy/icons.ttf +0 -0
  8. data/app/assets/fonts/alchemy/icons.woff +0 -0
  9. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +6 -8
  10. data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +2 -3
  11. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js.coffee +3 -8
  12. data/app/assets/javascripts/alchemy/alchemy.link_overlay.js.coffee +3 -3
  13. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +19 -9
  14. data/app/assets/javascripts/tiny_mce/plugins/alchemy_link/editor_plugin.js +6 -7
  15. data/app/assets/stylesheets/alchemy/admin.css.scss +0 -1
  16. data/app/assets/stylesheets/alchemy/archive.scss +55 -7
  17. data/app/assets/stylesheets/alchemy/base.scss +8 -144
  18. data/app/assets/stylesheets/alchemy/defaults.scss +1 -1
  19. data/app/assets/stylesheets/alchemy/elements.scss +20 -16
  20. data/app/assets/stylesheets/alchemy/flash.scss +1 -1
  21. data/app/assets/stylesheets/alchemy/form_elements.scss +49 -42
  22. data/app/assets/stylesheets/alchemy/icon-font.css.scss +67 -0
  23. data/app/assets/stylesheets/alchemy/icons.scss +16 -4
  24. data/app/assets/stylesheets/alchemy/jquery-ui.scss +40 -26
  25. data/app/assets/stylesheets/alchemy/menubar.css.scss +1 -1
  26. data/app/assets/stylesheets/alchemy/notices.scss +6 -1
  27. data/app/assets/stylesheets/alchemy/search.scss +3 -2
  28. data/app/assets/stylesheets/alchemy/sitemap.scss +72 -13
  29. data/app/assets/stylesheets/alchemy/tables.scss +31 -24
  30. data/app/assets/stylesheets/alchemy/upload.scss +1 -1
  31. data/app/assets/stylesheets/alchemy/variables.scss +2 -1
  32. data/app/assets/stylesheets/tiny_mce/plugins/inlinepopups/skins/{alchemy → alchemy-tinymce-dialog}/window.css.scss +70 -65
  33. data/app/controllers/alchemy/admin/base_controller.rb +7 -4
  34. data/app/controllers/alchemy/admin/pictures_controller.rb +2 -0
  35. data/app/controllers/alchemy/admin/users_controller.rb +1 -1
  36. data/app/controllers/alchemy/user_sessions_controller.rb +1 -1
  37. data/app/helpers/alchemy/admin/base_helper.rb +161 -60
  38. data/app/helpers/alchemy/admin/pages_helper.rb +4 -1
  39. data/app/helpers/alchemy/elements_block_helper.rb +1 -1
  40. data/app/helpers/alchemy/elements_helper.rb +119 -31
  41. data/app/helpers/alchemy/pages_helper.rb +29 -72
  42. data/app/models/alchemy/attachment.rb +0 -2
  43. data/app/models/alchemy/content.rb +1 -1
  44. data/app/models/alchemy/language.rb +1 -0
  45. data/app/models/alchemy/page.rb +8 -8
  46. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +3 -1
  47. data/app/views/alchemy/admin/attachments/_overlay_file_list.html.erb +1 -1
  48. data/app/views/alchemy/admin/attachments/_tag_list.html.erb +25 -27
  49. data/app/views/alchemy/admin/attachments/index.html.erb +4 -1
  50. data/app/views/alchemy/admin/elements/_elements_select.html.erb +6 -6
  51. data/app/views/alchemy/admin/elements/list.js.erb +1 -1
  52. data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
  53. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +1 -1
  54. data/app/views/alchemy/admin/pages/edit.html.erb +4 -2
  55. data/app/views/alchemy/admin/pictures/_archive.html.erb +0 -1
  56. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +2 -1
  57. data/app/views/alchemy/admin/pictures/_picture.html.erb +5 -0
  58. data/app/views/alchemy/admin/pictures/index.html.erb +1 -0
  59. data/app/views/alchemy/base/500.html.erb +26 -5
  60. data/app/views/alchemy/essences/_essence_picture_tools.html.erb +1 -1
  61. data/app/views/alchemy/essences/_linkable_essence_tools.html.erb +1 -1
  62. data/app/views/alchemy/language_links/_language.html.erb +12 -0
  63. data/app/views/alchemy/language_links/_spacer.html.erb +1 -0
  64. data/config/locales/alchemy.de.yml +7 -3
  65. data/config/locales/alchemy.en.yml +8 -3
  66. data/lib/alchemy/page_layout.rb +1 -1
  67. data/lib/alchemy/tinymce.rb +1 -1
  68. data/lib/alchemy/upgrader.rb +26 -0
  69. data/lib/alchemy/version.rb +1 -1
  70. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +4 -1
  71. data/lib/tasks/ferret.rake +1 -0
  72. data/spec/controllers/admin/users_controller_spec.rb +5 -5
  73. data/spec/features/admin/pages_controller_spec.rb +1 -1
  74. data/spec/helpers/admin/pages_helper_spec.rb +31 -0
  75. data/spec/helpers/pages_helper_spec.rb +60 -72
  76. data/spec/models/content_spec.rb +2 -1
  77. data/spec/models/page_layout_spec.rb +29 -0
  78. data/spec/models/page_spec.rb +33 -1
  79. data/spec/support/alchemy/test_tweaks.rb +2 -6
  80. metadata +34 -12
  81. data/app/assets/fonts/alchemy-icons.eot +0 -0
  82. data/app/assets/fonts/alchemy-icons.svg +0 -54
  83. data/app/assets/fonts/alchemy-icons.ttf +0 -0
  84. data/app/assets/fonts/alchemy-icons.woff +0 -0
  85. data/app/assets/images/alchemy/placeholder.png +0 -0
  86. data/app/assets/stylesheets/alchemy/fonts.scss +0 -46
@@ -15,82 +15,39 @@ module Alchemy
15
15
  content.essence.caption
16
16
  end
17
17
 
18
- # == Helper for rendering language switches
18
+ # Renders links to language root pages of all published languages.
19
19
  #
20
- # Renders links to all public language root pages
21
- #
22
- # === Options:
23
- #
24
- # :linkname => :name,
25
- # :spacer => "",
26
- # :link_to_public_child => configuration(:redirect_to_public_child),
27
- # :link_to_page_with_layout => nil,
28
- # :show_title => true,
29
- # :reverse => false,
30
- # :as_select_box => false,
31
- # :show_flags => false
20
+ # @option options linkname [String] ('name') Renders name/code of language, or I18n translation for code.
21
+ # @option options show_title [Boolean] (true) Renders title attributes for the links.
22
+ # @option options spacer [String] ('') Renders the passed spacer string. You can also overwrite the spacer partial: "alchemy/language_links/_spacer".
23
+ # @option options reverse [Boolean] (false) Reverses the ordering of the links.
32
24
  #
25
+ def language_links(options={})
26
+ options = {
27
+ linkname: 'name',
28
+ show_title: true,
29
+ spacer: '',
30
+ reverse: false
31
+ }.merge(options)
32
+ languages = Language.published.with_language_root.order("name #{options[:reverse] ? 'DESC' : 'ASC'}")
33
+ return nil if languages.count < 2
34
+ render(
35
+ partial: "alchemy/language_links/language",
36
+ collection: languages,
37
+ spacer_template: "alchemy/language_links/spacer",
38
+ locals: {languages: languages, options: options}
39
+ )
40
+ end
41
+
42
+ def language_switches(options={})
43
+ ActiveSupport::Deprecation.warn("Used deprecated language_switches helper. Please use language_links instead.")
44
+ language_links(options)
45
+ end
46
+
33
47
  def language_switcher(options={})
34
- default_options = {
35
- :linkname => :name,
36
- :spacer => "",
37
- :link_to_public_child => configuration(:redirect_to_public_child),
38
- :link_to_page_with_layout => nil,
39
- :show_title => true,
40
- :reverse => false,
41
- :as_select_box => false,
42
- :show_flags => false
43
- }
44
- options = default_options.merge(options)
45
- if multi_language?
46
- language_links = []
47
- pages = (options[:link_to_public_child] == true) ? Page.from_current_site.language_roots : Page.from_current_site.public_language_roots
48
- return nil if (pages.blank? || pages.length == 1)
49
- pages.each_with_index do |page, i|
50
- if (options[:link_to_page_with_layout] != nil)
51
- page_found_by_layout = Page.from_current_site.where(:page_layout => options[:link_to_page_with_layout].to_s, :language_id => page.language_id).first
52
- end
53
- page = page_found_by_layout || page
54
- page = (options[:link_to_public_child] ? (page.first_public_child.blank? ? nil : page.first_public_child) : nil) if !page.public?
55
- if !page.blank?
56
- active = session[:language_id] == page.language.id
57
- linkname = page.language.label(options[:linkname])
58
- if options[:as_select_box]
59
- language_links << [linkname, show_page_url(:urlname => page.urlname, :lang => page.language.code)]
60
- else
61
- language_links << link_to(
62
- "#{content_tag(:span, '', :class => "flag") if options[:show_flags]}#{ content_tag(:span, linkname)}".html_safe,
63
- alchemy.show_page_path(:urlname => page.urlname, :lang => page.language.code),
64
- :class => "#{(active ? 'active ' : nil)}#{page.language.code} #{(i == 0) ? 'first' : (i==pages.length-1) ? 'last' : nil}",
65
- :title => options[:show_title] ? Alchemy::I18n.t("alchemy.language_links.#{page.language.code}.title", :default => page.language.name) : nil
66
- )
67
- end
68
- end
69
- # when last iteration and we have just one language_link,
70
- # we dont need to render it.
71
- if (i==pages.length-1) && language_links.length == 1
72
- return nil
73
- end
74
- end
75
- return nil if language_links.empty? || language_links.length == 1
76
- language_links.reverse! if options[:reverse]
77
- if options[:as_select_box]
78
- return select_tag(
79
- 'language',
80
- options_for_select(
81
- language_links,
82
- show_page_url(:urlname => @page.urlname, :lang => @page.language.code)
83
- ),
84
- :onchange => "window.location=this.value"
85
- )
86
- else
87
- raw(language_links.join(options[:spacer]))
88
- end
89
- else
90
- nil
91
- end
48
+ ActiveSupport::Deprecation.warn("Used deprecated language_switcher helper. Please use language_links instead.")
49
+ language_links(options)
92
50
  end
93
- alias_method :language_switches, :language_switcher
94
51
 
95
52
  # Renders the layout from @page.page_layout. File resists in /app/views/page_layouts/_LAYOUT-NAME.html.erb
96
53
  def render_page_layout(options={})
@@ -91,8 +91,6 @@ module Alchemy
91
91
  end
92
92
  end
93
93
 
94
- private
95
-
96
94
  def sanitized_filename
97
95
  parts = self.file_name.split('.')
98
96
  sfx = parts.pop
@@ -121,7 +121,7 @@ module Alchemy
121
121
 
122
122
  # Returns all content descriptions from elements.yml
123
123
  def descriptions
124
- @descriptions ||= Element.descriptions.collect { |e| e['contents'] }.flatten.compact
124
+ Element.descriptions.collect { |e| e['contents'] }.flatten.compact
125
125
  end
126
126
 
127
127
  def normalize_essence_type(essence_type)
@@ -31,6 +31,7 @@ module Alchemy
31
31
  before_save :remove_old_default, :if => proc { |m| m.default_changed? && m != Language.get_default }
32
32
 
33
33
  scope :published, where(:public => true)
34
+ scope :with_language_root, joins(:pages).where("alchemy_pages" => {language_root: true})
34
35
 
35
36
  # multi-site support
36
37
  scope :on_site, lambda { |s| s.present? ? where(site_id: s) : scoped }
@@ -252,15 +252,15 @@ module Alchemy
252
252
  folded_page.folded
253
253
  end
254
254
 
255
- # Returns a Hash of attributes describing the status of the Page.
255
+ # Returns a Hash describing the status of the Page.
256
256
  #
257
257
  def status
258
- combined_status = {}
259
- combined_status[:visible] = self.visible?
260
- combined_status[:public] = self.public?
261
- combined_status[:locked] = self.locked?
262
- combined_status[:restricted] = self.restricted?
263
- return combined_status
258
+ {
259
+ visible: visible?,
260
+ public: public?,
261
+ locked: locked?,
262
+ restricted: restricted?
263
+ }
264
264
  end
265
265
 
266
266
  # Returns the translated status for given status type.
@@ -268,7 +268,7 @@ module Alchemy
268
268
  # @param [Symbol] status_type
269
269
  #
270
270
  def status_title(status_type)
271
- I18n.t(self.send(status_type), :scope => "page_states.#{status_type}")
271
+ I18n.t(self.status[status_type].to_s, scope: "page_states.#{status_type}")
272
272
  end
273
273
 
274
274
  def has_controller?
@@ -20,12 +20,14 @@
20
20
  <%= render 'alchemy/admin/partials/remote_search_form' %>
21
21
  </div>
22
22
  <div id="assign_file_list" class="with_padding<%= params[:tagged_with].present? ? ' filtered' : '' %>">
23
+ <% if any_tags = Alchemy::Attachment.tag_counts.any? %>
23
24
  <div id="library_sidebar">
24
25
  <div id="tag_list">
25
26
  <%= render 'tag_list' %>
26
27
  </div>
27
28
  </div>
28
- <div id="overlay_file_list">
29
+ <% end %>
30
+ <div id="overlay_file_list" class="<%= any_tags ? 'with_tag_list' : nil %>">
29
31
  <%= render 'overlay_file_list' %>
30
32
  </div>
31
33
  </div>
@@ -4,7 +4,7 @@
4
4
  <%= _t(:no_files_in_archive) %>
5
5
  </div>
6
6
  <% else %>
7
- <ul class="with_padding">
7
+ <ul>
8
8
  <%= render :partial => 'file_to_assign', :collection => @attachments %>
9
9
  </ul>
10
10
  <%= paginate @attachments, :remote => true %>
@@ -1,31 +1,29 @@
1
1
  <% p = params.dup %>
2
- <% if Alchemy::Attachment.tag_counts.any? %>
3
- <h2><%= _t("Filter by tag") %></h2>
4
- <%= js_filter_field '#tag_list li' %>
5
- <ul>
6
- <% Alchemy::Attachment.tag_counts.each do |t| %>
7
- <% attachment_tags = filtered_by_tag?(t) ? tag_filter(remove: t) : tag_filter(add: t) %>
8
- <%= content_tag 'li', name: t.name, class: p[:tagged_with].try(:split, ',').try(:include?, t.name) ? 'active' : nil do %>
9
- <%= link_to(
10
- "#{t.name} (#{t.count})",
11
- url_for(
12
- p.delete_if { |k, v| k == "page" }.merge(
13
- action: 'index',
14
- tagged_with: attachment_tags
15
- )
16
- ),
17
- remote: request.xhr?,
18
- class: 'please_wait'
19
- ) %>
20
- <% end %>
2
+ <h2><%= _t("Filter by tag") %></h2>
3
+ <%= js_filter_field '#tag_list li' %>
4
+ <ul>
5
+ <% Alchemy::Attachment.tag_counts.each do |t| %>
6
+ <% attachment_tags = filtered_by_tag?(t) ? tag_filter(remove: t) : tag_filter(add: t) %>
7
+ <%= content_tag 'li', name: t.name, class: p[:tagged_with].try(:split, ',').try(:include?, t.name) ? 'active' : nil do %>
8
+ <%= link_to(
9
+ "#{t.name} (#{t.count})",
10
+ url_for(
11
+ p.delete_if { |k, v| k == "page" }.merge(
12
+ action: 'index',
13
+ tagged_with: attachment_tags
14
+ )
15
+ ),
16
+ remote: request.xhr?,
17
+ class: 'please_wait'
18
+ ) %>
21
19
  <% end %>
22
- </ul>
23
- <% if p[:tagged_with].present? %>
24
- <%= link_to(
25
- render_icon('delete-small') + _t('Remove tag filter'),
26
- url_for(p.delete_if { |k, v| k == "tagged_with" }.merge(action: 'index')),
27
- remote: request.xhr?,
28
- class: 'button small with_icon please_wait'
29
- ) %>
30
20
  <% end %>
21
+ </ul>
22
+ <% if p[:tagged_with].present? %>
23
+ <%= link_to(
24
+ render_icon('delete-small') + _t('Remove tag filter'),
25
+ url_for(p.delete_if { |k, v| k == "tagged_with" }.merge(action: 'index')),
26
+ remote: request.xhr?,
27
+ class: 'button small with_icon please_wait'
28
+ ) %>
31
29
  <% end %>
@@ -1,3 +1,4 @@
1
+ <% any_tags = Alchemy::Attachment.tag_counts.any? %>
1
2
  <%= toolbar(
2
3
  buttons: [
3
4
  {
@@ -15,12 +16,14 @@
15
16
  }
16
17
  ]
17
18
  ) %>
18
- <div id="archive_all" class="with_tag_filter">
19
+ <div id="archive_all" class="<%= any_tags ? 'with_tag_filter' : nil %>">
19
20
  <%= resources_header %>
20
21
  <%= render partial: 'files_list' %>
22
+ <% if any_tags %>
21
23
  <div id="library_sidebar">
22
24
  <div id="tag_list" class="<%= params[:tagged_with].present? ? 'filtered' : '' %>">
23
25
  <%= render partial: 'tag_list' %>
24
26
  </div>
25
27
  </div>
28
+ <% end %>
26
29
  </div>
@@ -1,9 +1,9 @@
1
1
  <%= select_tag(
2
2
  "element_from_page_#{@page_id}_to_link",
3
- options_for_select(@elements.collect{ |m| [m.display_name_with_preview_text, "##{m.dom_id}"] }),
4
- :prompt => _t(:choose_element_to_link),
5
- :class => "elements_from_page_selector alchemy_selectbox",
6
- :onchange => "jQuery('#page_anchor').val(value)",
7
- :title => _t(:choose_element_as_target),
8
- :autofocus => true
3
+ options_for_select(@elements.collect{ |m| [m.display_name_with_preview_text.html_safe, "##{m.dom_id}"] }),
4
+ prompt: _t(:choose_element_to_link),
5
+ class: "elements_from_page_selector alchemy_selectbox",
6
+ onchange: "jQuery('#page_anchor').val(value)",
7
+ title: _t(:choose_element_as_target),
8
+ autofocus: true
9
9
  ) %>
@@ -1,6 +1,6 @@
1
1
  (function($) {
2
2
 
3
- var close = $('<a class="close_elements_from_page_selector" title="<%= _t(:remove) -%>">–</a>');
3
+ var close = $('<a class="close_elements_from_page_selector" title="<%= _t(:remove) -%>"/>');
4
4
  $('#elements_for_page_<%= @page_id -%>').html('<%= escape_javascript(render("elements_select")) %>');
5
5
  $('#elements_for_page_<%= @page_id -%>').append(close);
6
6
 
@@ -89,7 +89,7 @@
89
89
  </div>
90
90
  <div class="sitemap_sitename">
91
91
  <%- if page.redirects_to_external? -%>
92
- <span class="sitemap_pagename_link <%= cycle('even', 'odd') %> inactive"><%= page.name %></span>
92
+ <span class="sitemap_pagename_link inactive"><%= page.name %></span>
93
93
  <span class="redirect_url" title="<%= h page.urlname %>">
94
94
  &raquo; <%= _t('Redirects to') %>:
95
95
  <%= h page.urlname %>
@@ -33,7 +33,7 @@
33
33
  :url => @url_prefix + page_for_links.urlname
34
34
  },
35
35
  :title => _t('page_for_links.choose_page', :name => page_for_links.name),
36
- :class => "sitemap_pagename_link #{cycle('even', 'odd')}"
36
+ :class => "sitemap_pagename_link"
37
37
  }) %>
38
38
  <% end %>
39
39
  </div>
@@ -26,7 +26,7 @@
26
26
  <div class="toolbar_buttons">
27
27
  <div class="button_with_label">
28
28
  <%= form_tag alchemy.unlock_admin_page_path(@page, :redirect_to => @layoutpage ? alchemy.admin_layoutpages_path : alchemy.admin_pages_path), :id => 'unlock_page_form' do %>
29
- <button class="icon_button" title="<%= _t(:explain_unlocking) %>">
29
+ <button class="icon_button" title="<%= _t(:explain_unlocking) %>" data-alchemy-hotkey="alt-x">
30
30
  <%= render_icon('close') %>
31
31
  </button>
32
32
  <label><%= _t(:unlock_page) %></label>
@@ -51,7 +51,8 @@
51
51
  :size => @page.layoutpage? ? '410x150' : '410x650'
52
52
  },
53
53
  :class => :icon_button,
54
- :title => _t(:edit_page_properties)
54
+ :title => _t(:edit_page_properties),
55
+ 'data-alchemy-hotkey' => 'alt-e'
55
56
  ) %>
56
57
  <label><%= _t(:page_properties) %></label>
57
58
  </div>
@@ -111,6 +112,7 @@
111
112
  {
112
113
  title: '<%= _t("New Element") %>',
113
114
  label: '<%= _t("New Element") %>',
115
+ hotkey: 'alt-n',
114
116
  iconClass: 'new_element',
115
117
  onClick: function() {
116
118
  Alchemy.openWindow('<%= alchemy.new_admin_element_path(:page_id => @page.id) %>', {
@@ -34,7 +34,6 @@
34
34
  :style => 'float: none'
35
35
  ) %>
36
36
  </div>
37
- <%= content_tag :h3, _t("picture_library.filter.#{params[:filter]}") if params[:filter].present? %>
38
37
  <div id="pictures">
39
38
  <% if @pictures.blank? and @recent_pictures.blank? and params[:query].nil? %>
40
39
  <div class="info">
@@ -7,7 +7,8 @@
7
7
  options_for_select([
8
8
  [_t(:all_pictures), ''],
9
9
  [_t(:last_upload_only), 'last_upload'],
10
- [_t(:recently_uploaded_only), 'recent']
10
+ [_t(:recently_uploaded_only), 'recent'],
11
+ [_t(:without_tag), 'without_tag']
11
12
  ], params[:filter]),
12
13
  :data => { :remote => !!request.xhr? },
13
14
  :class => 'alchemy_selectbox'
@@ -79,4 +79,9 @@
79
79
  <span class="picture_name" title="<%= picture.name %>" id="image_picture_<%= picture.id %>_name">
80
80
  <%= picture.name %>
81
81
  </span>
82
+ <div class="picture_tags">
83
+ <% picture.tag_list.each do |tag| %>
84
+ <span class="tag"><%= tag %></span>
85
+ <% end %>
86
+ </div>
82
87
  </div>
@@ -82,6 +82,7 @@
82
82
  <h1>
83
83
  <%= @pictures.total_count %>
84
84
  <%= Alchemy::Picture.model_name.human(count: @pictures.total_count) %>
85
+ <%= _t("picture_library.filter.#{params[:filter]}") if params[:filter].present? %>
85
86
  </h1>
86
87
  <%= render 'archive' %>
87
88
  </div>
@@ -1,5 +1,26 @@
1
- <h1>Upps!</h1>
2
- <h2><%= @notice %></h2>
3
- <pre>
4
- <%= @trace.join("\n") %>
5
- </pre>
1
+ <%= toolbar(
2
+ buttons: [
3
+ {
4
+ icon: 'back',
5
+ url: request.referer || alchemy.admin_dashboard_path,
6
+ label: _t(:back),
7
+ title: _t(:back),
8
+ hotkey: 'alt-z',
9
+ overlay: false,
10
+ skip_permission_check: true
11
+ }
12
+ ]
13
+ ) %>
14
+
15
+ <%= render_message(:error) do %>
16
+ <h1><%= _t('An error happened') %></h1>
17
+ <h2>
18
+ <%= @error.class %>
19
+ <%= @notice %>
20
+ </h2>
21
+ <p>
22
+ <% @trace.each do |line| %>
23
+ <%= line %><br>
24
+ <% end %>
25
+ </p>
26
+ <% end %>
@@ -32,7 +32,7 @@
32
32
  ) %>
33
33
 
34
34
  <%= link_to(render_icon(:link), '#', {
35
- :onclick => "Alchemy.LinkOverlay.open(this, 420)",
35
+ :onclick => "Alchemy.LinkOverlay.open(this)",
36
36
  :class => content.linked? ? 'linked' : nil,
37
37
  :title => _t(:link_image),
38
38
  :data => {'content-id' => content.id},
@@ -2,7 +2,7 @@
2
2
  <%= link_to(
3
3
  render_icon(:link),
4
4
  '#',
5
- :onclick => "Alchemy.LinkOverlay.open(this, 420); return false;",
5
+ :onclick => "Alchemy.LinkOverlay.open(this); return false;",
6
6
  :class => "icon_button#{content.linked? ? ' linked' : ''}",
7
7
  :data => {'content-id' => content.id},
8
8
  :title => _t(:place_link),
@@ -0,0 +1,12 @@
1
+ <% css_classes = [language.code] %>
2
+ <% css_classes << 'active' if session[:language_id] == language.id %>
3
+ <% css_classes << 'first' if languages.first == language %>
4
+ <% css_classes << 'last' if languages.last == language %>
5
+ <% link_title = options[:show_title] ? _t("#{language.code}.title", scope: 'language_links', default: language.name) : nil %>
6
+
7
+ <%= link_to(
8
+ content_tag(:span, language.label(options[:linkname])).html_safe,
9
+ show_alchemy_page_path(language.pages.language_roots.first, lang: language.code),
10
+ class: css_classes.join(" "),
11
+ title: link_title
12
+ ) %>