Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -uNr -x '*~' redmine-1.0.1.orig/app/controllers/welcome_controller.rb redmine-1.0.1/app/controllers/welcome_controller.rb
- --- redmine-1.0.1.orig/app/controllers/welcome_controller.rb 2009-10-21 12:21:31.000000000 +0900
- +++ redmine-1.0.1/app/controllers/welcome_controller.rb 2010-11-09 19:19:41.000000000 +0900
- @@ -21,6 +21,7 @@
- def index
- @news = News.latest User.current
- @projects = Project.latest User.current
- + @documents = Document.latest User.current
- end
- def robots
- diff -uNr -x '*~' redmine-1.0.1.orig/app/helpers/application_helper.rb redmine-1.0.1/app/helpers/application_helper.rb
- --- redmine-1.0.1.orig/app/helpers/application_helper.rb 2010-08-23 04:49:31.000000000 +0900
- +++ redmine-1.0.1/app/helpers/application_helper.rb 2010-11-10 09:39:52.000000000 +0900
- @@ -120,6 +120,11 @@
- end
- end
- + def link_to_document(document, options={}, html_options = nil)
- + url = {:controller => 'documents', :action => 'show', :id => document}.merge(options)
- + link_to(h("#{document.title} - #{document.project}"), url, html_options)
- + end
- +
- def toggle_link(name, id, options={})
- onclick = "Element.toggle('#{id}'); "
- onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
- diff -uNr -x '*~' redmine-1.0.1.orig/app/models/document.rb redmine-1.0.1/app/models/document.rb
- --- redmine-1.0.1.orig/app/models/document.rb 2010-02-02 03:57:12.000000000 +0900
- +++ redmine-1.0.1/app/models/document.rb 2010-11-10 09:28:27.000000000 +0900
- @@ -46,4 +46,15 @@
- end
- @updated_on
- end
- +
- + def self.visible_by(user=nil)
- + user ||= User.current
- + return "#{Document.table_name}.project_id IN (SELECT #{Project.table_name}.id FROM #{Project.table_name} WHERE #{Project.visible_by(user)})"
- + end
- +
- + def self.latest(user=nil, count=5)
- + find(:all, :limit => count,
- + :conditions => self.visible_by(user),
- + :order => "created_on DESC")
- + end
- end
- diff -uNr -x '*~' redmine-1.0.1.orig/app/views/welcome/index.rhtml redmine-1.0.1/app/views/welcome/index.rhtml
- --- redmine-1.0.1.orig/app/views/welcome/index.rhtml 2010-08-19 13:32:06.000000000 +0900
- +++ redmine-1.0.1/app/views/welcome/index.rhtml 2010-11-10 09:42:23.000000000 +0900
- @@ -1,5 +1,21 @@
- <h2><%= l(:label_home) %></h2>
- +<div>
- + <% if @documents.any? %>
- + <div class="box">
- + <h3><%=l(:label_document_latest)%></h3>
- + <ul>
- + <% for document in @documents %>
- + <% @document = document %>
- + <li>
- + <%= link_to_document document %> (<%= format_time(document.created_on) %>)
- + </li>
- + <% end %>
- + </ul>
- + </div>
- + <% end %>
- +</div>
- +
- <div class="splitcontentleft">
- <%= textilizable Setting.welcome_text %>
- <% if @news.any? %>
- diff -uNr -x '*~' redmine-1.0.1.orig/config/locales/ja.yml redmine-1.0.1/config/locales/ja.yml
- --- redmine-1.0.1.orig/config/locales/ja.yml 2010-08-23 04:48:52.000000000 +0900
- +++ redmine-1.0.1/config/locales/ja.yml 2010-11-10 09:41:57.000000000 +0900
- @@ -462,6 +462,7 @@
- label_document_new: 新しい文書
- label_document_plural: 文書
- label_document_added: 文書が追加されました
- + label_document_latest: 最近の文書
- label_role: ロール
- label_role_plural: ロール
- label_role_new: 新しいロール
Add Comment
Please, Sign In to add comment