Revision 1009:066b55d7c053 app/controllers
| app/controllers/activities_controller.rb | ||
|---|---|---|
| 40 | 40 |
|
| 41 | 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.ssamr_user_detail.institution_name == @institution_name |
|
| 48 |
end |
|
| 49 |
if events.empty? |
|
| 50 |
# We don't want to dump into the output any arbitrary string |
|
| 51 |
# from the URL that has no matching events |
|
| 52 |
@institution_name = "" |
|
| 53 |
end |
|
| 54 |
end |
|
| 55 |
|
|
| 56 |
if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, @institution_name, events.first, User.current, current_language]) |
|
| 44 | 57 |
respond_to do |format| |
| 45 | 58 |
format.html {
|
| 46 | 59 |
@events_by_day = events.group_by(&:event_date) |
| app/controllers/projects_controller.rb | ||
|---|---|---|
| 20 | 20 |
menu_item :roadmap, :only => :roadmap |
| 21 | 21 |
menu_item :settings, :only => :settings |
| 22 | 22 |
|
| 23 |
before_filter :find_project, :except => [ :index, :list, :browse, :new, :create, :copy ]
|
|
| 24 |
before_filter :authorize, :except => [ :index, :list, :browse, :new, :create, :copy, :archive, :unarchive, :destroy]
|
|
| 23 |
before_filter :find_project, :except => [ :index, :list, :explore, :new, :create, :copy ]
|
|
| 24 |
before_filter :authorize, :except => [ :index, :list, :explore, :new, :create, :copy, :archive, :unarchive, :destroy]
|
|
| 25 | 25 |
before_filter :authorize_global, :only => [:new, :create] |
| 26 | 26 |
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ] |
| 27 | 27 |
accept_rss_auth :index |
| ... | ... | |
| 76 | 76 |
end |
| 77 | 77 |
end |
| 78 | 78 |
|
| 79 |
# A different view of projects using browse boxes
|
|
| 80 |
def browse
|
|
| 79 |
# A different view of projects using explore boxes
|
|
| 80 |
def explore
|
|
| 81 | 81 |
respond_to do |format| |
| 82 | 82 |
format.html {
|
| 83 | 83 |
@projects = Project.visible |
| 84 |
render :template => 'projects/browse.html.erb', :layout => !request.xhr?
|
|
| 84 |
render :template => 'projects/explore.html.erb', :layout => !request.xhr?
|
|
| 85 | 85 |
} |
| 86 | 86 |
end |
| 87 | 87 |
end |
Also available in: Unified diff