mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
cleaned code and added css spacing
This commit is contained in:
@@ -33,7 +33,6 @@ from app.asset_fingerprinter import asset_fingerprinter
|
|||||||
from app.config import configs
|
from app.config import configs
|
||||||
from app.extensions import redis_client
|
from app.extensions import redis_client
|
||||||
from app.formatters import (
|
from app.formatters import (
|
||||||
convert_time_unixtimestamp,
|
|
||||||
convert_markdown_template,
|
convert_markdown_template,
|
||||||
convert_to_boolean,
|
convert_to_boolean,
|
||||||
format_auth_type,
|
format_auth_type,
|
||||||
|
|||||||
@@ -421,14 +421,18 @@ td.table-empty-message {
|
|||||||
width: 25%;
|
width: 25%;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
|
td.jobid {
|
||||||
|
width: 5%;
|
||||||
|
}
|
||||||
td.template {
|
td.template {
|
||||||
width: 20%;
|
width: 25%;
|
||||||
}
|
}
|
||||||
td.time-sent {
|
td.time-sent {
|
||||||
width: 20%;
|
width: 30%;
|
||||||
}
|
}
|
||||||
td.sender {
|
td.sender {
|
||||||
width: 15%;
|
width: 20%;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
td.count-of-recipients {
|
td.count-of-recipients {
|
||||||
width: 5%;
|
width: 5%;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from flask_login import current_user
|
|||||||
from werkzeug.utils import redirect
|
from werkzeug.utils import redirect
|
||||||
|
|
||||||
from app import current_service, job_api_client
|
from app import current_service, job_api_client
|
||||||
from app.formatters import get_time_left, convert_time_unixtimestamp
|
from app.formatters import convert_time_unixtimestamp, get_time_left
|
||||||
from app.main import main
|
from app.main import main
|
||||||
from app.utils.pagination import (
|
from app.utils.pagination import (
|
||||||
generate_next_dict,
|
generate_next_dict,
|
||||||
@@ -43,13 +43,9 @@ def all_jobs_activity(service_id):
|
|||||||
def handle_pagination(jobs, service_id, page):
|
def handle_pagination(jobs, service_id, page):
|
||||||
if page is None:
|
if page is None:
|
||||||
abort(404, "Invalid page argument ({}).".format(request.args.get("page")))
|
abort(404, "Invalid page argument ({}).".format(request.args.get("page")))
|
||||||
|
|
||||||
prev_page = generate_previous_dict("main.all_jobs_activity", service_id, page) if page > 1 else None
|
prev_page = generate_previous_dict("main.all_jobs_activity", service_id, page) if page > 1 else None
|
||||||
|
|
||||||
next_page = generate_next_dict("main.all_jobs_activity", service_id, page) if jobs["links"].get("next") else None
|
next_page = generate_next_dict("main.all_jobs_activity", service_id, page) if jobs["links"].get("next") else None
|
||||||
|
|
||||||
pagination = generate_pagination_pages(jobs["total"], jobs['page_size'], page)
|
pagination = generate_pagination_pages(jobs["total"], jobs['page_size'], page)
|
||||||
|
|
||||||
return prev_page, next_page, pagination
|
return prev_page, next_page, pagination
|
||||||
|
|
||||||
|
|
||||||
@@ -57,17 +53,17 @@ def generate_job_dict(jobs):
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"job_id": job["id"],
|
"job_id": job["id"],
|
||||||
"sort_value": hashlib.sha1(job["id"].encode("utf-8")).hexdigest(),
|
|
||||||
"job_sort_value": job["id"].replace("-", ""),
|
|
||||||
"time_left": get_time_left(job["created_at"]),
|
"time_left": get_time_left(job["created_at"]),
|
||||||
"download_link": url_for(".view_job_csv", service_id=current_service.id, job_id=job["id"]),
|
"download_link": url_for(".view_job_csv", service_id=current_service.id, job_id=job["id"]),
|
||||||
"view_job_link": url_for(".view_job", service_id=current_service.id, job_id=job["id"]),
|
"view_job_link": url_for(".view_job", service_id=current_service.id, job_id=job["id"]),
|
||||||
"created_at": job["created_at"],
|
"created_at": job["created_at"],
|
||||||
"time_sent_data_value": convert_time_unixtimestamp(job["processing_finished"] if job["processing_finished"] else job["processing_started"]
|
"time_sent_data_value": convert_time_unixtimestamp(
|
||||||
if job["processing_started"] else job["created_at"]),
|
job["processing_finished"] if job["processing_finished"]
|
||||||
|
else job["processing_started"] if job["processing_started"]
|
||||||
|
else job["created_at"]
|
||||||
|
),
|
||||||
"processing_finished": job["processing_finished"],
|
"processing_finished": job["processing_finished"],
|
||||||
"processing_started": job["processing_started"],
|
"processing_started": job["processing_started"],
|
||||||
"notification_count": job["notification_count"],
|
|
||||||
"created_by": job["created_by"],
|
"created_by": job["created_by"],
|
||||||
"template_name": job["template_name"]
|
"template_name": job["template_name"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{% extends "withnav_template.html" %}
|
{% extends "withnav_template.html" %}
|
||||||
|
|
||||||
{% from "components/ajax-block.html" import ajax_block %}
|
|
||||||
{% from "components/previous-next-navigation.html" import previous_next_navigation %}
|
|
||||||
|
|
||||||
{% block service_page_title %}
|
{% block service_page_title %}
|
||||||
All activity
|
All activity
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -54,7 +51,6 @@
|
|||||||
>
|
>
|
||||||
<span class="usa-pagination__link-text">Next </span>
|
<span class="usa-pagination__link-text">Next </span>
|
||||||
<img src="{{ url_for('static', filename='/img/usa-icons/navigate_next.svg') }}" alt="arrow">
|
<img src="{{ url_for('static', filename='/img/usa-icons/navigate_next.svg') }}" alt="arrow">
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -65,23 +61,19 @@
|
|||||||
|
|
||||||
|
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
<div class="dashboard margin-bottom-8">
|
<div class="margin-bottom-8">
|
||||||
<h1 class="usa-sr-only">All activity</h1>
|
<h1 class="usa-sr-only">All activity</h1>
|
||||||
{% if current_user.has_permissions('manage_templates') and not current_service.all_templates %}
|
{% if current_user.has_permissions('manage_templates') and not current_service.all_templates %}
|
||||||
<!-- {% include 'views/dashboard/write-first-messages.html' %} -->
|
{% include 'views/dashboard/write-first-messages.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- {{ ajax_block(partials, updates_url, 'upcoming') }} -->
|
|
||||||
|
|
||||||
<h2 class="font-body-2xl line-height-sans-2 margin-0">All activity</h2>
|
<h2 class="font-body-2xl line-height-sans-2 margin-0">All activity</h2>
|
||||||
|
|
||||||
<h2 class="margin-top-4 margin-bottom-1">Sent jobs</h2>
|
<h2 class="margin-top-4 margin-bottom-1">Sent jobs</h2>
|
||||||
<div class="table-wrapper" tabindex="0">
|
<div class="table-wrapper" tabindex="0">
|
||||||
<table class="usa-table usa-table--borderless job-table" id="jobIdHeader">
|
<table class="usa-table usa-table--border job-table" id="jobIdHeader">
|
||||||
<caption></caption>
|
<caption></caption>
|
||||||
<thead class="table-field-headings">
|
<thead class="table-field-headings">
|
||||||
<tr>
|
<tr>
|
||||||
<th data-sortable aria-sort="none" scope="col" role="columnheader" class="table-field-heading-first" aria-sort="none" id="jobId">
|
<th scope="col" role="columnheader" class="table-field-heading-first" id="jobId">
|
||||||
<span>Job ID#</span>
|
<span>Job ID#</span>
|
||||||
</th>
|
</th>
|
||||||
<th data-sortable scope="col" role="columnheader" class="table-field-heading">
|
<th data-sortable scope="col" role="columnheader" class="table-field-heading">
|
||||||
@@ -101,29 +93,18 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% if all_jobs_dict %}
|
{% if all_jobs_dict %}
|
||||||
{% for job in all_jobs_dict %}
|
{% for job in all_jobs_dict %}
|
||||||
{% if job.job_id %}
|
<tr class="table-row">
|
||||||
<tr class="table-row" id="{{ job.job_id|replace('-', '') }}">
|
<td class="table-field jobid" scope="row" role="rowheader">
|
||||||
<!-- <th class="table-field file-name" scope="row" role="rowheader" data-sort-value="{{ job.job_id }}" id="jobId">
|
<a class="usa-link" href="{{ job.view_job_link }}">
|
||||||
<a class="usa-link file-list-filename" href="{{ job.view_job_link }}">
|
{{ job.job_id[:8] if job.job_id else 'Manually entered number' }}
|
||||||
{{ job.job_id if job.job_id else 'Manually entered number' }}
|
|
||||||
</a>
|
|
||||||
</th> -->
|
|
||||||
<td class="table-field file-name" scope="row" role="rowheader" data-sort-value="{{ job.job_id | replace('-', '') }}">
|
|
||||||
<a class="usa-link file-list-filename" href="{{ job.view_job_link }}">
|
|
||||||
{{ job.job_id if job.job_id else 'Manually entered number' }}
|
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td class="table-field template">{{ job.template_name }}</td>
|
||||||
<td class="table-field template">
|
|
||||||
{{ job.template_name }}
|
|
||||||
</td>
|
|
||||||
<td data-sort-value="{{job.time_sent_data_value}}" class="table-field time-sent">
|
<td data-sort-value="{{job.time_sent_data_value}}" class="table-field time-sent">
|
||||||
{{ (job.processing_finished if job.processing_finished else job.processing_started
|
{{ (job.processing_finished if job.processing_finished else job.processing_started
|
||||||
if job.processing_started else job.created_at)|format_datetime_table }}
|
if job.processing_started else job.created_at)|format_datetime_table }}
|
||||||
</td>
|
</td>
|
||||||
<td class="table-field sender">
|
<td class="table-field sender">{{ job.created_by.name }}</td>
|
||||||
{{ job.created_by.name }}
|
|
||||||
</td>
|
|
||||||
<td class="table-field report table-field-center-aligned">
|
<td class="table-field report table-field-center-aligned">
|
||||||
{% if job.time_left != "Data no longer available" %}
|
{% if job.time_left != "Data no longer available" %}
|
||||||
<a class="usa-link file-list-filename" href="{{ job.download_link }}"><img src="{{ url_for('static', filename='img/material-icons/file_download.svg') }}" alt="File Download Icon"></a>
|
<a class="usa-link file-list-filename" href="{{ job.download_link }}"><img src="{{ url_for('static', filename='img/material-icons/file_download.svg') }}" alt="File Download Icon"></a>
|
||||||
@@ -132,15 +113,13 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="usa-sr-only usa-table__announcement-region" aria-live="polite"></div>
|
<div class="usa-sr-only usa-table__announcement-region" aria-live="polite"></div>
|
||||||
<p><b>Note:</b> Report data is only available for 7 days after your message has been sent</p>
|
<p><b>Note:</b>Report data is only available for 7 days after your message has been sent</p>
|
||||||
</div>
|
</div>
|
||||||
{{show_pagination}}
|
{{show_pagination}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user