added pagination for all resources

This commit is contained in:
Hauke Klement
2015-03-11 16:13:45 +01:00
parent 400711ac58
commit acf03b1f51
20 changed files with 24 additions and 11 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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]))

View File

@@ -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)

View File

@@ -0,0 +1,3 @@
- if (pagination = will_paginate(collection, container: false)).present?
.text-center
ul.pagination = pagination

View File

@@ -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)

View File

@@ -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)