From 18a90334cef20346243034b105f9ebb02b707253 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Tue, 26 Apr 2022 18:28:39 +0530 Subject: [PATCH] feat: add gitea clinic page --- content/gitea-clinic/index.md | 27 +++++++++++ sass/gitea-clinic/main.scss | 32 +++++++++++++ sass/gitea-clinic/mobile.scss | 10 ++++ sass/main.scss | 1 + sass/mobile.scss | 1 + sass/page/main.scss | 34 ++++++------- templates/nav.html | 1 + .../shortcodes/gitea_clinic_doc_reviews.html | 48 +++++++++++++++++++ 8 files changed, 137 insertions(+), 17 deletions(-) create mode 100644 content/gitea-clinic/index.md create mode 100644 sass/gitea-clinic/main.scss create mode 100644 sass/gitea-clinic/mobile.scss create mode 100644 templates/shortcodes/gitea_clinic_doc_reviews.html diff --git a/content/gitea-clinic/index.md b/content/gitea-clinic/index.md new file mode 100644 index 0000000..90f369e --- /dev/null +++ b/content/gitea-clinic/index.md @@ -0,0 +1,27 @@ ++++ +title = "Gitea Clinic" +description = "Debug and Recover broken Gitea instances" ++++ + +## How does it work? + +1. Get in touch with the doctor of your choice +2. Upload your sick Gitea +3. Once it gets better bring it back home (or decide it should get a + permanent residence at hostea) +4. Pay the doctor + +## How much does it cost? + +All Hostea doctors charge a flat hourly rate for consultations held in public +(private information is never revealed, even if the consultation is held +in public) Private consultations fees depend on the Hostea doctor + +Sounds good, I want to get an appointment! +{{ call_to_action_banner(prompt="Sounds good, I want to get an appointment!", link="/contanct", action="Contact Us") }} + +The doctor name links to their resume. Stars are awarded when someone is +happy about a public consultation (not for private consulations). + +## Hostea Doctors +{{ gitea_clinic_doc_reviews() }} diff --git a/sass/gitea-clinic/main.scss b/sass/gitea-clinic/main.scss new file mode 100644 index 0000000..11aeb82 --- /dev/null +++ b/sass/gitea-clinic/main.scss @@ -0,0 +1,32 @@ +.clinic__doctors-container { + display: flex; +} + +.doctor__profile_photo { + width: 100px; + height: 100px; + border-radius: 100px; +} + +.doctor__container { + background-color: #eee; + margin: 10px 30px; + padding: 10px; + height: 250px; + border-radius: 5px; + width: 30%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-around; +} + +.doctor__name { + text-align: center; + margin: 0 auto !important; +} +.doctor_rating-stars, +.doctor_rating-value { + margin: 0 auto !important; + text-align: center; +} diff --git a/sass/gitea-clinic/mobile.scss b/sass/gitea-clinic/mobile.scss new file mode 100644 index 0000000..09359fa --- /dev/null +++ b/sass/gitea-clinic/mobile.scss @@ -0,0 +1,10 @@ +.clinic__doctors-container { + display: flex; + flex-direction: column; + align-items: center; +} + + +.doctor__container { + width: 80%; +} diff --git a/sass/main.scss b/sass/main.scss index 0132e51..cb03f24 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -5,6 +5,7 @@ @import "./page/main"; @import "./blog/main"; @import "./tag/main"; +@import "./gitea-clinic/main"; .zola-anchor { margin-left: 5px; diff --git a/sass/mobile.scss b/sass/mobile.scss index 555c47d..88473fe 100644 --- a/sass/mobile.scss +++ b/sass/mobile.scss @@ -4,6 +4,7 @@ @import "./page/mobile"; @import "./blog/mobile"; @import "./tag/mobile"; +@import "./gitea-clinic/mobile.scss"; header { height: auto; diff --git a/sass/page/main.scss b/sass/page/main.scss index d570b66..db3b08a 100644 --- a/sass/page/main.scss +++ b/sass/page/main.scss @@ -1,38 +1,38 @@ -@import '../components/_page.scss'; -@import '../components/_link.scss'; +@import "../components/_page.scss"; +@import "../components/_link.scss"; .page__container { - width: 50%; - margin: auto; - padding: 50px 0; + width: 50%; + margin: auto; + padding: 50px 0; } .page__group { - display: flex; - flex-direction: column; + display: flex; + flex-direction: column; } .page__group-title { - margin: 20px auto; + margin: 20px auto; } .page__group-content { - display: flex; - flex-direction: column; + display: flex; + flex-direction: column; } .page__group-content { - @include md; + @include md; } .page__preview-banner { - width: 10%; - height: #{'min(250px, 50vh)'}; - margin: 20px auto; + width: 10%; + height: #{"min(250px, 50vh)"}; + margin: 20px auto; } .page__banner { - width: 100%; - height: #{'max(450px, 50vh)'}; - margin: 20px auto; + width: 100%; + height: #{"max(450px, 50vh)"}; + margin: 20px auto; } diff --git a/templates/nav.html b/templates/nav.html index 864ae79..eb512a7 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -25,6 +25,7 @@ {{ macros::nav_link(link="/about/", name="About") }} {{ macros::nav_link(link="/blog/", name="Blog") }} {{ macros::nav_link(link="/contact/", name="Contact") }} + {{ macros::nav_link(link="/gitea-clinic/", name="Gitea Clinic") }} {{ macros::nav_link(link="/talks/", name="Talks") }} diff --git a/templates/shortcodes/gitea_clinic_doc_reviews.html b/templates/shortcodes/gitea_clinic_doc_reviews.html new file mode 100644 index 0000000..81a2867 --- /dev/null +++ b/templates/shortcodes/gitea_clinic_doc_reviews.html @@ -0,0 +1,48 @@ +{% set data_doctors = load_data(path="data/clinic-doctors.toml") %} +{% set full_star = "★" %} +{% set empty_star = "☆" %} + +
+{# sorted by name #} +{% set data_doctors = data_doctors["doctors"] | sort(attribute="name") %} +{% for doctor in data_doctors %} +
+ {% set_global rating = 0 %} + {% set reviews_length = doctor["reviews"] | length %} + {% for review in doctor["reviews"] %} + {% set_global rating = rating + review["rating"] %} + {% endfor %} + + {% set rating_fraction = rating % 1 %} + + {% if rating == 5 %} + {% set_global rating_str = full_star ~ full_star ~ full_star ~ full_star ~ full_star %} + {% elif rating > 4 %} + {% set_global rating_str = full_star ~ full_star ~ full_star ~ full_star ~ empty_star %} + {% elif rating > 3 %} + {% set_global rating_str = full_star ~ full_star ~ full_star ~ empty_star ~ empty_star %} + {% elif rating > 2 %} + {% set_global rating_str = full_star ~ full_star ~ empty_star ~ empty_star ~ empty_star %} + {% elif rating > 1 %} + {% set_global rating_str = full_star ~ empty_star ~ empty_star ~ empty_star ~ empty_star %} + {% else %} + {% set_global rating_str = empty_star ~ empty_star ~ empty_star ~ empty_star %} + {% endif %} + + {% if doctor["picture"] %} + {% set picture = doctor["picture"] %} + {% else %} + {% set picture = "/tmp-logo.png" %} + {% endif %} + + {% set rating = rating / reviews_length %} + +

{{ doctor["name"] }}

+
+

{{ rating_str }}

+ +
+ Learn More +
+{% endfor %} +