diff --git a/core/forms/access.py b/core/forms/access.py index a07d2e12..75a183b3 100644 --- a/core/forms/access.py +++ b/core/forms/access.py @@ -1,4 +1,4 @@ -from django.forms import ModelForm, DateInput, ChoiceField +from django.forms import ModelForm, DateInput, ChoiceField, Textarea from core.models import Access, DataLocation @@ -11,7 +11,9 @@ class Meta: widgets = { # Date pickers 'granted_on': DateInput(attrs={'class': 'datepicker'}), - 'grant_expires_on': DateInput(attrs={'class': 'datepicker'}) + 'grant_expires_on': DateInput(attrs={'class': 'datepicker'}), + # Textareas + 'access_notes': Textarea(attrs={'rows': 2, 'cols': 40}), } def __init__(self, *args, **kwargs): @@ -40,7 +42,9 @@ class Meta: widgets = { # Date pickers 'granted_on': DateInput(attrs={'class': 'datepicker'}), - 'grant_expires_on': DateInput(attrs={'class': 'datepicker'}) + 'grant_expires_on': DateInput(attrs={'class': 'datepicker'}), + # Textareas + 'access_notes': Textarea(attrs={'rows': 2, 'cols': 40}), } field_order = [ @@ -56,4 +60,3 @@ def __init__(self, *args, **kwargs): # we don't allow editing dataset self.fields.pop('dataset') self.fields['defined_on_locations'].choices = [(d.id, d) for d in kwargs['instance'].dataset.data_locations.all()] - diff --git a/core/forms/cohort.py b/core/forms/cohort.py index 97867223..707caac5 100644 --- a/core/forms/cohort.py +++ b/core/forms/cohort.py @@ -1,4 +1,4 @@ -from django.forms import ModelForm +from django.forms import ModelForm, Textarea from core.forms.input import SelectWithModal from core.models import Cohort @@ -8,6 +8,9 @@ class CohortForm(ModelForm): class Meta: model = Cohort fields = '__all__' + widgets = { + 'comments': Textarea(attrs={'rows': 2, 'cols': 40}), + } def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/core/forms/contract.py b/core/forms/contract.py index f273aeb9..3a2b41ef 100644 --- a/core/forms/contract.py +++ b/core/forms/contract.py @@ -1,5 +1,5 @@ from django import forms -from django.forms import ModelForm, ModelChoiceField +from django.forms import ModelForm, ModelChoiceField, Textarea from django.utils.text import slugify from core.forms.input import SelectWithModal @@ -11,6 +11,9 @@ class Meta: model = Contract fields = '__all__' exclude = ['partners_roles'] + widgets = { + 'comments': Textarea(attrs={'rows': 2, 'cols': 40}), + } def __init__(self, *args, **kwargs): kwargs['label_suffix'] = "" diff --git a/core/forms/dataset.py b/core/forms/dataset.py index 473920fd..8ad5f843 100644 --- a/core/forms/dataset.py +++ b/core/forms/dataset.py @@ -9,6 +9,10 @@ class DatasetForm(forms.ModelForm): class Meta: model = Dataset fields = ['local_custodians', 'title', 'comments'] + widgets = { + 'comments': forms.Textarea(attrs={'rows': 2, 'cols': 40}), + } + def __init__(self, *args, **kwargs): dataset = None @@ -70,7 +74,7 @@ def save(self, commit=True): class DatasetFormEdit(DatasetForm): class Meta(DatasetForm.Meta): - fields = DatasetForm.Meta.fields +['other_external_id', 'sensitivity'] + fields = DatasetForm.Meta.fields + ['other_external_id', 'sensitivity'] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/core/forms/document.py b/core/forms/document.py index 00e32b44..c772d182 100644 --- a/core/forms/document.py +++ b/core/forms/document.py @@ -1,7 +1,8 @@ from django import forms +from django.forms import DateInput, Textarea + from core.models import Document from core.forms.input import CustomClearableFileInput -from django.forms import DateInput class DocumentForm(forms.ModelForm): @@ -13,10 +14,9 @@ class Meta: 'content': CustomClearableFileInput, 'content_type': forms.HiddenInput(), 'object_id': forms.HiddenInput(), - 'expiry_date': DateInput(attrs={'class': 'datepicker'}) + 'expiry_date': DateInput(attrs={'class': 'datepicker'}), + 'content_notes': Textarea(attrs={'rows': 2, 'cols': 40}), } def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - - diff --git a/core/forms/project.py b/core/forms/project.py index a3c73f19..b4cdf5cd 100644 --- a/core/forms/project.py +++ b/core/forms/project.py @@ -14,6 +14,12 @@ class Meta: # Date pickers 'start_date': DateInput(attrs={'class': 'datepicker'}), 'end_date': DateInput(attrs={'class': 'datepicker'}), + # Smaller text-areas + 'description': forms.Textarea(attrs={'rows': 6, 'cols': 40}), + 'cner_notes': forms.Textarea(attrs={'rows': 2, 'cols': 40}), + 'erp_notes': forms.Textarea(attrs={'rows': 2, 'cols': 40}), + 'comments': forms.Textarea(attrs={'rows': 2, 'cols': 40}), + 'dpia': forms.Textarea(attrs={'rows': 2, 'cols': 40}) } exclude = ['publications', 'contacts'] @@ -129,5 +135,3 @@ class Meta: heading_help = 'Select the the dataset the project uses.' dataset = forms.ModelChoiceField(queryset=Dataset.objects.all(), help_text='Select the dataset.') - - diff --git a/core/forms/share.py b/core/forms/share.py index 1b69b55d..6aedfcb0 100644 --- a/core/forms/share.py +++ b/core/forms/share.py @@ -1,5 +1,5 @@ from django import forms -from django.forms import ModelForm, DateInput +from django.forms import ModelForm, DateInput, Textarea from core.models import Share, Partner, Contract, PartnerRole @@ -12,7 +12,8 @@ class Meta: widgets = { # Date pickers 'granted_on': DateInput(attrs={'class': 'datepicker'}), - 'grant_expires_on': DateInput(attrs={'class': 'datepicker'}) + 'grant_expires_on': DateInput(attrs={'class': 'datepicker'}), + 'share_notes': Textarea(attrs={'rows': 2, 'cols': 40}), } help_texts = { 'contract': '' diff --git a/web/static/css/daisy.scss b/web/static/css/daisy.scss index d6e273cf..2a746a52 100644 --- a/web/static/css/daisy.scss +++ b/web/static/css/daisy.scss @@ -390,3 +390,8 @@ body { color: #d9d9d9; font-weight: bolder; } + +/* Reduce padding in forms */ +form.col-md-12.nice-selects > .form-group.bmd-form-group { + padding-top: 0.75rem; +} \ No newline at end of file diff --git a/web/templates/_includes/field.html b/web/templates/_includes/field.html index 80d12df5..126fe691 100644 --- a/web/templates/_includes/field.html +++ b/web/templates/_includes/field.html @@ -1,7 +1,6 @@ {% load widget_tweaks %}
- {% if field.field.widget.input_type == 'checkbox' %} {% include '_includes/checkbox.html' %} {% elif field.field.widget.input_type == 'radio' %} diff --git a/web/templates/_includes/forms.html b/web/templates/_includes/forms.html index 0754fd7c..ff4c6a99 100644 --- a/web/templates/_includes/forms.html +++ b/web/templates/_includes/forms.html @@ -8,16 +8,22 @@
{% endfor %} -
- {% csrf_token %} - {% for hidden_field in form.hidden_fields %} - {{ hidden_field }} - {% endfor %} - {% for field in form.visible_fields %} - {% include '_includes/field.html' with field=field %} - {% endfor %} + + + + {% csrf_token %} + + {% for hidden_field in form.hidden_fields %} + {{ hidden_field }} + {% endfor %} + + {% for field in form.visible_fields %} + {% include '_includes/field.html' with field=field %} + {% endfor %} {% if not hide_submit %} {% if wizard and wizard_url_name %}
@@ -33,10 +39,11 @@ {% else %} + class="btn btn-primary btn-raised btn-block">{{ submit_label | default:"Submit" }} {% endif %} {% endif %} {% if cancel_button %} - Cancel + Cancel {% endif %} - \ No newline at end of file + + diff --git a/web/templates/_includes/search_form.html b/web/templates/_includes/search_form.html index d896b761..1a995e0f 100644 --- a/web/templates/_includes/search_form.html +++ b/web/templates/_includes/search_form.html @@ -1,27 +1,36 @@
-

Search {{title}}

+

+ Browse {{title}} +

-
-
-
- - +
+
+
+ +
+ + +
+ + + + +
+ +
+ {% if order_by_fields %} +
+
+ {% for field in order_by_fields %} + {% orderbylink search_url field %} + {% endfor %} +
+
+ {% endif %}
- - - - -
- {% if order_by_fields %} -
-
- {% for field in order_by_fields %} - {% orderbylink search_url field %} - {% endfor %}
- {% endif %} -
\ No newline at end of file +
diff --git a/web/templates/about.html b/web/templates/about.html index 357f93cf..755807e8 100644 --- a/web/templates/about.html +++ b/web/templates/about.html @@ -8,7 +8,7 @@

About

-
+
diff --git a/web/templates/cohorts/cohort_form.html b/web/templates/cohorts/cohort_form.html index a7fdd9d4..07175cc2 100644 --- a/web/templates/cohorts/cohort_form.html +++ b/web/templates/cohorts/cohort_form.html @@ -3,7 +3,7 @@ {% block title %}Cohort - Add{% endblock %} {% block content %} -
+

{% block content_title %}Cohort{% endblock %}

@@ -14,4 +14,4 @@

{% block card_title %}Add cohort{% endblock %}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/cohorts/cohort_form_edit.html b/web/templates/cohorts/cohort_form_edit.html index 284c99be..0a3eb0e3 100644 --- a/web/templates/cohorts/cohort_form_edit.html +++ b/web/templates/cohorts/cohort_form_edit.html @@ -1,5 +1,6 @@ {% extends 'cohorts/cohort_form.html' %} -{% block title %}Cohort - Edit{% endblock %} -{% block card_title %}Edit cohort{% endblock %} -{% block content_title %}Cohort "{{ cohort.title }}"{% endblock %} \ No newline at end of file +{% block title %}{% endblock %} +{% block card_title %}Edit cohort - {{ cohort.title }}{% endblock %} +{% block jumbotron_class %}d-none{% endblock %} +{% block content_title %}Cohort {{ cohort.title }}{% endblock %} diff --git a/web/templates/contacts/contact_form.html b/web/templates/contacts/contact_form.html index c9579dd0..203d78ff 100644 --- a/web/templates/contacts/contact_form.html +++ b/web/templates/contacts/contact_form.html @@ -3,7 +3,7 @@ {% block title %}Contact - Add{% endblock %} {% block content %} -
+

{% block content_title %}Contacts{% endblock %}

@@ -17,4 +17,4 @@

{% block card_title %}Add a new contact{% endblock %}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/contacts/contact_form_edit.html b/web/templates/contacts/contact_form_edit.html index 46d7e8ff..197141db 100644 --- a/web/templates/contacts/contact_form_edit.html +++ b/web/templates/contacts/contact_form_edit.html @@ -1,5 +1,6 @@ {% extends 'contacts/contact_form.html' %} -{% block title %}Contact - Edit - {{ contact.full_name }}{% endblock %} -{% block card_title %}Edit contact{% endblock %} -{% block content_title %}{{ contact.full_name }}{% endblock %} \ No newline at end of file +{% block title %}{% endblock %} +{% block jumbotron_class %}d-none{% endblock %} +{% block card_title %}Edit contact - {{ contact.full_name }}{% endblock %} +{% block content_title %}{{ contact.full_name }}{% endblock %} diff --git a/web/templates/contracts/contract_form.html b/web/templates/contracts/contract_form.html index 7170f56a..962534e4 100644 --- a/web/templates/contracts/contract_form.html +++ b/web/templates/contracts/contract_form.html @@ -3,7 +3,7 @@ {% block title %}Contract - Add{% endblock %} {% block content %} -
+

{% block content_title %}Contracts{% endblock %}

@@ -14,4 +14,4 @@

{% block card_title %}Add contract{% endblock %}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/contracts/contract_form_edit.html b/web/templates/contracts/contract_form_edit.html index 232045c2..94b3a3d4 100644 --- a/web/templates/contracts/contract_form_edit.html +++ b/web/templates/contracts/contract_form_edit.html @@ -1,5 +1,6 @@ {% extends 'contracts/contract_form.html' %} -{% block title %}Contract - Edit{% endblock %} -{% block card_title %}Edit contract{% endblock %} -{% block content_title %}{{ contract }}{% endblock %} \ No newline at end of file +{% block title %}{% endblock %} +{% block jumbotron_class %}d-none{% endblock %} +{% block card_title %}Edit - {{ contract }}{% endblock %} +{% block content_title %}{{ contract }}{% endblock %} diff --git a/web/templates/datasets/dataset.html b/web/templates/datasets/dataset.html index 68cdd480..65bdc302 100644 --- a/web/templates/datasets/dataset.html +++ b/web/templates/datasets/dataset.html @@ -105,7 +105,7 @@

{{ dataset.title }}

Data declarations

{% if dataset.data_declarations.all %} -
+
diff --git a/web/templates/datasets/dataset_form.html b/web/templates/datasets/dataset_form.html index fe163f6a..340207bd 100644 --- a/web/templates/datasets/dataset_form.html +++ b/web/templates/datasets/dataset_form.html @@ -3,7 +3,7 @@ {% block title %}Dataset - Add{% endblock %} {% block content %} -
+

{% block content_title %}Datasets{% endblock %}

@@ -16,4 +16,4 @@

{% block card_title %}Add dataset{% endblock %}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/web/templates/datasets/dataset_form_edit.html b/web/templates/datasets/dataset_form_edit.html index ccb33e2b..a07f73d3 100644 --- a/web/templates/datasets/dataset_form_edit.html +++ b/web/templates/datasets/dataset_form_edit.html @@ -1,5 +1,6 @@ {% extends 'datasets/dataset_form.html' %} -{% block title %}Dataset - Edit - {{ dataset.title }}{% endblock %} -{% block card_title %}Edit dataset - {{ dataset.title }}{% endblock %} -{% block content_title %}{{ dataset.title }}{% endblock %} \ No newline at end of file +{% block title %}{% endblock %} +{% block jumbotron_class %}d-none{% endblock %} +{% block card_title %}Edit dataset - {{ dataset.title }}{% endblock %} +{% block content_title %}{{ dataset.title }}{% endblock %} diff --git a/web/templates/datasets/dataset_list.html b/web/templates/datasets/dataset_list.html index b5fcdd7d..b8187750 100644 --- a/web/templates/datasets/dataset_list.html +++ b/web/templates/datasets/dataset_list.html @@ -25,6 +25,3 @@

{{ dataset.title }}

{% empty %}

No results

{% endfor %} - - - diff --git a/web/templates/layout.html b/web/templates/layout.html index b44e5f81..45dc3b3c 100644 --- a/web/templates/layout.html +++ b/web/templates/layout.html @@ -54,7 +54,7 @@

{{ message.tags | title }}

{% endblock %}