Skip to content

Commit

Permalink
Merge branch 'main' into enhance/CMD-182-design-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
jarosenb authored Oct 17, 2024
2 parents 9beb9ac + 14c4106 commit a7983db
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 26 deletions.
8 changes: 4 additions & 4 deletions apps/tup-cms/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"options": {
"commands": ["docker-compose -f docker-compose.dev.yml build"],
"commands": ["docker compose -f docker-compose.dev.yml build"],
"cwd": "apps/tup-cms",
"parallel": false
}
Expand All @@ -23,8 +23,8 @@
"executor": "nx:run-commands",
"options": {
"commands": [
"docker-compose -f docker-compose.dev.yml stop",
"docker-compose -f docker-compose.dev.yml up"
"docker compose -f docker-compose.dev.yml stop",
"docker compose -f docker-compose.dev.yml up"
],
"cwd": "apps/tup-cms",
"parallel": false
Expand All @@ -33,7 +33,7 @@
"down": {
"executor": "nx:run-commands",
"options": {
"command": "docker-compose -f docker-compose.dev.yml down",
"command": "docker compose -f docker-compose.dev.yml down",
"cwd": "apps/tup-cms"
}
},
Expand Down
7 changes: 5 additions & 2 deletions apps/tup-cms/src/apps/portal/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from djangocms_forms.signals import form_submission
from django.conf import settings
from django.core.mail import send_mail

from .utils import reverse_slugify

logger = logging.getLogger(f"portal.{__name__}")
service_url = settings.TUP_SERVICES_URL
Expand Down Expand Up @@ -49,7 +49,10 @@ def send_confirmation_email(form_name, form_data):
if form_name == "Tour Request Form":
tour_receipt = "<p>A copy of your tour request is provided below for your records:</p>\n"
for key in form_data:
tour_receipt += f"<p>{key}: {form_data[key]}</p>\n"
if not key.startswith('recaptcha_'):
label = reverse_slugify(key) if key != 'form_id' else 'Form ID'
value = form_data[key]
tour_receipt += f"<p>{label}: {value}</p>\n"

email_body = f"""
<p>Greetings,</p>
Expand Down
23 changes: 23 additions & 0 deletions apps/tup-cms/src/apps/portal/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Utilities for Portal
"""

def reverse_slugify(slug):
"""
:param str slug: A name that is lowercase and uses hyphens instead of spaces
:rtype: str
..note:: Usage:
```
slug = "and-hello-world-this-is-a-slug"
original_text = reverse_slugify(slug)
print(original_text) # Output: "And Hello World This is a Slug"
```
"""

words_to_exclude = {'a', 'is', 'to', 'of', 'for', 'and', 'or', 'in'}
words = slug.split('-')
words_for_title = [ word if word.lower() in words_to_exclude else word.capitalize() for word in words ]
text = ' '.join(words_for_title)

return text
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
<!-- Tableau Snippet: Start -->
<!-- TACC: For responsiveness, added class `embed-responsive` -->
<div class="tableauPlaceholder embed-responsive" id="viz1669848991031" style="position: relative">
<noscript><a href="#"><img alt="LandingPage " src="https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;EP&#47;EPICDashboard&#47;LandingPage&#47;1_rss.png" style="border: none" /></a></noscript><object class="tableauViz" style="display: none"><param name="host_url" value="https%3A%2F%2Fpublic.tableau.com%2F" /><param name="embed_code_version" value="3" /><param name="site_root" value="" /><param name="name" value="EPICDashboard/LandingPage" /><param name="tabs" value="no" /><param name="toolbar" value="yes" /><param name="static_image" value="https://public.tableau.com/static/images/EP/EPICDashboard/LandingPage/1.png" /><param name="animate_transition" value="yes" /><param name="display_static_image" value="yes" /><param name="display_spinner" value="yes" /><param name="display_overlay" value="yes" /><param name="display_count" value="yes" /><param name="language" value="en-US" /></object></div>
<script type="text/javascript">
var divElement = document.getElementById("viz1669848991031");
var vizElement = divElement.getElementsByTagName("object")[0];
if (divElement.offsetWidth > 800) {
vizElement.style.width = "1140px";
vizElement.style.height = "795px";
} else if (divElement.offsetWidth > 500) {
vizElement.style.width = "1140px";
vizElement.style.height = "795px";
} else {
vizElement.style.width = "100%";
vizElement.style.height = "1227px";
}
/* TACC: 100% width prevents overflow */ vizElement.style.width = "100%";
var scriptElement = document.createElement("script");
scriptElement.src = "https://public.tableau.com/javascripts/api/viz_v1.js";
vizElement.parentNode.insertBefore(scriptElement, vizElement);
</script><!-- Tableau Snippet: End -->
<div class='tableauPlaceholder embed-responsive' id='viz1723091620076' style='position:
relative'><noscript><a href='#'><img alt='LandingPage '
src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;EP&#47;EPICDas
hboard3_0&#47;LandingPage&#47;1_rss.png' style='border: none'
/></a></noscript><object class='tableauViz' style='display:none;'><param
name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param
name='embed_code_version' value='3' /> <param name='site_root' value='' /><param
name='name' value='EPICDashboard3_0&#47;LandingPage' /><param name='tabs'
value='no' /><param name='toolbar' value='yes' /><param name='static_image'
value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;EP&#47;EPIC
Dashboard3_0&#47;LandingPage&#47;1.png' /> <param name='animate_transition'
value='yes' /><param name='display_static_image' value='yes' /><param
name='display_spinner' value='yes' /><param name='display_overlay' value='yes'
/><param name='display_count' value='yes' /><param name='language' value='en-US'
/><param name='filter' value='publish=yes' /></object></div>
<script type='text/javascript'>
var divElement = document.getElementById('viz1723091620076');
var vizElement = divElement.getElementsByTagName('object')[0];
if ( divElement.offsetWidth > 800 ) {
vizElement.style.width='1140px';vizElement.style.height='795px';} else if (
divElement.offsetWidth > 500 ) {
vizElement.style.width='1140px';vizElement.style.height='795px';} else {
vizElement.style.width='100%';vizElement.style.height='2427px';}
/* TACC: 100% width prevents overflow */ vizElement.style.width = "100%";
var scriptElement = document.createElement('script');
scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';
vizElement.parentNode.insertBefore(scriptElement, vizElement);
</script>
<!-- Tableau Snippet: End -->

0 comments on commit a7983db

Please sign in to comment.