calendar and activity views edited (previous/next links)

git-svn-id: http://redmine.rubyforge.org/svn/trunk@72 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2006-12-06 20:54:43 +00:00
parent d6d1502200
commit 2c335dbf32
4 changed files with 23 additions and 5 deletions

View File

@ -403,7 +403,8 @@ class ProjectsController < ApplicationController
}
@show_documents = 1
end
render :layout => false if request.xhr?
end
def calendar

View File

@ -61,6 +61,10 @@ module ApplicationHelper
def day_name(day)
l(:general_day_names).split(',')[day-1]
end
def month_name(month)
l(:actionview_datehelper_select_month_names).split(',')[month-1]
end
def pagination_links_full(paginator, options={}, html_options={})
html = ''

View File

@ -1,4 +1,4 @@
<h2><%=l(:label_activity)%></h2>
<h2><%=l(:label_activity)%>: <%= "#{month_name(@month).downcase} #{@year}" %></h2>
<div>
<div class="rightbox">
@ -13,7 +13,7 @@
<%= end_form_tag %>
</div>
<% @events_by_day.keys.sort {|x,y| y <=> x }.each do |day| %>
<h3><%= day_name(day.cwday) %> <%= format_date(day) %></h3>
<h3><%= day_name(day.cwday) %> <%= day.day %></h3>
<ul>
<% @events_by_day[day].sort {|x,y| y.created_on <=> x.created_on }.each do |e| %>
<li><p>
@ -37,5 +37,18 @@
</ul>
<% end %>
<% if @events_by_day.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
<div style="float:left;">
<%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
{:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
{:href => url_for(:action => 'activity', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
%>
</div>
<div style="float:right;">
<%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' &#187;'),
{:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }},
{:href => url_for(:action => 'activity', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))}
%>&nbsp;
</div>
<br />
</div>

View File

@ -55,13 +55,13 @@ end %>
<table width="100%">
<tr>
<td align="left">
<%= link_to_remote ('&#171; ' + l(:label_previous)),
<%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
{:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
{:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
%>
</td>
<td align="right">
<%= link_to_remote (l(:label_next) + ' &#187;'),
<%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' &#187;'),
{:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }},
{:href => url_for(:action => 'calendar', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))}
%>