This repository has been archived on 2024-12-01. You can view files and clone it, but cannot push or open issues or pull requests.
redmine_rodax_crm/app/views/contracts/index.html.erb

101 lines
4.1 KiB
Plaintext
Raw Normal View History

<% content_for(:header_tags) do %>
<%= javascript_include_tag :contacts, :plugin => 'redmine_contacts' %>
<%= stylesheet_link_tag :contacts, :plugin => 'redmine_contacts' %>
<%= stylesheet_link_tag :contacts_sidebar, :plugin => 'redmine_contacts' %>
<meta name = "format-detection" content = "telephone=no">
<% end %>
<% content_for :sidebar do %>
<%= render :partial => 'common/sidebar' %>
<%= render :partial => 'contracts_statistics' %>
<%= render :partial => 'notes/last_notes', :object => @last_notes %>
<%= render :partial => 'common/recently_viewed' %>
<% end %>
<div class="contextual">
<%= link_to_if_authorized l(:label_contract_new), {:controller => 'contracts', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>
</div>
<div class="filters">
<% form_tag(params, :id => "query_form") do %>
<%= hidden_field_tag('project_id', @project.to_param) if @project %>
<% no_filters = ((params[:status_id].blank? || params[:status_id] == 'o') && params[:period].blank? && params[:assigned_to_id].blank? && params[:category_id].blank?) %>
<h2 class="contacts_header">
<span id='scope_header' class="scope_title">
<%= l(:label_contract_plural) %>
</span>
<span class="live_search">
<%= label_tag :search, l(:label_search), :id => "search_overlabel" %>
<%= text_field_tag(:search, params[:search], :autocomplete => "off", :size => "35", :class => "live_search_field", :onfocus => "Element.hide('search_overlabel'); return false;", :onblur => "if (this.value == '') {Element.show('search_overlabel');}" ) %>
<!-- , :onfocus => "if (this.value == 'Поиск') {this.value = '';}", :onblur => "if (this.value == '') {this.value ='Поиск'; this.style.color='#aaa'}" -->
<%= observe_field("search",
:frequency => 2,
:update => 'contact_list',
:url => {:controller => 'contracts', :action => 'index', :project_id => @project },
:with => "Form.serialize('query_form')") %>
</span>
</h2>
<fieldset id="filters" class="collapsible <%= 'collapsed' if no_filters %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
<div style="<%= 'display: none;' if no_filters %>">
<p>
<% if !contract_statuses.empty? %>
<span class="filter-condition">
<%= label_tag l(:label_contract_status) + " " %>
<%= select_tag :status_id, options_for_select(collection_for_status_select.insert(0, [l(:label_open_issues), "o"]).insert(0, [l(:label_all), ""]), params[:status_id]) %>
</span>
<% end %>
<span class="filter-condition">
<%= label_tag l(:label_created_on) + " "%>
<%= select_tag 'period', options_for_period_select(params[:period]) %>
</span>
<% if @project && !@project.contract_categories.empty? %>
<span class="filter-condition">
<%= label_tag l(:label_contract_category) + " "%>
<%= select_tag 'category_id', options_for_select(@project.contract_categories.collect {|c| [c.name, c.id.to_s]}.insert(0, [""]), params[:category_id]) %>
</span>
<% end %>
<span class="filter-condition">
<%= label_tag l(:label_assigned_to) + " " %>
<%= select_tag :assigned_to_id, options_for_select(Contract.available_users(@project).collect{|u| [u.name, u.id.to_s]}.insert(0, [""]), params[:assigned_to_id]) %>
</span>
<!-- <%= render :partial => 'custom_field_filter' %> -->
</p>
</div>
</fieldset>
<p class="buttons hide-when-print">
<%= link_to_remote l(:button_apply),
{ :url => {},
:update => "contact_list",
:with => "Form.serialize('query_form')"
}, :class => 'icon icon-checked' %>
<%= link_to l(:button_clear),
{:project_id => @project, :set_filter => 1 },
:method => :get,
:update => "contact_list",
:class => 'icon icon-reload' %>
</p>
<% end %>
</div>
<div id="contact_list">
<%= render :partial => 'list' %>
</div>
<% html_title l(:label_contract_plural) %>