Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp of Notes #586

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
51a0801
BS upgraded to 5.0.2, changes made throughout
rg663 Aug 9, 2022
b068f1d
additional changes made
rg663 Aug 9, 2022
7d872a8
checkbox formatting on common.css
rg663 Aug 9, 2022
21e9849
fix bug with aligning Add Notification button
rg663 Aug 9, 2022
e0d89a8
fix bug with alignment of Log in button
rg663 Aug 9, 2022
7d1f96e
center justify footer text
rg663 Aug 9, 2022
514aac5
Merge branch 'ubccr:master' into 436-upgrade-to-bootstrap5
rg663 Aug 30, 2022
d286242
fixed content width
rg663 Sep 4, 2022
db0baaa
Merge fix, upgraded crispyforms to 1.14.0
rg663 Sep 29, 2022
b96a6d0
Merge branch 'master' into 436-upgrade-to-bootstrap5
rg663 Jan 5, 2023
d8ed6c1
upgraded to 5.2.3
rg663 Jan 9, 2023
ed6b93d
small alignment fix from old merge
rg663 Jan 24, 2023
3970204
Merge branch 'main' into 436-upgrade-to-bootstrap5
rg663 Feb 9, 2023
f6bb0fb
Merge branch 'main' into 436-upgrade-to-bootstrap5
rg663 Jul 27, 2023
376586a
Merge remote-tracking branch 'upstream/main' into 436-upgrade-to-boot…
rg663 Jul 28, 2023
8aa9653
Merge remote-tracking branch 'upstream/main' into 436-upgrade-to-boot…
rg663 Jul 31, 2023
2b28064
5.3.1 update
rg663 Jul 31, 2023
ec5a52b
bug fixes
rg663 Aug 1, 2023
a4535fd
more bug fixes
rg663 Aug 1, 2023
5f5a055
enabled dark mode functionality
rg663 Aug 22, 2023
e4b8a72
center summary fixes
rg663 Aug 22, 2023
5aa610d
css better for sliders
rg663 Aug 23, 2023
e36e44f
added dark mode toggle to docs
rg663 Aug 24, 2023
109e709
home fixes
rg663 Oct 1, 2023
ee2a56c
dark mode toggle works
rg663 Oct 14, 2023
17e4bf8
small datepicker fix
rg663 Oct 16, 2023
5f745eb
small change
rg663 Oct 21, 2023
fedd146
alloc notes with new app
ShreyasSridhar24 Oct 30, 2023
ff340e3
note pr 1
ShreyasSridhar24 Oct 30, 2023
ebc625f
alloc fix
ShreyasSridhar24 Oct 30, 2023
d10b638
alloc
ShreyasSridhar24 Oct 30, 2023
116c8e5
commit
ShreyasSridhar24 Nov 13, 2023
3757d80
fix merg
ShreyasSridhar24 Nov 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions coldfront/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
LANGUAGE_CODE = ENV.str('LANGUAGE_CODE', default='en-us')
TIME_ZONE = ENV.str('TIME_ZONE', default='America/New_York')
USE_I18N = True
USE_L10N = True
USE_L10N = False
DATE_FORMAT = 'Y-m-d'
DATETIME_FORMAT = 'Y-m-d H:i'
USE_TZ = True

#------------------------------------------------------------------------------
Expand All @@ -53,13 +55,13 @@
# Hack to fix fontawesome. Will be fixed in version 6
sys.modules['fontawesome_free'] = __import__('fontawesome-free')
INSTALLED_APPS += [
'crispy_bootstrap5',
'crispy_forms',
'sslserver',
'django_q',
'simple_history',
'fontawesome_free',
]

# ColdFront Apps
INSTALLED_APPS += [
'coldfront.core.user',
Expand Down Expand Up @@ -134,7 +136,10 @@
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/'
Expand Down
2 changes: 2 additions & 0 deletions coldfront/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
path('grant/', include('coldfront.core.grant.urls')),
path('publication/', include('coldfront.core.publication.urls')),
path('research-output/', include('coldfront.core.research_output.urls')),
path('note/', include('coldfront.core.note.urls')),

]


Expand Down
6 changes: 3 additions & 3 deletions coldfront/core/allocation/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, request_user, project_pk, *args, **kwargs):
if user_query_set:
self.fields['users'].choices = ((user.user.username, "%s %s (%s)" % (
user.user.first_name, user.user.last_name, user.user.username)) for user in user_query_set)
self.fields['users'].help_text = '<br/>Select users in your project to add to this allocation.'
self.fields['users'].help_text = '<Select users in your project to add to this allocation.'
else:
self.fields['users'].widget = forms.HiddenInput()

Expand All @@ -47,11 +47,11 @@ def __init__(self, request_user, project_pk, *args, **kwargs):
self.fields['allocation_account'].choices = (((account.name, account.name))
for account in allocation_accounts)

