Skip to content

Commit

Permalink
Merge branch 'main' into epic/TUP-700-core-components-node-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar committed Oct 18, 2024
2 parents e8a958c + 0466dcc commit fd993c2
Show file tree
Hide file tree
Showing 21 changed files with 1,764 additions and 780 deletions.
3 changes: 2 additions & 1 deletion .postcssrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ plugins:
features:
custom-media-queries: true
media-query-ranges: true
custom-selectors: true
nesting-rules: true
custom-selectors: true
relative-color-syntax: true
postcss-replace:
# @tacc/core-styles: 'dist/' uses `../../fonts/`
pattern: fonts/
Expand Down
2 changes: 1 addition & 1 deletion apps/tup-cms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY . /code/
RUN npx nx build tup-ui
RUN npx nx build tup-cms-react

FROM taccwma/core-cms:v4.10.2
FROM taccwma/core-cms:v4.17.1

WORKDIR /code

Expand Down
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
58 changes: 21 additions & 37 deletions apps/tup-cms/src/taccsite_cms/settings_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
CMS_TEMPLATES = (
('standard.html', 'Standard'),
('fullwidth.html', 'Full Width'),

('guide.html', 'Guide'),
('guides/getting_started.html', 'Guide: Getting Started'),
('guides/data_transfer.html', 'Guide: Data Transfer'),
('guides/data_transfer.globus.html', 'Guide: Globus Data Transfer'),
('guides/portal_technology.html', 'Guide: Portal Technology Stack'),
)

CMS_PERMISSIONS = True
Expand Down Expand Up @@ -87,35 +81,23 @@
# TACC: BRANDING
########################

# NOTE: Variables NSF_BRANDING, TACC_BRANDING, and UTEXAS_BRANDING are duplicated from Core-CMS cuz current infrastructure lacks ability to reference default values.

UTEXAS_BRANDING = [
"utexas",
"site_cms/img/org_logos/utaustin-white.png",
"branding-utaustin",
"https://www.utexas.edu/",
"_blank",
"University of Texas at Austin Logo",
"anonymous",
"True"
]
from taccsite_cms._settings.branding import *

BRANDING = [ UTEXAS_BRANDING ]
PORTAL_BRANDING = [ PORTAL_BRANDING_UTEXAS ]

########################
# TACC: LOGOS
########################

LOGO = [
"tup",
"tup_cms/img/org_logos/tacc-logo-white.svg",
"tup",
"/",
"_self",
"TACC Logo",
"anonymous",
"True"
]
PORTAL_LOGO = {
"img_file_src": "tup_cms/img/org_logos/tacc-logo-white.svg",
"is_remote": False,
"img_class": "",
"link_href": "/",
"link_target": "_self",
"img_alt_text": "TACC Logo",
"img_crossorigin": "anonymous",
} # To hide logo, set `PORTAL_LOGO = False`

########################
# TACC: SEARCH
Expand All @@ -140,15 +122,17 @@
# TACC: PORTAL
########################

INCLUDES_CORE_PORTAL = False
INCLUDES_PORTAL_NAV = True
INCLUDES_SEARCH_BAR = True
PORTAL_IS_TACC_CORE_PORTAL = False
PORTAL_HAS_LOGIN = True
PORTAL_HAS_SEARCH = True

PORTAL_NAV_WIDTH = 'lg'

########################
# TACC: SOCIAL MEDIA
########################

TACC_SOCIAL_SHARE_PLATFORMS = ['linkedin', 'facebook', 'email']
PORTAL_SOCIAL_SHARE_PLATFORMS = ['linkedin', 'facebook', 'email']

########################
# DJANGOCMS_BLOG
Expand Down Expand Up @@ -200,10 +184,10 @@
# DJANGOCMS_BLOG: TACC
########################

TACC_BLOG_SHOW_CATEGORIES = True
TACC_BLOG_SHOW_TAGS = False
TACC_BLOG_CUSTOM_MEDIA_POST_CATEGORY = 'multimedia'
TACC_BLOG_SHOW_ABSTRACT_TAG = 'external'
PORTAL_BLOG_SHOW_CATEGORIES = True
PORTAL_BLOG_SHOW_TAGS = False
PORTAL_BLOG_CUSTOM_MEDIA_POST_CATEGORY = 'multimedia'
PORTAL_BLOG_SHOW_ABSTRACT_TAG = 'external'

TACC_BLOG_CATEGORY_ORDER = ['press-release', 'feature-story', 'multimedia', 'podcast']

Expand Down

This file was deleted.

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 -->

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

/* url under search result title */
& .gs-webResult div.gs-visibleUrl {
color: var(--global-color-accent--secondary);
color: var(--global-color-secondary--normal);
}

/* search result titles */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
/* TODO: Share styles between c-news and c-feed-list (`time:not(…)`) */
.c-feed-list > :is(div, article) > time:not(:is(h1, h2, h3, h4, h5, h6) *),
.c-feed-list > :is(div, article) > p:has(time):not(:is(h1, h2, h3, h4, h5, h6) *) {
color: var(--global-color-accent--secondary);
color: var(--global-color-secondary--normal);
font-weight: var(--medium);
text-transform: uppercase;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/* TODO: Share styles between c-news and c-feed-list (`time:not(…)`) */
.c-news article time:not(:is(h1, h2, h3, h4, h5, h6) *) {
color: var(--global-color-accent--secondary);
color: var(--global-color-secondary--normal);
font-weight: var(--medium);
text-transform: uppercase;
}
Expand Down
Loading

0 comments on commit fd993c2

Please sign in to comment.