diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-12-05 20:45:04 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-12-05 20:45:04 +0000 |
commit | 96f83cc8f0f032554f771a59da22303cd473b878 (patch) | |
tree | 355a0d2ed653a5426c59ebf6a1fe65eba024b4d0 /app/views/my/blocks | |
parent | eabc04d8368824965d3ac8de3fa84502e9c05d38 (diff) | |
download | redmine-96f83cc8f0f032554f771a59da22303cd473b878.tar.gz redmine-96f83cc8f0f032554f771a59da22303cd473b878.zip |
trunk moved from /trunk/redmine to /trunk
git-svn-id: http://redmine.rubyforge.org/svn/trunk@67 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/my/blocks')
-rw-r--r-- | app/views/my/blocks/_calendar.rhtml | 45 | ||||
-rw-r--r-- | app/views/my/blocks/_documents.rhtml | 15 | ||||
-rw-r--r-- | app/views/my/blocks/_issues_assigned_to_me.rhtml | 10 | ||||
-rw-r--r-- | app/views/my/blocks/_issues_reported_by_me.rhtml | 10 | ||||
-rw-r--r-- | app/views/my/blocks/_latest_news.rhtml | 13 |
5 files changed, 93 insertions, 0 deletions
diff --git a/app/views/my/blocks/_calendar.rhtml b/app/views/my/blocks/_calendar.rhtml new file mode 100644 index 000000000..2d7930f52 --- /dev/null +++ b/app/views/my/blocks/_calendar.rhtml @@ -0,0 +1,45 @@ +<h3><%= l(:label_calendar) %></h3>
+
+<%
+@date_from = Date.today - (Date.today.cwday-1)
+@date_to = Date.today + (7-Date.today.cwday)
+@issues = Issue.find :all,
+ :conditions => ["issues.project_id in (#{@user.projects.collect{|m| m.id}.join(',')}) AND ((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?))", @date_from, @date_to, @date_from, @date_to],
+ :include => [:project, :tracker] unless @user.projects.empty?
+@issues ||= []
+%>
+
+<table class="calenderTable">
+<tr class="ListHead">
+<td></td>
+<% 1.upto(7) do |d| %>
+ <td align="center" width="14%"><%= day_name(d) %></td>
+<% end %>
+</tr>
+<tr height="100">
+<% day = @date_from
+while day <= @date_to
+ if day.cwday == 1 %>
+ <td valign="middle"><%= day.cweek %></td>
+ <% end %>
+ <td valign="top" width="14%" class="<%= day.month==@month ? "even" : "odd" %>">
+ <p align="right"><%= day==Date.today ? "<b>#{day.day}</b>" : day.day %></p>
+ <% day_issues = []
+ @issues.each { |i| day_issues << i if i.start_date == day or i.due_date == day }
+ day_issues.each do |i| %>
+ <%= if day == i.start_date and day == i.due_date
+ image_tag('arrow_bw')
+ elsif day == i.start_date
+ image_tag('arrow_from')
+ elsif day == i.due_date
+ image_tag('arrow_to')
+ end %>
+ <small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: <%= i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
+ <% end %>
+ </td>
+ <%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %>
+ <%
+ day = day + 1
+end %>
+</tr>
+</table>
\ No newline at end of file diff --git a/app/views/my/blocks/_documents.rhtml b/app/views/my/blocks/_documents.rhtml new file mode 100644 index 000000000..5fa8c7980 --- /dev/null +++ b/app/views/my/blocks/_documents.rhtml @@ -0,0 +1,15 @@ +<h3><%=l(:label_document_plural)%></h3>
+
+<ul>
+<% for document in Document.find :all,
+ :limit => 10,
+ :conditions => "documents.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
+ :include => [:project] %>
+ <li>
+ <b><%= link_to document.title, :controller => 'documents', :action => 'show', :id => document %></b>
+ <br />
+ <%= truncate document.description, 150 %><br />
+ <em><%= format_time(document.created_on) %></em><br />
+ </li>
+<% end unless @user.projects.empty? %>
+</ul>
\ No newline at end of file diff --git a/app/views/my/blocks/_issues_assigned_to_me.rhtml b/app/views/my/blocks/_issues_assigned_to_me.rhtml new file mode 100644 index 000000000..2a4e2a05d --- /dev/null +++ b/app/views/my/blocks/_issues_assigned_to_me.rhtml @@ -0,0 +1,10 @@ +<h3><%=l(:label_assigned_to_me_issues)%></h3>
+<% assigned_issues = Issue.find(:all,
+ :conditions => ["assigned_to_id=?", user.id],
+ :limit => 10,
+ :include => [ :status, :project, :tracker ],
+ :order => 'issues.updated_on DESC') %>
+<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>
+<% if assigned_issues.length > 0 %>
+<p><%=lwr(:label_last_updates, assigned_issues.length)%></p>
+<% end %>
diff --git a/app/views/my/blocks/_issues_reported_by_me.rhtml b/app/views/my/blocks/_issues_reported_by_me.rhtml new file mode 100644 index 000000000..9b40b3606 --- /dev/null +++ b/app/views/my/blocks/_issues_reported_by_me.rhtml @@ -0,0 +1,10 @@ +<h3><%=l(:label_reported_issues)%></h3>
+<% reported_issues = Issue.find(:all,
+ :conditions => ["author_id=?", user.id],
+ :limit => 10,
+ :include => [ :status, :project, :tracker ],
+ :order => 'issues.updated_on DESC') %>
+<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues } %>
+<% if reported_issues.length > 0 %>
+<p><%=lwr(:label_last_updates, reported_issues.length)%></p>
+<% 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 new file mode 100644 index 000000000..85430ef54 --- /dev/null +++ b/app/views/my/blocks/_latest_news.rhtml @@ -0,0 +1,13 @@ +<h3><%=l(:label_news_latest)%></h3>
+
+<ul>
+<% for news in News.find :all,
+ :limit => 10,
+ :conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
+ :include => [:project, :author] %>
+ <li><%= link_to news.title, :controller => 'news', :action => 'show', :id => news %><br />
+ <% unless news.summary.empty? %><%= news.summary %><br /><% end %>
+ <em><%= news.author.name %>, <%= format_time(news.created_on) %></em><br />
+ </li>
+<% end unless @user.projects.empty? %>
+</ul>
\ No newline at end of file |