Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
.git
.gitignore

.venv
__pycache__/
*.pyc
node_modules


# everything in gitignore
*.py[cod]
*.swp
Expand Down
3 changes: 1 addition & 2 deletions Containerfile.debugpy
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 4 additions & 2 deletions coldfront/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
Base Django settings for ColdFront project.
"""

import importlib.util

Check failure on line 9 in coldfront/config/base.py

View workflow job for this annotation

GitHub Actions / ruff lint

ruff (F401)

coldfront/config/base.py:9:8: F401 `importlib.util` imported but unused help: Remove unused import: `importlib.util`
import os
import sys

Check failure on line 11 in coldfront/config/base.py

View workflow job for this annotation

GitHub Actions / ruff lint

ruff (F401)

coldfront/config/base.py:11:8: F401 `sys` imported but unused help: Remove unused import: `sys`
import coldfront

from django.core.exceptions import ImproperlyConfigured
from django.core.management.utils import get_random_secret_key

import coldfront

Check failure on line 17 in coldfront/config/base.py

View workflow job for this annotation

GitHub Actions / ruff lint

ruff (F811)

coldfront/config/base.py:17:8: F811 Redefinition of unused `coldfront` from line 12: `coldfront` redefined here coldfront/config/base.py:12:8: previous definition of `coldfront` here help: Remove definition: `coldfront`
from coldfront.config.env import ENV, PROJECT_ROOT

Check failure on line 18 in coldfront/config/base.py

View workflow job for this annotation

GitHub Actions / ruff lint

ruff (I001)

coldfront/config/base.py:9:1: I001 Import block is un-sorted or un-formatted help: Organize imports

# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -60,7 +60,7 @@

INSTALLED_APPS += [
"crispy_forms",
"crispy_bootstrap4",
"crispy_bootstrap5",
"django_q",
"simple_history",
"django_vite",
Expand Down Expand Up @@ -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/"
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
270 changes: 135 additions & 135 deletions coldfront/core/allocation/templates/allocation/allocation_change.html
Original file line number Diff line number Diff line change
@@ -1,135 +1,135 @@
{% extends "common/base.html" %}
{% load crispy_forms_tags %}
{% load static %}
{% block title %}
Request Allocation Change
{% endblock %}
{% block content %}
<h2>Request change to {{ allocation.get_parent_resource }} for project: {{ allocation.project.title }}</h2>
<hr>
<p class="text-justify">
Request changes to an existing allocation using the form below. For each change
you must provide a justification.
</p>
<form action="{% url 'allocation-change' allocation.pk %}" method="post">
<div class="card mb-3">
<div class="card-header">
<h3><i class="fas fa-list" aria-hidden="true"></i> Allocation Information</h3>
</div>
<div class="card-body">
{% csrf_token %}
<div class="table-responsive">
<table class="table table-bordered table-sm">
<tr>
<th scope="row" class="text-nowrap">Project:</th>
<td><a href="{% url 'project-detail' allocation.project.pk %}">{{ allocation.project }}</a></td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Resource{{ allocation.resources.all|pluralize }} in allocation:</th>
<td>{{ allocation.get_resources_as_string }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Justification:</th>
<td>{{ allocation.justification }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Status:</th>
<td>{{ allocation.status }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Start Date:</th>
<td>{{ allocation.start_date }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">End Date:</th>
<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>
Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}} - Not renewable
</span>
{% endif %}
</td>
</tr>
{% if allocation.is_changeable %}
<tr>
<th scope="row" class="text-nowrap">Request End Date Extension:</th>
<td>
{{ form.end_date_extension }}
</td>
</tr>
{% endif %}
<tr>
<th scope="row" class="text-nowrap">Description:</th>
<td>{{allocation.description|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Created:</th>
<td>{{ allocation.created|date:"M. d, Y" }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Last Modified:</th>
<td>{{ allocation.modified|date:"M. d, Y" }}</td>
</tr>
<tr>
{% if allocation.is_locked %}
<th scope="row" class="text-nowrap">Locked</th>
<td><i class="fas fa-lock" aria-hidden="true"></i></td>
{% else %}
<th scope="row" class="text-nowrap">Unlocked</th>
<td><i class="fas fa-lock-open" aria-hidden="true"></i></td>
{% endif %}
</tr>
</table>
</div>
</div>
</div>
{% if formset %}
<div class="card mb-3">
<div class="card-header">
<h3 class="d-inline"><i class="fas fa-info-circle" aria-hidden="true"></i> Allocation Attributes</h3>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered table-sm">
<thead>
<tr>
<th scope="col">Attribute</th>
<th scope="col">Current Value</th>
<th scope="col">Request New Value</th>
</tr>
</thead>
<tbody>
{% for form in formset %}
<tr>
<td>{{form.name.value}}</td>
<td>{{form.value.value}}</td>
<td>{{form.new_value}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{{ formset.management_form }}
</div>
</div>
{% endif %}
<div>
{{form.justification | as_crispy_field }}
<input class="btn btn-success" type="submit" value="Submit" />
<a class="btn btn-secondary" href="{% url 'allocation-detail' allocation.pk %}" role="button">Back to
Allocation</a><br>
</div>
</form>
{% endblock %}
{% extends "common/base.html" %}
{% load crispy_forms_tags %}
{% load static %}


{% block title %}
Request Allocation Change
{% endblock %}


{% block content %}

<h2>Request change to {{ allocation.get_parent_resource }} for project: {{ allocation.project.title }}</h2>
<hr>

<p>
Request changes to an existing allocation using the form below. For each change
you must provide a justification.
</p>

<form action="{% url 'allocation-change' allocation.pk %}" method="post">
<div class="card mb-3">
<div class="card-header">
<h3><i class="fas fa-list" aria-hidden="true"></i> Allocation Information</h3>
</div>

<div class="card-body">
{% csrf_token %}
<div class="table-responsive">
<table class="table table-bordered table-sm">
<tr>
<th scope="row" class="text-nowrap">Project:</th>
<td><a href="{% url 'project-detail' allocation.project.pk %}">{{ allocation.project }}</a></td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Resource{{ allocation.resources.all|pluralize }} in allocation:</th>
<td>{{ allocation.get_resources_as_string }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Justification:</th>
<td>{{ allocation.justification }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Status:</th>
<td>{{ allocation.status }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Start Date:</th>
<td>{{ allocation.start_date }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">End Date:</th>
<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 bg-warning text-dark"><i class="far fa-clock" aria-hidden="true"></i>
Expires in {{allocation.expires_in}} day{{allocation.expires_in|pluralize}} - Not renewable
</span>
{% endif %}
</td>
</tr>
{% if allocation.is_changeable %}
<tr>
<th scope="row" class="text-nowrap">Request End Date Extension:</th>
<td>
{{ form.end_date_extension }}
</td>
</tr>
{% endif %}
<tr>
<th scope="row" class="text-nowrap">Description:</th>
<td>{{allocation.description|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Created:</th>
<td>{{ allocation.created|date:"M. d, Y" }}</td>
</tr>
<tr>
<th scope="row" class="text-nowrap">Last Modified:</th>
<td>{{ allocation.modified|date:"M. d, Y" }}</td>
</tr>
<tr>
{% if allocation.is_locked %}
<th scope="row" class="text-nowrap">Locked</th>
<td><i class="fas fa-lock" aria-hidden="true"></i></td>
{% else %}
<th scope="row" class="text-nowrap">Unlocked</th>
<td><i class="fas fa-lock-open" aria-hidden="true"></i></td>
{% endif %}
</tr>
</table>
</div>
</div>
</div>

{% if formset %}
<div class="card mb-3">
<div class="card-header">
<h3 class="d-inline"><i class="fas fa-info-circle" aria-hidden="true"></i> Allocation Attributes</h3>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered table-sm">
<thead>
<tr>
<th scope="col">Attribute</th>
<th scope="col">Current Value</th>
<th scope="col">Request New Value</th>
</tr>
</thead>
<tbody>
{% for form in formset %}
<tr>
<td>{{form.name.value}}</td>
<td>{{form.value.value}}</td>
<td>{{form.new_value}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{{ formset.management_form }}
</div>
</div>
{% endif %}

<div>
{{form.justification | as_crispy_field }}
<input class="btn btn-success" type="submit" value="Submit" />
<a class="btn btn-secondary" href="{% url 'allocation-detail' allocation.pk %}" role="button">Back to
Allocation</a><br>
</div>
</form>

{% endblock %}
Loading
Loading