mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 08:34:49 +08:00
fix hound
This commit is contained in:
parent
39dda1ad5d
commit
dde714d78f
2 changed files with 13 additions and 13 deletions
|
@ -13,13 +13,13 @@ class RepositoriesController < ApplicationController
|
||||||
def create_new_modal
|
def create_new_modal
|
||||||
@new_repository = Repository.new
|
@new_repository = Repository.new
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json {
|
format.json do
|
||||||
render json: {
|
render json: {
|
||||||
html: render_to_string({
|
html: render_to_string(
|
||||||
partial: "create_new_repository_modal.html.erb"
|
partial: 'create_new_repository_modal.html.erb'
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,17 +31,16 @@ class RepositoriesController < ApplicationController
|
||||||
@repository.assign_attributes(repository_params)
|
@repository.assign_attributes(repository_params)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @repository.save
|
format.json do
|
||||||
flash[:success] = t("repositories.index.modal_create.success_flash", name: @repository.name)
|
if @repository.save
|
||||||
format.json {
|
flash[:success] = t('repositories.index.modal_create.success_flash',
|
||||||
|
name: @repository.name)
|
||||||
render json: { url: team_repositories_path(repository: @repository) },
|
render json: { url: team_repositories_path(repository: @repository) },
|
||||||
status: :ok
|
status: :ok
|
||||||
}
|
else
|
||||||
else
|
|
||||||
format.json {
|
|
||||||
render json: @repository.errors,
|
render json: @repository.errors,
|
||||||
status: :unprocessable_entity
|
status: :unprocessable_entity
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1054,7 +1054,8 @@ module PermissionHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_create_new_repository(team)
|
def can_create_new_repository(team)
|
||||||
is_admin_of_team(team) && team.repositories.count < Constants::REPOSITORIES_LIMIT
|
is_admin_of_team(team) &&
|
||||||
|
team.repositories.count < Constants::REPOSITORIES_LIMIT
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_view_repositories(team)
|
def can_view_repositories(team)
|
||||||
|
|
Loading…
Add table
Reference in a new issue