diff --git a/mamweb/static/css/mamweb.css b/mamweb/static/css/mamweb.css index 63c5f527..3833ff92 100644 --- a/mamweb/static/css/mamweb.css +++ b/mamweb/static/css/mamweb.css @@ -1255,3 +1255,8 @@ div.gdpr { label[for=id_skola] { font-weight: bold; } + +/* detail řešení */ +.bodovani>input { + width: 4em; +} diff --git a/odevzdavatko/forms.py b/odevzdavatko/forms.py index a31122dd..8b71cff4 100644 --- a/odevzdavatko/forms.py +++ b/odevzdavatko/forms.py @@ -103,6 +103,22 @@ class JednoHodnoceniForm(forms.ModelForm): 'feedback': forms.Textarea(attrs={'rows': 1, 'cols': 30, 'class': 'feedback'}), } + body_celkem = forms.DecimalField(required=False, decimal_places=1) + body_neprepocitane = forms.DecimalField(required=False, decimal_places=1) + body_neprepocitane_celkem = forms.DecimalField(required=False, decimal_places=1) + + def __init__(self, *args, initial=None, **kwargs): + if initial is not None: + body_max = initial["body_max"] + body_neprepocitane_max = initial["body_neprepocitane_max"] + del(initial["body_max"]) + del(initial["body_neprepocitane_max"]) + super().__init__(*args, initial=initial, **kwargs) + if initial is not None: + self.fields['body_celkem'].widget.attrs['placeholder'] = body_max + self.fields['body_neprepocitane_celkem'].widget.attrs['placeholder'] = body_neprepocitane_max + + OhodnoceniReseniFormSet = formset_factory(JednoHodnoceniForm, extra = 0, ) diff --git a/odevzdavatko/templates/odevzdavatko/detail.html b/odevzdavatko/templates/odevzdavatko/detail.html index 06f69609..c605b701 100644 --- a/odevzdavatko/templates/odevzdavatko/detail.html +++ b/odevzdavatko/templates/odevzdavatko/detail.html @@ -54,12 +54,15 @@ {{ form.management_form }}