diff --git a/hypha/apply/activity/forms.py b/hypha/apply/activity/forms.py index 13462fa88b3bb7182a97fc6c0fbfb7a588514e4d..c623f92503a30bb7163e8ba2803fa6681033c2bc 100644 --- a/hypha/apply/activity/forms.py +++ b/hypha/apply/activity/forms.py @@ -1,9 +1,8 @@ from django import forms from django.core.exceptions import ValidationError -from django.utils.safestring import mark_safe from pagedown.widgets import PagedownWidget -from .models import VISIBILILTY_HELP_TEXT, VISIBILITY, Activity +from .models import Activity class CommentForm(forms.ModelForm): @@ -28,9 +27,6 @@ class CommentForm(forms.ModelForm): visibility.initial = self.visibility_choices[1] if user.is_apply_staff else self.visibility_choices[0] if len(self.visibility_choices) > 1: visibility.choices = self.visibility_choices - visibility.help_text = mark_safe('<br>'.join( - [VISIBILITY[choice] + ': ' + VISIBILILTY_HELP_TEXT[choice] for choice in self.allowed_visibility] - )) else: visibility.widget = forms.HiddenInput() diff --git a/hypha/apply/activity/models.py b/hypha/apply/activity/models.py index cbd82e72060d406a929c30b2dd18630d3d6a2989..fb80820c5e787d9483540241aad835f184da3072 100644 --- a/hypha/apply/activity/models.py +++ b/hypha/apply/activity/models.py @@ -21,15 +21,6 @@ REVIEWER = 'reviewers' PARTNER = 'partners' ALL = 'all' -VISIBILILTY_HELP_TEXT = { - APPLICANT: 'Visible to applicant and team.', - TEAM: 'Visible only to team.', - REVIEWER: 'Visible to reviewers and team.', - PARTNER: 'Visible to partners and team.', - ALL: 'Visible to any user who has access to the submission.', -} - - VISIBILITY = { APPLICANT: 'Applicant(s)', TEAM: 'Team', diff --git a/hypha/apply/templates/forms/includes/field.html b/hypha/apply/templates/forms/includes/field.html index 4d69a78e767211a5b7b86b9e9c4dfa94c23e5c7f..629a6e248b2c7066368bd79a38bed5166262ff3f 100644 --- a/hypha/apply/templates/forms/includes/field.html +++ b/hypha/apply/templates/forms/includes/field.html @@ -1,7 +1,7 @@ {% load util_tags %} {% with widget_type=field|widget_type field_type=field|field_type %} -<div class="form__group {% if widget_type == 'checkbox_input' %} form__group--checkbox{% endif %}{% if widget_type == 'clearable_file_input' or widget_type == 'multi_file_input' or widget_type == 'single_file_field_widget' or widget_type == 'multi_file_field_widget' %} form__group--file{% endif %}{% if field.help_text %} form__group--wrap{% endif %}{% if field.errors %} form__error{% endif %}{% if is_application and field.field.group_number > 1 %} field-group field-group-{{ field.field.group_number }}{% endif %}{% if is_application and field.field.grouper_for %} form-fields-grouper{% endif %}"{% if is_application and field.field.grouper_for %}data-grouper-for="{{ field.field.grouper_for }}" data-toggle-on="{{ field.field.choices.0.0 }}" data-toggle-off="{{ field.field.choices.1.0 }}"{% endif %}{% if is_application and field.field.group_number > 1 %} data-hidden="{% if not show_all_group_fields and not field.field.visible %}true{% else %}false{% endif %}" data-required="{{ field.field.required_when_visible }}"{% endif %}{% if field.field.word_limit %} data-word-limit="{{ field.field.word_limit }}"{% endif %}> +<div class="form__group {{ field.id_for_label }} {% if widget_type == 'checkbox_input' %} form__group--checkbox{% endif %}{% if widget_type == 'clearable_file_input' or widget_type == 'multi_file_input' or widget_type == 'single_file_field_widget' or widget_type == 'multi_file_field_widget' %} form__group--file{% endif %}{% if field.help_text %} form__group--wrap{% endif %}{% if field.errors %} form__error{% endif %}{% if is_application and field.field.group_number > 1 %} field-group field-group-{{ field.field.group_number }}{% endif %}{% if is_application and field.field.grouper_for %} form-fields-grouper{% endif %}"{% if is_application and field.field.grouper_for %}data-grouper-for="{{ field.field.grouper_for }}" data-toggle-on="{{ field.field.choices.0.0 }}" data-toggle-off="{{ field.field.choices.1.0 }}"{% endif %}{% if is_application and field.field.group_number > 1 %} data-hidden="{% if not show_all_group_fields and not field.field.visible %}true{% else %}false{% endif %}" data-required="{{ field.field.required_when_visible }}"{% endif %}{% if field.field.word_limit %} data-word-limit="{{ field.field.word_limit }}"{% endif %}> {% if widget_type == 'clearable_file_input' or widget_type == 'multi_file_input' or widget_type == 'single_file_field_widget' or widget_type == 'multi_file_field_widget'%} <span class="form__question">{{ field.label }}</span> <label for="{{ field.id_for_label }}" class="form__question form__question--{{ field_type }} {{ widget_type }}" {% if field.field.required %}required{% endif %}> diff --git a/hypha/static_src/src/sass/apply/components/_form.scss b/hypha/static_src/src/sass/apply/components/_form.scss index afacb6f7d1b6dfd86e6ac9ea00df8ee6aa26609a..5b87a18e6349997bb86d06eadc9e29222fc3186f 100644 --- a/hypha/static_src/src/sass/apply/components/_form.scss +++ b/hypha/static_src/src/sass/apply/components/_form.scss @@ -335,6 +335,45 @@ } } + &__comments { + display: grid; + grid-template-areas: 'message' + 'visibility' + 'actions'; + grid-template-rows: auto + auto + auto; + grid-template-columns: 1fr; + + + @include media-query(tablet-landscape) { + grid-template-areas: 'message visibility' + 'actions actions'; + grid-template-rows: auto + auto; + grid-template-columns: 2fr 1fr; + column-gap: 2rem; + + .wmd-input { + max-width: 100%; + } + } + + .id_message { + grid-area: message; + } + + .id_visibility_0 { + grid-area: visibility; + } + + #comment_form-submit { + grid-area: actions; + max-width: 210px; + text-align: center; + } + } + select, input[type='url'], input[type='text']:not(.input--secondary), diff --git a/hypha/static_src/src/sass/apply/components/_grid.scss b/hypha/static_src/src/sass/apply/components/_grid.scss index db5479bffca6d4306ecddc82264be032b0503471..5c5bb7afba76b6b33b0f54610a95d12a91690b8b 100644 --- a/hypha/static_src/src/sass/apply/components/_grid.scss +++ b/hypha/static_src/src/sass/apply/components/_grid.scss @@ -56,12 +56,7 @@ } .wrapper--comments & { - max-width: 800px; - margin-bottom: 0; - - @include media-query(mob-landscape) { - grid-template-columns: repeat(auto-fit, 200px 200px); - } + grid-template-columns: 1fr; } + br {