Guest User

Untitled

a guest
Jun 21st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. diff -uNr -x '*~' redmine-1.0.1.orig/app/controllers/welcome_controller.rb redmine-1.0.1/app/controllers/welcome_controller.rb
  2. --- redmine-1.0.1.orig/app/controllers/welcome_controller.rb 2009-10-21 12:21:31.000000000 +0900
  3. +++ redmine-1.0.1/app/controllers/welcome_controller.rb 2010-11-09 19:19:41.000000000 +0900
  4. @@ -21,6 +21,7 @@
  5. def index
  6. @news = News.latest User.current
  7. @projects = Project.latest User.current
  8. + @documents = Document.latest User.current
  9. end
  10.  
  11. def robots
  12. diff -uNr -x '*~' redmine-1.0.1.orig/app/helpers/application_helper.rb redmine-1.0.1/app/helpers/application_helper.rb
  13. --- redmine-1.0.1.orig/app/helpers/application_helper.rb 2010-08-23 04:49:31.000000000 +0900
  14. +++ redmine-1.0.1/app/helpers/application_helper.rb 2010-11-10 09:39:52.000000000 +0900
  15. @@ -120,6 +120,11 @@
  16. end
  17. end
  18.  
  19. + def link_to_document(document, options={}, html_options = nil)
  20. + url = {:controller => 'documents', :action => 'show', :id => document}.merge(options)
  21. + link_to(h("#{document.title} - #{document.project}"), url, html_options)
  22. + end
  23. +
  24. def toggle_link(name, id, options={})
  25. onclick = "Element.toggle('#{id}'); "
  26. onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
  27. diff -uNr -x '*~' redmine-1.0.1.orig/app/models/document.rb redmine-1.0.1/app/models/document.rb
  28. --- redmine-1.0.1.orig/app/models/document.rb 2010-02-02 03:57:12.000000000 +0900
  29. +++ redmine-1.0.1/app/models/document.rb 2010-11-10 09:28:27.000000000 +0900
  30. @@ -46,4 +46,15 @@
  31. end
  32. @updated_on
  33. end
  34. +
  35. + def self.visible_by(user=nil)
  36. + user ||= User.current
  37. + return "#{Document.table_name}.project_id IN (SELECT #{Project.table_name}.id FROM #{Project.table_name} WHERE #{Project.visible_by(user)})"
  38. + end
  39. +
  40. + def self.latest(user=nil, count=5)
  41. + find(:all, :limit => count,
  42. + :conditions => self.visible_by(user),
  43. + :order => "created_on DESC")
  44. + end
  45. end
  46. diff -uNr -x '*~' redmine-1.0.1.orig/app/views/welcome/index.rhtml redmine-1.0.1/app/views/welcome/index.rhtml
  47. --- redmine-1.0.1.orig/app/views/welcome/index.rhtml 2010-08-19 13:32:06.000000000 +0900
  48. +++ redmine-1.0.1/app/views/welcome/index.rhtml 2010-11-10 09:42:23.000000000 +0900
  49. @@ -1,5 +1,21 @@
  50. <h2><%= l(:label_home) %></h2>
  51.  
  52. +<div>
  53. + <% if @documents.any? %>
  54. + <div class="box">
  55. + <h3><%=l(:label_document_latest)%></h3>
  56. + <ul>
  57. + <% for document in @documents %>
  58. + <% @document = document %>
  59. + <li>
  60. + <%= link_to_document document %> (<%= format_time(document.created_on) %>)
  61. + </li>
  62. + <% end %>
  63. + </ul>
  64. + </div>
  65. + <% end %>
  66. +</div>
  67. +
  68. <div class="splitcontentleft">
  69. <%= textilizable Setting.welcome_text %>
  70. <% if @news.any? %>
  71. diff -uNr -x '*~' redmine-1.0.1.orig/config/locales/ja.yml redmine-1.0.1/config/locales/ja.yml
  72. --- redmine-1.0.1.orig/config/locales/ja.yml 2010-08-23 04:48:52.000000000 +0900
  73. +++ redmine-1.0.1/config/locales/ja.yml 2010-11-10 09:41:57.000000000 +0900
  74. @@ -462,6 +462,7 @@
  75. label_document_new: 新しい文書
  76. label_document_plural: 文書
  77. label_document_added: 文書が追加されました
  78. + label_document_latest: 最近の文書
  79. label_role: ロール
  80. label_role_plural: ロール
  81. label_role_new: 新しいロール
Add Comment
Please, Sign In to add comment