-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
email_branding, | ||
find_services, | ||
find_users, | ||
find_ids, | ||
forgot_password, | ||
inbound_number, | ||
index, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from flask import render_template | ||
|
||
from app import user_api_client | ||
from app.main import main | ||
from app.main.forms import SearchIds | ||
from app.utils import user_is_platform_admin | ||
|
||
|
||
@main.route("/find-ids", methods=["GET", "POST"]) | ||
@user_is_platform_admin | ||
def find_ids(): | ||
form = SearchIds() | ||
records = None | ||
if form.validate_on_submit(): | ||
records = user_api_client.find_ids(form.search.data) | ||
return render_template("views/find-ids/find-ids.html", form=form, records=records) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{% extends "views/platform-admin/_base_template.html" %} | ||
{% from "components/form.html" import form_wrapper %} | ||
{% from "components/page-footer.html" import page_footer %} | ||
{% from "components/textbox.html" import textbox_search %} | ||
|
||
{% block per_page_title %} | ||
{{ _('Search for uuids') }} | ||
{% endblock %} | ||
|
||
{% block platform_admin_content %} | ||
|
||
<h1 class="heading-large"> | ||
{{ _('Search for ids') }} | ||
</h1> | ||
|
||
|
||
{% call form_wrapper( | ||
action=url_for('.find_ids'), | ||
class='grid-row contain-floats' | ||
) %} | ||
{% set label_txt = _('Find records by uuid') %} | ||
<div class="md:w-full float-left py-0 px-0 px-gutterHalf box-border"> | ||
{{ textbox_search( | ||
form.search, | ||
width='w-full', | ||
label=label_txt | ||
) }} | ||
</div> | ||
{% endcall %} | ||
|
||
{% call form_wrapper(id='search-form' ) %} | ||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> | ||
{% endcall %} | ||
|
||
{% if records %} | ||
{% for record in records %} | ||
<nav class="browse-list"> | ||
<ul> | ||
<li class="browse-list-item"> | ||
{{ record.id }} : | ||
{% if record.type == "notification" %} | ||
<a href="{{url_for('.view_notification', service_id=record.service_id, notification_id=record.id)}}" class="browse-list-link">notification</a> | ||
{% elif record.type == "template" %} | ||
<a href="{{url_for('.view_template', service_id=record.service_id, template_id=record.id)}}" class="browse-list-link">{{ record.template_name }}</a> | ||
{% elif record.type == "service" %} | ||
<a href="{{url_for('.service_dashboard', service_id=record.id)}}" class="browse-list-link">{{ record.service_name}} </a> | ||
{% elif record.type == "user" %} | ||
<a href="{{url_for('.user_information', user_id=record.id)}}" class="browse-list-link">{{ record.user_name }}</a> | ||
{% elif record.type == "job" %} | ||
<a href="{{url_for('.view_job', service_id=record.service_id, job_id=record.id)}}" class="browse-list-link">job</a> | ||
{% else %} | ||
{{ record.type}} | ||
{% endif %} | ||
</li> | ||
<hr> | ||
</ul> | ||
</nav> | ||
{% endfor %} | ||
|
||
{% elif records == [] %} | ||
<p class="browse-list-hint">{{ _('No records found.') }}</p> | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters