|
|
|
@@ -2,11 +2,12 @@ class SitePagesController < ApplicationController |
|
|
|
before_action :require_login, except: [:softbot_build, :themes] |
|
|
|
before_action :require_profile_completed, only: [:create] |
|
|
|
before_action :load_project, except: [:softbot_build, :index, :themes] |
|
|
|
before_action :authenticate_user!, except: [:softbot_build, :index, :themes] |
|
|
|
before_action :authenticate_user!, except: [:softbot_build, :index, :themes, :show] |
|
|
|
before_action :authenticate_member!, only: [:show] |
|
|
|
|
|
|
|
def index |
|
|
|
@pages = PageQuery.call(params,current_user) |
|
|
|
@pages = paginate(@pages) |
|
|
|
pages = PageQuery.call(params,current_user) |
|
|
|
@pages = paginate(pages) |
|
|
|
end |
|
|
|
|
|
|
|
def show |
|
|
|
@@ -66,6 +67,12 @@ class SitePagesController < ApplicationController |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
def authenticate_member! |
|
|
|
unless @project.member?(current_user) || current_user.admin? |
|
|
|
return render_forbidden('你不是成员,没有权限操作') |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
def theme_params |
|
|
|
params[:language_frame] || "hugo" |
|
|
|
end |
|
|
|
|