diff --git a/.dockerignore b/.dockerignore index 2a87a513f9..9c80bf416e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,6 +2,12 @@ .git .gitignore +.venv +__pycache__/ +*.pyc +node_modules + + # everything in gitignore *.py[cod] *.swp diff --git a/Containerfile.debugpy b/Containerfile.debugpy index 250f90d963..e4cb4cb946 100644 --- a/Containerfile.debugpy +++ b/Containerfile.debugpy @@ -29,9 +29,8 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* WORKDIR /app +COPY uv.lock pyproject.toml ./ RUN --mount=type=cache,target=/root/.cache/uv \ - --mount=type=bind,source=uv.lock,target=uv.lock \ - --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ uv sync --locked --no-install-project COPY . /app RUN --mount=type=cache,target=/root/.cache/uv \ diff --git a/coldfront/config/base.py b/coldfront/config/base.py index b1b2559051..2732de94ac 100644 --- a/coldfront/config/base.py +++ b/coldfront/config/base.py @@ -60,7 +60,7 @@ INSTALLED_APPS += [ "crispy_forms", - "crispy_bootstrap4", + "crispy_bootstrap5", "django_q", "simple_history", "django_vite", @@ -151,7 +151,9 @@ else: raise ImproperlyConfigured("SITE_TEMPLATES should be a path to a directory") -CRISPY_TEMPLATE_PACK = "bootstrap4" +CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5" +CRISPY_TEMPLATE_PACK = "bootstrap5" + SETTINGS_EXPORT = [] STATIC_URL = "/static/" diff --git a/coldfront/core/allocation/templates/allocation/allocation_account_list.html b/coldfront/core/allocation/templates/allocation/allocation_account_list.html index 0a9373d260..c24c1db737 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_account_list.html +++ b/coldfront/core/allocation/templates/allocation/allocation_account_list.html @@ -11,7 +11,7 @@ {% block content %}

Allocation Accounts

-
+
diff --git a/coldfront/core/allocation/templates/allocation/allocation_add_users.html b/coldfront/core/allocation/templates/allocation/allocation_add_users.html index 62b0950f0a..f00e35f609 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_add_users.html +++ b/coldfront/core/allocation/templates/allocation/allocation_add_users.html @@ -22,7 +22,7 @@

Add users to allocation for project: {{allocation.project.title}}

- + # Username diff --git a/coldfront/core/allocation/templates/allocation/allocation_allocationattribute_delete.html b/coldfront/core/allocation/templates/allocation/allocation_allocationattribute_delete.html index c23a4629fb..3a3d2d3667 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_allocationattribute_delete.html +++ b/coldfront/core/allocation/templates/allocation/allocation_allocationattribute_delete.html @@ -22,7 +22,7 @@

Delete allocation attributes from allocation for project: {{allocation.proje - + Name Value diff --git a/coldfront/core/allocation/templates/allocation/allocation_change.html b/coldfront/core/allocation/templates/allocation/allocation_change.html index b639d487f7..06e01278a9 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_change.html +++ b/coldfront/core/allocation/templates/allocation/allocation_change.html @@ -1,135 +1,135 @@ -{% extends "common/base.html" %} -{% load crispy_forms_tags %} -{% load static %} - - -{% block title %} -Request Allocation Change -{% endblock %} - - -{% block content %} - -

Request change to {{ allocation.get_parent_resource }} for project: {{ allocation.project.title }}

-
- -

- Request changes to an existing allocation using the form below. For each change - you must provide a justification. -

- -
-
-
-

Allocation Information

-
- -
- {% csrf_token %} -
- - - - - - - - - - - - - - - - - - - - - - - - - - {% if allocation.is_changeable %} - - - - - {% endif %} - - - - - - - - - - - - - - {% if allocation.is_locked %} - - - {% else %} - - - {% endif %} - -
Project:{{ allocation.project }}
Resource{{ allocation.resources.all|pluralize }} in allocation:{{ allocation.get_resources_as_string }}
Justification:{{ allocation.justification }}
Status:{{ allocation.status }}
Start Date:{{ allocation.start_date }}
End Date: - {{ allocation.end_date }} - {% if allocation.is_locked and allocation.status.name == 'Active' and allocation.expires_in <= 60 and allocation.expires_in >= 0 %} - - Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}} - Not renewable - - {% endif %} -
Request End Date Extension: - {{ form.end_date_extension }} -
Description:{{allocation.description|default_if_none:""}}
Created:{{ allocation.created|date:"M. d, Y" }}
Last Modified:{{ allocation.modified|date:"M. d, Y" }}
LockedUnlocked
-
-
-
- - {% if formset %} -
-
-

Allocation Attributes

-
-
-
- - - - - - - - - - {% for form in formset %} - - - - - - {% endfor %} - -
AttributeCurrent ValueRequest New Value
{{form.name.value}}{{form.value.value}}{{form.new_value}}
-
- {{ formset.management_form }} -
-
- {% endif %} - -
- {{form.justification | as_crispy_field }} - - Back to - Allocation
-
-
- -{% endblock %} +{% extends "common/base.html" %} +{% load crispy_forms_tags %} +{% load static %} + + +{% block title %} +Request Allocation Change +{% endblock %} + + +{% block content %} + +

Request change to {{ allocation.get_parent_resource }} for project: {{ allocation.project.title }}

+
+ +

+ Request changes to an existing allocation using the form below. For each change + you must provide a justification. +

+ +
+
+
+

Allocation Information

+
+ +
+ {% csrf_token %} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + {% if allocation.is_changeable %} + + + + + {% endif %} + + + + + + + + + + + + + + {% if allocation.is_locked %} + + + {% else %} + + + {% endif %} + +
Project:{{ allocation.project }}
Resource{{ allocation.resources.all|pluralize }} in allocation:{{ allocation.get_resources_as_string }}
Justification:{{ allocation.justification }}
Status:{{ allocation.status }}
Start Date:{{ allocation.start_date }}
End Date: + {{ allocation.end_date }} + {% if allocation.is_locked and allocation.status.name == 'Active' and allocation.expires_in <= 60 and allocation.expires_in >= 0 %} + + Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}} - Not renewable + + {% endif %} +
Request End Date Extension: + {{ form.end_date_extension }} +
Description:{{allocation.description|default_if_none:""}}
Created:{{ allocation.created|date:"M. d, Y" }}
Last Modified:{{ allocation.modified|date:"M. d, Y" }}
LockedUnlocked
+
+
+
+ + {% if formset %} +
+
+

Allocation Attributes

+
+
+
+ + + + + + + + + + {% for form in formset %} + + + + + + {% endfor %} + +
AttributeCurrent ValueRequest New Value
{{form.name.value}}{{form.value.value}}{{form.new_value}}
+
+ {{ formset.management_form }} +
+
+ {% endif %} + +
+ {{form.justification | as_crispy_field }} + + Back to + Allocation
+
+
+ +{% endblock %} diff --git a/coldfront/core/allocation/templates/allocation/allocation_change_detail.html b/coldfront/core/allocation/templates/allocation/allocation_change_detail.html index df6dd86d5f..12a0de7bb1 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_change_detail.html +++ b/coldfront/core/allocation/templates/allocation/allocation_change_detail.html @@ -1,225 +1,225 @@ -{% extends "common/base.html" %} -{% load crispy_forms_tags %} -{% load static %} - - -{% block title %} -Allocation Change Detail -{% endblock %} - - -{% block content %} - -

