Stage
This commit is contained in:
parent
30a21270e3
commit
d10580a0ee
13
main.py
13
main.py
@ -5,7 +5,7 @@ import numpy.random as gaussian_rnd
|
|||||||
|
|
||||||
|
|
||||||
app = Flask(__name__, subdomain_matching=True)
|
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():
|
def generate_iq():
|
||||||
@ -32,15 +32,8 @@ def index():
|
|||||||
data = json.loads(file.read())
|
data = json.loads(file.read())
|
||||||
cols = data['cols']
|
cols = data['cols']
|
||||||
projects = data['projects']
|
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')
|
@app.route('/', subdomain='tex')
|
||||||
@ -49,7 +42,7 @@ def texindex():
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
app.run('thematdev.local', 22837)
|
app.run('192.168.51.3', 1488)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -99,7 +99,8 @@ body {
|
|||||||
.project-container {
|
.project-container {
|
||||||
position: inherit;
|
position: inherit;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-container-row {
|
.project-container-row {
|
||||||
|
@ -28,15 +28,11 @@
|
|||||||
<div class="pagebody-inner-section" id="pbi">
|
<div class="pagebody-inner-section" id="pbi">
|
||||||
<h1>Мои проекты</h1>
|
<h1>Мои проекты</h1>
|
||||||
<div class="project-container" id="pbic">
|
<div class="project-container" id="pbic">
|
||||||
{% for row in rows %}
|
{% for project in projects %}
|
||||||
<div class="project-container-row">
|
<div class="project-element">
|
||||||
{% for project in row %}
|
<h1> {{ project.title }}</h1>
|
||||||
<div class="project-element">
|
<img src="{{ url_for('static', filename='assets/{0}'.format(project.image))}}" width=200 height=200>
|
||||||
<h1> {{ project.title }}</h1>
|
<p> {{ project.description }} </p>
|
||||||
<img src="{{ url_for('static', filename='assets/{0}'.format(project.image))}}" width=200 height=200>
|
|
||||||
<p> {{ project.description }} </p>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user