mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05:00
reorganized org templates and styling
This commit is contained in:
@@ -25,7 +25,6 @@ from app.main.views.dashboard import (
|
||||
)
|
||||
from app.models.organization import AllOrganizations, Organization
|
||||
from app.models.user import InvitedOrgUser, User
|
||||
from app.utils.navigation_dictionaries import using_organization_nav
|
||||
from app.utils.csv import Spreadsheet
|
||||
from app.utils.user import user_has_permissions, user_is_platform_admin
|
||||
|
||||
@@ -85,7 +84,6 @@ def organization_dashboard(org_id):
|
||||
download_link=url_for(
|
||||
".download_organization_usage_report", org_id=org_id, selected_year=year
|
||||
),
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@@ -147,7 +145,6 @@ def organization_trial_mode_services(org_id):
|
||||
return render_template(
|
||||
"views/organizations/organization/trial-mode-services.html",
|
||||
search_form=SearchByNameForm(),
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@@ -159,7 +156,6 @@ def manage_org_users(org_id):
|
||||
users=current_organization.team_members,
|
||||
show_search_box=(len(current_organization.team_members) > 7),
|
||||
form=SearchUsersForm(),
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@@ -178,8 +174,7 @@ def invite_org_user(org_id):
|
||||
return redirect(url_for(".manage_org_users", org_id=org_id))
|
||||
|
||||
return render_template(
|
||||
"views/organizations/organization/users/invite-org-user.html", form=form,
|
||||
org_navigation_links=using_organization_nav(),
|
||||
"views/organizations/organization/users/invite-org-user.html", form=form
|
||||
)
|
||||
|
||||
|
||||
@@ -233,7 +228,6 @@ def cancel_invited_org_user(org_id, invited_user_id):
|
||||
def organization_settings(org_id):
|
||||
return render_template(
|
||||
"views/organizations/organization/settings/index.html",
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@@ -257,7 +251,6 @@ def edit_organization_name(org_id):
|
||||
return render_template(
|
||||
"views/organizations/organization/settings/edit-name.html",
|
||||
form=form,
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@@ -278,7 +271,6 @@ def edit_organization_type(org_id):
|
||||
return render_template(
|
||||
"views/organizations/organization/settings/edit-type.html",
|
||||
form=form,
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@@ -317,7 +309,6 @@ def edit_organization_domains(org_id):
|
||||
return render_template(
|
||||
"views/organizations/organization/settings/edit-domains.html",
|
||||
form=form,
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@@ -336,7 +327,6 @@ def edit_organization_notes(org_id):
|
||||
return render_template(
|
||||
"views/organizations/organization/settings/edit-organization-notes.html",
|
||||
form=form,
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@@ -367,11 +357,10 @@ def edit_organization_billing_details(org_id):
|
||||
return render_template(
|
||||
"views/organizations/organization/settings/edit-organization-billing-details.html",
|
||||
form=form,
|
||||
org_navigation_links=using_organization_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route("/organizations/<uuid:org_id>/billing")
|
||||
@user_is_platform_admin
|
||||
def organization_billing(org_id):
|
||||
return render_template("views/organizations/organization/billing.html",org_navigation_links=using_organization_nav(),)
|
||||
return render_template("views/organizations/organization/billing.html")
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
<!-- <nav class="navigation">
|
||||
<ul>
|
||||
<li><a class="usa-link{{ org_navigation.is_selected('dashboard') }}" href="{{ url_for('.organization_dashboard', org_id=current_org.id) }}">Usage</a></li>
|
||||
<li><a class="usa-link{{ org_navigation.is_selected('team-members') }}" href="{{ url_for('.manage_org_users', org_id=current_org.id) }}">Team members</a></li>
|
||||
{% if current_user.platform_admin %}
|
||||
|
||||
<li><a class="usa-link{{ org_navigation.is_selected('settings') }}" href="{{ url_for('.organization_settings', org_id=current_org.id) }}">Settings</a></li>
|
||||
<li><a class="usa-link{{ org_navigation.is_selected('trial-services') }}" href="{{ url_for('.organization_trial_mode_services', org_id=current_org.id) }}">Trial mode services</a></li>
|
||||
<li><a class="usa-link{{ org_navigation.is_selected('billing') }}" href="{{ url_for('.organization_billing', org_id=current_org.id) }}">Billing</a></li>
|
||||
{% endif %}
|
||||
<nav class="nav margin-bottom-4">
|
||||
<ul class="usa-sidenav">
|
||||
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('dashboard') }}" href="{{ url_for('.organization_dashboard', org_id=current_org.id) }}">Usage</a></li>
|
||||
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('team-members') }}" href="{{ url_for('.manage_org_users', org_id=current_org.id) }}">Team members</a></li>
|
||||
{% if current_user.platform_admin %}
|
||||
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('settings') }}" href="{{ url_for('.organization_settings', org_id=current_org.id) }}">Settings</a></li>
|
||||
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('trial-services') }}" href="{{ url_for('.organization_trial_mode_services', org_id=current_org.id) }}">Trial mode services</a></li>
|
||||
<li class="usa-sidenav__item"><a class="usa-link{{ org_navigation.is_selected('billing') }}" href="{{ url_for('.organization_billing', org_id=current_org.id) }}">Billing</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav> -->
|
||||
|
||||
|
||||
{% if org_navigation_links %}
|
||||
<nav aria-label="Side navigation,">
|
||||
<ul class="usa-sidenav" itemtype="http://schema.org/ItemList">
|
||||
{% for item in org_navigation_links %}
|
||||
{% if not item['requires_permission'] or current_user.platform_admin %}
|
||||
<li class="usa-sidenav__item" href="{{ url_for(item['link'], org_id=current_org.id) }}"
|
||||
itemprop="itemListElement"
|
||||
itemscope
|
||||
itemtype="http://schema.org/ListItem"
|
||||
>
|
||||
<a class="{% if request.endpoint == item['link'] %}usa-current{% endif %}" href="{{ url_for(item['link'], org_id=current_org.id) }}" itemprop="item">
|
||||
<span itemprop="name">{{item['name']}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
{% extends "/new/base.html" %}
|
||||
|
||||
{% block per_page_title %}
|
||||
{% block org_page_title %}{% endblock %} – {{ current_org.name }}
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div class="grid-container">
|
||||
<div class="navigation-service usa-breadcrumb">
|
||||
{% if current_user.platform_admin %}
|
||||
<a href="{{ url_for('.organizations') }}" class="usa-link navigation-organization-link">Organizations</a>
|
||||
{% endif %}
|
||||
<div class="navigation-service">
|
||||
{{ current_org.name }}
|
||||
</div>
|
||||
<a href="{{ url_for('main.choose_account') }}" class="usa-link navigation-service">Switch service</a>
|
||||
</div>
|
||||
<div class="grid-row">
|
||||
<div class="grid-col-3">
|
||||
{% include "/new/components/org_nav.html" %}
|
||||
</div>
|
||||
<div class="grid-col-9">
|
||||
{% block beforeContent %}
|
||||
{% block backLink %}{% endblock %}
|
||||
{% endblock %}
|
||||
<main class="main" id="main-content" role="main" >
|
||||
{% block content %}
|
||||
{% include 'flash_messages.html' %}
|
||||
{% block maincolumn_content %}{% endblock %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -8,14 +8,17 @@
|
||||
{% block main %}
|
||||
<div class="grid-container">
|
||||
{% block serviceNavigation %}
|
||||
{% include "new/components/service_navigation.html" %}
|
||||
{% if current_org.name %}
|
||||
{% else %}
|
||||
{% include "new/components/service_navigation.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{#
|
||||
The withnav_template can serve as a replacement for both settings_template and org_template.html.
|
||||
|
||||
The file service_navigation.html is included only in withnav_template. It's not used in settings_template. That is one out of the two differences between settings template and withnav template. As a result, when other templates extend settings_template, they include the serviceNavigation block but keep it empty. The settings_template.html is specifically used for these pages in the app: manage-users.html, service-settings.html, and user-profile.html.
|
||||
|
||||
In addition, for templates that previously extended org_template.html, there's an addition of the orgNavBreadcrumb block. serviceNavigation should be empty on templates that previously extended org_template
|
||||
In addition, serviceNavigation should be empty on templates that previously extended org_template. For templates that previously extended org_template.html, there's an addition of the orgNavBreadcrumb block.
|
||||
{% block orgNavBreadcrumb %}
|
||||
{% include "/new/components/org_nav_breadcrumb.html" %}
|
||||
{% endblock %}
|
||||
@@ -24,7 +27,7 @@
|
||||
{% block orgNavBreadcrumb %}{% include "/new/components/org_nav_breadcrumb.html" %}{% endblock %}
|
||||
{% endif %}
|
||||
<div class="grid-row margin-top-5">
|
||||
<div class="grid-col-3">
|
||||
<div class="tablet:grid-col-3">
|
||||
{% block sideNavigation %}
|
||||
{% if org_navigation_links %}
|
||||
{% include "/new/components/org_nav.html" %}
|
||||
@@ -38,7 +41,7 @@
|
||||
#}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="grid-col-9 padding-left-4">
|
||||
<div class="tablet:grid-col-9 tablet:padding-left-4">
|
||||
{% block beforeContent %}
|
||||
{% block backLink %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
def using_organization_nav():
|
||||
return [
|
||||
{
|
||||
"name": "Usage",
|
||||
"link": ".organization_dashboard",
|
||||
"requires_permission": False,
|
||||
},
|
||||
{
|
||||
"name": "Team members",
|
||||
"link": ".manage_org_users",
|
||||
"requires_permission": False,
|
||||
},
|
||||
{
|
||||
"name": "Settings",
|
||||
"link": ".organization_settings",
|
||||
"requires_permission": False,
|
||||
},
|
||||
{
|
||||
"name": "Trial mode services",
|
||||
"link": ".organization_trial_mode_services",
|
||||
"requires_permission": False,
|
||||
},
|
||||
{
|
||||
"name": "Billing",
|
||||
"link": ".organization_billing",
|
||||
"requires_permission": False,
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user