Skip to content

Commit

Permalink
feat: a2cps_cms (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored Aug 18, 2023
1 parent e9ff424 commit 274884b
Show file tree
Hide file tree
Showing 24 changed files with 530 additions and 0 deletions.
4 changes: 4 additions & 0 deletions a2cps_cms/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
.cache
**/secrets.py
**/settings_local.py
7 changes: 7 additions & 0 deletions a2cps_cms/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# TACC/Core-CMS#v3.12.0-alpha.12
FROM taccwma/core-cms:59f1592

WORKDIR /code

COPY /src/taccsite_custom /code/taccsite_custom
COPY /src/taccsite_cms /code/taccsite_cms
39 changes: 39 additions & 0 deletions a2cps_cms/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
DOCKERHUB_REPO := $(shell cat ./docker_repo.var)
DOCKER_TAG ?= $(shell git rev-parse --short HEAD)
DOCKER_IMAGE := $(DOCKERHUB_REPO):$(DOCKER_TAG)
DOCKER_IMAGE_LATEST := $(DOCKERHUB_REPO):latest

####
# `DOCKER_IMAGE_BRANCH` tag is the git tag for the commit if it exists, else the branch on which the commit exists
DOCKER_IMAGE_BRANCH := $(DOCKERHUB_REPO):$(shell git describe --exact-match --tags 2> /dev/null || git symbolic-ref --short HEAD)

#.PHONY: build
build:
docker-compose -f docker-compose.dev.yml build

.PHONY: build-full
build-full:
docker build -t $(DOCKER_IMAGE) --target production -f Dockerfile .
docker tag $(DOCKER_IMAGE) $(DOCKER_IMAGE_BRANCH) # Note: Currently broken for branches with slashes

.PHONY: publish
publish:
docker push $(DOCKER_IMAGE)
docker push $(DOCKER_IMAGE_BRANCH)

.PHONY: publish-latest
publish-latest:
docker tag $(DOCKER_IMAGE) $(DOCKER_IMAGE_LATEST)
docker push $(DOCKER_IMAGE_LATEST)

.PHONY: start
start:
docker-compose -f docker-compose.dev.yml up

.PHONY: stop
stop:
docker-compose -f docker-compose.dev.yml down

.PHONY: stop-full
stop-v:
docker-compose -f docker-compose.dev.yml down -v
7 changes: 7 additions & 0 deletions a2cps_cms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example

An extension of the [Core CMS](https://github.com/TACC/Core-CMS) project

## Basics

See [Core-CMS-Custom](https://github.com/TACC/Core-CMS-Custom#readme).
56 changes: 56 additions & 0 deletions a2cps_cms/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: "3"
services:
cms:
build: .
ports:
- 127.0.0.1:8000:8000
command: ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
container_name: core_cms
hostname: core_cms
volumes:
- ./src/apps:/code/apps
- ./src/taccsite_custom:/code/taccsite_custom
- ./src/taccsite_cms/custom_app_settings.py:/code/taccsite_cms/custom_app_settings.py
- ./src/taccsite_cms/urls_custom.py:/code/taccsite_cms/urls_custom.py
- ./src/taccsite_cms/settings_custom.py:/code/taccsite_cms/settings_custom.py
- ./src/taccsite_cms/settings_local.py:/code/taccsite_cms/settings_local.py
- ./src/taccsite_cms/secrets.py:/code/taccsite_cms/secrets.py
networks:
- core_cms_net

postgres:
image: postgres:11.5
environment:
- POSTGRES_PASSWORD=taccforever
- POSTGRES_USER=postgresadmin
- POSTGRES_DB=taccsite
- PGDATA=/var/lib/postgresql/data/taccsite
volumes:
- core_cms_postgres_data:/var/lib/postgresql/data
hostname: core_cms_postgres
container_name: core_cms_postgres
networks:
- core_cms_net

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
ulimits:
memlock: -1
environment:
- ES_HEAP_SIZE:1g
- discovery.type=single-node
volumes:
- ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- core_cms_es_data:/usr/share/elasticsearch/data
container_name: core_cms_elasticsearch
ports:
- 127.0.0.1:9201:9200
networks:
- core_cms_net

volumes:
core_cms_postgres_data:
core_cms_es_data:

networks:
core_cms_net:
14 changes: 14 additions & 0 deletions a2cps_cms/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Use this to configure elasticsearch
#More info: https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html
#
cluster.name: es-dev
network.host: 0.0.0.0
#network.publish_host: hostname
node.name: es01
#minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
discovery.zen.minimum_master_nodes: 1
#More info about memory_lock: https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html
bootstrap.memory_lock: true
xpack.security.enabled: false
Empty file added a2cps_cms/src/__init__.py
Empty file.
39 changes: 39 additions & 0 deletions a2cps_cms/src/taccsite_cms/settings_custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# CUSTOM SETTINGS VALUES.
# TACC WMA CMS SITE:
# *.A2CPS.TACC.UTEXAS.EDU


########################
# DJANGO CMS SETTINGS
########################

CMS_TEMPLATES = (
('a2cps_cms/templates/standard.html', 'Standard'),
('a2cps_cms/templates/fullwidth.html', 'Full Width'),
('a2cps-cms/templates/standard.html', 'DEPRECATED Standard'),
('a2cps-cms/templates/fullwidth.html', 'DEPRECATED 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')
)

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

LOGO = [
"a2cps",
"a2cps_cms/img/org_logos/a2cps.png",
"",
"/",
"_self",
"A2CPS: Acute to Chronic Pain Signatures",
"anonymous",
"True"
]

FAVICON = {
"img_file_src": "a2cps_cms/img/org_logos/favicon.ico"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "a2cps_cms/templates/fullwidth.html" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "a2cps_cms/templates/standard.html" %}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
A2CPS Migration Styles
HOW: Manually find discrepencies in UI that seem specific to A2CPS
*/

/*!
* A2CPS Migration Styles
*/





/* ELEMENTS */

/* Table Content */

table,
td,
th {
/* To mimic 2020 site by restoring browser default */
border-color: inherit; /* override `site.css` */
}

/* To mimic unscoped styles from Angular component that v1 CMS assumes exist */
/* SEE: https://bitbucket.org/taccaci/frontera/src/8167403/client/src/angular/data_depot/projects/components/project-meta/project-meta.css?#project-meta.css-34 */
td {
padding-right: 2.25em;
padding-bottom: 0.5em;
}





/* COMPONENTS */



/* COMPONENTS: Bootstrap */

/* Cards */

/* To mimic 2020 site faux cards via Bootstrap cards */
/* SEE: https://a2cps.org/patients/.../ */
/* SEE: https://a2cps.org/researchers/ */
/* FAQ: A faux cards was a <div> (card) with two <p>'s (header, body) */
.card {
/* To clear `.card` styles */
border-radius: 0;

/* To mimic header <p> (from inline styles) */
margin-top: 20px;

/* To mimic body <img> (from inline styles) */
margin-bottom: 20px;
}

.card-header {
/* To mimic header <p> (from inline styles) */
padding: 15px;

/* To mimic header <p>'s typography (from inline styles) */
text-align: center;
font-weight: bold;
font-size: 16px;
}
.card-header:first-child {
/* To clear `.card` styles */
border-radius: 0;
}

.card-body {
/* SEE: https://a2cps.org/connect/ */
padding: 15px;
}

/* To mimic faux card inline styles */
.card.bg-light .card-header,
.card.bg-transparent .card-header {
background-color: #DFDFDF;
border-bottom-color: #DFDFDF;
}
.card.bg-light .card-body,
.card.bg-transparent .card-body {
/* SEE: https://a2cps.org/connect/ */
border-color: #DFDFDF;
}

/* Cards: "For ..." Pages */
.s-page-cards .card,
.s-page-cards .card-header {
/* To clear `.card` styles */
border: none;
}
.s-page-cards .card-header p {
/* To prevent <p> (forced by Text plugin WYSIWIG) from breaking layout */
margin: 0;
}
.s-page-cards .card-body {
/* To clear `.card` styles */
padding: 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* DO NOT ADD STYLES HERE; ONLY IMPORT OTHER STYLESHEETS */

@import url("/static/site_cms/css/build/v1_v2.css"); /* Core-CMS:/taccsite_cms/…/ */

@import url("/static/a2cps_cms/css/_migrations/v1_v2/a2cps.css");
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% load static %}

<!-- To style old CMS content on new CMS -->
<link rel="stylesheet" href="{% static 'a2cps_cms/css/migrate.v1_v2.css' %}">
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "fullwidth.html" %}
{% load cms_tags %}

{% block assets_custom %}
{{ block.super }}

{% include "./assets_custom.html" %}
{% endblock assets_custom %}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="embed-responsive embed-responsive-16by9"><iframe src="https://www.google.com/maps/d/embed?mid=1tSZHV9LoG07v9ikVw6qaVcACShB3hoBG&hl=en" ></iframe></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>&nbsp;<!-- To mimic 2020 site whitespace in Cards with reusable tracable code --></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p><span style="color: #ffffff;"><iframe frameborder="0" height="1200" width="100%" src="/upstreams/a2cps-sankey-dash-dev/"></iframe></span></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p><span style="color: #ffffff;"><iframe frameborder="0" height="1600" width="100%" src="/upstreams/a2cps-weekly-dash-dev/"></iframe></span></p>
Loading

0 comments on commit 274884b

Please sign in to comment.