From d10580a0eefc3cea06983a254e8b499214d8433c Mon Sep 17 00:00:00 2001 From: thematdev Date: Sun, 27 Dec 2020 10:46:48 +0300 Subject: [PATCH] Stage --- main.py | 13 +++---------- static/assets/css/style.css | 3 ++- templates/index.html | 14 +++++--------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/main.py b/main.py index 525067a..dfa1bfa 100644 --- a/main.py +++ b/main.py @@ -5,7 +5,7 @@ import numpy.random as gaussian_rnd app = Flask(__name__, subdomain_matching=True) -app.config['SERVER_NAME'] = 'thematdev.local:22837' +app.config['SERVER_NAME'] = '192.168.51.3:1488' def generate_iq(): @@ -32,15 +32,8 @@ def index(): data = json.loads(file.read()) cols = data['cols'] projects = data['projects'] - length = len(projects) - rows = [] - for i in range(0, length, cols): - row = [] - for j in range(i, min(i + cols, length)): - row.append(projects[j]) - rows.append(row) - return render_template('index.html', random_number=generate_iq(), rows=rows) + return render_template('index.html', random_number=generate_iq(), projects=projects) @app.route('/', subdomain='tex') @@ -49,7 +42,7 @@ def texindex(): def main(): - app.run('thematdev.local', 22837) + app.run('192.168.51.3', 1488) if __name__ == '__main__': diff --git a/static/assets/css/style.css b/static/assets/css/style.css index 9c60239..5714658 100644 --- a/static/assets/css/style.css +++ b/static/assets/css/style.css @@ -99,7 +99,8 @@ body { .project-container { position: inherit; display: flex; - flex-direction: column; + flex-direction: row; + flex-wrap: wrap; } .project-container-row { diff --git a/templates/index.html b/templates/index.html index 048658a..96fc83b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -28,15 +28,11 @@

Мои проекты

- {% for row in rows %} -
- {% for project in row %} -
-

{{ project.title }}

- -

{{ project.description }}

-
- {% endfor %} + {% for project in projects %} +
+

{{ project.title }}

+ +

{{ project.description }}

{% endfor %}