diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-07 20:07:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-07 20:07:11 +0000 |
commit | ec51cdd0f9926d0fe42e9563e0f5bf1a3db18196 (patch) | |
tree | 9a6c7a92e250707b8fbd5ac9e9758a6ac56d3d9d /app/views/common | |
parent | cdb2781b48f2a3ee2ba7d04574671ee195f7006f (diff) | |
download | redmine-ec51cdd0f9926d0fe42e9563e0f5bf1a3db18196.tar.gz redmine-ec51cdd0f9926d0fe42e9563e0f5bf1a3db18196.zip |
Calendar:
* added an helper and moved the rendering code to a shared partial (used by project calendar and my calendar)
* first day of week can now be set in lang files (general_first_day_of_week)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@815 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/common')
-rw-r--r-- | app/views/common/_calendar.rhtml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/views/common/_calendar.rhtml b/app/views/common/_calendar.rhtml new file mode 100644 index 000000000..7534a1223 --- /dev/null +++ b/app/views/common/_calendar.rhtml @@ -0,0 +1,36 @@ +<table class="cal"> +<thead> +<tr><td></td><% 7.times do |i| %><th><%= day_name( (calendar.first_wday+i)%7 ) %></th><% end %></tr> +</thead> +<tbody> +<tr> +<% day = calendar.startdt +while day <= calendar.enddt %> +<%= "<th>#{day.cweek}</th>" if day.cwday == calendar.first_wday %> +<td class="<%= day.month==calendar.month ? 'even' : 'odd' %><%= ' today' if Date.today == day %>"> +<p class="day-num"><%= day.day %></p> +<% calendar.events_on(day).each do |i| %> + <% if i.is_a? Issue %> + <div class="tooltip"> + <%= if day == i.start_date && day == i.due_date + image_tag('arrow_bw.png') + elsif day == i.start_date + image_tag('arrow_from.png') + elsif day == i.due_date + image_tag('arrow_to.png') + end %> + <%= h("#{i.project.name} -") unless @project && @project == i.project %> + <%= link_to_issue i %>: <%= h(truncate(i.subject, 30)) %> + <span class="tip"><%= render_issue_tooltip i %></span> + </div> + <% else %> + <%= link_to_version i, :class => "icon icon-package" %> + <% end %> +<% end %> +</td> +<%= '</tr><tr>' if day.cwday==calendar.last_wday and day!=calendar.enddt %> +<% day = day + 1 +end %> +</tr> +</tbody> +</table> |