Add UI for anomaly detection flag

This commit is contained in:
Maximilian Grundke
2017-12-13 07:37:49 +01:00
parent 041f080191
commit 7ed78a2cfd
5 changed files with 7 additions and 1 deletions

View File

@ -47,6 +47,6 @@ class ExerciseCollectionsController < ApplicationController
end
def exercise_collection_params
params[:exercise_collection].permit(:name, :user_id, :user_type, :exercise_ids => [])
params[:exercise_collection].permit(:name, :use_anomaly_detection, :user_id, :user_type, :exercise_ids => [])
end
end

View File

@ -6,6 +6,9 @@
.form-group
= f.label(t('activerecord.attributes.exercise_collections.name'))
= f.text_field(:name, class: 'form-control', required: true)
.form-group
= f.label(t('activerecord.attributes.exercise_collections.use_anomaly_detection'))
= f.check_box(:use_anomaly_detection, {class: 'form-control'})
.form-group
= f.label(t('activerecord.attributes.exercise_collections.user'))
= f.collection_select(:user_id, users, :id, :name, {}, {class: 'form-control'})

View File

@ -4,6 +4,7 @@ h1
= row(label: 'exercise_collections.name', value: @exercise_collection.name)
= row(label: 'exercise_collections.user', value: link_to(@exercise_collection.user.name, @exercise_collection.user))
= row(label: 'exercise_collections.use_anomaly_detection', value: @exercise_collection.use_anomaly_detection)
= row(label: 'exercise_collections.updated_at', value: @exercise_collection.updated_at)
h4 = t('activerecord.attributes.exercise_collections.exercises')

View File

@ -125,6 +125,7 @@ de:
id: "ID"
name: "Name"
user: "Verantwortlicher"
use_anomaly_detection: "Abweichungen in der Arbeitszeit erkennen"
updated_at: "Letzte Änderung"
exercises: "Aufgaben"
models:

View File

@ -125,6 +125,7 @@ en:
id: "ID"
name: "Name"
user: "Associated User"
use_anomaly_detection: "Enable Worktime Anomaly Detection"
updated_at: "Last Update"
exercises: "Exercises"
models: