Rethink permissions in CodeOcean for usage in schools and adopt views

This commit is contained in:
Sebastian Serth
2018-11-27 17:05:38 +01:00
parent 7a63a9c1c1
commit d3f67ab4c7
17 changed files with 47 additions and 76 deletions

View File

@@ -11,12 +11,12 @@ h1 = FileType.model_name.human(count: 2)
tbody
- @file_types.each do |file_type|
tr
td = link_to(file_type.name, file_type)
td = link_to(file_type.author, file_type.author)
td = link_to_if(policy(file_type).show?, file_type.name, file_type)
td = link_to_if(policy(file_type.author).show?, file_type.author, file_type.author)
td = file_type.file_extension
td = link_to(t('shared.show'), file_type)
td = link_to(t('shared.edit'), edit_file_type_path(file_type))
td = link_to(t('shared.destroy'), file_type, data: {confirm: t('shared.confirm_destroy')}, method: :delete)
td = link_to(t('shared.show'), file_type) if policy(file_type).show?
td = link_to(t('shared.edit'), edit_file_type_path(file_type)) if policy(file_type).edit?
td = link_to(t('shared.destroy'), file_type, data: {confirm: t('shared.confirm_destroy')}, method: :delete) if policy(file_type).destroy?
= render('shared/pagination', collection: @file_types)
p = render('shared/new_button', model: FileType)