Add ProgrammingGroup & ProgrammingGroupMembership
* User can create programming group with other users for exercise * Submission is shared in a group * Also adjust specs
This commit is contained in:

committed by
Sebastian Serth

parent
0234414bae
commit
319c3ab3b4
7
app/views/programming_groups/_form.html.slim
Normal file
7
app/views/programming_groups/_form.html.slim
Normal file
@ -0,0 +1,7 @@
|
||||
= form_for(@programming_group, url: exercise_programming_groups_path) do |f|
|
||||
= render('shared/form_errors', object: @programming_group)
|
||||
.mb-3
|
||||
= f.label(:programming_partner_ids, class: 'form-label')
|
||||
= f.text_field(:programming_partner_ids, class: 'form-control', required: true, value: (@programming_group.programming_partner_ids - [current_user.id_with_type]).join(', '))
|
||||
.help-block.form-text = t('.hints.programming_partner_ids')
|
||||
.actions.mb-0 = render('shared/submit_button', f: f, object: @programming_group)
|
14
app/views/programming_groups/new.html.slim
Normal file
14
app/views/programming_groups/new.html.slim
Normal file
@ -0,0 +1,14 @@
|
||||
h1 = t('shared.new_model', model: ProgrammingGroup.model_name.human)
|
||||
p
|
||||
=> t('programming_groups.new.own_user_id')
|
||||
b
|
||||
= current_user.id_with_type
|
||||
p
|
||||
= t('programming_groups.new.enter_partner_id', exercise_title: @exercise.title)
|
||||
= render('form')
|
||||
|
||||
div.mt-4
|
||||
a.btn.btn-success href=new_exercise_programming_group_path(@exercise) == t('programming_groups.new.check_invitation')
|
||||
|
||||
p.mt-4
|
||||
== t('programming_groups.new.work_alone', path: implement_exercise_path(@exercise))
|
Reference in New Issue
Block a user