Code Cleanup: Usage of Polymorphic User instead of ExternalUser and InternalUser

Renamed requestor_user_id -> user_id
Index of request_for_comments now returns the n (5?) newest requests per user. Solved via sliding windows in postgres, code added to model.
Added route to /my_request_for_comments/ that shows all requests for the current user.
Changed view from ERB to slim
This commit is contained in:
Ralf Teusner
2015-09-03 19:04:38 +02:00
parent 8e9f19f41d
commit d292fec47c
15 changed files with 78 additions and 47 deletions

View File

@ -73,6 +73,11 @@ de:
password: Passwort
password_confirmation: Passwort-Bestätigung
role: Rolle
request_for_comments:
exercise: Aufgabe
execution_environment: Sprache
username: Benutzername
requested_at: Angefragezeitpunkt
submission:
cause: Anlass
code: Code
@ -176,7 +181,7 @@ de:
run: Ausführen
run_failure: Ihr Code konnte nicht auf der Plattform ausgeführt werden.
run_success: Ihr Code wurde auf der Plattform ausgeführt.
requestComments: Rückmeldung erbitten
requestComments: Kommentare erbitten
save: Speichern
score: Bewerten
start_over: Von vorne anfangen
@ -272,6 +277,9 @@ de:
reset_password:
body: 'Bitte besuchen Sie %{link}, sofern Sie Ihr Passwort zurücksetzen wollen.'
subject: Anweisungen zum Zurücksetzen Ihres Passworts
request_for_comments:
index:
get_my_comment_requests: Meine Kommentaranfragen
sessions:
create:
failure: Fehlerhafte E-Mail oder Passwort.

View File

@ -73,6 +73,11 @@ en:
password: Password
password_confirmation: Passwort Confirmation
role: Role
request_for_comments:
exercise: Exercise
execution_environment: Language
username: Username
requested_at: Request Date
submission:
cause: Cause
code: Code
@ -272,6 +277,9 @@ en:
reset_password:
body: 'Please visit %{link} if you want to reset your password.'
subject: Password reset instructions
request_for_comments:
index:
get_my_comment_requests: My Requests for Comments
sessions:
create:
failure: Invalid email or password.

View File

@ -2,6 +2,7 @@ FILENAME_REGEXP = /[\w\.]+/ unless Kernel.const_defined?(:FILENAME_REGEXP)
Rails.application.routes.draw do
resources :request_for_comments
get '/my_request_for_comments', as: 'my_request_for_comments', to: 'request_for_comments#get_my_comment_requests'
resources :comments, except: [:destroy] do
collection do
delete :destroy