Project

General

Profile

Feature #6204 » index.rhtml

Seth Sandler, 2011-07-31 00:50

 
1
<div class="contextual">
2
<% if !@query.new_record? && @query.editable_by?(User.current) %>
3
	<%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %>
4
	<%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
5
<% end %>
6
<%= link_to_if_authorized l(:label_issue_new),
7
                          {:controller => 'issues', :action => 'new', :project_id => @project},
8
                          :class => 'icon icon-add' %>
9
</div>
10

    
11

    
12

    
13

    
14

    
15
<h2><%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %></h2>
16
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
17

    
18
<% form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, :method => :get, :id => 'query_form') do %>
19
    <%= hidden_field_tag 'set_filter', '1' %>
20
		<div id="query_form_content" class="hide-when-print">
21
    <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
22
    	<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
23
    	<div style="<%= @query.new_record? ? "" : "display: none;" %>">
24
    		<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
25
    	</div>
26
    </fieldset>
27
    <fieldset class="collapsible collapsed">
28
    	<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
29
    	<div style="display: none;">
30
    		<table>
31
    			<tr>
32
    				<td><%= l(:field_column_names) %></td>
33
						<td><%= render :partial => 'queries/columns', :locals => {:query => @query} %></td>
34
					</tr>
35
					<tr>
36
						<td><%= l(:field_group_by) %></td>
37
						<td><%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by)) %></td>
38
					</tr>
39
				</table>
40
			</div>
41
		</fieldset>
42
		</div>
43
    <p class="buttons hide-when-print">
44

    
45
    <%= link_to_function l(:button_apply), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
46
    <%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload'  %>
47
    <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %>
48
    <%= link_to_function l(:button_save), "$('query_form').action='#{ url_for :controller => 'queries', :action => 'new', :project_id => @project }'; submit_query_form('query_form')", :class => 'icon icon-save' %>
49
    <% end %>
50
    </p>
51
<% end %>
52

    
53
<%= error_messages_for 'query' %>
54
<% if @query.valid? %>
55
<% if @issues.empty? %>
56
<p class="nodata"><%= l(:label_no_data) %></p>
57
<% else %>
58
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
59
<p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p>
60
<% end %>
61

    
62
<% other_formats_links do |f| %>
63
	<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
64
	<%= f.link_to 'CSV', :url => params %>
65
	<%= f.link_to 'PDF', :url => params %>
66
<% end %>
67

    
68
<% end %>
69
<%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %>
70

    
71
<% content_for :sidebar do %>
72
    <%= render :partial => 'issues/sidebar' %>
73
<% end %>
74

    
75
<% content_for :header_tags do %>
76
    <%= auto_discovery_link_tag(:atom, {:query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_issue_plural)) %>
77
    <%= auto_discovery_link_tag(:atom, {:controller => 'journals', :action => 'index', :query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_changes_details)) %>
78
<% end %>
79

    
80
<%= context_menu issues_context_menu_path %>
(5-5/6)