mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
1089- styling update to Team Member cards
This commit is contained in:
@@ -585,7 +585,7 @@ def add_template_filters(application):
|
|||||||
format_mobile_network,
|
format_mobile_network,
|
||||||
format_yes_no,
|
format_yes_no,
|
||||||
square_metres_to_square_miles,
|
square_metres_to_square_miles,
|
||||||
convert_markdown_template
|
convert_markdown_template,
|
||||||
]:
|
]:
|
||||||
application.add_template_filter(fn)
|
application.add_template_filter(fn)
|
||||||
|
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ td.table-empty-message {
|
|||||||
.button-flex-header {
|
.button-flex-header {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
margin-bottom: units(2);
|
||||||
@include at-media(desktop) {
|
@include at-media(desktop) {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -141,10 +142,11 @@ td.table-empty-message {
|
|||||||
.user-list {
|
.user-list {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: units(2);
|
gap: units(4);
|
||||||
.user-list-item {
|
.user-list-item {
|
||||||
@include at-media(desktop) {
|
@include at-media(desktop) {
|
||||||
flex: 1 1 calc(50% - units(2));
|
flex: 1 1 calc(50% - units(2));
|
||||||
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
flex: 1 1 calc(100% - units(2));
|
flex: 1 1 calc(100% - units(2));
|
||||||
border: 1px solid color('gray-cool-10');
|
border: 1px solid color('gray-cool-10');
|
||||||
|
|||||||
@@ -26,18 +26,16 @@ from app.utils.time import parse_naive_dt
|
|||||||
|
|
||||||
|
|
||||||
def apply_html_class(tags, html_file):
|
def apply_html_class(tags, html_file):
|
||||||
|
|
||||||
new_html = html_file
|
new_html = html_file
|
||||||
|
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
|
|
||||||
element = tag[0]
|
element = tag[0]
|
||||||
class_name = tag[1]
|
class_name = tag[1]
|
||||||
|
|
||||||
soup = BeautifulSoup(new_html, 'html.parser')
|
soup = BeautifulSoup(new_html, "html.parser")
|
||||||
|
|
||||||
for xtag in soup.find_all(element):
|
for xtag in soup.find_all(element):
|
||||||
xtag['class'] = class_name
|
xtag["class"] = class_name
|
||||||
|
|
||||||
new_html = str(soup)
|
new_html = str(soup)
|
||||||
|
|
||||||
@@ -45,12 +43,11 @@ def apply_html_class(tags, html_file):
|
|||||||
|
|
||||||
|
|
||||||
def convert_markdown_template(mdf, test=False):
|
def convert_markdown_template(mdf, test=False):
|
||||||
|
|
||||||
content_text = ""
|
content_text = ""
|
||||||
|
|
||||||
if not test:
|
if not test:
|
||||||
APP_ROOT = get_root_path('notifications-admin')
|
APP_ROOT = get_root_path("notifications-admin")
|
||||||
file = 'app/content/' + mdf + '.md'
|
file = "app/content/" + mdf + ".md"
|
||||||
md_file = os.path.join(APP_ROOT, file)
|
md_file = os.path.join(APP_ROOT, file)
|
||||||
with open(md_file) as f:
|
with open(md_file) as f:
|
||||||
content_text = f.read()
|
content_text = f.read()
|
||||||
|
|||||||
@@ -138,16 +138,20 @@ def get_started_old():
|
|||||||
@main.route("/using-notify/get-started")
|
@main.route("/using-notify/get-started")
|
||||||
@user_is_logged_in
|
@user_is_logged_in
|
||||||
def get_started():
|
def get_started():
|
||||||
markdown = convert_markdown_template('get-started')
|
markdown = convert_markdown_template("get-started")
|
||||||
html_style = apply_html_class([['ol', 'usa-process-list'],
|
html_style = apply_html_class(
|
||||||
['li', 'usa-process-list__item padding-bottom-4 margin-top-2'],
|
[
|
||||||
['h2', 'usa-process-list__heading line-height-sans-3']],
|
["ol", "usa-process-list"],
|
||||||
markdown)
|
["li", "usa-process-list__item padding-bottom-4 margin-top-2"],
|
||||||
|
["h2", "usa-process-list__heading line-height-sans-3"],
|
||||||
|
],
|
||||||
|
markdown,
|
||||||
|
)
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"views/get-started.html",
|
"views/get-started.html",
|
||||||
navigation_links=using_notify_nav(),
|
navigation_links=using_notify_nav(),
|
||||||
content=html_style
|
content=html_style,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -174,16 +174,23 @@ def test_format_delta():
|
|||||||
def test_jinja_format(fake_jinja_template):
|
def test_jinja_format(fake_jinja_template):
|
||||||
app = Flask("app")
|
app = Flask("app")
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
assert convert_markdown_template(fake_jinja_template, test=True) == "<p>True</p>"
|
assert (
|
||||||
|
convert_markdown_template(fake_jinja_template, test=True) == "<p>True</p>"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("fake_markdown_file")
|
@pytest.mark.usefixtures("fake_markdown_file")
|
||||||
def test_markdown_format(fake_markdown_file):
|
def test_markdown_format(fake_markdown_file):
|
||||||
app = Flask("app")
|
app = Flask("app")
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
assert convert_markdown_template(fake_markdown_file, test=True) == "<h1>Test</h1>"
|
assert (
|
||||||
|
convert_markdown_template(fake_markdown_file, test=True) == "<h1>Test</h1>"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("fake_soup_template")
|
@pytest.mark.usefixtures("fake_soup_template")
|
||||||
def test_soup_format(fake_soup_template):
|
def test_soup_format(fake_soup_template):
|
||||||
assert apply_html_class([['h1', 'testClass']], fake_soup_template) == '<h1 class="testClass">Test</h1>'
|
assert (
|
||||||
|
apply_html_class([["h1", "testClass"]], fake_soup_template)
|
||||||
|
== '<h1 class="testClass">Test</h1>'
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user