Structure link with json
This commit is contained in:
1 parent
a4d1c68299
commit
8ebfac2b99
13 files changed
+124
-136
No files matched your search
@@ -0,0 +1,57 @@
|
||||
<div id="link" class="hide">
|
||||
<%= form_for :link, url: admin_links_path, remote: true do |f| %>
|
||||
<fieldset>
|
||||
<div id="page_error"></div>
|
||||
<%= f.hidden_field :parent, class: "parent" %>
|
||||
<%= f.label :name, content_tag(:i, nil, :class => "icons-star") + t(:name) %>
|
||||
<%= f.text_field :name, class: 'input-xlarge', placeholder: t(:name), id: 'name' %>
|
||||
<span class="help-block"><%= t("front_page.name_field_helper") %></span>
|
||||
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}" %>
|
||||
<%= f.text_field locale, class: 'input-xlarge', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %>
|
||||
<%= f.label :url, "#{t(:url)} #{I18nVariable.from_locale(locale)}" %>
|
||||
<%= f.text_field :url, :class => 'input-xlarge', placeholder: "#{t(:url)} #{I18nVariable.from_locale(locale)}", id: "url-#{locale}" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="checkbox-groups" id="link-is-published">
|
||||
<%= f.label :is_published, t(:is_published) %>
|
||||
<p>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :is_published, true %> <%= t(:yes_) %>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :is_published, false, checked: "checked" %> <%= t(:no_) %>
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="link-options checkbox-groups hide">
|
||||
<label><%= t(:activation_link) %></label>
|
||||
<% @site_valid_locales.each do |valid_locale| %>
|
||||
<div class="active-link <%= valid_locale %>">
|
||||
<label class="checkbox">
|
||||
<%= check_box_tag 'link[enabled_for][]', valid_locale, false, class: "lang-enable" %> <%= I18nVariable.from_locale(valid_locale) %>
|
||||
</label>
|
||||
<div class="active-mune">
|
||||
<span><%= t(:menu_enable) %></span>
|
||||
<label class="radio inline">
|
||||
<%= radio_button_tag "link[menu_enabled_for][#{valid_locale}]", false, true %> <%= t(:no_) %>
|
||||
</label>
|
||||
<label class="radio inline">
|
||||
<%= radio_button_tag "link[menu_enabled_for][#{valid_locale}]", true, false %> <%= t(:yes_) %>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
|
||||
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -63,7 +63,7 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="link-options checkbox-groups">
|
||||
<div class="link-options checkbox-groups hide">
|
||||
<label><%= t(:activation_link) %></label>
|
||||
<% @site_valid_locales.each do |valid_locale| %>
|
||||
<div class="active-link <%= valid_locale %>">
|
||||
|
||||
@@ -18,9 +18,13 @@
|
||||
<% end %>
|
||||
<div class="item-menu">
|
||||
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), "/#{node.path}?edit=true", class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-edit"), "#page", class: "open-slide tip #{node.class.to_s.downcase} edit", title: t(:edit), data: {title: t(:edit), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations)} %>
|
||||
<% if node.class.to_s.downcase.eql?("page") %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-edit"), "#page", class: "open-slide tip page edit", title: t('editing.page'), data: {title: t('editing.page'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations)} %>
|
||||
<% elsif node.class.to_s.downcase.eql?("link") %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-edit"), "#link", class: "open-slide tip link edit", title: t('editing.link'), data: {title: t('editing.link'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations).merge(node.urls)} %>
|
||||
<% end %>
|
||||
<%= link_to content_tag(:i, nil, class: "icons-newspaper"), "#page", class: "open-slide tip page", title: t(:add_page), data: {title: t(:add_page), id: 'new', parent: node.parent_id.to_s} if node.class.to_s.eql?('Page') %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-link"), new_admin_link_path(:parent_id => node.id), class: "open-slide tip link", title: t(:add_link), data: {title: t(:add_link)} if node.class.to_s.eql?('Page') %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-link"), "#link", class: "open-slide tip link", title: t(:add_link), data: {title: t(:add_link)} if node.class.to_s.eql?('Page') %>
|
||||
<%= link_to content_tag(:i, nil, class: "icon-trash"), nil, rel: eval("admin_#{node.class.to_s.downcase}_path(node)"), class: "delete tip", title: t(:delete_), data: {title: t(:delete_)} unless node.root? %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
<% end %>
|
||||
<%= render 'layouts/delete_modal', delete_options: {remote: true} %>
|
||||
<%= render 'form_page' %>
|
||||
<%= render 'form_link' %>
|
||||
<%= javascript_include_tag "lib/pageslide.js" %>
|
||||
@@ -0,0 +1,6 @@
|
||||
<% if @error %>
|
||||
$("#pageslide #page_error").html("<%= j @error %>");
|
||||
<% else %>
|
||||
$("#<%= @item.id.to_s %>").html("<%= j render 'admin/items/node_and_children', node: @item %>");
|
||||
reloadStructure();
|
||||
<% end %>
|
||||
Reference in new issue
Block a user