]> source.dussan.org Git - redmine.git/commitdiff
removed underscores in block names (problem with scriptaculous sortables)
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 5 Feb 2007 19:33:43 +0000 (19:33 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 5 Feb 2007 19:33:43 +0000 (19:33 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@242 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/my_controller.rb
app/views/my/blocks/_issues_assigned_to_me.rhtml [deleted file]
app/views/my/blocks/_issues_reported_by_me.rhtml [deleted file]
app/views/my/blocks/_issuesassignedtome.rhtml [new file with mode: 0644]
app/views/my/blocks/_issuesreportedbyme.rhtml [new file with mode: 0644]
app/views/my/blocks/_latest_news.rhtml [deleted file]
app/views/my/blocks/_news.rhtml [new file with mode: 0644]

index ec6b88b4c7e154d6b434ed518c27839007865046..e29c78e0373e3310f415b131c0bcfac03d754d34 100644 (file)
@@ -19,13 +19,17 @@ class MyController < ApplicationController
   layout 'base'
   before_filter :require_login
 
-  BLOCKS = { 'issues_assigned_to_me' => :label_assigned_to_me_issues,
-             'issues_reported_by_me' => :label_reported_issues,
-             'latest_news' => :label_news_latest,
+  BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues,
+             'issuesreportedbyme' => :label_reported_issues,
+             'news' => :label_news_latest,
              'calendar' => :label_calendar,
              'documents' => :label_document_plural
            }.freeze
 
+  DEFAULT_LAYOUT = {  'left' => ['issuesassignedtome'], 
+                      'right' => ['issuesreportedbyme'] 
+                   }.freeze
+
   verify :xhr => true,
          :session => :page_layout,
          :only => [:add_block, :remove_block, :order_blocks]
@@ -38,7 +42,7 @@ class MyController < ApplicationController
   # Show user's page
   def page
     @user = self.logged_in_user
-    @blocks = @user.pref[:my_page_layout] || { 'left' => ['issues_assigned_to_me'], 'right' => ['issues_reported_by_me'] }
+    @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
   end
 
   # Edit user's account
@@ -75,7 +79,7 @@ class MyController < ApplicationController
   # User's page layout configuration
   def page_layout
     @user = self.logged_in_user
-    @blocks = @user.pref[:my_page_layout] || { 'left' => ['issues_assigned_to_me'], 'right' => ['issues_reported_by_me'] }
+    @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
     session[:page_layout] = @blocks
     %w(top left right).each {|f| session[:page_layout][f] ||= [] }
     @block_options = []
diff --git a/app/views/my/blocks/_issues_assigned_to_me.rhtml b/app/views/my/blocks/_issues_assigned_to_me.rhtml
deleted file mode 100644 (file)
index 2a4e2a0..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<h3><%=l(:label_assigned_to_me_issues)%></h3>\r
-<% assigned_issues = Issue.find(:all, \r
-                                :conditions => ["assigned_to_id=?", user.id],\r
-                                :limit => 10, \r
-                                :include => [ :status, :project, :tracker ], \r
-                                :order => 'issues.updated_on DESC') %>\r
-<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>\r
-<% if assigned_issues.length > 0 %>\r
-<p><%=lwr(:label_last_updates, assigned_issues.length)%></p>\r
-<% end %>\r
diff --git a/app/views/my/blocks/_issues_reported_by_me.rhtml b/app/views/my/blocks/_issues_reported_by_me.rhtml
deleted file mode 100644 (file)
index 9b40b36..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<h3><%=l(:label_reported_issues)%></h3>\r
-<% reported_issues = Issue.find(:all, \r
-                                :conditions => ["author_id=?", user.id],\r
-                                :limit => 10, \r
-                                :include => [ :status, :project, :tracker ], \r
-                                :order => 'issues.updated_on DESC') %>\r
-<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues } %>\r
-<% if reported_issues.length > 0 %>\r
-<p><%=lwr(:label_last_updates, reported_issues.length)%></p>\r
-<% end %>
\ No newline at end of file
diff --git a/app/views/my/blocks/_issuesassignedtome.rhtml b/app/views/my/blocks/_issuesassignedtome.rhtml
new file mode 100644 (file)
index 0000000..2a4e2a0
--- /dev/null
@@ -0,0 +1,10 @@
+<h3><%=l(:label_assigned_to_me_issues)%></h3>\r
+<% assigned_issues = Issue.find(:all, \r
+                                :conditions => ["assigned_to_id=?", user.id],\r
+                                :limit => 10, \r
+                                :include => [ :status, :project, :tracker ], \r
+                                :order => 'issues.updated_on DESC') %>\r
+<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>\r
+<% if assigned_issues.length > 0 %>\r
+<p><%=lwr(:label_last_updates, assigned_issues.length)%></p>\r
+<% end %>\r
diff --git a/app/views/my/blocks/_issuesreportedbyme.rhtml b/app/views/my/blocks/_issuesreportedbyme.rhtml
new file mode 100644 (file)
index 0000000..9b40b36
--- /dev/null
@@ -0,0 +1,10 @@
+<h3><%=l(:label_reported_issues)%></h3>\r
+<% reported_issues = Issue.find(:all, \r
+                                :conditions => ["author_id=?", user.id],\r
+                                :limit => 10, \r
+                                :include => [ :status, :project, :tracker ], \r
+                                :order => 'issues.updated_on DESC') %>\r
+<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues } %>\r
+<% if reported_issues.length > 0 %>\r
+<p><%=lwr(:label_last_updates, reported_issues.length)%></p>\r
+<% end %>
\ No newline at end of file
diff --git a/app/views/my/blocks/_latest_news.rhtml b/app/views/my/blocks/_latest_news.rhtml
deleted file mode 100644 (file)
index 4bad9a5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<h3><%=l(:label_news_latest)%></h3>\r
-\r
-<%= render (:partial => 'news/news', \r
-            :collection => News.find(:all,\r
-                                     :limit => 10,\r
-                                     :order => 'news.created_on DESC',\r
-                                     :conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",\r
-                                     :include => [:project, :author])) unless @user.projects.empty? %>
\ No newline at end of file
diff --git a/app/views/my/blocks/_news.rhtml b/app/views/my/blocks/_news.rhtml
new file mode 100644 (file)
index 0000000..4bad9a5
--- /dev/null
@@ -0,0 +1,8 @@
+<h3><%=l(:label_news_latest)%></h3>\r
+\r
+<%= render (:partial => 'news/news', \r
+            :collection => News.find(:all,\r
+                                     :limit => 10,\r
+                                     :order => 'news.created_on DESC',\r
+                                     :conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",\r
+                                     :include => [:project, :author])) unless @user.projects.empty? %>
\ No newline at end of file