Skip to content

Commit

Permalink
Merge branch 'main' into feat/example-cms-v3.11.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored Aug 10, 2023
2 parents 912381e + 1d4c600 commit 67064af
Show file tree
Hide file tree
Showing 47 changed files with 1,686 additions and 481 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ecep-cms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: ECEP CMS Builds
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'ecep_cms/**'

jobs:
build_commit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ecep_cms
steps:
- uses: actions/checkout@v2
- name: Get shortsha
id: vars
run: |
if [ -z "$EVENT_SHA" ]; then SHORT_SHA=${GITHUB_SHA::8}; else SHORT_SHA=${EVENT_SHA::8}; fi
echo ::set-output name=sha_short::${SHORT_SHA}
env:
EVENT_SHA: ${{ github.event.client_payload.sha }}
- name: Print shortsha
run: |
echo $SHORTSHA
env:
SHORTSHA: ${{ steps.vars.outputs.sha_short }}
- uses: docker/setup-buildx-action@v2
name: Setup Docker Builds
- uses: docker/login-action@v2
name: Log in to docker
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v3
name: Build & push commit tagged Docker image
with:
context: ecep_cms
push: true
tags: taccwma/ecep-cms:${{ steps.vars.outputs.sha_short }}
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Set up a new local CMS instance.

0. Core CMS:

