app/views/admin/settings/_collection.html.erb in fullstack-cms-0.2.5 vs app/views/admin/settings/_collection.html.erb in fullstack-cms-0.2.6

- old
+ new

@@ -1,39 +1,58 @@ <% if Setting.any? %> -<% + <% if Fullstack::Cms.localized? %> + + <%= nav :class => "nav-pills" do %> + + <%= content_tag :li, :class => (:active if @locale.blank?) do %> + <%= link_to t("fullstack.cms.commons", :default => "Commons"), request.path %> + <% end %> - @groups = {} - - @settings.each {|s| - @groups[s.group] ||= [] - @groups[s.group] << s - } + <% I18n.available_locales.each do |locale| %> + <%= content_tag :li, :class => (:active if @locale == locale.to_s) do %> + <%= link_to t("locale_names.#{locale}", :default => "#{locale}".humanize), "?locale=#{locale}" %> + <% end %> + <% end %> + <% end %> - @groups = @groups.to_a - - @groups.sort! do |g1, g2| - if g1.first.to_s == "global" - -1 - elsif g2.first.to_s == "global" - 1 - else - g1.first.to_s <=> g2.first.to_s - end - end +<% end %> + + <%= tabs :class => "tabs-left" do |t| %> - nil - %> + <% @groups.each do |g,settings| %> + <%= t.pane t(g, :scope => "fullstack.admin.groups", :default => g.to_s.humanize) do %> -<%= tabs do |t| %> - <% @groups.each do |g,settings| %> - <%= t.pane t(g, :scope => "fullstack.admin.groups", :default => g.to_s.humanize) do %> - <% settings.each do |stg| %> - <p><%= link_to t(stg.key, :scope => "helpers.label", :default => stg.key.to_s.humanize), [:edit, :admin, stg] %></p> + <table class="table table-striped table-bordered"> + <% settings.each do |stg| %> + + <tr> + <th style="width: 20%"> + <%= link_to t(stg.key, :scope => "helpers.label", :default => stg.key.to_s.humanize), [:edit, :admin, stg] %> + </th> + <td style="width: 10%"> + <%= locale ? t("locale_names.#{locale}", :default => "#{locale}".humanize) : "-" %> + </td> + <td> + <% if stg.value %> + <%= truncate stg.options[:markup] ? "#markup" : "#{stg.value}" %> + <% else %> + (<%= t('fullstack.cms.empty', :default => "Empty") %>) + <% end %> + </td> + </tr> + + <% end %> + </table> + + + <% end %> <% end %> - <% end %> -<% end %> + <% end %> <% end %> + + +