2016-02-12 23:52:43 +08:00
|
|
|
class ProjectActivitiesController < ApplicationController
|
|
|
|
before_action :load_vars, only: [ :index ]
|
|
|
|
before_action :check_view_permissions, only: [ :index ]
|
|
|
|
|
|
|
|
def index
|
|
|
|
@activities = @project.last_activities
|
|
|
|
|
2023-07-18 19:36:41 +08:00
|
|
|
render json: {
|
|
|
|
html: render_to_string({ partial: 'index', formats: :html })
|
|
|
|
}
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def load_vars
|
|
|
|
@project = Project.find_by_id(params[:project_id])
|
|
|
|
unless @project
|
|
|
|
render_404
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def check_view_permissions
|
2018-01-25 19:00:30 +08:00
|
|
|
render_403 unless can_read_project?(@project)
|
2016-02-12 23:52:43 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|