estimancy/projestimate

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

Summary

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

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

      <%= f.input :organization_id, :as => :hidden, :input_html => { :value => @organization.id } %>

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

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