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:
parent
d6d1502200
commit
2c335dbf32
|
@ -404,6 +404,7 @@ class ProjectsController < ApplicationController
|
|||
@show_documents = 1
|
||||
end
|
||||
|
||||
render :layout => false if request.xhr?
|
||||
end
|
||||
|
||||
def calendar
|
||||
|
|
|
@ -62,6 +62,10 @@ module ApplicationHelper
|
|||
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 = ''
|
||||
html << link_to_remote(('« ' + l(:label_previous)),
|
||||
|
|
|
@ -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 ('« ' + (@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)}") + ' »'),
|
||||
{: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))}
|
||||
%>
|
||||
</div>
|
||||
<br />
|
||||
</div>
|
|
@ -55,13 +55,13 @@ end %>
|
|||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<%= link_to_remote ('« ' + l(:label_previous)),
|
||||
<%= link_to_remote ('« ' + (@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) + ' »'),
|
||||
<%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'),
|
||||
{: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))}
|
||||
%>
|
||||
|
|
Loading…
Reference in New Issue