Skip to content

Commit b5e20e9

Browse files
feature/credits-page (#261)
* feature/credits-page
1 parent cff596e commit b5e20e9

29 files changed

+263
-3
lines changed

AUTHORS.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
🐍 This document only reflects the team at the time of the original release in February 2021.
2+
3+
# Our Authors
4+
5+
* Yam Mesicka - Leader
6+
* Adva Alkalay - Developer
7+
* Aviad Amar - Developer
8+
* Efrat Bar Yehuda - Developer
9+
* Michael Ben David - Developer
10+
* Tamar Berger - Developer
11+
* Yuval Cagan - Developer
12+
* Elior Digmi - Developer
13+
* Adi Faibish - Developer
14+
* Yaakov Fogel - Developer
15+
* Ori Hirshfeld - Developer
16+
* Hadas Kedar - Developer
17+
* Hagai Kraus - Developer
18+
* Eyal Merav - Developer
19+
* Idan Pelled - Developer
20+
* Nadav Pesach - Developer
21+
* Nir Perelshtein - Developer
22+
* Elor Shoshan - Developer
23+
* Anna Shtirberg - Developer
24+
* Zohar Yamin - Developer
25+
* Odelia Yechiel - Developer
26+
* Sagi Zaid Or - Developer
27+
* Ap1234567 - Developer
28+
* ellenc345 - Developer
29+
* Gonzom - Developer
30+
* ivarshav - Developer
31+
* Liad-n - Developer
32+
* leddest - Developer
33+
* PureDreamer - Developer
34+
* ShiZinDle - Developer
35+
* YairEn - Developer
36+
37+
# Special thanks to
38+
39+
Yam Mesicka for dedicated accompaniment throughout the year of fascinating Python studies.

app/config.py.example

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import pathlib
23

34
from fastapi_mail import ConnectionConfig
45
from pydantic import BaseSettings
@@ -107,3 +108,6 @@ LOG_FORMAT = ("<level>{level: <8}</level>"
107108
" <green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green>"
108109
" - <cyan>{name}</cyan>:<cyan>{function}</cyan>"
109110
" - <level>{message}</level>")
111+
112+
# RESOURCES
113+
RESOURCES_DIR = pathlib.Path(__file__).parent / 'resources'

app/main.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def create_tables(engine, psql_environment):
4242
set_ui_language()
4343

4444
from app.routers import ( # noqa: E402
45-
about_us, agenda, calendar, categories, celebrity, currency, dayview,
46-
email, event, export, four_o_four, google_connect,
47-
invitation, login, logout, profile,
45+
about_us, agenda, calendar, categories, celebrity, credits,
46+
currency, dayview, email, event, export, four_o_four,
47+
google_connect, invitation, login, logout, profile,
4848
register, search, telegram, user, weekview, whatsapp,
4949
)
5050

@@ -73,6 +73,7 @@ async def swagger_ui_redirect():
7373
calendar.router,
7474
categories.router,
7575
celebrity.router,
76+
credits.router,
7677
currency.router,
7778
dayview.router,
7879
weekview.router,

app/resources/credits.json

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
[
2+
{
3+
"picture": "Yam Mesicka",
4+
"name": "Yam Mesicka",
5+
"linkedin": "https://www.linkedin.com/in/mesicka/"
6+
},
7+
{
8+
"picture": "Adva Alkalay",
9+
"name": "Adva Alkalay",
10+
11+
},
12+
{
13+
"picture": "Aviad Amar",
14+
"name": "Aviad Amar",
15+
"linkedin": "https://www.linkedin.com/in/aviad-amar-368405aa"
16+
},
17+
{
18+
"picture": "profile",
19+
"name": "Efrat Bar Yehuda",
20+
21+
},
22+
{
23+
"picture": "profile",
24+
"name": "Michael Ben David",
25+
"mail": ""
26+
},
27+
{
28+
"picture": "profile",
29+
"name": "Tamar Berger",
30+
31+
},
32+
{
33+
"picture": "YuvalCagan",
34+
"name": "Yuval Cagan",
35+
"linkedin": "https://www.linkedin.com/in/yuval-cagan-4a79a6206"
36+
},
37+
{
38+
"picture": "Elior Digmi",
39+
"name": "Elior Digmi",
40+
41+
},
42+
{
43+
"picture": "Adi Faibish",
44+
"name": "Adi Faibish",
45+
"linkedin": "https://www.linkedin.com/in/adi-faibish-3a9664144/"
46+
},
47+
{
48+
"picture": "Yaakov Fogel",
49+
"name": "Yaakov Fogel",
50+
51+
},
52+
{
53+
"picture": "Ori Hirshfeld",
54+
"name": "Ori Hirshfeld",
55+
"linkedin": "https://www.linkedin.com/in/ori-hirshfeld-799748172/"
56+
},
57+
{
58+
"picture": "RonHuberfeld",
59+
"name": "Ron Huberfeld",
60+
"linkedin": "https://www.linkedin.com/in/ron-huberfeld/"
61+
},
62+
{
63+
"picture": "profile",
64+
"name": "Hadas Kedar",
65+
66+
},
67+
{
68+
"picture": "profile",
69+
"name": "Eyal Merav",
70+
"mail": ""
71+
},
72+
{
73+
"picture": "Idan Pelled",
74+
"name": "Idan Pelled",
75+
76+
},
77+
{
78+
"picture": "Nir Perelshtein",
79+
"name": "Nir Perelshtein",
80+
"linkedin": "https://www.linkedin.com/in/nir-perelshtein"
81+
},
82+
{
83+
"picture": "Nadav Pesach",
84+
"name": "Nadav Pesach",
85+
"linkedin": "https://www.linkedin.com/in/nadav-pesach-b337a51b1"
86+
},
87+
{
88+
"picture": "Elor Shoshan",
89+
"name": "Elor Shoshan",
90+
"linkedin": "https://www.linkedin.com/in/elor-shoshan-319192119/"
91+
},
92+
{
93+
"picture": "Anna Shtirberg",
94+
"name": "Anna Shtirberg",
95+
"linkedin": "https://www.linkedin.com/in/anna-shtirberg-586250206/"
96+
},
97+
{
98+
"picture": "Zohar Yamin",
99+
"name": "Zohar Yamin",
100+
101+
},
102+
{
103+
"picture": "Odelia Yechiel",
104+
"name": "Odelia Yechiel",
105+
"linkedin": "https://www.linkedin.com/in/odeliayec/"
106+
},
107+
{
108+
"picture": "Sagi Zaid Or",
109+
"name": "Sagi Zaid Or",
110+
111+
}
112+
]

app/routers/credits.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from fastapi import APIRouter, Request
2+
import json
3+
from typing import List
4+
5+
from loguru import logger
6+
from starlette.templating import _TemplateResponse
7+
8+
from app.config import RESOURCES_DIR
9+
from app.dependencies import templates
10+
11+
router = APIRouter()
12+
13+
14+
def credits_from_json() -> List:
15+
path = RESOURCES_DIR / "credits.json"
16+
try:
17+
with open(path, 'r') as json_file:
18+
json_list = json.load(json_file)
19+
except (IOError, ValueError):
20+
logger.exception(
21+
"An error occurred during reading of json file")
22+
return []
23+
return json_list
24+
25+
26+
@router.get("/credits")
27+
def credits(request: Request) -> _TemplateResponse:
28+
credit_list = credits_from_json()
29+
return templates.TemplateResponse("credits.html", {
30+
"request": request,
31+
"credit_list": credit_list
32+
})
789 KB
Loading
310 KB
Loading
801 KB
Loading
309 KB
Loading
496 KB
Loading
619 KB
Loading
369 KB
Loading
485 KB
Loading
515 KB
Loading
Loading
644 KB
Loading
366 KB
Loading
286 KB
Loading
1.23 MB
Loading
1.04 MB
Loading
1.01 MB
Loading
649 KB
Loading
529 KB
Loading
15.3 KB
Loading

app/static/credits_style.css

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
body {
2+
margin-left: 6.25em;
3+
margin-right: 6.25em;
4+
}
5+
6+
div.gallery {
7+
margin: 1.875em;
8+
border: 0.0625em solid #ccc;
9+
float: left;
10+
width: 21.875em;
11+
height: 31.25em;
12+
}
13+
14+
div.gallery:hover {
15+
border: 0.0625em solid #777;
16+
}
17+
18+
div.gallery img {
19+
width: 100%;
20+
height: 23.75em;
21+
}
22+
23+
div.credit-details {
24+
padding: 1em;
25+
text-align: center;
26+
}
27+
28+
div.a.contact {
29+
padding: 1em;
30+
text-align: center;
31+
}
32+
33+
p {
34+
color: rgb(13, 110, 253);
35+
}

app/templates/base.html

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
<li class="nav-item">
5656
<a class="nav-link" href="{{ url_for('about') }}">{{ gettext("About Us") }}</a>
5757
</li>
58+
<li class="nav-item">
59+
<a class="nav-link" href="{{ url_for('credits') }}">Credits</a>
60+
</li>
5861
</ul>
5962
</div>
6063
</nav>

app/templates/credits.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends "base.html" %}
2+
3+
{% block head %}
4+
{{ super() }}
5+
<link href="{{ url_for('static', path='/credits_style.css') }}" rel="stylesheet">
6+
{% endblock %}
7+
8+
{% block content %}
9+
<h1>Say hello to our developers:</h1>
10+
{% for credit in credit_list %}
11+
<div class="gallery">
12+
<img src="{{ url_for('static', path='/credits_pictures/' + credit.picture + '.PNG') }}" alt="{{credit.name}}">
13+
<div class="credit-details">{{credit.name}}</div>
14+
<div class="credit-details">
15+
{% if credit.linkedin %}
16+
<a class="contact" href={{credit.linkedin}}>LinkedIn</a>
17+
{% else %}
18+
<p>{{credit.mail}}</p>
19+
{% endif %}
20+
</div>
21+
</div>
22+
{% endfor %}
23+
{% endblock %}

app/templates/partials/index/navigation.html

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
<li class="nav-item">
3333
<a class="nav-link" href="{{ url_for('about') }}">{{ gettext("About Us") }}</a>
3434
</li>
35+
<li class="nav-item">
36+
<a class="nav-link" href="{{ url_for('credits') }}">Credits</a>
37+
</li>
3538
</ul>
3639
</div>
3740
</div>

tests/test_credits.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class TestCredits:
2+
CREDITS_OPENING = b"Say hello to our developers"
3+
4+
@staticmethod
5+
def test_get_credits_ok_request(client):
6+
response = client.get("/credits")
7+
assert response.ok
8+
assert TestCredits.CREDITS_OPENING in response.content

0 commit comments

Comments
 (0)