Revision 1027:b0e0ffb43fa1 app/controllers

View differences:

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.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 59
      respond_to do |format|
45 60
        format.html {
46 61
          @events_by_day = events.group_by(&:event_date)
app/controllers/attachments_controller.rb
17 17

  
18 18
class AttachmentsController < ApplicationController
19 19

  
20
  include AttachmentsHelper
21
  helper :attachments
22

  
20 23
  before_filter :find_project
21 24
  before_filter :file_readable, :read_authorize, :except => :destroy
22 25
  before_filter :delete_authorize, :only => :destroy
......
49 52
  end
50 53

  
51 54
  def download
52
    if @attachment.container.is_a?(Version) || @attachment.container.is_a?(Project)
55
    # cc: formerly this happened only if "@attachment.container.is_a?(Version)"
56
    # or Project. Not good for us, we want to tally all downloads [by humans]
57
    if not user_is_search_bot?
53 58
      @attachment.increment_download
54 59
    end
55 60

  
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, :new, :create, :copy ]
24
  before_filter :authorize, :except => [ :index, :list, :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
......
43 43
  helper :repositories
44 44
  include RepositoriesHelper
45 45
  include ProjectsHelper
46
  include ActivitiesHelper
47
  helper :activities
46 48

  
47 49
  # Lists visible projects. Paginator is for top-level projects only
48 50
  # (subprojects belong to them)
......
76 78
    end
77 79
  end
78 80

  
81
  # A different view of projects using explore boxes
82
  def explore
83
    respond_to do |format|
84
      format.html {
85
        @projects = Project.visible
86
        render :template => 'projects/explore.html.erb', :layout => !request.xhr?
87
      }
88
    end
89
  end
90

  
79 91
  def new
80 92
    @issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
81 93
    @trackers = Tracker.all
app/controllers/sys_controller.rb
21 21
  def projects
22 22
    p = Project.active.has_module(:repository).find(:all, :include => :repository, :order => 'identifier')
23 23
    # extra_info attribute from repository breaks activeresource client
24
    render :xml => p.to_xml(:only => [:id, :identifier, :name, :is_public, :status], :include => {:repository => {:only => [:id, :url]}})
24
    render :xml => p.to_xml(:only => [:id, :identifier, :name, :is_public, :status], :include => {:repository => {:only => [:id, :url, :is_external, :external_url]}})
25 25
  end
26 26

  
27 27
  def create_project_repository
app/controllers/welcome_controller.rb
25 25
    @site_project = Project.find_by_identifier "soundsoftware-site"
26 26
    @site_news = []
27 27
    @site_news = News.latest_for @site_project if @site_project
28
    @projects = Project.latest User.current
29 28
    
30 29
    # tests if user is logged in to generate the tips of the day list
31 30
    if User.current.logged?

Also available in: Unified diff