summaryrefslogtreecommitdiffstats
path: root/app/views/my/blocks
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/my/blocks')
-rw-r--r--app/views/my/blocks/_issues.erb42
-rw-r--r--app/views/my/blocks/_issuesassignedtome.html.erb15
-rw-r--r--app/views/my/blocks/_issuesreportedbyme.html.erb15
-rw-r--r--app/views/my/blocks/_issueswatched.html.erb9
4 files changed, 42 insertions, 39 deletions
diff --git a/app/views/my/blocks/_issues.erb b/app/views/my/blocks/_issues.erb
new file mode 100644
index 000000000..bbd10af33
--- /dev/null
+++ b/app/views/my/blocks/_issues.erb
@@ -0,0 +1,42 @@
+<% issues, query = issues_items(block, settings) %>
+
+<div class="contextual">
+ <%= link_to_function l(:label_options), "$('##{block}-settings').toggle();", :class => 'icon-only icon-settings' %>
+</div>
+
+<h3>
+ <%= link_to query.name, issues_path(query.as_params) %>
+ (<%= query.issue_count %>)
+</h3>
+
+<div id="<%= block %>-settings" style="display:none;">
+ <%= form_tag(my_page_path, :remote => true) do %>
+ <div class="box">
+ <%= render_query_columns_selection(query, :name => "settings[#{block}][columns]") %>
+ </div>
+ <p>
+ <%= submit_tag l(:button_save) %>
+ <%= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();" %>
+ </p>
+ <% end %>
+</div>
+
+<% if issues.any? %>
+ <%= render :partial => 'issues/list',
+ :locals => {
+ :issues => issues,
+ :query => query,
+ :query_options => {
+ :sort_param => "settings[#{block}][sort]",
+ :sort_link_options => {:method => :post, :remote => true}
+ }
+ } %>
+<% else %>
+ <p class="nodata"><%= l(:label_no_data) %></p>
+<% end %>
+
+<% content_for :header_tags do %>
+<%= auto_discovery_link_tag(:atom,
+ issues_path(query.as_params.merge(:format => 'atom', :key => User.current.rss_key)),
+ {:title => query.name}) %>
+<% end %>
diff --git a/app/views/my/blocks/_issuesassignedtome.html.erb b/app/views/my/blocks/_issuesassignedtome.html.erb
deleted file mode 100644
index 94948b7aa..000000000
--- a/app/views/my/blocks/_issuesassignedtome.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-<% assigned_issues = issuesassignedtome_items %>
-<h3>
- <%= link_to l(:label_assigned_to_me_issues),
- issues_path(:set_filter => 1, :assigned_to_id => 'me', :sort => 'priority:desc,updated_on:desc') %>
- (<%= assigned_issues.limit(nil).count %>)
-</h3>
-
-<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues.to_a } %>
-
-<% content_for :header_tags do %>
-<%= auto_discovery_link_tag(:atom,
- {:controller => 'issues', :action => 'index', :set_filter => 1,
- :assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key},
- {:title => l(:label_assigned_to_me_issues)}) %>
-<% end %>
diff --git a/app/views/my/blocks/_issuesreportedbyme.html.erb b/app/views/my/blocks/_issuesreportedbyme.html.erb
deleted file mode 100644
index 91557c035..000000000
--- a/app/views/my/blocks/_issuesreportedbyme.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-<% reported_issues = issuesreportedbyme_items %>
-<h3>
- <%= link_to l(:label_reported_issues),
- issues_path(:set_filter => 1, :status_id => 'o', :author_id => 'me', :sort => 'updated_on:desc') %>
- (<%= reported_issues.limit(nil).count %>)
-</h3>
-
-<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues.to_a } %>
-
-<% content_for :header_tags do %>
-<%= auto_discovery_link_tag(:atom,
- {:controller => 'issues', :action => 'index', :set_filter => 1,
- :author_id => 'me', :format => 'atom', :key => User.current.rss_key},
- {:title => l(:label_reported_issues)}) %>
-<% end %>
diff --git a/app/views/my/blocks/_issueswatched.html.erb b/app/views/my/blocks/_issueswatched.html.erb
deleted file mode 100644
index 512a52238..000000000
--- a/app/views/my/blocks/_issueswatched.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<% watched_issues = issueswatched_items %>
-<h3>
- <%= link_to l(:label_watched_issues),
- issues_path(:set_filter => 1, :watcher_id => 'me', :sort => 'updated_on:desc') %>
- (<%= watched_issues.limit(nil).count %>)
-</h3>
-
-
-<%= render :partial => 'issues/list_simple', :locals => { :issues => watched_issues.to_a } %>