estimancy/projestimate

View on GitHub
app/views/project_security_levels/_form.html.erb

Summary

Maintainability
Test Coverage
<div class="tabs">
  <ul>
    <li>
      <a href="#tabs-1">
        <%= I18n.t(:security_level) %>
      </a>
    </li>
  </ul>

  <div id="tabs-1">
    <%= simple_form_for([@organization, @project_security_level]) do |f| %>
      <%= f.error_notification %>

      <%= f.input :name, :label => I18n.t('name'), :input_html => {:autofocus => (controller.action_name == 'new'), :class => 'input-xxlarge' } %>
      <%= f.input :description, :label => I18n.t('description'), :input_html => { :class => 'input-xxlarge', :rows => 5 } %>

      <%= f.input :organization_id, as: :hidden, :input_html => { value: params[:organization_id] } %>

      <div class="actions-tabs">
        <% if can? :manage, ProjectSecurityLevel %>
            <% if action_name.in?(%w(new create)) %>
                <%= submit_tag I18n.t('save_and_create'), :class => 'btn' %>
            <% elsif action_name == 'edit' || action_name=="update" %>
                <%= submit_tag I18n.t('apply'), :class => 'btn' %>
            <% end %>
            <%= submit_tag I18n.t('save'), :class => 'btn' %>
        <% end %>
        <%= link_to I18n.t('back'), organization_authorization_path(@organization, anchor: "tabs-project-security-levels"), :class => 'btn' %>
      </div>

    <% end %>
  </div>
</div>