diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-12-01 17:15:42 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-12-01 17:15:42 +0000 |
commit | db002edabdec9050e6d512ae8759783894b9624a (patch) | |
tree | a7f455c3b01a3c59380808b44ffb8b0d767acf82 /app/controllers | |
parent | 3baf086e2d8e5d969ce12217e1e143e5b4ec971a (diff) | |
download | redmine-db002edabdec9050e6d512ae8759783894b9624a.tar.gz redmine-db002edabdec9050e6d512ae8759783894b9624a.zip |
* Added links to previous and next revisions on revision view (patch by Cyril Mougel slightly edited)
* Fixed TimelogController#report december error
* Fixed ProjectsControllerTest#test_activity 1st and 2nd day of the month failure
git-svn-id: http://redmine.rubyforge.org/svn/trunk@938 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/repositories_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/timelog_controller.rb | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 8ff464c5b..b332c7213 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -19,6 +19,9 @@ require 'SVG/Graph/Bar' require 'SVG/Graph/BarHorizontal' require 'digest/sha1' +class ChangesetNotFound < Exception +end + class RepositoriesController < ApplicationController layout 'base' before_filter :find_repository, :except => :edit @@ -94,14 +97,19 @@ class RepositoriesController < ApplicationController def revision @changeset = @repository.changesets.find_by_revision(@rev) - show_error and return unless @changeset + raise ChangesetNotFound unless @changeset @changes_count = @changeset.changes.size @changes_pages = Paginator.new self, @changes_count, 150, params['page'] @changes = @changeset.changes.find(:all, :limit => @changes_pages.items_per_page, :offset => @changes_pages.current.offset) - - render :action => "revision", :layout => false if request.xhr? + + respond_to do |format| + format.html + format.js {render :layout => false} + end + rescue ChangesetNotFound + show_error end def diff diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index 1a1bace3a..f90c4527e 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -54,7 +54,7 @@ class TimelogController < ApplicationController begin; @date_to = params[:date_to].to_date; rescue; end end @date_from ||= Date.civil(Date.today.year, 1, 1) - @date_to ||= Date.civil(Date.today.year, Date.today.month+1, 1) - 1 + @date_to ||= (Date.civil(Date.today.year, Date.today.month, 1) >> 1) - 1 unless @criterias.empty? sql_select = @criterias.collect{|criteria| @available_criterias[criteria][:sql] + " AS " + criteria}.join(', ') |