index.html.erb 2.37 KB
<h1><%= _('Edit Templates') %></h1>

<%= _('Manage the templates used on creation of profiles') %>

<% list_of_templates = [[_('Person')    , environment.person_templates     , 'person'    ],
                        [_('Community') , environment.communities.templates, 'community' ],
                        [_('Enterprise'), environment.enterprises.templates, 'enterprise']] %>


<% list_of_templates.each do |title, templates, kind|%>
  <div class='template-kind'>
    <h2><%= title %></h2>
    <%= button :add, _('New...'), {:action => "create_#{kind}_template"}, :title => _("Create a new template for %s") % title.downcase %>
    <table class='actions'>
      <tr>
        <th><%= _('Template') %></th>
        <th><%= _('Actions') %></th>
      </tr>
      <% templates.each do |template| %>
        <tr>
          <td>
            <%#= image_tag "icons-app/#{kind}-icon.png" %>
            <%= link_to(template.name, {:controller => 'profile_editor', :profile => template.identifier}, :title => _('Edit template "%s"') % template.name ) %>
            <% if environment.is_default_template?(template) %>
              <%= _('is the default template') %>
            <% else %>
              <%= link_to(_('Set as default'), {:action => "set_#{kind}_as_default", :template_id => template.id}, :title => _('Set %s template as default') % template.name ) %>
            <% end %>
          </td>
          <td>
            <%= button_without_text 'edit', _('Edit settings'), {:controller => 'profile_editor', :profile => template.identifier, :action => 'edit'} %>
            <%= button_without_text 'welcome-page', _('Edit welcome page'), {:controller => 'profile_editor', :profile => template.identifier, :action => 'welcome_page'} %>
            <%= button_without_text 'blocks', _('Edit sideblocks'), {:controller => 'profile_design', :profile => template.identifier, :action => 'index'} %>
            <%= button_without_text 'appearance', _('Edit appearance'), {:controller => 'profile_themes', :profile => template.identifier, :action => 'index'} %>
            <%= button_without_text 'header-footer', _('Edit header/footer'), {:controller => 'profile_editor', :profile => template.identifier, :action => 'header_footer'} %>
          </td>
        </tr>
      <% end %>
    </table>
  </div>
<% end %>

<% button_bar do %>
  <%= button :back, _('Back to admin panel'), :controller => 'admin_panel' %>
<% end %>