|
|
|
@@ -4,9 +4,9 @@ class ProjectsController < ApplicationController |
|
|
|
include ProjectsHelper |
|
|
|
include Acceleratorable |
|
|
|
|
|
|
|
before_action :require_login, except: %i[index branches branches_slice group_type_list simple show fork_users praise_users watch_users recommend banner_recommend about menu_list verify_auth_token] |
|
|
|
before_action :require_login, except: %i[index branches branches_slice group_type_list simple show mp_show fork_users praise_users watch_users recommend banner_recommend about menu_list verify_auth_token] |
|
|
|
before_action :require_profile_completed, only: [:create, :migrate,:page_migrate,:verify_auth_token] |
|
|
|
before_action :load_repository, except: %i[index group_type_list migrate page_migrate create recommend banner_recommend verify_auth_token] |
|
|
|
before_action :load_repository, except: %i[index mp_show group_type_list migrate page_migrate create recommend banner_recommend verify_auth_token] |
|
|
|
before_action :authorizate_user_can_edit_project!, only: %i[update] |
|
|
|
before_action :project_public?, only: %i[fork_users praise_users watch_users] |
|
|
|
before_action :request_limit, only: %i[index] |
|
|
|
@@ -232,6 +232,15 @@ class ProjectsController < ApplicationController |
|
|
|
def show |
|
|
|
end |
|
|
|
|
|
|
|
def mp_show |
|
|
|
@project = Project.joins(:owner).find params[:project_id] |
|
|
|
data={ |
|
|
|
owner:@project.owner.try(:login), |
|
|
|
identifier:@project.identifier |
|
|
|
} |
|
|
|
render_ok(data:data) |
|
|
|
end |
|
|
|
|
|
|
|
def destroy |
|
|
|
if current_user.admin? || @project.manager?(current_user) |
|
|
|
ActiveRecord::Base.transaction do |
|
|
|
|