platzky 0.2.15__tar.gz → 0.2.17__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {platzky-0.2.15 → platzky-0.2.17}/PKG-INFO +1 -1
  2. {platzky-0.2.15 → platzky-0.2.17}/platzky/db/db.py +4 -0
  3. {platzky-0.2.15 → platzky-0.2.17}/platzky/db/graph_ql_db.py +15 -0
  4. {platzky-0.2.15 → platzky-0.2.17}/platzky/db/json_db.py +9 -0
  5. {platzky-0.2.15 → platzky-0.2.17}/platzky/platzky.py +1 -0
  6. platzky-0.2.17/platzky/static/styles.css +60 -0
  7. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/base.html +3 -96
  8. platzky-0.2.17/platzky/templates/dynamic_css.html +38 -0
  9. {platzky-0.2.15 → platzky-0.2.17}/pyproject.toml +1 -1
  10. platzky-0.2.15/platzky/templates/home.html +0 -195
  11. {platzky-0.2.15 → platzky-0.2.17}/README.md +0 -0
  12. {platzky-0.2.15 → platzky-0.2.17}/platzky/__init__.py +0 -0
  13. {platzky-0.2.15 → platzky-0.2.17}/platzky/blog/__init__.py +0 -0
  14. {platzky-0.2.15 → platzky-0.2.17}/platzky/blog/blog.py +0 -0
  15. {platzky-0.2.15 → platzky-0.2.17}/platzky/blog/comment_form.py +0 -0
  16. {platzky-0.2.15 → platzky-0.2.17}/platzky/config.py +0 -0
  17. {platzky-0.2.15 → platzky-0.2.17}/platzky/db/__init__.py +0 -0
  18. {platzky-0.2.15 → platzky-0.2.17}/platzky/db/db_loader.py +0 -0
  19. {platzky-0.2.15 → platzky-0.2.17}/platzky/db/google_json_db.py +0 -0
  20. {platzky-0.2.15 → platzky-0.2.17}/platzky/db/json_file_db.py +0 -0
  21. {platzky-0.2.15 → platzky-0.2.17}/platzky/locale/en/LC_MESSAGES/messages.po +0 -0
  22. {platzky-0.2.15 → platzky-0.2.17}/platzky/locale/pl/LC_MESSAGES/messages.po +0 -0
  23. {platzky-0.2.15 → platzky-0.2.17}/platzky/models.py +0 -0
  24. {platzky-0.2.15 → platzky-0.2.17}/platzky/plugin_loader.py +0 -0
  25. {platzky-0.2.15 → platzky-0.2.17}/platzky/plugins/google-tag-manager/entrypoint.py +0 -0
  26. {platzky-0.2.15 → platzky-0.2.17}/platzky/plugins/redirections/entrypoint.py +0 -0
  27. {platzky-0.2.15 → platzky-0.2.17}/platzky/plugins/sendmail/entrypoint.py +0 -0
  28. {platzky-0.2.15 → platzky-0.2.17}/platzky/seo/seo.py +0 -0
  29. {platzky-0.2.15 → platzky-0.2.17}/platzky/static/blog.css +0 -0
  30. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/404.html +0 -0
  31. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/blog.html +0 -0
  32. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/body_meta.html +0 -0
  33. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/feed.xml +0 -0
  34. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/head_meta.html +0 -0
  35. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/page.html +0 -0
  36. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/post.html +0 -0
  37. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/robots.txt +0 -0
  38. {platzky-0.2.15 → platzky-0.2.17}/platzky/templates/sitemap.xml +0 -0
  39. {platzky-0.2.15 → platzky-0.2.17}/platzky/www_handler.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: platzky
3
- Version: 0.2.15
3
+ Version: 0.2.17
4
4
  Summary: Not only blog engine
5
5
  License: MIT
6
6
  Requires-Python: >=3.10,<4.0
@@ -44,6 +44,10 @@ class DB(ABC):
44
44
  except Exception as e:
45
45
  raise ValueError(f"Failed to extend DB with function {function_name}: {e}")
46
46
 
47
+ @abstractmethod
48
+ def get_app_description(self, lang) -> str:
49
+ pass
50
+
47
51
  @abstractmethod
48
52
  def get_all_posts(self, lang) -> list[Post]:
49
53
  pass
