Skip to content

Commit 9b2cfa8

Browse files
committed
Add infrastructureascode.ch branding, update dependencies
1 parent 6646456 commit 9b2cfa8

File tree

8 files changed

+694
-446
lines changed

8 files changed

+694
-446
lines changed

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
ARG PYTHON
2-
FROM python:3.8
2+
FROM python:3.10
33

44
WORKDIR /playground
55
RUN useradd -m iac
66

7-
ENV PATH="/root/.poetry/bin:$PATH" \
7+
ENV PATH="/root/.local/bin:$PATH" \
88
PYTHONDONTWRITEBYTECODE=1 \
9-
PYTHONUNBUFFERED=1
9+
PYTHONUNBUFFERED=1 \
10+
TTPCACHEFOLDER=/tmp/
1011

1112

1213
RUN apt-get update && apt-get install curl -y \
1314
&& rm -rf /var/lib/apt/lists/* \
14-
&& curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python \
15+
&& curl -sSL https://install.python-poetry.org | python3 \
1516
&& poetry config virtualenvs.create false
1617

1718
COPY --chown=iac:iac pyproject.toml .

demo.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

flask_app.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
from ttp import ttp
44

55
app = Flask(__name__, static_url_path="/static")
6-
app.config["JSON_SORT_KEYS"] = False
7-
86
config = {"name": "TTP", "data": "RAW", "rendered": "JSON"}
9-
7+
app.json.sort_keys = False
8+
app.config.update(
9+
TITLE="TTP",
10+
SUBTITLE="Playground for TTP templates",
11+
GITHUB="https://github.com/infrastructureAsCode-ch/ttp101/",
12+
13+
)
1014

1115
@app.route("/")
1216
def index():

poetry.lock

Lines changed: 378 additions & 282 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[tool.poetry]
22
name = "ttp101"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = ""
55
authors = ["ubaumann <[email protected]>"]
66

77
[tool.poetry.dependencies]
8-
python = "^3.8"
9-
flask = "^2.0.1"
10-
pyaml = "^21.10.1"
11-
gunicorn = "^20.1.0"
12-
ttp = "^0.8.4"
8+
python = "^3.10"
9+
flask = "^3"
10+
pyaml = "^23"
11+
gunicorn = "^21"
12+
ttp = "^0.9"
1313

1414
[tool.poetry.dev-dependencies]
15-
black = "^21.12b0"
16-
pylama = "^8.3.7"
17-
rich = "^11.0.0"
15+
black = "^23"
16+
pylama = "^8"
17+
rich = "^13"
1818

1919
[build-system]
2020
requires = ["poetry>=0.12"]

static/background.jpg

596 KB
Loading

templates/form.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div class="container-fluid">
2+
<form id="templateForm" method="POST" action="rend">
3+
<div class="row">
4+
<div class="col-lg-4">
5+
<div class="form-group">
6+
<label for="textData">Data <small>{{data}}</small></label>
7+
<textarea class="form-control show-spaces" id="textData" name="data" rows="20"></textarea>
8+
</div>
9+
</div>
10+
<div class="col-lg-4">
11+
<div class="form-group">
12+
<label for="textTemplate">Template <small>{{name}}</small></label>
13+
<textarea class="form-control show-spaces" id="textTemplate" name="template"
14+
rows="20"></textarea>
15+
</div>
16+
</div>
17+
<div class="col-lg-4">
18+
<div class="form-group">
19+
<label for="textRendered" disabled>Rendered <small>{{rendered}}</small></label>
20+
<textarea class="form-control show-spaces" id="textRendered" rows="20" disabled></textarea>
21+
</div>
22+
</div>
23+
</div>
24+
<div class="row">
25+
<div class="col-auto">
26+
<div>
27+
<button class="btn btn-primary" type="submit">
28+
Render Template
29+
</button>
30+
</div>
31+
</div>
32+
<div class="col-auto mr-auto ">
33+
<div class="dropdown">
34+
<button id="examples" class="btn btn-primary dropdown-toggle" type="button"
35+
data-toggle="dropdown">Examples
36+
<span class="caret"></span></button>
37+
<ul class="dropdown-menu">
38+
</ul>
39+
</div>
40+
</div>
41+
</div>
42+
</div>
43+
</form>
44+
</div>

0 commit comments

Comments
 (0)