Change requested to {{ allocation_change.allocation.get_parent_resource }} for project: {{ allocation_change.allocation.project.title }}

-
- - {% if allocation_change.status.name == "Approved" %} - - {% elif allocation_change.status.name == "Denied"%} - - {% else %} - - {% endif %} - -
-
-
-

Allocation Information

-
- -
- {% csrf_token %} -
- - - - - - - - - - - - - - - - - - - - - - - - - - {% if allocation_change.allocation.is_changeable %} - - - - - {% endif %} - - - - - - - - - - - - - - {% if allocation_change.allocation.is_locked %} - - - {% else %} - - - {% endif %} - -
Project:{{ allocation_change.allocation.project }}
Resource{{ allocation_change.allocation.resources.all|pluralize }} in allocation:{{ allocation_change.allocation.get_resources_as_string }}
Justification:{{ allocation_change.allocation.justification }}
Status:{{ allocation_change.allocation.status }}
Start Date:{{ allocation_change.allocation.start_date }}
End Date: - {{ allocation_change.allocation.end_date }} - {% if allocation_change.allocation.is_locked and allocation_change.allocation.status.name == 'Approved' and allocation_change.allocation.expires_in <= 60 and allocation_change.allocation.expires_in >= 0 %} - - Expires in {{allocation_change.allocation.expires_in}} day{{allocation_change.allocation.expires_in|pluralize}} - Not renewable - - {% endif %} -
Requested End Date Extension: - {{allocation_change_form.end_date_extension}} -
Description:{{ allocation_change.allocation.description|default_if_none:"" }}
Change Requested:{{ allocation_change.created|date:"M. d, Y" }}
Change Last Modified:{{ allocation_change.modified|date:"M. d, Y" }}
LockedUnlocked
-
-
-
- - -
-
-

Allocation Attributes

-
-
- {% if attribute_changes %} -
- - - - - {% if allocation_change.status.name == 'Pending' %} - - {% endif %} - - - - - {% for form in formset %} - - - {% if allocation_change.status.name == 'Pending' %} - - {% if request.user.is_superuser %} - - {% else %} - - {% endif %} - {% else %} - {% if form.new_value.value == '' %} - - {% else %} - - {% endif %} - {% endif %} - - {% endfor %} - -
AttributeCurrent ValueRequested New Value
{{form.name.value}}{{form.value.value}} - {{form.new_value}} - - - - {{form.new_value.value}}None{{form.new_value.value}}
-
- {% else %} - - {% endif %} - {{ formset.management_form }} -
-
- -

{{allocation_change_form.justification | as_crispy_field}}

- -
- - {% if request.user.is_superuser %} -
-
-

Actions

-
-
- - - {% csrf_token %} - {{note_form.notes | as_crispy_field}} -
- {% if allocation_change.status.name == 'Pending' %} - - - {% endif %} - -
-
-
-
- {% endif %} - - - - - View Allocation - - {% if request.user.is_superuser %} - - See all allocation change requests - - {% endif %} -
- -{% endblock %} - -{% block javascript %} -{{ block.super }} - -{% endblock %} - +{% extends "common/base.html" %} +{% load crispy_forms_tags %} +{% load static %} + + +{% block title %} +Allocation Change Detail +{% endblock %} + + +{% block content %} + +

Change requested to {{ allocation_change.allocation.get_parent_resource }} for project: {{ allocation_change.allocation.project.title }}

+
+ + {% if allocation_change.status.name == "Approved" %} + + {% elif allocation_change.status.name == "Denied"%} + + {% else %} + + {% endif %} + +
+
+
+

Allocation Information

+
+ +
+ {% csrf_token %} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% if allocation_change.allocation.is_changeable %} + + + + + {% endif %} + + + + + + + + + + + + + + {% if allocation_change.allocation.is_locked %} + + + {% else %} + + + {% endif %} + +
Project:{{ allocation_change.allocation.project }}
Allocation ID:{{ allocation_change.allocation.pk }}
Resource{{ allocation_change.allocation.resources.all|pluralize }} in allocation:{{ allocation_change.allocation.get_resources_as_string }}
Justification:{{ allocation_change.allocation.justification }}
Status:{{ allocation_change.allocation.status }}
Start Date:{{ allocation_change.allocation.start_date }}
End Date: + {{ allocation_change.allocation.end_date }} + {% if allocation_change.allocation.is_locked and allocation_change.allocation.status.name == 'Approved' and allocation_change.allocation.expires_in <= 60 and allocation_change.allocation.expires_in >= 0 %} + + Expires in {{allocation_change.allocation.expires_in}} day{{allocation_change.allocation.expires_in|pluralize}} - Not renewable + + {% endif %} +
Requested End Date Extension: + {{allocation_change_form.end_date_extension}} +
Description:{{ allocation_change.allocation.description|default_if_none:"" }}
Change Requested:{{ allocation_change.created|date:"M. d, Y" }}
Change Last Modified:{{ allocation_change.modified|date:"M. d, Y" }}
LockedUnlocked
+
+
+
+ + +
+
+

Allocation Attributes

+
+
+ {% if attribute_changes %} +
+ + + + + {% if allocation_change.status.name == 'Pending' %} + + {% endif %} + + + + + {% for form in formset %} + + + {% if allocation_change.status.name == 'Pending' %} + + {% if request.user.is_superuser %} + + {% else %} + + {% endif %} + {% else %} + {% if form.new_value.value == '' %} + + {% else %} + + {% endif %} + {% endif %} + + {% endfor %} + +
AttributeCurrent ValueRequested New Value
{{form.name.value}}{{form.value.value}} + {{form.new_value}} + + + + {{form.new_value.value}}None{{form.new_value.value}}
+
+ {% else %} + + {% endif %} + {{ formset.management_form }} +
+
+ +

{{allocation_change_form.justification | as_crispy_field}}

+ +
+ + {% if request.user.is_superuser %} +
+
+

Actions

+
+
+ {% csrf_token %} + {{note_form.notes | as_crispy_field}} +
+ {% if allocation_change.status.name == 'Pending' %} + + + {% endif %} + +
+
+
+ {% endif %} +
+ + + + View Allocation + + {% if request.user.is_superuser %} + + See all allocation change requests + + {% endif %} +
+ +{% endblock %} + +{% block javascript %} +{{ block.super }} + +{% endblock %} diff --git a/coldfront/core/allocation/templates/allocation/allocation_change_list.html b/coldfront/core/allocation/templates/allocation/allocation_change_list.html index 66d871669f..976d9a28ac 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_change_list.html +++ b/coldfront/core/allocation/templates/allocation/allocation_change_list.html @@ -1,80 +1,81 @@ -{% extends "common/base.html" %} -{% load crispy_forms_tags %} -{% load common_tags %} -{% load static %} - - -{% block title %} -Allocation Review New and Pending Change Requests -{% endblock %} - - -{% block content %} -

Allocation Change Requests

- -
- -

- For each allocation change request below, there is the option to activate the allocation request and to view the allocation change's detail page. - If a change request is only for an extension to the allocation, they can be approved on this page. However if the change request includes changes to - the allocation's attributes, the request must be reviewed and acted upon in its detail page. -

- -{% if allocation_change_list %} -
- - - - - - - - - - - - - - {% for change in allocation_change_list %} - - - - - - - - - - {% endfor %} - -
#RequestedProject TitlePIResourceExtensionActions
{{change.pk}}{{ change.created|date:"M. d, Y" }}{{change.allocation.project.title|truncatechars:50}}{{change.allocation.project.pi.first_name}} {{change.allocation.project.pi.last_name}} - ({{change.allocation.project.pi.username}}){{change.allocation.get_parent_resource}} - {% if change.end_date_extension == 0 %} - {% else %} {{change.end_date_extension}} days - {% endif %} - -
- {% if change.allocationattributechangerequest_set.all %} - - {% else %} - {% csrf_token %} - - - {% endif %} - Details -
-
-
-{% else %} -
- No new or pending allocation change requests! -
-{% endif %} - -{% endblock %} +{% extends "common/base.html" %} +{% load crispy_forms_tags %} +{% load common_tags %} +{% load static %} + + +{% block title %} +Allocation Review New and Pending Change Requests +{% endblock %} + + +{% block content %} +

Allocation Change Requests

+ +
+ +

+ For each allocation change request below, there is the option to activate the allocation request and to view the allocation change's detail page. + If a change request is only for an extension to the allocation, they can be approved on this page. However if the change request includes changes to + the allocation's attributes, the request must be reviewed and acted upon in its detail page. +

+ +{% if allocation_change_list %} +
+ + + + + + + + + + + + + + + {% for change in allocation_change_list %} + + + + + + + + + + {% endfor %} + +
#RequestedProject TitleAllocation IDPIResourceExtensionActions
{{change.pk}}{{ change.created|date:"M. d, Y" }}{{change.allocation.project.title|truncatechars:50}}{{change.allocation.project.pi.first_name}} {{change.allocation.project.pi.last_name}} + ({{change.allocation.project.pi.username}}){{change.allocation.get_parent_resource}} + {% if change.end_date_extension == 0 %} + {% else %} {{change.end_date_extension}} days + {% endif %} + +
+ {% if change.allocationattributechangerequest_set.all %} + + {% else %} + {% csrf_token %} + + + {% endif %} + Details +
+
+
+{% else %} +
+ No new or pending allocation change requests! +
+{% endif %} + +{% endblock %} diff --git a/coldfront/core/allocation/templates/allocation/allocation_create.html b/coldfront/core/allocation/templates/allocation/allocation_create.html index f5d1546c17..4aa0a0fd65 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_create.html +++ b/coldfront/core/allocation/templates/allocation/allocation_create.html @@ -13,7 +13,7 @@

Request New Allocation
Project: {{ project.title }}


-

The following {% settings_value 'CENTER_NAME' %} +

The following {% settings_value 'CENTER_NAME' %} resources are available to request for this project. If you need access to more than one of these, please submit a separate allocation request for each resource. For each request you must provide the justification for how you @@ -32,7 +32,7 @@

Request New Allocation
Project: {{ project.title }}

@@ -45,8 +45,8 @@

Request New Allocation
Project: {{ project.title }}

@@ -86,7 +86,7 @@ $(document).ready(function () { $('

').insertAfter($("#div_id_resource")) - $('
Select All Users').insertAfter($("#div_id_users > label")) + $('
Select All Users').insertAfter($("#div_id_users > label")) $("#id_resource").trigger('change'); $("#selectAll").click(function () { @@ -102,7 +102,7 @@ }); $('#modal_link').on("click", function () { - $('#Modal').modal('show'); + bootstrap.Modal.getOrCreateInstance(document.getElementById('Modal')).show(); }); $(function () { $('#myFormSubmit').click(function (e) { @@ -122,7 +122,7 @@ success: function (json) { console.log(json); $('#allocation_account_form')[0].reset(); - $('#Modal').modal('toggle'); + bootstrap.Modal.getOrCreateInstance(document.getElementById('Modal')).hide(); $('#error_div').html('
'); }, error: function (xhr, errmsg, err) { diff --git a/coldfront/core/allocation/templates/allocation/allocation_delete_invoice_note.html b/coldfront/core/allocation/templates/allocation/allocation_delete_invoice_note.html index d5632f7a23..911cea21fb 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_delete_invoice_note.html +++ b/coldfront/core/allocation/templates/allocation/allocation_delete_invoice_note.html @@ -21,7 +21,7 @@

Delete invoice notes for allocation to {{allocation.get_resources_as_string} - + Note Author diff --git a/coldfront/core/allocation/templates/allocation/allocation_detail.html b/coldfront/core/allocation/templates/allocation/allocation_detail.html index f141e325bf..cac6e94696 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_detail.html +++ b/coldfront/core/allocation/templates/allocation/allocation_detail.html @@ -117,12 +117,12 @@

Allocation Information

{{ allocation.end_date }} {% endif %} {% if allocation.is_locked and allocation.status.name == 'Active' and allocation.expires_in <= 60 and allocation.expires_in >= 0 %} - + Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}} - Not renewable {% elif is_allowed_to_update_project and ALLOCATION_ENABLE_ALLOCATION_RENEWAL and allocation.status.name == 'Active' and allocation.expires_in <= 60 and allocation.expires_in >= 0 %} - + Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}} - Click to renew @@ -174,10 +174,10 @@

Allocation Information

{% if request.user.is_superuser or request.user.is_staff %} -
+
{% if allocation.status.name == 'New' or allocation.status.name == 'Renewal Requested' %} - - + + {% endif %} {% endif %} @@ -190,7 +190,7 @@

Allocation Information

Allocation Attributes

-
+
{% if request.user.is_superuser or request.user.is_staff%} Add Allocation Attribute @@ -235,7 +235,7 @@

Alloc {% if attributes_with_usage %}
{% for attribute in attributes_with_usage %} -
+

{{attribute}}

@@ -250,10 +250,10 @@

{{attribute}}

-

Allocation Change Requests

{{allocation_changes.count}} -
+

Allocation Change Requests

{{allocation_changes.count}} +
{% if request.user.is_superuser and allocation.is_changeable and not allocation.is_locked and is_allowed_to_update_project and allocation.status.name in 'Active, Renewal Requested, Payment Pending, Payment Requested, Paid' %} - + Request Change {% endif %} @@ -269,7 +269,9 @@

Alloc Date Requested Status Notes - Actions + {% if can_edit_allocation_changes %} + Actions + {% endif %} @@ -288,7 +290,9 @@

Alloc {% else %} {% endif %} - Edit + {% if can_edit_allocation_changes %} + Edit + {% endif %} {% endfor %} @@ -307,8 +311,8 @@

