diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c968800..6718b83 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -403,7 +403,8 @@ class ProjectsController < ApplicationController } @show_documents = 1 end - + + render :layout => false if request.xhr? end def calendar diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0f0deeb..196d91f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 = '' diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml index d6e5a1a..4050d62 100644 --- a/app/views/projects/activity.rhtml +++ b/app/views/projects/activity.rhtml @@ -1,4 +1,4 @@ -

<%=l(:label_activity)%>

+

<%=l(:label_activity)%>: <%= "#{month_name(@month).downcase} #{@year}" %>

@@ -13,7 +13,7 @@ <%= end_form_tag %>
<% @events_by_day.keys.sort {|x,y| y <=> x }.each do |day| %> -

<%= day_name(day.cwday) %> <%= format_date(day) %>

+

<%= day_name(day.cwday) %> <%= day.day %>

<% end %> <% if @events_by_day.empty? %>

<%= l(:label_no_data) %>

<% end %> + +
+<%= 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))} + %> +
+
+<%= 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))} + %>  +

\ No newline at end of file diff --git a/app/views/projects/calendar.rhtml b/app/views/projects/calendar.rhtml index fc62921..22fcfa0 100644 --- a/app/views/projects/calendar.rhtml +++ b/app/views/projects/calendar.rhtml @@ -55,13 +55,13 @@ end %>
-<%= 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))} %> -<%= 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))} %>