Implement index page
This commit is contained in:
@ -3,7 +3,7 @@ class ExerciseCollectionsController < ApplicationController
|
|||||||
before_action :set_exercise_collection, only: [:show]
|
before_action :set_exercise_collection, only: [:show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@exercise_collections = ExerciseCollection.all
|
@exercise_collections = ExerciseCollection.all.paginate(:page => params[:page])
|
||||||
authorize!
|
authorize!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1 +1,24 @@
|
|||||||
h1 = 'ExerciseCollections#index'
|
h1 = ExerciseCollection.model_name.human(count: 2)
|
||||||
|
|
||||||
|
.table-responsive
|
||||||
|
table.table
|
||||||
|
thead
|
||||||
|
tr
|
||||||
|
th = t('activerecord.attributes.exercise_collections.id')
|
||||||
|
th = t('activerecord.attributes.exercise_collections.name')
|
||||||
|
th = t('activerecord.attributes.exercise_collections.updated_at')
|
||||||
|
th = t('activerecord.attributes.exercise_collections.exercises')
|
||||||
|
th colspan=3 = t('shared.actions')
|
||||||
|
tbody
|
||||||
|
- @exercise_collections.each do |collection|
|
||||||
|
tr
|
||||||
|
td = collection.id
|
||||||
|
td = link_to(collection.name, collection)
|
||||||
|
td = collection.updated_at
|
||||||
|
td = collection.exercises.size
|
||||||
|
td = link_to(t('shared.show'), collection)
|
||||||
|
td = link_to(t('shared.edit'), edit_exercise_collection_path(collection))
|
||||||
|
td = link_to(t('shared.destroy'), collection, data: {confirm: t('shared.confirm_destroy')}, method: :delete)
|
||||||
|
|
||||||
|
= render('shared/pagination', collection: @exercise_collections)
|
||||||
|
p = render('shared/new_button', model: ExerciseCollection)
|
@ -111,6 +111,11 @@ de:
|
|||||||
name: "Name"
|
name: "Name"
|
||||||
file_type: "Dateityp"
|
file_type: "Dateityp"
|
||||||
content: "Code"
|
content: "Code"
|
||||||
|
exercise_collections:
|
||||||
|
id: "ID"
|
||||||
|
name: "Name"
|
||||||
|
updated_at: "Letzte Änderung"
|
||||||
|
exercises: "Aufgaben"
|
||||||
models:
|
models:
|
||||||
code_harbor_link:
|
code_harbor_link:
|
||||||
one: CodeHarbor-Link
|
one: CodeHarbor-Link
|
||||||
@ -127,6 +132,9 @@ de:
|
|||||||
exercise:
|
exercise:
|
||||||
one: Aufgabe
|
one: Aufgabe
|
||||||
other: Aufgaben
|
other: Aufgaben
|
||||||
|
exercise_collection:
|
||||||
|
one: Aufgabesammlung
|
||||||
|
other: Aufgabensammlungen
|
||||||
proxy_exercise:
|
proxy_exercise:
|
||||||
one: Proxy Aufgabe
|
one: Proxy Aufgabe
|
||||||
other: Proxy Aufgaben
|
other: Proxy Aufgaben
|
||||||
|
@ -111,6 +111,11 @@ en:
|
|||||||
name: "Name"
|
name: "Name"
|
||||||
file_type: "File Type"
|
file_type: "File Type"
|
||||||
content: "Content"
|
content: "Content"
|
||||||
|
exercise_collections:
|
||||||
|
id: "ID"
|
||||||
|
name: "Name"
|
||||||
|
updated_at: "Last Update"
|
||||||
|
exercises: "Exercises"
|
||||||
models:
|
models:
|
||||||
code_harbor_link:
|
code_harbor_link:
|
||||||
one: CodeHarbor Link
|
one: CodeHarbor Link
|
||||||
@ -127,6 +132,9 @@ en:
|
|||||||
exercise:
|
exercise:
|
||||||
one: Exercise
|
one: Exercise
|
||||||
other: Exercises
|
other: Exercises
|
||||||
|
exercise_collection:
|
||||||
|
one: Exercise Collection
|
||||||
|
other: Exercise Collections
|
||||||
proxy_exercise:
|
proxy_exercise:
|
||||||
one: Proxy Exercise
|
one: Proxy Exercise
|
||||||
other: Proxy Exercises
|
other: Proxy Exercises
|
||||||
|
Reference in New Issue
Block a user