Alloc

Users in Allocation

- {{allocation_users.count}} -
+ {{allocation_users.count}} +
{% if allocation.project.status.name != 'Archived' and is_allowed_to_update_project and allocation.status.name in 'Active,New,Renewal Requested' %} Add Users @@ -410,8 +414,8 @@

Wait time

Notifications

- {{notes.count}} -
@@ -93,8 +93,8 @@

Allocation Information

Notes from Staff

- {{allocation.allocationusernote_set.count}} -
+ {{allocation.allocationusernote_set.count}} +
Add Note @@ -121,7 +121,7 @@

Notes from {{ note.note }} {{ note.author.first_name }} {{ note.author.last_name }} ({{ note.author.username }}) {{ note.modified }} - Edit + Edit {% endfor %} @@ -135,4 +135,3 @@

Notes from

{% endblock %} - diff --git a/coldfront/core/allocation/templates/allocation/allocation_list.html b/coldfront/core/allocation/templates/allocation/allocation_list.html index ae36490834..b787eebc95 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_list.html +++ b/coldfront/core/allocation/templates/allocation/allocation_list.html @@ -17,12 +17,12 @@

Allocations

-
+
{{ allocation_search_form|crispy }} @@ -44,8 +44,8 @@

Allocations

ID - Sort ID asc - Sort ID desc + Sort ID asc + Sort ID desc Project @@ -53,24 +53,24 @@

Allocations

PI Sort PI asc + class="fas fa-sort-up" aria-hidden="true">Sort PI asc Sort PI desc + class="fas fa-sort-down" aria-hidden="true">Sort PI desc Resource Name - Sort Resource Name asc - Sort Resource Name desc + Sort Resource Name asc + Sort Resource Name desc Status - Sort Status asc - Sort Status desc + Sort Status asc + Sort Status desc End Date - Sort End Date asc - Sort End Date desc + Sort End Date asc + Sort End Date desc @@ -90,7 +90,7 @@

Allocations

