Mercurial > hg > soundsoftware-site
comparison app/controllers/activities_controller.rb @ 1026:b42553f6df71 bibplugin_bibtex
Merge
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 13 Nov 2012 13:23:29 +0000 |
parents | e3f78fa30a36 |
children | bb32da3bea34 |
comparison
equal
deleted
inserted
replaced
953:b52621512b47 | 1026:b42553f6df71 |
---|---|
38 @activity.scope_select {|t| !params["show_#{t}"].nil?} | 38 @activity.scope_select {|t| !params["show_#{t}"].nil?} |
39 @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty? | 39 @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty? |
40 | 40 |
41 events = @activity.events(@date_from, @date_to) | 41 events = @activity.events(@date_from, @date_to) |
42 | 42 |
43 if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, User.current, current_language]) | 43 @institution_name = params[:institution] |
44 if !@institution_name.blank? | |
45 events = events.select do |e| | |
46 e.respond_to?(:event_author) and e.event_author and | |
47 e.event_author.respond_to?(:ssamr_user_detail) and | |
48 !e.event_author.ssamr_user_detail.nil? and | |
49 e.event_author.ssamr_user_detail.institution_name == @institution_name | |
50 end | |
51 if events.empty? | |
52 # We don't want to dump into the output any arbitrary string | |
53 # from the URL that has no matching events | |
54 @institution_name = "" | |
55 end | |
56 end | |
57 | |
58 if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, @institution_name, events.first, User.current, current_language]) | |
44 respond_to do |format| | 59 respond_to do |format| |
45 format.html { | 60 format.html { |
46 @events_by_day = events.group_by(&:event_date) | 61 @events_by_day = events.group_by(&:event_date) |
47 render :layout => false if request.xhr? | 62 render :layout => false if request.xhr? |
48 } | 63 } |