added pagination for all resources
This commit is contained in:
@@ -14,4 +14,5 @@ h1 = Consumer.model_name.human(count: 2)
|
||||
td = link_to(t('shared.edit'), edit_consumer_path(consumer))
|
||||
td = link_to(t('shared.destroy'), consumer, data: {confirm: t('shared.confirm_destroy')}, method: :delete)
|
||||
|
||||
= render('shared/pagination', collection: @consumers)
|
||||
p = render('shared/new_button', model: Consumer)
|
||||
|
@@ -15,3 +15,5 @@ h1 = ::Error.model_name.human(count: 2)
|
||||
td = error.message
|
||||
td = l(error.created_at, format: :short)
|
||||
td = link_to(t('shared.show'), execution_environment_error_path(params[:execution_environment_id], error))
|
||||
|
||||
p = render('shared/pagination', collection: @errors)
|
||||
|
@@ -20,4 +20,5 @@ h1 = ExecutionEnvironment.model_name.human(count: 2)
|
||||
td = link_to(t('activerecord.models.error.other'), execution_environment_errors_path(execution_environment.id))
|
||||
td = link_to(t('activerecord.models.hint.other'), execution_environment_hints_path(execution_environment.id))
|
||||
|
||||
= render('shared/pagination', collection: @execution_environments)
|
||||
p = render('shared/new_button', model: ExecutionEnvironment)
|
||||
|
@@ -35,4 +35,5 @@ h1 = Exercise.model_name.human(count: 2)
|
||||
td = link_to(t('.implement'), implement_exercise_path(exercise))
|
||||
td = link_to(t('shared.statistics'), statistics_exercise_path(exercise))
|
||||
|
||||
= render('shared/pagination', collection: @exercises)
|
||||
p = render('shared/new_button', model: Exercise)
|
||||
|
@@ -13,3 +13,5 @@ h1 = ExternalUser.model_name.human(count: 2)
|
||||
td = user.name
|
||||
td = link_to(user.consumer, user.consumer)
|
||||
td = link_to(t('shared.show'), user)
|
||||
|
||||
= render('shared/pagination', collection: @users)
|
||||
|
@@ -18,4 +18,5 @@ h1 = FileType.model_name.human(count: 2)
|
||||
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)
|
||||
|
||||
= render('shared/pagination', collection: @file_types)
|
||||
p = render('shared/new_button', model: FileType)
|
||||
|
@@ -16,4 +16,5 @@ h1 = Hint.model_name.human(count: 2)
|
||||
td = link_to(t('shared.edit'), edit_execution_environment_hint_path(params[:execution_environment_id], hint.id))
|
||||
td = link_to(t('shared.destroy'), execution_environment_hint_path(params[:execution_environment_id], hint.id), data: {confirm: t('shared.confirm_destroy')}, method: :delete)
|
||||
|
||||
= render('shared/pagination', collection: @hints)
|
||||
p = render('shared/new_button', model: Hint, path: new_execution_environment_hint_path(params[:execution_environment_id]))
|
||||
|
@@ -31,4 +31,5 @@ h1 = InternalUser.model_name.human(count: 2)
|
||||
- if policy(user).destroy?
|
||||
= link_to(t('shared.destroy'), user, data: {confirm: t('shared.confirm_destroy')}, method: :delete)
|
||||
|
||||
= render('shared/pagination', collection: @users)
|
||||
p = render('shared/new_button', model: InternalUser)
|
||||
|
3
app/views/shared/_pagination.html.slim
Normal file
3
app/views/shared/_pagination.html.slim
Normal file
@@ -0,0 +1,3 @@
|
||||
- if (pagination = will_paginate(collection, container: false)).present?
|
||||
.text-center
|
||||
ul.pagination = pagination
|
@@ -29,5 +29,4 @@ h1 = Submission.model_name.human(count: 2)
|
||||
td = link_to(t('shared.show'), submission)
|
||||
td = link_to(t('shared.statistics'), statistics_submission_path(submission))
|
||||
|
||||
.text-center
|
||||
ul.pagination = will_paginate(@submissions, container: false)
|
||||
= render('shared/pagination', collection: @submissions)
|
||||
|
@@ -16,4 +16,5 @@ h1 = Team.model_name.human(count: 2)
|
||||
td = link_to(t('shared.edit'), edit_team_path(team.id))
|
||||
td = link_to(t('shared.destroy'), team_path(team.id), data: {confirm: t('shared.confirm_destroy')}, method: :delete)
|
||||
|
||||
= render('shared/pagination', collection: @teams)
|
||||
p = render('shared/new_button', model: Team, path: new_team_path)
|
||||
|
Reference in New Issue
Block a user