In the `custom_project_dir/` you will run, create a `settings_local.py` with content from [Core-CMS `settings_local.example.py`](https://github.com/TACC/Core-CMS/blob/main/taccsite_cms/settings_local.example.py).
In the `/custom_project_dir/` you will run, create a `./src/taccsite_cms/settings_local.py` with content from [Core-CMS `settings_local.example.py`](https://github.com/TACC/Core-CMS/blob/main/taccsite_cms/settings_local.example.py).

1. Docker Containers:

Expand All @@ -78,13 +78,10 @@ Set up a new local CMS instance.
# To use default "Username" and skip "Email address", press Enter at both prompts.
# At "Password" prompts, you may use an easy-to-remember password.
python manage.py collectstatic --no-input
# If the project has no static assets,
# (and you have not set up other projects)
# then expect output of "0 static files […]"
```

3. Django CMS:
1. Open http://0.0.0.0:8000/.
1. Open http://localhost:8000/.
2. Login with the credentials you defined in step 2.
3. Create one CMS page.\
(With "New page" highlighted, click "Next" button.)
Expand Down Expand Up @@ -116,6 +113,8 @@ Update an existing local CMS instance.
# That opens a command prompt within the container.
python manage.py migrate
python manage.py collectstatic --no-input
# If the project has no new/changed assets,
# then expect output of "0 static files […]"
```

[^1]: Pertinent changes are those in the Core CMS or the custom project. Changes to external assets or databases are not pertinent.
Expand Down
2 changes: 1 addition & 1 deletion apcd-cms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ An extension of the [Core CMS](https://github.com/TACC/Core-CMS) project

## Basics

See [Core-CMS-Custom](https://github.com/TACC/Core-CMS-Custom#readme).
See [Core-CMS-Custom](../README.md).
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
.title {
margin-top: 0;
}

.modal-section {
width: 100%;
}

dl {
display: flex;
flex-flow: row wrap;
padding-left: 0;
}

dt {
flex-basis: 25%;
padding: 0;
}

dd {
flex-basis: 75%;
}
margin: 0;
padding: 0;
}
/* Necessary so dl keys display fully */
.modal-body {
padding: 2rem;
font-size: var(--global-font-size--small);
font-family: var(--global-font-family--sans--portal);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.modal-cell {
padding-left: 0px;
}
/* SEE: https://css-tricks.com/responsive-data-tables/ */
@media (max-width: 767px) {

/* To label the cells */
/* RFE: Add `data-label` to each cell so we can use `attr(data-label)` */
.exception-table td:nth-of-type(1):before { content: "Created"; }
.exception-table td:nth-of-type(2):before { content: "Organization"; }
.exception-table td:nth-of-type(3):before { content: "Requestor Name"; }
.exception-table td:nth-of-type(4):before { content: "Exception Type"; }
.exception-table td:nth-of-type(5):before { content: "Outcome"; }
.exception-table td:nth-of-type(6):before { content: "Status"; }
.exception-table td:nth-of-type(7):before { content: "Actions"; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "standard.html" %}
{% block content %}

{% include 'snippets/tup-175-css-alerts-messages-ui-pattern.html' %}

<div class="container">
{% include "nav_cms_breadcrumbs.html" %}

<h1>Edit Exception</h1>
<hr />
<p class="c-message c-message--error">
An error occurred while updating this Exception. For help, <a href="/workbench/dashboard">submit a ticket</a>.
</p>
<a class="c-button c-button--primary" href="/administration/list-exceptions/">Back to List Exceptions</a>
</div>
{% endblock %}
127 changes: 127 additions & 0 deletions apcd-cms/src/apps/admin_exception/templates/edit_exception_modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{% load static %}
<link rel="stylesheet" href="{% static 'apcd-cms/css/modal.css' %}">
<link rel="stylesheet" href="{% static 'admin_exception/css/modal.css' %}">
<div id="editExceptionModal_{{r.exception_id}}" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Edit Exception ID: {{r.exception_id}} for {{r.org_name}}</h4>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&#xe912;</span>
</button>
</div>
<div class="modal-body">
<div class="modal-section">
<h4 class="modal-header">Edit Selected Exception</h4>
<form action="" method="POST">
{% csrf_token %}
<div class="field-wrapper textinput required disabled">
<input type="hidden" name="exception_id" id="exception_id" value="{{r.exception_id}}">
</div>
<div class="o-grid o-grid--col-auto-count">
<!-- To not allow edit of approved_threshold
unless it is a threshold exception request-->
{% if r.request_type == 'Threshold' %}
<div class="field-wrapper numberinput required">
<div class="field-errors" style="display: none"></div>
<label for="approved_threshold" >Approved Threshold </label>
</label>
<!-- Value set so if there isn't an approved threshold from DB, None is not displayed and field is blank-->
<input type="numeric" name="approved_threshold" class="approved_threshold"
inputmode="numeric" id="approved_threshold" value="{{r.approved_threshold|default:''}}"/>
<div id="help-text-approved_threshold" class="help-text">
Requested: {{r.requested_threshold}}%
</div>
</div>
{% endif %}
<div class="field-wrapper numberinput required" >
<div class="field-errors" style="display: none"></div>

<label for="approved" name="date-row">Approved Expiration Date</label>

<input type="date" name="approved" class="numeric" id="approved"
inputmode="numeric"/>
<div id="help-text-approved" class="help-text">
Current: {{r.approved_expiration_date}}
</div>
</div>
<div class="field-wrapper textinput required">
<label for="status">
Exception Status
</label>
<select name='status' class="choicefield" id='status'>
<!-- To make sure hard coded 'All' option doesn't populate in edit modal dropdown-->
{% for option in status_options %}
{% if option != 'All' %}
<option class="dropdown-text" {% if option == r.status %}selected{% endif %}>{{ option }}</option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="field-wrapper textinput required">
<label for="status">
Exception Outcome
</label>
<select name='outcome' class="choicefield" id='outcome'>
{% for option in outcome_options %}
<option class="dropdown-text" {% if option == r.outcome %}selected{% endif %}>{{ option }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="field-wrapper textarea required">
<label for="notes">
Exception Notes
</label>
<textarea name="notes" cols="40" rows="5" class="textinput" type="text" id="notes"
minlength="2" maxlength="2000">{{r.notes|default:''}}</textarea>
<div class="help-text">
2000 character limit
</div>
</div>
<div class="button-wrapper submit">
<button class="form-button" type="submit" value="Submit">
Submit
</button>
</div>
<hr>
</form>
</div>
<div class="modal-section">
<h4 class="modal-header">Current Exception Information</h4>
<dl class="c-data-list--is-vert c-data-list--is-wide">
<dt class="c-data-list__key">Created</dt>
<dd class="c-data-list__value">{{r.created_at}}</dd>
<dt class="c-data-list__key">Organization</dt>
<dd class="c-data-list__value">{{r.org_name}}</dd>
<dt class="c-data-list__key">Requestor</dt>
<dd class="c-data-list__value">{{r.requestor_name}}</dd>
<dt class="c-data-list__key">Requestor Email</dt>
<dd class="c-data-list__value">{{r.requestor_email}}</dd>
<dt class="c-data-list__key">Exception Type</dt>
<dd class="c-data-list__value">{{r.request_type}}</dd>
<dt class="c-data-list__key">Status</dt>
<dd class="c-data-list__value">{{r.status}}</dd>
<dt class="c-data-list__key">Outcome</dt>
<dd class="c-data-list__value">{{r.outcome}}</dd>
<dt class="c-data-list__key">File Type</dt>
<dd class="c-data-list__value">{{r.data_file_name}}</dd>
<dt class="c-data-list__key">Field Number</dt>
<dd class="c-data-list__value">{{r.field_number}}</dd>
<dt class="c-data-list__key">Required Threshold</dt>
<dd class="c-data-list__value">{{r.required_threshold}}</dd>
<dt class="c-data-list__key">Requested Expiration Date</dt>
<dd class="c-data-list__value">{{r.requested_expiration_date}}</dd>
<dt class="c-data-list__key">Explanation Justification</dt>
<dd class="c-data-list__value">{{r.explanation_justification}}</dd>
<dt class="c-data-list__key">Last Updated</dt>
<dd class="c-data-list__value">{{r.updated_at}}</dd>
</dl>
<hr>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends "standard.html" %}
{% block content %}
<div class="container">
{% include "nav_cms_breadcrumbs.html" %}

<h1>Edit Exception</h1>
<hr />
<p>
Updating this exception was successful.
</p>
<a class="c-button c-button--primary" href="/administration/list-exceptions/">Back to List Exceptions</a>
</div>
{% endblock %}
Loading

0 comments on commit 67064af

Please sign in to comment.