Merge pull request #197 from openHPI/feature/anomaly_feedback_ui
Feature/anomaly feedback ui
This commit is contained in:
@@ -114,6 +114,7 @@ a.file-heading {
|
|||||||
|
|
||||||
.feedback-header {
|
.feedback-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
|
||||||
.username {
|
.username {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
@@ -9,4 +9,9 @@ class UserExerciseFeedback < ActiveRecord::Base
|
|||||||
def to_s
|
def to_s
|
||||||
"User Exercise Feedback"
|
"User Exercise Feedback"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def anomaly_notification
|
||||||
|
AnomalyNotification.where({exercise_id: exercise.id, user_id: user_id, user_type: user_type})
|
||||||
|
.where("created_at < ?", created_at).order("created_at DESC").to_a.first
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@@ -14,6 +14,8 @@ h1 = link_to(@exercise, exercise_path(@exercise))
|
|||||||
.panel-heading role="tab" id="heading"
|
.panel-heading role="tab" id="heading"
|
||||||
div.clearfix.feedback-header
|
div.clearfix.feedback-header
|
||||||
span.username = link_to(feedback.user.name, statistics_external_user_exercise_path(id: @exercise.id, external_user_id: feedback.user.id))
|
span.username = link_to(feedback.user.name, statistics_external_user_exercise_path(id: @exercise.id, external_user_id: feedback.user.id))
|
||||||
|
- if feedback.anomaly_notification
|
||||||
|
i class="fa fa-envelope-o" data-placement="top" data-toggle="tooltip" data-container="body" title=feedback.anomaly_notification.reason
|
||||||
span.date = feedback.created_at
|
span.date = feedback.created_at
|
||||||
.panel-collapse role="tabpanel"
|
.panel-collapse role="tabpanel"
|
||||||
.panel-body.feedback
|
.panel-body.feedback
|
||||||
@@ -22,3 +24,5 @@ h1 = link_to(@exercise, exercise_path(@exercise))
|
|||||||
.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)
|
||||||
|
|
||||||
|
script type="text/javascript" $(function () { $('[data-toggle="tooltip"]').tooltip() });
|
||||||
|
Reference in New Issue
Block a user