Removed old PHP code, migrated to Python and Flask
Update .dockerignore, .env, and 503 more files...
This commit is contained in:
0
website/renderers/__init__.py
Normal file
0
website/renderers/__init__.py
Normal file
10
website/renderers/button.py
Normal file
10
website/renderers/button.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from flask import render_template
|
||||
|
||||
|
||||
def render_button(inner_html: str, disabled: bool = False) -> str:
|
||||
return render_template(
|
||||
"elements/button.jinja",
|
||||
button_inner_html=inner_html,
|
||||
button_disabled=disabled,
|
||||
button_extra_classes=""
|
||||
)
|
37
website/renderers/headings.py
Normal file
37
website/renderers/headings.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from typing import Optional
|
||||
|
||||
from flask import render_template
|
||||
|
||||
|
||||
def render_heading(inner_html: str, level: int = 1, icon: Optional[str] = None, right_html: Optional[str] = None,
|
||||
anchor_id: Optional[str] = None, background_class: str = "bkgd-grid") -> str:
|
||||
return render_template(
|
||||
"elements/heading.jinja",
|
||||
heading_inner_html=inner_html,
|
||||
heading_level=level + 1,
|
||||
heading_icon=icon,
|
||||
heading_right_html=right_html,
|
||||
heading_anchor_id=anchor_id,
|
||||
heading_background_class=background_class,
|
||||
)
|
||||
|
||||
|
||||
def render_h1(inner_html: str, icon: Optional[str] = None, right_html: Optional[str] = None,
|
||||
anchor_id: Optional[str] = None, background_class: str = "bkgd-grid") -> str:
|
||||
return render_heading(
|
||||
inner_html, 1, icon, right_html, anchor_id, background_class
|
||||
)
|
||||
|
||||
|
||||
def render_h2(inner_html: str, icon: Optional[str] = None, right_html: Optional[str] = None,
|
||||
anchor_id: Optional[str] = None, background_class: str = "bkgd-grid") -> str:
|
||||
return render_heading(
|
||||
inner_html, 2, icon, right_html, anchor_id, background_class
|
||||
)
|
||||
|
||||
|
||||
def render_h3(inner_html: str, icon: Optional[str] = None, right_html: Optional[str] = None,
|
||||
anchor_id: Optional[str] = None, background_class: str = "bkgd-grid") -> str:
|
||||
return render_heading(
|
||||
inner_html, 3, icon, right_html, anchor_id, background_class
|
||||
)
|
0
website/renderers/lists.py
Normal file
0
website/renderers/lists.py
Normal file
8
website/renderers/paragraph.py
Normal file
8
website/renderers/paragraph.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from flask import render_template
|
||||
|
||||
|
||||
def render_paragraph(inner_html: str) -> str:
|
||||
return render_template(
|
||||
"elements/paragraph.jinja",
|
||||
paragraph_inner_html=inner_html,
|
||||
)
|
8
website/renderers/splide.py
Normal file
8
website/renderers/splide.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from flask import render_template
|
||||
|
||||
|
||||
def render_splide(inner_html_panes: list[str]) -> str:
|
||||
return render_template(
|
||||
"elements/splide.jinja",
|
||||
splide_inner_html_panes=inner_html_panes,
|
||||
)
|
Reference in New Issue
Block a user