self.fields['allocation_account'].help_text = '<br/>Select account name to associate with resource. <a href="#Modal" id="modal_link">Click here to create an account name!</a>'
self.fields['allocation_account'].help_text = '<Select account name to associate with resource. <a href="#Modal" id="modal_link">Click here to create an account name!</a>'
else:
self.fields['allocation_account'].widget = forms.HiddenInput()

self.fields['justification'].help_text = '<br/>Justification for requesting this allocation.'
self.fields['justification'].help_text = 'Justification for requesting this allocation.'


class AllocationUpdateForm(forms.Form):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% block content %}
<h2>Allocation Accounts</h2>

<div class="card mb-3 bg-light">
<div class="card mb-3">
<div class="card-body">
<a class="btn btn-success" href="{% url 'add-allocation-account' %}" role="button"><i class="fas fa-plus" aria-hidden="true"></i> Add Allocation Account</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Add users to allocation for project: {{allocation.project.title}}</h2>
<thead>
<tr>
<th>
<input type="checkbox" class="check" id="selectAll">
<input type="checkbox" class="form-check-input" id="selectAll">
</th>
<th scope="col">#</th>
<th scope="col">Username</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Delete allocation attributes from allocation for project: {{allocation.proje
<thead>
<tr>
<th>
<input type="checkbox" class="check" id="selectAll">
<input type="checkbox" class="form-check-input" id="selectAll">
</th>
<th scope="col">Name</th>
<th scope="col">Value</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h2>Request change to {{ allocation.get_parent_resource }} for project: {{ allocation.project.title }}</h2>
<hr>

<p class="text-justify">
<p>
Request changes to an existing allocation using the form below. For each change
you must provide a justification.
</p>
Expand Down Expand Up @@ -53,7 +53,7 @@ <h3><i class="fas fa-list" aria-hidden="true"></i> Allocation Information</h3>
<td>
{{ allocation.end_date }}
{% if allocation.is_locked and allocation.status.name == 'Active' and allocation.expires_in <= 60 and allocation.expires_in >= 0 %}
<span class="badge badge-warning"><i class="far fa-clock" aria-hidden="true"></i>
<span class="badge bg-warning"><i class="far fa-clock" aria-hidden="true"></i>
Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}} - Not renewable
</span>
{% endif %}
Expand All @@ -73,11 +73,11 @@ <h3><i class="fas fa-list" aria-hidden="true"></i> Allocation Information</h3>
</tr>
<tr>
<th scope="row" class="text-nowrap">Created:</th>
<td>{{ allocation.created|date:"M. d, Y" }}</td>
<td>{{ allocation.created|date:"Y-m-d" }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Last Modified:</th>
<td>{{ allocation.modified|date:"M. d, Y" }}</td>
<td>{{ allocation.modified|date:"Y-m-d" }}</td>
</tr>
<tr>
{% if allocation.is_locked %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h3 class="d-inline"><i class="fas fa-list" aria-hidden="true"></i> Allocation I
<td>
{{ 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 %}
<span class="badge badge-warning"><i class="far fa-clock" aria-hidden="true"></i>
<span class="badge bg-warning"><i class="far fa-clock" aria-hidden="true"></i>
Expires in {{allocation_change.allocation.expires_in}} day{{allocation_change.allocation.expires_in|pluralize}} - Not renewable
</span>
{% endif %}
Expand All @@ -94,11 +94,11 @@ <h3 class="d-inline"><i class="fas fa-list" aria-hidden="true"></i> Allocation I
</tr>
<tr>
<th scope="row" class="text-nowrap">Change Requested:</th>
<td>{{ allocation_change.created|date:"M. d, Y" }}</td>
<td>{{ allocation_change.created|date:"Y-m-d" }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Change Last Modified:</th>
<td>{{ allocation_change.modified|date:"M. d, Y" }}</td>
<td>{{ allocation_change.modified|date:"Y-m-d" }}</td>
</tr>
<tr>
{% if allocation_change.allocation.is_locked %}
Expand Down Expand Up @@ -141,7 +141,7 @@ <h3 class="d-inline"><i class="fas fa-info-circle" aria-hidden="true"></i> Alloc
{% if request.user.is_superuser %}
<td>
{{form.new_value}}
<a href="{% url 'allocation-attribute-change-delete' form.change_pk.value %}" class="float-right confirm-delete">
<a href="{% url 'allocation-attribute-change-delete' form.change_pk.value %}" class="float-end confirm-delete">
<i class="far fa-trash-alt fa-lg"></i>
</a>
</td>
Expand Down Expand Up @@ -170,7 +170,7 @@ <h3 class="d-inline"><i class="fas fa-info-circle" aria-hidden="true"></i> Alloc
</div>
</div>

<p class="card-text text-justify">{{allocation_change_form.justification | as_crispy_field}}</p>
<p class="card-text">{{allocation_change_form.justification | as_crispy_field}}</p>

<hr/>

Expand All @@ -184,12 +184,12 @@ <h3 class="d-inline"><i class="fas fa-info-circle" aria-hidden="true"></i> Actio

{% csrf_token %}
{{note_form.notes | as_crispy_field}}
<div style="float: right;">
<div style="float:right;">
{% if allocation_change.status.name == 'Pending' %}
<button type="submit" name="action" value="approve" class="btn btn-success mr-1">Approve</button>
<button type="submit" name="action" value="deny" class="btn btn-danger mr-1">Deny</button>
<button type="submit" name="action" value="approve" class="btn btn-success me-1">Approve</button>
<button type="submit" name="action" value="deny" class="btn btn-danger me-1">Deny</button>
{% endif %}
<button type="submit" name="action" value="update" class="btn btn-primary float-right">
<button type="submit" name="action" value="update" class="btn btn-primary float-end">
<i class="fas fa-sync" aria-hidden="true"></i> Update
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>Allocation Change Requests</h2>

<hr>

<p class="text-justify">
<p>
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.
Expand All @@ -38,7 +38,7 @@ <h2>Allocation Change Requests</h2>
{% for change in allocation_change_list %}
<tr>
<td>{{change.pk}}</td>
<td>{{ change.created|date:"M. d, Y" }}</td>
<td>{{ change.created|date:"Y-m-d" }}</td>
<td><a href="{% url 'project-detail' change.allocation.project.pk %}">{{change.allocation.project.title|truncatechars:50}}</a></td>
<td>{{change.allocation.project.pi.first_name}} {{change.allocation.project.pi.last_name}}
({{change.allocation.project.pi.username}})</td>
Expand All @@ -51,7 +51,7 @@ <h2>Allocation Change Requests</h2>
<td class="text-nowrap">
<form method="post" action="{% url 'allocation-change-detail' change.pk %}">
{% if change.allocationattributechangerequest_set.all %}
<button class="btn btn-success mr-1" aria-disabled="true"
<button class="btn btn-success me-1" aria-disabled="true"
style="
cursor: not-allowed;
opacity: 0.6;
Expand All @@ -61,7 +61,7 @@ <h2>Allocation Change Requests</h2>
{% else %}
{% csrf_token %}
<input type="hidden" name="end_date_extension" value="{{ change.end_date_extension }}" />
<button type="submit" name="action" value="approve" class="btn btn-success mr-1">Approve</button>
<button type="submit" name="action" value="approve" class="btn btn-success me-1">Approve</button>
{% endif %}
<a href="{% url 'allocation-change-detail' change.pk %}" class="btn btn-primary mr-1">Details</a>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h2>Request New Allocation <br><small>Project: {{ project.title }}</small></h2>
<hr>

<p class="text-justify">The following {% settings_value 'CENTER_NAME' %}
<p>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
Expand All @@ -26,7 +26,7 @@ <h2>Request New Allocation <br><small>Project: {{ project.title }}</small></h2>
<div id="eula-div" style="display: none;">
<textarea style="display:none;min-width:100%" id="eula" rows="15"></textarea>
<br>
<p class="font-weight-bold">By clicking submit you agree to the Terms and Conditions.</p>
<p class="fw-bold">By clicking submit you agree to the Terms and Conditions.</p>
</div>

<input class="btn btn-primary" type="submit" value="Submit" />
Expand All @@ -39,8 +39,8 @@ <h2>Request New Allocation <br><small>Project: {{ project.title }}</small></h2>
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Add New Account Name</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
<!-- <span aria-hidden="true">&times;</span> -->
</button>
</div>
<div class="modal-body">
Expand All @@ -49,13 +49,13 @@ <h5 class="modal-title" id="exampleModalLabel">Add New Account Name</h5>
<form id="allocation_account_form">
{{AllocationAccountForm |crispy}}
<button id="myFormSubmit" class="btn btn-primary" type="submit">Submit</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Send message</button>
</div>
</div>
Expand All @@ -67,7 +67,7 @@ <h5 class="modal-title" id="exampleModalLabel">Add New Account Name</h5>
var resources_with_eula = {{ resources_with_eula | safe }};

$(document).ready(function () {
$('<br><input id="selectAll" class="check" type="checkbox"> <strong>Select All Users</strong>').insertAfter($("#div_id_users > label"))
$('<br><input id="selectAll" class="form-check-input" type="checkbox"> <strong>Select All Users</strong>').insertAfter($("#div_id_users > label"))
$("#id_resource").trigger('change');

$("#selectAll").click(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h3>Delete invoice notes for allocation to {{allocation.get_resources_as_string}
<thead>
<tr>
<th>
<input type="checkbox" class="check" id="selectAll">
<input type="checkbox" class="form-check-input" id="selectAll">
</th>
<th scope="col">Note</th>
<th scope="col">Author</th>
Expand Down
Loading