Sha256: c8c64d2eead73468f117b5e1e291ce044d2f40c17146c92ca3ed9f15159b337b

Contents?: true

Size: 1.94 KB

Versions: 11

Compression:

Stored size: 1.94 KB

Contents

<% if root = Alchemy::Page.rootpage %>
<div id="create_language_tree_form">
  <%= render_message do %>
    <h2><%= _t(:language_does_not_exist) %></h2>
  <% end %>
<%- if @language -%>

  <%- if @languages_with_page_tree.size >= 1 -%>
    <%= form_tag(alchemy.copy_language_tree_admin_pages_path) do %>
      <h3><%= _t(:copy_language_tree_heading) %></h3>
      <p><%= _t(:want_to_make_copy_of_existing_language) %></p>
      <div class="input select">
        <%= label_tag('languages[old_lang_id]', _t('Language tree'), class: 'control-label') %>
        <%= select_tag("languages[old_lang_id]", options_for_select(@languages_with_page_tree.map{ |l| [l.name, l.id] }), class: "alchemy_selectbox") %>
        <%= hidden_field_tag("languages[new_lang_id]", @language.id) %>
      </div>
      <div class="submit">
        <%= button_tag _t(:copy) %>
      </div>
    <% end %>
  <%- end -%>

  <%- if params[:action] == "index" -%>

  <%= form_for([:admin, Alchemy::Page.new]) do |form| %>
    <h3><%= _t(:create_language_tree_heading) %></h3>
    <p><%= _t(:want_to_create_new_language) %></p>
    <%= form.hidden_field :name, value: @language.frontpage_name %>
    <%= form.hidden_field :language_id, value: @language.id %>
    <%= form.hidden_field :language_code, value: @language.code %>
    <%= form.hidden_field :page_layout, value: @language.page_layout %>
    <%= form.hidden_field :language_root, value: true %>
    <%= form.hidden_field :parent_id, value: root.id %>
    <%= form.hidden_field :public, value: Alchemy::Language.all.size == 1 %>
    <div class="submit">
      <%= form.button _t("create_tree_as_new_language", language: @language.name) %>
    </div>
  <% end %>

  <%- end -%>

<%- else -%>

  <p><%= _t("Actually this language does not exist. Please create this language first.") %></p>

<%- end -%>

</div>
<% else %>
<%= render_message :error do %>
  <h2>Root page not found.</h2>
  <p>Please run <code>rake alchemy:db:seed</code> task.</p>
<% end %>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.0.3 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.1.0.beta2 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.1.0.beta1 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.0.2 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.0.1 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.0.0 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.0.0.rc8 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.0.0.rc7 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.0.0.rc6 app/views/alchemy/admin/pages/_create_language_form.html.erb
alchemy_cms-3.0.0.rc5 app/views/alchemy/admin/pages/_create_language_form.html.erb