-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from TACC/quick/create-tup-cms-dir
Quick: Add tup-cms dir
- Loading branch information
Showing
9 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,55 @@ | ||
# TACC CMS Per-Site Resources - Configuration | ||
|
||
# In a project-specific configuration file like this, edit existing configuration values from `cms-site-template:/taccsite_cms/default_secrets.py` that must change to suit this project. | ||
|
||
# Until this custom configuration is automatically applied, to use it one must copy the content of it and append it to `cms-site-template:/taccsite_cms/secrets.py` | ||
|
||
# TUP CONFIGURATION | ||
|
||
######################## | ||
# DJANGO CMS SETTINGS | ||
######################## | ||
|
||
_CMS_TEMPLATES = ( | ||
('tup-cms/templates/fullwidth.html', 'Fullwidth') | ||
) | ||
|
||
######################## | ||
# GOOGLE ANALYTICS | ||
######################## | ||
|
||
_GOOGLE_ANALYTICS_PROPERTY_ID = "UA-96034853-2" | ||
_GOOGLE_ANALYTICS_PRELOAD = True | ||
|
||
######################## | ||
# BRANDING & LOGOS | ||
######################## | ||
|
||
# … | ||
|
||
######################## | ||
# BRANDING. | ||
|
||
_BRANDING = [_TACC_BRANDING, _UTEXAS_BRANDING] | ||
|
||
######################## | ||
# LOGOS. | ||
|
||
_PORTAL_LOGO = [ | ||
"tup", | ||
"tup-cms/img/org_logos/tacc-logo.svg", | ||
"", | ||
"/", | ||
"_self", | ||
"TACC Logo", | ||
"anonymous", | ||
"True" | ||
] | ||
|
||
_LOGO = _PORTAL_LOGO | ||
|
||
######################## | ||
# PORTAL | ||
######################## | ||
|
||
_PORTAL = False |
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,43 @@ | ||
# TACC CMS Per-Site Resources - Example - Snippets | ||
|
||
All snippet code specific to this project __must__ be placed in this directory. This allows us to version and source control snippet code. Failure to do so will result in snippet code loss upon data loss from database. | ||
|
||
_This directory can alleviate danger #1 of [Why a Snippet Is Dangerous](#why-a-snippet-is-dangerous)._ | ||
|
||
## Important | ||
|
||
1. The Core CMS __must not__ use any snippets. _They would be inaccessible to projects._ | ||
2. A CMS project __should not__ use any snippets. _They __may only__ be temporarily._ | ||
|
||
## Usage | ||
|
||
In a CMS project: | ||
|
||
1. Any snippet __must__ also be saved into this directory in its own file. | ||
2. Any snippet file __must__ be kept up to date.[^1] | ||
|
||
[^1]: For now, maintain snippet source code via internal team process. | ||
|
||
## What a Snippet Is | ||
|
||
A snippet is a __dangerous__ feature from the plugin [`djangocms-snippet`](https://github.com/divio/djangocms-snippet) which is installed in the CMS. | ||
|
||
It allows an authorized CMS user to create a snippet of front-end web code (e.g. CSS, HTML, JS) in the database for use anywhere on the website. | ||
|
||
## Why a Snippet Is Dangerous | ||
|
||
1. The code is dependent on the (unsynced) database, because it is not under: | ||
- source/version control | ||
2. The code is independent of any other code control: | ||
- security | ||
- dependency management | ||
- style guide | ||
- organization | ||
- linting | ||
|
||
## Why a Snippet Is Allowed | ||
|
||
1. Support time-sensitive changes to the CMS.[^2] | ||
2. Support ad-hoc changes by designer who codes.[^2] | ||
|
||
[^2] This is permitted with the expectation that the snippet code is soon appropriately integrated into the repository. |
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,20 @@ | ||
# TACC CMS Per-Site Resources - Example - Static Files | ||
|
||
All static files specific to this CMS project __must__ be placed here _within_ a directory whose name matches _the parent directory of this directory_. Failure to do so will make them unavailable via [Core CMS][core-cms-repo]. | ||
|
||
See [Core `static/README.md`](/taccsite_cms/static/README.md). | ||
|
||
|
||
[core-cms-repo]: https://gitlab.tacc.utexas.edu/wma-cms/cms-site-template | ||
|
||
|
||
## Clarification | ||
|
||
Where `cms-project-a` and `cms-project-b` are unique CMS projects with custom resources: | ||
|
||
- `cms-site-resources:/cms-project-a/static/cms-project-a/…` | ||
- `cms-site-resources:/cms-project-b/static/cms-project-b/…` | ||
|
||
The redundancy is intentional. The high-level instance isolates per-project resources. The low-level instance [namespaces the custom static files and templates][djangocms-custom-resources]. | ||
|
||
[djangocms-custom-resources]: https://docs.djangoproject.com/en/2.2/intro/tutorial06/#customize-your-app-s-look-and-feel |
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,5 @@ | ||
# TACC CMS Per-Site Resources - Example - Static Files (Namespaced) | ||
|
||
The directory structure here __should__ mirror that of `/taccsite_cms/static/site_cms` in the [Core CMS][core-cms-repo]. This simplifies the effort of developing and maintaining multiple custom websites. | ||
|
||
[core-cms-repo]: https://gitlab.tacc.utexas.edu/wma-cms/cms-site-template |
6 changes: 6 additions & 0 deletions
6
tup-cms/static/tup-cms/css/src/_imports/elements/html-elements.css
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,6 @@ | ||
/* ELEMENTS: Main Root & Sectioning Root */ | ||
|
||
body { | ||
/* FAQ: This color change merely illustrates that custom styles are working */ | ||
/* background-color: yellow; */ | ||
} |
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,22 @@ | ||
/* DO NOT ADD STYLES HERE; ONLY IMPORT OTHER STYLESHEETS */ | ||
|
||
/* Organize via ITCSS */ | ||
/* SEE: https://confluence.tacc.utexas.edu/x/IAA9Cw */ | ||
|
||
/* SETTINGS */ | ||
/* … */ | ||
|
||
/* GENERICS */ | ||
/* … */ | ||
|
||
/* ELEMENTS */ | ||
@import url("_imports/elements/html-elements.css"); | ||
|
||
/* OBJECTS */ | ||
/* … */ | ||
|
||
/* COMPONENTS */ | ||
/* … */ | ||
|
||
/* TRUMPS */ | ||
/* … */ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
{% extends "base.html" %} | ||
{% load cms_tags staticfiles %} | ||
|
||
{% block title %}{% page_attribute "page_title" %}{% endblock title %} | ||
|
||
{% block assets_font %} | ||
{{ block.super }} | ||
{% endblock assets_font %} | ||
|
||
{% block content %} | ||
{% placeholder "content" %} | ||
{% endblock content %} | ||
|
||
{% block assets_custom %} | ||
{{ block.super }} | ||
|
||
<link rel="stylesheet" href="{% static 'tup-cms/css/build/site.css' %}"> | ||
{% endblock assets_custom %} |