Merge pull request #141 from openHPI/fix-user-exercise-feedback-ui
Update exercise feedback UI
This commit is contained in:
@ -95,7 +95,35 @@ a.file-heading {
|
|||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.feedback {
|
.feedback-page {
|
||||||
|
.header {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
border: 1px solid grey;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-feedback {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-header {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.username {
|
||||||
|
flex-grow: 1;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date {}
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback {
|
||||||
.text {
|
.text {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
@ -105,4 +133,5 @@ a.file-heading {
|
|||||||
.worktime {
|
.worktime {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,24 @@
|
|||||||
h1 = @exercise
|
h1 = link_to(@exercise, exercise_path(@exercise))
|
||||||
|
|
||||||
ul.list-unstyled.panel-group#files
|
.feedback-page
|
||||||
|
.header = t('activerecord.attributes.exercise.description')
|
||||||
|
.value = render_markdown(@exercise.description)
|
||||||
|
|
||||||
|
.header = t('activerecord.models.user_exercise_feedback.other')
|
||||||
|
- if @feedbacks.nil? or @feedbacks.size == 0
|
||||||
|
.no-feedback = t('user_exercise_feedback.no_feedback')
|
||||||
|
|
||||||
|
ul.list-unstyled.panel-group
|
||||||
- @feedbacks.each do |feedback|
|
- @feedbacks.each do |feedback|
|
||||||
li.panel.panel-default
|
li.panel.panel-default
|
||||||
.panel-heading role="tab" id="heading"
|
.panel-heading role="tab" id="heading"
|
||||||
div.clearfix
|
div.clearfix.feedback-header
|
||||||
span = feedback.user.name
|
span.username = link_to(feedback.user.name, statistics_external_user_exercise_path(id: @exercise.id, external_user_id: feedback.user.id))
|
||||||
|
span.date = feedback.created_at
|
||||||
.panel-collapse role="tabpanel"
|
.panel-collapse role="tabpanel"
|
||||||
.panel-body.feedback
|
.panel-body.feedback
|
||||||
.text = feedback.feedback_text
|
.text = feedback.feedback_text
|
||||||
.difficulty = "#{t('user_exercise_feedback.difficulty')} #{feedback.difficulty}" if feedback.difficulty
|
.difficulty = "#{t('user_exercise_feedback.difficulty')} #{feedback.difficulty}" if feedback.difficulty
|
||||||
.worktime = "#{t('user_exercise_feedback.working_time')} #{feedback.user_estimated_worktime}" if feedback.user_estimated_worktime
|
.worktime = "#{t('user_exercise_feedback.working_time')} #{feedback.user_estimated_worktime}" if feedback.user_estimated_worktime
|
||||||
|
|
||||||
= render('shared/pagination', collection: @feedbacks)
|
= render('shared/pagination', collection: @feedbacks)
|
||||||
|
@ -662,6 +662,7 @@ de:
|
|||||||
estimated_time_20_to_30: "zwischen 20 und 30 Minuten"
|
estimated_time_20_to_30: "zwischen 20 und 30 Minuten"
|
||||||
estimated_time_more_30: "mehr als 30 Minuten"
|
estimated_time_more_30: "mehr als 30 Minuten"
|
||||||
working_time: "Geschätze Bearbeitungszeit für diese Aufgabe:"
|
working_time: "Geschätze Bearbeitungszeit für diese Aufgabe:"
|
||||||
|
no_feedback: "Es wurde noch kein Feedback zu dieser Aufgabe gegeben."
|
||||||
error_templates:
|
error_templates:
|
||||||
hints:
|
hints:
|
||||||
signature: "Ein regulärer Ausdruck in Ruby-Syntax und ohne führende und schließende \"/\""
|
signature: "Ein regulärer Ausdruck in Ruby-Syntax und ohne führende und schließende \"/\""
|
||||||
|
@ -662,6 +662,7 @@ en:
|
|||||||
estimated_time_20_to_30: "between 20 and 30 minutes"
|
estimated_time_20_to_30: "between 20 and 30 minutes"
|
||||||
estimated_time_more_30: "more than 30 minutes"
|
estimated_time_more_30: "more than 30 minutes"
|
||||||
working_time: "Estimated time working on this exercise:"
|
working_time: "Estimated time working on this exercise:"
|
||||||
|
no_feedback: "There is no feedback for this exercise yet."
|
||||||
error_templates:
|
error_templates:
|
||||||
hints:
|
hints:
|
||||||
signature: "A regular expression in Ruby syntax without leading and trailing \"/\""
|
signature: "A regular expression in Ruby syntax without leading and trailing \"/\""
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
class AddTimestampsToUserExerciseFeedbacks < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
add_column :user_exercise_feedbacks, :created_at, :datetime, null: false, default: Time.now
|
||||||
|
add_column :user_exercise_feedbacks, :updated_at, :datetime, null: false, default: Time.now
|
||||||
|
end
|
||||||
|
end
|
@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20171002131135) do
|
ActiveRecord::Schema.define(version: 20171120153705) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
@ -354,6 +354,8 @@ ActiveRecord::Schema.define(version: 20171002131135) do
|
|||||||
t.integer "working_time_seconds"
|
t.integer "working_time_seconds"
|
||||||
t.string "feedback_text"
|
t.string "feedback_text"
|
||||||
t.integer "user_estimated_worktime"
|
t.integer "user_estimated_worktime"
|
||||||
|
t.datetime "created_at", default: '2017-11-20 18:20:25', null: false
|
||||||
|
t.datetime "updated_at", default: '2017-11-20 18:20:25', null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "user_exercise_interventions", force: :cascade do |t|
|
create_table "user_exercise_interventions", force: :cascade do |t|
|
||||||
|
Reference in New Issue
Block a user