diff --git a/app/assets/stylesheets/components/table.css.scss b/app/assets/stylesheets/components/table.css.scss index a6f2eef0ae..243a2604ed 100644 --- a/app/assets/stylesheets/components/table.css.scss +++ b/app/assets/stylesheets/components/table.css.scss @@ -134,6 +134,15 @@ tr.gu-mirror { text-align: center; color: $on-surface-muted; } + + td.empty { + white-space: break-spaces; + text-align: center; + padding: 16px; + line-height: 22px; + width: 100%; + color: $on-surface-muted; + } } #scoresheet-table-wrapper td { diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 6d6f89d7a8..2adb6a80c5 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -7,8 +7,9 @@ class RepositoriesController < ApplicationController # GET /repositories.json def index authorize Repository - @repositories = Repository.all - @title = I18n.t('repositories.index.title') + @repositories = policy_scope(Repository.all) + @repositories = @repositories.has_admin(current_user) unless current_user&.zeus? + @title = current_user&.zeus? ? I18n.t('repositories.index.title_zeus') : I18n.t('repositories.index.title') end # GET /repositories/1 diff --git a/app/models/user.rb b/app/models/user.rb index 61900988e2..e530357ad7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -274,6 +274,10 @@ def repository_admin?(repository) @repository_admin.include?(repository.id) end + def a_repository_admin? + zeus? || repositories.any? + end + def personal? institution.nil? end diff --git a/app/views/repositories/index.html.erb b/app/views/repositories/index.html.erb index d63be1605c..b5710719a2 100644 --- a/app/views/repositories/index.html.erb +++ b/app/views/repositories/index.html.erb @@ -2,7 +2,7 @@