{% if is_paginated %} Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} -
    +
      {% if page_obj.has_previous %}
    • Previous
    • {% else %} diff --git a/coldfront/core/allocation/templates/allocation/allocation_remove_users.html b/coldfront/core/allocation/templates/allocation/allocation_remove_users.html index 3e73ff250d..3e2eb989e0 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_remove_users.html +++ b/coldfront/core/allocation/templates/allocation/allocation_remove_users.html @@ -22,7 +22,7 @@

      Remove users from allocation for project: {{allocation.project.title}}

      - + # Username diff --git a/coldfront/core/allocation/templates/allocation/allocation_renew.html b/coldfront/core/allocation/templates/allocation/allocation_renew.html index 44883d3a00..20e6e614dc 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_renew.html +++ b/coldfront/core/allocation/templates/allocation/allocation_renew.html @@ -77,7 +77,7 @@

      Renew allocation to {{allocation.get_parent_resource }} for project: {{alloc
      -

      By clicking submit you agree to the Terms and Conditions.

      +

      By clicking submit you agree to the Terms and Conditions.

diff --git a/coldfront/core/allocation/templates/allocation/allocation_request_list.html b/coldfront/core/allocation/templates/allocation/allocation_request_list.html index df88855af4..ddf399d361 100644 --- a/coldfront/core/allocation/templates/allocation/allocation_request_list.html +++ b/coldfront/core/allocation/templates/allocation/allocation_request_list.html @@ -14,11 +14,11 @@

Allocation Requests


-

+

For each allocation request below, there is the option to activate the allocation request and to view the allocation's detail page.

-

+

By default, activating an allocation will make it active for {{ settings.ALLOCATION_DEFAULT_ALLOCATION_LENGTH }} days.

@@ -56,8 +56,8 @@

Allocation Requests

{% csrf_token %} - - Details + + Details diff --git a/coldfront/core/grant/templates/grant/grant_delete_grants.html b/coldfront/core/grant/templates/grant/grant_delete_grants.html index cdb025c256..437f76552c 100644 --- a/coldfront/core/grant/templates/grant/grant_delete_grants.html +++ b/coldfront/core/grant/templates/grant/grant_delete_grants.html @@ -22,7 +22,7 @@

Delete grants from project: {{project.title}}

- + Title Grant Number diff --git a/coldfront/core/grant/templates/grant/grant_report_list.html b/coldfront/core/grant/templates/grant/grant_report_list.html index cbae5d4244..6d479fb4d9 100644 --- a/coldfront/core/grant/templates/grant/grant_report_list.html +++ b/coldfront/core/grant/templates/grant/grant_report_list.html @@ -14,7 +14,7 @@

Grants

- +
{% if formset %} @@ -24,7 +24,7 @@

Grants

- + Grant Title Project PI Faculty Role diff --git a/coldfront/core/portal/templates/portal/authorized_home.html b/coldfront/core/portal/templates/portal/authorized_home.html index 3b31d94f81..11655a26d2 100644 --- a/coldfront/core/portal/templates/portal/authorized_home.html +++ b/coldfront/core/portal/templates/portal/authorized_home.html @@ -16,7 +16,7 @@

Projects »

  • {{project.title}} {% if project.needs_review %} - Needs Review + Needs Review {% endif %}
  • {% endfor %} @@ -24,7 +24,9 @@

    Projects »

    {% else %} {% if user.userprofile.is_pi or user.is_superuser %} - Add a project +
    {% endif %} {% endif %} @@ -51,30 +53,23 @@

    Allocations »

    {{allocation.get_parent_resource}} {% if allocation.get_parent_resource.get_ondemand_status == 'Yes' and ondemand_url %} {% load static %} ondemand cta - {% endif %} + {% endif %} {% if allocation.status.name == "Expired" and allocation.expires_in < 0 %} - Expired + {% elif allocation.status.name == "Renewal Requested" %} - Renewal - Requested + {% elif allocation.expires_in >= 0 and allocation.expires_in <= 30 %} - Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize }} - + {% elif allocation.expires_in > 30 and allocation.expires_in <= 90 %} - Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize }} - + {% elif allocation.status.name == "Pending" %} - {{allocation.status}} + {% elif allocation.status.name == "Active" %} - {{allocation.status}} + {% else %} - {{allocation.status}} + {% endif %} {% endfor %} diff --git a/coldfront/core/portal/templates/portal/center_summary.html b/coldfront/core/portal/templates/portal/center_summary.html index 3463d50d56..b520dde274 100644 --- a/coldfront/core/portal/templates/portal/center_summary.html +++ b/coldfront/core/portal/templates/portal/center_summary.html @@ -12,6 +12,7 @@ {% block content %}

    {% settings_value 'CENTER_NAME' %} Scientific Impact


    + {% if settings.PUBLICATION_ENABLE %}
    @@ -99,7 +100,7 @@

    {% settings_value 'CENTER_NAME' %} Scientific Impact

    + ...
    diff --git a/coldfront/core/portal/templates/portal/nonauthorized_home.html b/coldfront/core/portal/templates/portal/nonauthorized_home.html index 70173be42c..9697dbe4ab 100644 --- a/coldfront/core/portal/templates/portal/nonauthorized_home.html +++ b/coldfront/core/portal/templates/portal/nonauthorized_home.html @@ -1,9 +1,10 @@ {% extends "common/base.html" %} {% load common_tags %} + {% block content %}
    -
    +

    Log In to HPC project management portal


    diff --git a/coldfront/core/project/templates/project/add_user_search_results.html b/coldfront/core/project/templates/project/add_user_search_results.html index 075dde373e..1fbef3ee84 100644 --- a/coldfront/core/project/templates/project/add_user_search_results.html +++ b/coldfront/core/project/templates/project/add_user_search_results.html @@ -7,7 +7,7 @@ Found {{number_of_usernames_found}} of {{number_of_usernames_searched}} usernames searched. {% elif matches %} - Found {{matches|length}} match{{matches|length|pluralize}}. + Found {{matches|length}} match{{matches|length|pluralize:"es"}}. {% endif %}
    {% if usernames_not_found %} @@ -26,15 +26,45 @@

    - + @@ -87,14 +117,16 @@ } }); - $("#id_allocationform-allocation_0").click(function () { + $("#selectAllAllocations").click(function () { $("input[name^='allocationform-']").prop('checked', $(this).prop('checked')); }); $("input[name^='allocationform-']").click(function (ele) { var id = $(this).attr('id'); - if ( id != "id_allocationform-allocation_0") { - $("#id_allocationform-allocation_0").prop('checked', false); + if ( id != "selectAllAllocations") { + $("#selectAllAllocations").prop('checked', false); } }); + +{% comment %} if eula box is in focus, then required {% endcomment %} diff --git a/coldfront/core/project/templates/project/project_add_users.html b/coldfront/core/project/templates/project/project_add_users.html index c9b8201db8..cfae4212e7 100644 --- a/coldfront/core/project/templates/project/project_add_users.html +++ b/coldfront/core/project/templates/project/project_add_users.html @@ -17,7 +17,9 @@

    Add users to project: {{project.title}}

    {% csrf_token %} {{ user_search_form|crispy }} - +
    + +
    @@ -84,10 +86,10 @@

    Add users to project: {{project.title}}

    // handle a non-successful response error : function(xhr,errmsg,err) { if(xhr.status == 403 || xhr.status == 401) { - $('#search_results_inner').html("
    Your session expired. Please login again. ×
    "); + $('#search_results_inner').html("
    Your session expired. Please login again.
    "); } else { $('#search_results_inner').html("
    Oops! We have encountered an error: "+errmsg+ - " ×
    "); // add the error to the dom + " "); // add the error to the dom } console.log(xhr.status + ": " + xhr.responseText); // provide a bit more info about the error to the console } @@ -96,7 +98,6 @@

    Add users to project: {{project.title}}

    $('#search_results').hide(); $('#selected_users').hide(); - $('[data-toggle="popover"]').popover(); }); {% endblock %} diff --git a/coldfront/core/project/templates/project/project_archive.html b/coldfront/core/project/templates/project/project_archive.html index d6ee42d2ae..712352b30e 100644 --- a/coldfront/core/project/templates/project/project_archive.html +++ b/coldfront/core/project/templates/project/project_archive.html @@ -19,11 +19,11 @@

    {{ project.pi.first_name }} {{ project.pi.last_name }} ({{ project.pi.username }}) - Email + Email

    -

    Description: {{ project.description }}

    -

    School: {{ project.school }}

    -

    Status: {{ project.status}}

    +

    Description: {{ project.description }}

    +

    School: {{ project.school }}

    +

    Status: {{ project.status}}

    diff --git a/coldfront/core/project/templates/project/project_archived_list.html b/coldfront/core/project/templates/project/project_archived_list.html index 6fdc05e1b0..8efb4054da 100644 --- a/coldfront/core/project/templates/project/project_archived_list.html +++ b/coldfront/core/project/templates/project/project_archived_list.html @@ -10,9 +10,9 @@ {% block content %} -
    +
    - @@ -25,12 +25,12 @@

    Archived Projects

    -
    +
    {{ project_search_form|crispy }} @@ -52,24 +52,24 @@

    Archived Projects

    @@ -78,7 +78,7 @@

    Archived Projects

    - @@ -87,7 +87,7 @@

    Archived Projects

    # Username First Name
    ID - Sort ID asc - Sort ID desc + Sort ID asc + Sort ID desc PI - Sort PI asc - Sort PI desc + Sort PI asc + Sort PI desc Title and Description School - Sort School asc - Sort School desc + Sort School asc + Sort School desc Status - Sort Status asc - Sort Status desc + Sort Status asc + Sort Status desc
    {{ project.id }} {{ project.pi.username }}Title: {{ project.title }} + Title: {{ project.title }}
    Description: {{ project.description }}
    {{ project.school.description }} {{ project.status.name }}
    {% if is_paginated %} Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} -
      +
        {% if page_obj.has_previous %}
      • Previous
      • {% else %} diff --git a/coldfront/core/project/templates/project/project_attribute_create.html b/coldfront/core/project/templates/project/project_attribute_create.html index 39c7beb439..96c3cc0b7f 100644 --- a/coldfront/core/project/templates/project/project_attribute_create.html +++ b/coldfront/core/project/templates/project/project_attribute_create.html @@ -1,22 +1,22 @@ -{% extends "common/base.html" %} -{% load crispy_forms_tags %} -{% load common_tags %} -{% load static %} - - -{% block title %} -Add Project Attribute -{% endblock %} - - -{% block content %} -

        Adding project attribute to {{ project }}

        - - - {% csrf_token %} - {{ form | crispy }} - - Back to - Project
        - +{% extends "common/base.html" %} +{% load crispy_forms_tags %} +{% load common_tags %} +{% load static %} + + +{% block title %} +Add Project Attribute +{% endblock %} + + +{% block content %} +

        Adding project attribute to {{ project }}

        + +
        + {% csrf_token %} + {{ form | crispy }} + + Back to + Project
        +
        {% endblock %} \ No newline at end of file diff --git a/coldfront/core/project/templates/project/project_attribute_delete.html b/coldfront/core/project/templates/project/project_attribute_delete.html index e21a415b9c..c996f8b1f8 100644 --- a/coldfront/core/project/templates/project/project_attribute_delete.html +++ b/coldfront/core/project/templates/project/project_attribute_delete.html @@ -1,61 +1,61 @@ -{% extends "common/base.html" %} -{% load crispy_forms_tags %} -{% load common_tags %} -{% load static %} - - -{% block title %} -Remove Project Attribute -{% endblock %} - - -{% block content %} -

        Removing project attribute from {{ project }}

        - -{% if formset %} -
        -
        -
        - {% csrf_token %} -
        - - - - - - - - - - {% for form in formset %} - - - - - - {% endfor %} - -
        - - TypeValue
        {{ form.selected }}{{ form.name.value }}{{ form.value.value }}
        -
        - {{ formset.management_form }} -
        - - Back to Project -
        -
        -
        -
        -
        -{% else %} -
        - No attributes to remove! -
        - Back to Project -{% endif %} - -{% endblock %} +{% extends "common/base.html" %} +{% load crispy_forms_tags %} +{% load common_tags %} +{% load static %} + + +{% block title %} +Remove Project Attribute +{% endblock %} + + +{% block content %} +

        Removing project attribute from {{ project }}

        + +{% if formset %} +
        +
        +
        + {% csrf_token %} +
        + + + + + + + + + + {% for form in formset %} + + + + + + {% endfor %} + +
        + + TypeValue
        {{ form.selected }}{{ form.name.value }}{{ form.value.value }}
        +
        + {{ formset.management_form }} +
        + + Back to Project +
        +
        +
        +
        +
        +{% else %} +
        + No attributes to remove! +
        + Back to Project +{% endif %} + +{% endblock %} diff --git a/coldfront/core/project/templates/project/project_attribute_update.html b/coldfront/core/project/templates/project/project_attribute_update.html index 9d8213ebb6..a68a24a5d0 100644 --- a/coldfront/core/project/templates/project/project_attribute_update.html +++ b/coldfront/core/project/templates/project/project_attribute_update.html @@ -1,49 +1,48 @@ -{% extends "common/base.html" %} -{% load crispy_forms_tags %} -{% load static %} - - -{% block title %} -Project Attribute Details -{% endblock %} - - -{% block content %} -

        Project Attribute Update Form

        - -
        - -
        - {% csrf_token %} -
        -
        Attribute Details
        -
        -
        - - - - - - - - - - - - - - - - - - -
        Name:{{project_attribute_obj}}
        Type:{{project_attribute_obj.proj_attr_type.attribute_type}}
        Value:{{project_attribute_obj.value}}
        New Value:{{project_attribute_update_form.new_value}}
        -
        -
        - -
        -
        -{% endblock%} \ No newline at end of file +{% extends "common/base.html" %} +{% load crispy_forms_tags %} +{% load static %} + + +{% block title %} +Project Attribute Details +{% endblock %} + + +{% block content %} +

        Project Attribute Update Form

        + +
        + +
        + {% csrf_token %} +
        +
        Attribute Details
        +
        +
        + + + + + + + + + + + + + + + + + +
        Name:{{project_attribute_obj}}
        Type:{{project_attribute_obj.proj_attr_type.attribute_type}}
        Value:{{project_attribute_obj.value}}
        New Value:{{project_attribute_update_form.new_value}}
        +
        +
        + +
        +
        +{% endblock%} diff --git a/coldfront/core/project/templates/project/project_detail.html b/coldfront/core/project/templates/project/project_detail.html index c809e31898..d726b14fcf 100644 --- a/coldfront/core/project/templates/project/project_detail.html +++ b/coldfront/core/project/templates/project/project_detail.html @@ -26,15 +26,15 @@ {% endif %}
        -

        {{ project.title }}

        +

        {{ project.title }}


        {% if project.status.name != 'Archived' and is_allowed_to_update_project %} -
        +

        Manage Project

        -
        +
        {% if project.status.name in 'Active, New' %} Update Project Information Archive Project @@ -66,16 +66,16 @@

        {{ project.pi.first_name }} {{ project.pi.last_name }} ({{ project.pi.username }}) - Email PI + Email PI

        -

        Description: {{ project.description }}

        -

        School: {{ project.school }}

        -

        Project Status: {{ project.status }} +

        Description: {{ project.description }}

        +

        School: {{ project.school }}

        +

        Project Status: {{ project.status }} {% if project.last_project_review and project.last_project_review.status.name == 'Pending'%} - project review pending + project review pending {% endif %}

        -

        Created: {{ project.created|date:"M. d, Y" }}

        +

        Created: {{ project.created|date:"M. d, Y" }}

        @@ -84,8 +84,8 @@

        -

        Users

        {{project_users.count}} -
        +

        Users

        {{project_users.count}} +
        {% if project.status.name != 'Archived' and is_allowed_to_update_project %} Email Project Users Add Users @@ -102,9 +102,9 @@

        First Name Last Name Email - Role Manager role grants user access to add/remove users, allocations, grants, and publications to the project. + Role Manager role grants user access to add/remove users, allocations, grants, and publications to the project. Status - Enable Notifications When disabled, user will not receive notifications for allocation requests and expirations or cloud usage (if applicable). + Enable Notifications When disabled, user will not receive notifications for allocation requests and expirations or cloud usage (if applicable). Actions @@ -147,7 +147,7 @@

        {% if is_allowed_to_update_project %} - Edit + Edit {% endif %} @@ -163,8 +163,8 @@

        -

        Allocations

        {{allocations.count}} -
        +

        Allocations

        {{allocations.count}} +
        {% if project.status.name != 'Archived' and is_allowed_to_update_project %} Request Resource Allocation {% endif %} @@ -203,14 +203,14 @@

        Allocation {% endif %} {{allocation.end_date|date:"Y-m-d"}} - Details + Details {% if allocation.is_locked and allocation.status.name == 'Active' and allocation.expires_in <= 60 and allocation.expires_in >= 0 %} - + Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}}
        Not renewable
        {% elif is_allowed_to_update_project and ALLOCATION_ENABLE_ALLOCATION_RENEWAL and allocation.status.name == 'Active' and allocation.expires_in <= 60 and allocation.expires_in >= 0 %} - + Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}}
        Click to renew
        @@ -234,8 +234,8 @@

        Allocation
        -

        Attributes

        {{attributes.count}} -
        +

        Attributes

        {{attributes.count}} +
        {% if project.status.name != 'Archived' and is_allowed_to_update_project %} Add Attribute {% if attributes %} @@ -263,7 +263,7 @@

        Attri {{attribute}} {{attribute.value}} - Edit + Edit {% else %} @@ -272,7 +272,7 @@

        Attri {{attribute.value}} {% if is_allowed_to_update_project %} - Edit + Edit {% endif %} {% endif %} @@ -283,7 +283,7 @@

        Attri {% if attributes_with_usage %}
        {% for attribute in attributes_with_usage %} -
        +

        {{attribute}}

        @@ -303,10 +303,10 @@

        {{attribute}}

        -

        Grants

        {{grants.count}} -
        - {% if project.latest_grant.modified %} - Last Updated: {{project.latest_grant.modified|date:"M. d, Y"}} +

        Grants

        {{grants.count}} +
        + {% if latest_grant.modified %} + Last Updated: {{latest_grant.modified|date:"M. d, Y"}} {% endif %} {% if project.status.name != 'Archived' and is_allowed_to_update_project %} Add Grant @@ -348,7 +348,7 @@

        {{ grant.status.name }} {% endif %} - Edit + Edit {% endfor %} @@ -367,10 +367,10 @@

        -

        Publications

        {{publications.count}} -
        +

        Publications

        {{publications.count}} +
        {% if project.latest_publication.created %} - Last Updated: {{project.latest_publication.created|date:"M. d, Y"}} + Last Updated: {{project.latest_publication.created|date:"M. d, Y"}} {% endif %} {% if project.status.name != 'Archived' and is_allowed_to_update_project %} Add Publication @@ -397,7 +397,7 @@

        Visit source + Visit source {% endif %}
        Author: {{ publication.author}}
        Journal: {{ publication.journal}} @@ -421,8 +421,8 @@

        -

        Research Outputs

        {{ research_outputs.count}} -
        +

        Research Outputs

        {{ research_outputs.count}} +
        {% if project.status.name != 'Archived' and is_allowed_to_update_project %} Add Research Output {% if research_outputs %} @@ -462,8 +462,8 @@

        -

        Notifications

        {{project.projectusermessage_set.count}} -
        +

        Notifications

        {{project.projectusermessage_set.count}} +
        {% if request.user.is_superuser %} Add Notification @@ -508,7 +508,6 @@

        Notificatio {{ block.super }} {% endblock %} diff --git a/coldfront/core/publication/templates/publication/publication_add_publication_search_result.html b/coldfront/core/publication/templates/publication/publication_add_publication_search_result.html index df60dcb2bf..0337f4d5e9 100644 --- a/coldfront/core/publication/templates/publication/publication_add_publication_search_result.html +++ b/coldfront/core/publication/templates/publication/publication_add_publication_search_result.html @@ -10,7 +10,7 @@ - + # Publication diff --git a/coldfront/core/publication/templates/publication/publication_delete_publications.html b/coldfront/core/publication/templates/publication/publication_delete_publications.html index 335dcc4534..f8df61f3de 100644 --- a/coldfront/core/publication/templates/publication/publication_delete_publications.html +++ b/coldfront/core/publication/templates/publication/publication_delete_publications.html @@ -23,7 +23,7 @@

        Delete publications from project: {{project.title}}

        - + Title Year diff --git a/coldfront/core/publication/templates/publication/publication_export_publications.html b/coldfront/core/publication/templates/publication/publication_export_publications.html index 5a467c83c7..2d061ff638 100644 --- a/coldfront/core/publication/templates/publication/publication_export_publications.html +++ b/coldfront/core/publication/templates/publication/publication_export_publications.html @@ -22,7 +22,7 @@

        Export publications from project: {{project.title}}

        - + Title Year diff --git a/coldfront/core/resource/templates/resource_detail.html b/coldfront/core/resource/templates/resource_detail.html index 73ee775342..681d1dcdf3 100644 --- a/coldfront/core/resource/templates/resource_detail.html +++ b/coldfront/core/resource/templates/resource_detail.html @@ -81,7 +81,7 @@

        Resource Information

        Resource Attributes

        -
        +
        {% if request.user.is_superuser %} Add Resource Attribute diff --git a/coldfront/core/resource/templates/resource_list.html b/coldfront/core/resource/templates/resource_list.html index ca31714fb0..ffb118bde0 100644 --- a/coldfront/core/resource/templates/resource_list.html +++ b/coldfront/core/resource/templates/resource_list.html @@ -17,12 +17,12 @@

        Resources

        -
        +
        {{ resource_search_form|crispy }} @@ -44,23 +44,23 @@

        Resources

        ID - Sort ID asc - Sort ID desc + Sort ID asc + Sort ID desc Resource Name - Sort Resource Name asc - Sort Resource Name desc + Sort Resource Name asc + Sort Resource Name desc Parent Resource - Sort Parent Resource asc - Sort Parent Resource desc + Sort Parent Resource asc + Sort Parent Resource desc Resource Type - Sort Resource Type asc - Sort Resource Type desc + Sort Resource Type asc + Sort Resource Type desc @@ -76,7 +76,7 @@

        Resources

        {% if is_paginated %} Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} -
          +
            {% if page_obj.has_previous %}
          • Previous
          • {% else %} diff --git a/coldfront/core/resource/templates/resource_resourceattribute_delete.html b/coldfront/core/resource/templates/resource_resourceattribute_delete.html index 5099ed2988..d8775a6bf9 100644 --- a/coldfront/core/resource/templates/resource_resourceattribute_delete.html +++ b/coldfront/core/resource/templates/resource_resourceattribute_delete.html @@ -22,7 +22,7 @@

            Delete allocation attributes from {{resource}}

            - + Name Value diff --git a/coldfront/core/user/forms.py b/coldfront/core/user/forms.py index c03f0fd41d..513ef3fe35 100644 --- a/coldfront/core/user/forms.py +++ b/coldfront/core/user/forms.py @@ -5,7 +5,6 @@ class UserSearchForm(forms.Form): CHOICES = [ ("username_only", "Exact Username Only"), - # ('all_fields', mark_safe('All Fields ')), ( "all_fields", mark_safe( diff --git a/coldfront/core/user/templates/user/login.html b/coldfront/core/user/templates/user/login.html index d69b7b6d3e..b7c185af2e 100644 --- a/coldfront/core/user/templates/user/login.html +++ b/coldfront/core/user/templates/user/login.html @@ -2,20 +2,22 @@ {% load static %} {% load common_tags %} + {% block title %} Log In {% endblock %} + {% block content %}
            - {% if form.errors %} - - {% endif %} + {% if form.errors %} + + {% endif %}
            @@ -25,7 +27,7 @@

            {% if 'mozilla_django_oidc' in EXTRA_APPS %}

            For everyone

            - + Log in with NYU NetID diff --git a/coldfront/core/user/templates/user/login_form.html b/coldfront/core/user/templates/user/login_form.html index 1d25a5aeed..21612a8510 100644 --- a/coldfront/core/user/templates/user/login_form.html +++ b/coldfront/core/user/templates/user/login_form.html @@ -5,7 +5,7 @@ {% csrf_token %} {{ form|crispy }} - diff --git a/coldfront/core/user/templates/user/user_profile.html b/coldfront/core/user/templates/user/user_profile.html index c36b580e6f..1484354f0c 100644 --- a/coldfront/core/user/templates/user/user_profile.html +++ b/coldfront/core/user/templates/user/user_profile.html @@ -8,54 +8,60 @@ {% block content %}

            User Profile


            +
            -
            - - {{ viewed_user.username }} - -
            -
            -
            - {{viewed_user.first_name}} {{viewed_user.last_name}} -
            -
            - - - {% block profile_contents %} - - - - - - - - - - - - - - - - - {% endblock %} - -
            University Role(s):{{group_list}}
            Email:{{viewed_user.email}}
            PI Status: - {% if viewed_user.userprofile.is_pi %} - Yes - {% elif not user == viewed_user %} - No - {% else %} -
            - No -
            - {% endif %} -
            Last Login:{{viewed_user.last_login}}
            -
            -
            +
            + + {{ viewed_user.username }} + +
            +
            +
            + {{viewed_user.first_name}} {{viewed_user.last_name}} +
            +
            + + + {% block profile_contents %} + + + + + + + + + + + + + + + + + {% endblock %} + +
            University Role(s):{{group_list}}
            Email:{{viewed_user.email}}
            PI Status: + {% if viewed_user.userprofile.is_pi %} + Yes + {% elif not user == viewed_user %} + No + {% else %} +
            +
            + No +
            +
            + {% csrf_token %} + +
            +
            + {% endif %} +
            Last Login:{{viewed_user.last_login}}
            +
            +
            {% endblock %} diff --git a/coldfront/core/user/templates/user/user_projects_managers.html b/coldfront/core/user/templates/user/user_projects_managers.html index ea42121eda..242b3da2ac 100644 --- a/coldfront/core/user/templates/user/user_projects_managers.html +++ b/coldfront/core/user/templates/user/user_projects_managers.html @@ -21,27 +21,27 @@

            User Projects and Managers{% if not user == viewed_user %}: {{ viewed_user.u

            {{ project.title }}

            {% if user == viewed_user or perms.project.can_view_all_projects %} - Details + Details {% endif %}
            {# support non-default roles #} {% if not association.is_project_manager and not association.role.name == 'User' %} -

            User role in project: {{ association.role }}

            +

            User role in project: {{ association.role }}

            {% endif %} {# a few Pending statuses may be displayed here #} -

            User status in project: +

            User status in project: {% if association.status.name == 'Active' %} {{ association.status.name }} {% else %} {{ association.status.name }} {% endif %}

            -

            Description: {{ project.description }}

            -

            School: {{ project.school }}

            -

            Project Status: {{ project.status }}

            +

            Description: {{ project.description }}

            +

            School: {{ project.school }}

            +

            Project Status: {{ project.status }}

            Principal Investigator: {{ project.pi.first_name }} {{ project.pi.last_name }} ({{ project.pi.username }}) - Email + Email {% if association.is_project_pi %} ({{ user_pronounish | lower }} {{user_verbform_be}} the project PI) {% endif %} @@ -51,9 +51,9 @@

            {{ project.title }}

            -

            Additional Managers

            {{ project.project_managers | length }} +

            Additional Managers

            {{ project.project_managers | length }} {% if association.is_project_manager and not association.is_project_pi %} -
            +

            {{ user_pronounish }} {{user_verbform_be}} a manager of this project.

            {% endif %} diff --git a/coldfront/core/user/templates/user/user_search_home.html b/coldfront/core/user/templates/user/user_search_home.html index 611c18048d..d6edc6a0f8 100644 --- a/coldfront/core/user/templates/user/user_search_home.html +++ b/coldfront/core/user/templates/user/user_search_home.html @@ -9,8 +9,10 @@
            {% csrf_token %} {{ user_search_form|crispy }} - +
            + +
            @@ -71,8 +73,6 @@ } }); }; - - $('[data-toggle="popover"]').popover(); }); {% endblock %} diff --git a/coldfront/core/utils/templatetags/common_tags.py b/coldfront/core/utils/templatetags/common_tags.py index 429af6e41a..7f1360d249 100644 --- a/coldfront/core/utils/templatetags/common_tags.py +++ b/coldfront/core/utils/templatetags/common_tags.py @@ -34,13 +34,9 @@ def get_icon(expand_accordion): @register.filter def convert_boolean_to_icon(boolean): if boolean is False: - return mark_safe( - '' - ) + return mark_safe('') else: - return mark_safe( - '' - ) + return mark_safe('') @register.filter @@ -48,21 +44,13 @@ def convert_status_to_icon(project): if project.last_project_review: status = project.last_project_review.status.name if status == "Pending": - return mark_safe( - '

            ' - ) + return mark_safe('

            ') elif status == "Completed": - return mark_safe( - '

            ' - ) + return mark_safe('

            ') elif project.needs_review and not project.last_project_review: - return mark_safe( - '

            ' - ) + return mark_safe('

            ') elif not project.needs_review: - return mark_safe( - '

            ' - ) + return mark_safe('

            ') @register.filter("get_value_from_dict") diff --git a/coldfront/core/utils/validate.py b/coldfront/core/utils/validate.py index e910406db3..e2760aac79 100644 --- a/coldfront/core/utils/validate.py +++ b/coldfront/core/utils/validate.py @@ -1,41 +1,49 @@ -import datetime -from django.core.exceptions import ValidationError -from formencode import validators - - -class AttributeValidator: - def __init__(self, value): - self.value = value - - def validate_int(self): - try: - validate = validators.Int() - validate.to_python(self.value) - except: - raise ValidationError(f"Invalid Value {self.value}. Value must be an int.") - - def validate_float(self): - try: - validate = validators.Number() - validate.to_python(self.value) - except: - raise ValidationError( - f"Invalid Value {self.value}. Value must be an float." - ) - - def validate_yes_no(self): - try: - validate = validators.OneOf(["Yes", "No"]) - validate.to_python(self.value) - except: - raise ValidationError( - f"Invalid Value {self.value}. Value must be an Yes/No value." - ) - - def validate_date(self): - try: - datetime.datetime.strptime(self.value.strip(), "%Y-%m-%d") - except: - raise ValidationError( - f"Invalid Value {self.value}. Date must be in format YYYY-MM-DD and date must be today or later." - ) +# SPDX-FileCopyrightText: (C) ColdFront Authors +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +import datetime + +from django.core.exceptions import ValidationError +from formencode import validators + + +class AttributeValidator: + def __init__(self, value): + self.value = value + + def _raise_if_empty(self): + if self.value == "": + raise ValidationError(f'Invalid Value "{self.value}". Value cannot be empty.') + + def validate_int(self): + self._raise_if_empty() + try: + validate = validators.Int() + validate.to_python(self.value) + except Exception: + raise ValidationError(f"Invalid Value {self.value}. Value must be an int.") + + def validate_float(self): + self._raise_if_empty() + try: + validate = validators.Number() + validate.to_python(self.value) + except Exception: + raise ValidationError(f"Invalid Value {self.value}. Value must be an float.") + + def validate_yes_no(self): + self._raise_if_empty() + try: + validate = validators.OneOf(["Yes", "No"]) + validate.to_python(self.value) + except Exception: + raise ValidationError(f"Invalid Value {self.value}. Value must be an Yes/No value.") + + def validate_date(self): + try: + datetime.datetime.strptime(self.value.strip(), "%Y-%m-%d") + except Exception: + raise ValidationError( + f"Invalid Value {self.value}. Date must be in format YYYY-MM-DD and date must be today or later." + ) diff --git a/coldfront/plugins/iquota/templates/iquota/iquota.html b/coldfront/plugins/iquota/templates/iquota/iquota.html index 8421aa99ce..75c840ad6e 100644 --- a/coldfront/plugins/iquota/templates/iquota/iquota.html +++ b/coldfront/plugins/iquota/templates/iquota/iquota.html @@ -30,7 +30,7 @@ $("#quota-button").click(function() { - $('#iquota_inner_button').html(''); + $('#iquota_inner_button').html(''); $.ajax({ url: "{% url 'get-isilon-quota' %}", diff --git a/coldfront/plugins/iquota/templates/iquota/iquota_div.html b/coldfront/plugins/iquota/templates/iquota/iquota_div.html index 638f0b3161..ed35e92d39 100644 --- a/coldfront/plugins/iquota/templates/iquota/iquota_div.html +++ b/coldfront/plugins/iquota/templates/iquota/iquota_div.html @@ -10,7 +10,7 @@

            CCR Storage Quotas