@@ -259,6 +259,21 @@ class GraphQL(DB):
259
259
  except IndexError:
260
260
  return ""
261
261
 
262
+ def get_app_description(self, lang):
263
+ description_query = gql(
264
+ """
265
+ query myquery($lang: Lang!) {
266
+ applicationSetups(where: {language: $lang}, stage: PUBLISHED) {
267
+ applicationDescription
268
+ }
269
+ }
270
+ """
271
+ )
272
+
273
+ return self.client.execute(description_query, variable_values={"lang": lang})[
274
+ "applicationSetups"
275
+ ][0].get("applicationDescription", None)
276
+
262
277
  def get_favicon_url(self):
263
278
  favicon = gql(
264
279
  """
@@ -24,6 +24,11 @@ def db_from_config(config: JsonDbConfig):
24
24
  return Json(config.data)
25
25
 
26
26
 
27
+ # TODO make all language specific methods to be available without language
28
+ # this will allow to have a default language and if there is one language
29
+ # there will be no need to pass it to the method or in db
30
+
31
+
27
32
  class Json(DB):
28
33
  def __init__(self, data: Dict[str, Any]):
29
34
  super().__init__()
@@ -31,6 +36,10 @@ class Json(DB):
31
36
  self.module_name = "json_db"
32
37
  self.db_name = "JsonDb"
33
38
 
39
+ def get_app_description(self, lang):
40
+ description = self._get_site_content().get("app_description", {})
41
+ return description.get(lang, None)
42
+
34
43
  def get_all_posts(self, lang):
35
44
  return [
36
45
  Post.model_validate(post)
@@ -102,6 +102,7 @@ def create_engine(config: Config, db) -> Engine:
102
102
  country = lang.country if (lang := config.languages.get(locale)) is not None else ""
103
103
  return {
104
104
  "app_name": config.app_name,
105
+ "app_description": app.db.get_app_description(locale) or config.app_name,
105
106
  "languages": languages_dict(config.languages),
106
107
  "current_flag": flag,
107
108
  "current_lang_country": country,
@@ -0,0 +1,60 @@
1
+ html,
2
+ body {
3
+ height: 100%;
4
+ }
5
+
6
+ .logo {
7
+ max-height: 6rem;
8
+ max-width: 50vw;
9
+ }
10
+
11
+ #main-row {
12
+ position: relative;
13
+ flex-grow: 1;
14
+ z-index: 0;
15
+ }
16
+
17
+ .left-panel-contents {
18
+ padding: 16px;
19
+ }
20
+
21
+ @media only screen and (min-width: 768px) {
22
+ #left-panel {
23
+ inline-size: calc(100vw * 0.1666666667);
24
+ }
25
+ }
26
+
27
+ .language-indicator-text {
28
+ color: white;
29
+ font-weight: normal;
30
+ }
31
+
32
+ .offcanvas-lg.offcanvas-start {
33
+ top: auto;
34
+ width: auto;
35
+ }
36
+
37
+ #filter-form form > div {
38
+ padding-bottom: 1rem;
39
+ }
40
+
41
+ #filter-form form div > span {
42
+ font-weight: bold;
43
+ padding-bottom: 0.5rem;
44
+ }
45
+
46
+ .dropdown-menu {
47
+ z-index: 1;
48
+ }
49
+
50
+ .btn {
51
+ padding: 0;
52
+ }
53
+
54
+ .btn-close {
55
+ opacity: 1;
56
+ }
57
+
58
+ i.fi {
59
+ margin: 0 0.5em;
60
+ }
@@ -2,106 +2,13 @@
2
2
  <html lang="{{ current_language }}-{{ current_lang_country }}">
3
3
  <head>
4
4
  {% include "head_meta.html" %}
5
+ {% include "dynamic_css.html" %}
5
6
  {% block head_meta %}{% endblock %}
6
7
  {{ dynamic_head | safe }}
7
8
 
8
-
9
-
9
+ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css') }}">
10
10
  <title>{% block title %}{{app_name}}{% endblock %}</title>
11
- <meta name="description" content=" {% block description %} {% endblock %} ">
12
- <style>
13
- html,
14
- body {
15
- height: 100%;
16
-
17
- }
18
- body {
19
- font-family: {{ font.name }}
20
- }
21
- .logo {
22
- max-height: 6rem;
23
- max-width: 50vw;
24
- }
25
- .header-row {
26
- z-index: 1;
27
- background-color: {{ primary_color }};
28
- height: min-content;
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
- }
33
- #main-row {
34
- position: relative;
35
- flex-grow: 1;
36
- z-index: 0;
37
- }
38
-
39
- .left-panel-contents {
40
- padding: 16px;
41
- }
42
-
43
- .left-panel {
44
- background-color: {{ secondary_color }};
45
- }
46
-
47
- #left-panel {
48
- background-color: {{ secondary_color }};
49
- position: absolute;
50
- height: 100%;
51
- max-width: 80vw;
52
- overflow-y: auto;
53
- color: white;
54
- inline-size: 80vw;
55
- overflow-wrap: break-word;
56
- z-index: 999999999;
57
- }
58
-
59
- @media only screen and (min-width: 768px) {
60
- #left-panel {
61
- inline-size: calc(100vw * 0.1666666667);
62
- }
63
-
64
- .language-indicator-text {
65
- color: white;
66
- font-weight: normal;
67
- }
68
-
69
- #languages-menu {
70
- background-color: {{ secondary_color }};
71
- padding: 5px 10px;
72
- border-radius: 5px;
73
- color: white;
74
- }
75
-
76
- .offcanvas-lg.offcanvas-start {
77
- top: auto;
78
- width: auto;
79
- }
80
-
81
- #filter-form form > div {
82
- padding-bottom: 1rem;
83
- }
84
-
85
- #filter-form form div > span {
86
- font-weight: bold;
87
- padding-bottom: 0.5rem;
88
- }
89
-
90
- .dropdown-menu {
91
- z-index: 1;
92
- }
93
-
94
- .btn {
95
- padding: 0;
96
- }
97
-
98
- .btn-close {
99
- opacity: 1;
100
- }
101
- i.fi {
102
- margin: 0 0.5em;
103
- }
104
- </style>
11
+ <meta name="description" content="{% block description %} {{ app_description }} {% endblock %}">
105
12
  </head>
106
13
  <body>
107
14
  {% block body_meta %}
@@ -0,0 +1,38 @@
1
+ <style>
2
+
3
+ body {
4
+ font-family: {{ font.name }};
5
+ }
6
+
7
+ .left-panel {
8
+ background-color: {{ secondary_color }};
9
+ }
10
+
11
+ #left-panel {
12
+ background-color: {{ secondary_color }};
13
+ position: absolute;
14
+ height: 100%;
15
+ max-width: 80vw;
16
+ overflow-y: auto;
17
+ color: white;
18
+ inline-size: 80vw;
19
+ overflow-wrap: break-word;
20
+ z-index: 999999999;
21
+ }
22
+
23
+ #languages-menu {
24
+ background-color: {{ secondary_color }};
25
+ padding: 5px 10px;
26
+ border-radius: 5px;
27
+ color: white;
28
+ }
29
+
30
+ .header-row {
31
+ z-index: 1;
32
+ background-color: {{ primary_color }};
33
+ height: min-content;
34
+ display: flex;
35
+ justify-content: center;
36
+ align-items: center;
37
+ }
38
+ </style>
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "platzky"
3
- version = "0.2.15"
3
+ version = "0.2.17"
4
4
  description = "Not only blog engine"
5
5
  authors = []
6
6
  license = "MIT"
@@ -1,195 +0,0 @@
1
- {% extends "base.html" %}
2
- {% block content %}
3
-
4
- <style>
5
- .content {
6
- padding-top:150px;
7
- }
8
-
9
- .envelope {
10
- position: relative;
11
- margin: 50px auto 0;
12
- width: 400px;
13
- height: 200px;
14
- background: #00528c;
15
- border-radius: 0 0 5px 5px;
16
- box-shadow: 0 0 1px #c94548 inset;
17
- }
18
-
19
- .envelope:before,
20
- .envelope:after {
21
- content: '';
22
- position: absolute;
23
- width: 0;
24
- height: 0;
25
- border: 0 solid transparent;
26
- border-width: 100px 200px;
27
- }
28
- .envelope:before {
29
- border-bottom-color: #255e87;
30
- top: -100%;
31
- left: 0px;
32
- }
33
- .envelope:after {
34
- border-right-color: #b3d7ff;
35
- border-left-color: #97b3d3;
36
- border-bottom-color:#b3d7e0;
37
- top: 0;
38
- border-radius: 0 0 5px 5px;
39
- transform: rotate(360deg);
40
- box-shadow: 0 1px 1px rgba(0,0,0,0.25);
41
- z-index:3;
42
- }
43
-
44
- .triangle {
45
- border-style:solid;
46
- border-width: 150px 300px;
47
- position: absolute;
48
- z-index:3;
49
- }
50
-
51
- .triangle-down {
52
- border-color: #00528c transparent transparent transparent;
53
- z-index:1;
54
- }
55
-
56
-
57
- .rect {
58
- left: 5%;
59
- bottom:0;
60
- border-radius:6px;
61
- width: 90%;
62
- height:200px;
63
- background: white;
64
- display: inline-block;
65
- border-style:solid;
66
- border-color:#b3d7ff;
67
- box-shadow: inset -3px 3px 10px #b3d7ff;
68
- position:absolute;
69
- padding-bottom:30px;
70
- }
71
- .recto {
72
- position:relative;
73
- width: 100%;
74
- height: 700px;
75
- background: white;
76
- display: inline-block;
77
- z-index:20;
78
- }
79
- .go-up {
80
- animation-delay:0.6s;
81
- animation-name: go-up;
82
- animation-duration: 2s;
83
- animation-fill-mode: forwards;
84
- }
85
-
86
- .scale-up {
87
- animation-delay:0.6s;
88
- animation-name: scale-up;
89
- animation-duration: 2s;
90
- animation-fill-mode: forwards;
91
- }
92
-
93
-
94
- .go-behind {
95
- animation-delay:1s;
96
- animation-name: go-behind;
97
- animation-duration: 1s;
98
- animation-fill-mode: forwards;
99
- }
100
-
101
- .open
102
- {
103
- animation-name: open;
104
- animation-duration: 2s;
105
- animation-fill-mode: forwards;
106
- transform-origin: top;
107
- }
108
-
109
- .boldos
110
- {
111
- color:#007bff;
112
- font-size:1.2rem;
113
- font-weight:bold;
114
- }
115
-
116
- .envelopeso
117
- {
118
- position:relative;
119
- margin-top:500px;
120
- text-align: center;
121
- width:400px;
122
- height:500px;
123
- }
124
-
125
- .begin {
126
- position:relative;
127
- bottom: 160px;
128
- left: 45%;
129
- z-index:5;
130
- transition: 0.3s;
131
- animation: fadein 2s;
132
- animation-delay:1.6s;
133
- opacity: 0;
134
- animation-fill-mode: forwards;
135
- }
136
-
137
- @keyframes fadein {
138
- from { opacity: 0; }
139
- to { opacity: 1; }
140
- }
141
-
142
- @keyframes go-up {
143
- 0% { bottom:0px;}
144
- 100% { bottom:100px;
145
- z-index:1;}
146
- }
147
-
148
-
149
- @keyframes open {
150
- from { transform: scaleY(1);}
151
- to { transform: scaleY(-1);z-index:0}
152
- }
153
-
154
- h1 {
155
- font-size:1rem;
156
- }
157
- h2 {
158
- font-size:0.7rem;
159
- }
160
- p {
161
- font-size:0.8rem;
162
- }
163
-
164
-
165
- </style>
166
-
167
-
168
- <div class="envelope">
169
- <div class="rect go-up" style="display: inline-block">
170
- <div style="display: inline-block;position:relative">
171
- <div class="col-lg-12 text-center mt-3" style="position:relative; text-align:center;">
172
- <p style="margin-bottom:0">
173
- So you are looking for best
174
- <br>
175
- <span class="boldos"> Email Marketing Service
176
- </span>?
177
- </p>
178
- <div style="width:80%; padding-left:20%;">
179
- <p style="margin-bottom:.1rem;color:#4c85c2;">
180
- Please, answer few questions.
181
- </p>
182
- <p>
183
- When you'll be ready hit button "No more questions. ANSWERS!"
184
- </p>
185
- </div>
186
- </div>
187
- </div>
188
- </div>
189
- </div>
190
- <form method="post" class="begin">
191
- <button type="submit" style="z-index:6;" class="btn btn-primary">Begin</button>
192
- </form>
193
-
194
-
195
- {% endblock %}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes