Skip to content

Commit

Permalink
First commit. Implemented the basic design. Added a few links and the…
Browse files Browse the repository at this point in the history
… main-page and the blog-page
  • Loading branch information
jwanglof committed Mar 16, 2012
1 parent 9354422 commit dfa00c8
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 0 deletions.
6 changes: 6 additions & 0 deletions muskelbyggning/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from flask import Flask
app = Flask("muskelbyggning")
app = Flask(__name__.split('.')[0])
# http://flask.pocoo.org/docs/api/#flask.Flask

import muskelbyggning.views
Binary file added muskelbyggning/__init__.pyc
Binary file not shown.
58 changes: 58 additions & 0 deletions muskelbyggning/static/css/mall.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
body,html {
background-color: #c0c0c0;
margin: 0px;
padding: 0px;
}

a {
color: #ffffff;
}

#top_container {
margin-top: 0px;
padding-left: 0px;
}

#top_container .properties {
height: 150px;
float: left;
}

#top_logo {
width: 350px;
background-image: url('/static/gfx/layout/top_logo_thin.png');
}

#top_belt {
background-image: url('/static/gfx/layout/top_logo_belt.png');
background-repeat: repeat-x;
}

#menu .properties {
clear: both;
color: #ffffff;
}

#menu_login {
position: absolute; top: 10px; left: 120px;
}

#menu_login input[type="text"],input[type="password"] {
border: 1px solid #379ac4;
}

#menu_login input[type="submit"] {
border: 1px solid #000000;
}

#menu_main {
position: absolute; top: 70px; left: 150px;
word-spacing: 40px;
}

#content {
margin-left: 10px;
margin-right: 10px;
clear: both;
width: 70%;
}
Binary file added muskelbyggning/static/gfx/layout/top_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
3 changes: 3 additions & 0 deletions muskelbyggning/static/mall.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-color: #c0c0c0;
}
5 changes: 5 additions & 0 deletions muskelbyggning/templates/blogs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "layout.html" %}
{% block title %}Bloggar{% endblock %}
{% block content %}
Blooooggar
{% endblock %}
5 changes: 5 additions & 0 deletions muskelbyggning/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "layout.html" %}
{% block title %}Index{% endblock %}
{% block content %}
Heeeejsan Varlden!
{% endblock %}
37 changes: 37 additions & 0 deletions muskelbyggning/templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Muskelbyggning - {% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/mall.css') }}" />
</head>
<body>

<div id="top_container">
<div id="top_logo" class="properties"></div>

<div id="top_belt" class="properties">

</div>
</div>

<div id="menu">
<div id="menu_login" class="properties">
<form method="post" action="/login">
<input type="text" name="username" placeholder="Anvandarnamn" / >
<input type="password" name="password" placeholder="Losenord" />
<input type="submit" value="Logga in" />
</form>
</div>

<div id="menu_main" class="properties">
<a href="/">Hem</a> <a href="/blogs/">Bloggar</a> Forum Gallerier
</div>
</div>

<div id="content">
{% block content %}{% endblock %}
</div>

</body>
</html>
8 changes: 8 additions & 0 deletions muskelbyggning/templates/show_post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>


</html>
{{ post_id }}
14 changes: 14 additions & 0 deletions muskelbyggning/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from muskelbyggning import app
from flask import render_template

@app.route("/")
def index():
return render_template("index.html")

@app.route("/blogs/")
def blogs():
return render_template("blogs.html")

@app.route("/post/<int:post_id>")
def show_post(post_id):
return render_template("show_post.html", post_id=post_id)
Binary file added muskelbyggning/views.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions runserver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from muskelbyggning import app
app.run(debug=True)

0 comments on commit dfa00c8

Please sign in to comment.