Stage
This commit is contained in:
		
							
								
								
									
										13
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								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__':
 | 
			
		||||
 
 | 
			
		||||
@@ -99,7 +99,8 @@ body {
 | 
			
		||||
.project-container {
 | 
			
		||||
    position: inherit;
 | 
			
		||||
    display: flex;
 | 
			
		||||
    flex-direction: column;
 | 
			
		||||
    flex-direction: row;
 | 
			
		||||
    flex-wrap: wrap;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.project-container-row {
 | 
			
		||||
 
 | 
			
		||||
@@ -28,15 +28,11 @@
 | 
			
		||||
            <div class="pagebody-inner-section" id="pbi">
 | 
			
		||||
                <h1>Мои проекты</h1>
 | 
			
		||||
                <div class="project-container" id="pbic">
 | 
			
		||||
                    {% for row in rows %}
 | 
			
		||||
                        <div class="project-container-row">
 | 
			
		||||
                            {% for project in row %}
 | 
			
		||||
                                <div class="project-element">
 | 
			
		||||
                                    <h1> {{ project.title }}</h1>
 | 
			
		||||
                                    <img src="{{ url_for('static', filename='assets/{0}'.format(project.image))}}" width=200 height=200>
 | 
			
		||||
                                    <p> {{ project.description }} </p>
 | 
			
		||||
                                </div>
 | 
			
		||||
                            {% endfor %}
 | 
			
		||||
                    {% for project in projects %}
 | 
			
		||||
                        <div class="project-element">
 | 
			
		||||
                            <h1> {{ project.title }}</h1>
 | 
			
		||||
                            <img src="{{ url_for('static', filename='assets/{0}'.format(project.image))}}" width=200 height=200>
 | 
			
		||||
                            <p> {{ project.description }} </p>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    {% endfor %}
 | 
			
		||||
                </div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user