Skip to content

Commit 7024aa5

Browse files
committed
Added base/master page. Refactored templates
1 parent f74d650 commit 7024aa5

File tree

10 files changed

+139
-312
lines changed

10 files changed

+139
-312
lines changed

artcon_z/artcon_z.sqlite

-4 KB
Binary file not shown.

artcon_z/artcon_z/models/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class User(Base):
2020
name = Column(Text, nullable=False)
2121
email = Column(String(64), nullable=False)
2222
password = Column(String(300), nullable=False)
23-
# last_logged = Column(DateTime, default=datetime.datetime.utcnow)
23+
last_logged = Column(DateTime, default=datetime.datetime.utcnow)
2424
user_type = relationship("UserType", back_populates="users")
2525

2626
def __init__(self, name, email, user_type_id):

artcon_z/artcon_z/models/user.pyc

75 Bytes
Binary file not shown.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!DOCTYPE html>
2+
<html lang="${request.locale_name}">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta name="description" content="pyramid web application">
8+
<meta name="author" content="Pylons Project">
9+
<link rel="shortcut icon" href="${request.static_url('artcon_z:static/pyramid-16x16.png')}">
10+
11+
<title>Fuck you</title>
12+
13+
<!-- Bootstrap core CSS -->
14+
<link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
15+
16+
<!-- Custom styles for this scaffold -->
17+
18+
<link href="${request.static_url('artcon_z:static/theme.css')}" rel="stylesheet">
19+
20+
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
21+
<!--[if lt IE 9]>
22+
<script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
23+
<script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
24+
<![endif]-->
25+
</head>
26+
<body>
27+
<div class="starter-template">
28+
<div class="container">
29+
<div class="row">
30+
<div class="col-md-2">
31+
<img class="logo img-responsive" src="${request.static_url('artcon_z:static/pyramid.png')}" alt="pyramid web framework">
32+
</div>
33+
<div class="col-md-10">
34+
<div class="pull-right">
35+
<tal:block tal:condition="not:logged_in">
36+
<p>
37+
<a href="${request.application_url}/login">Login</a>
38+
</p>
39+
<p>
40+
<a href="${request.application_url}/register">Register</a>
41+
</p>
42+
</tal:block>
43+
</div>
44+
<p tal:condition="logged_in" class="pull-right">
45+
<a href="${request.application_url}/logout">Logout</a>
46+
</p>
47+
<div metal:define-slot="content" class="content"></div>
48+
<br>
49+
<tal:block tal:condition="python: str(request.url) != str(request.application_url+'/')">
50+
<p class="pull-left">You can return to the
51+
<a href="${request.application_url}">FrontPage</a>.
52+
</p>
53+
</tal:block>
54+
</div>
55+
</div>
56+
<div class="row">
57+
<div class="copyright">
58+
Copyright &copy; Pylons Project
59+
</div>
60+
</div>
61+
</div>
62+
</div>
63+
64+
65+
<!-- Bootstrap core JavaScript
66+
================================================== -->
67+
<!-- Placed at the end of the document so the pages load faster -->
68+
<script src="//oss.maxcdn.com/libs/jquery/1.10.2/jquery.min.js"></script>
69+
<script src="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
70+
</body>
71+
</html>
Lines changed: 29 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,31 @@
1-
<!DOCTYPE html>
2-
<html lang="${request.locale_name}">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta name="description" content="pyramid web application">
8-
<meta name="author" content="Pylons Project">
9-
<link rel="shortcut icon" href="${request.static_url('artcon_z:static/pyramid-16x16.png')}">
10-
11-
<title> - Pyramid artcon_z wiki (based on
12-
TurboGears 20-Minute Wiki)</title>
13-
14-
<!-- Bootstrap core CSS -->
15-
<link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
16-
17-
<!-- Custom styles for this scaffold -->
18-
<link href="${request.static_url('artcon_z:static/theme.css')}" rel="stylesheet">
19-
20-
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
21-
<!--[if lt IE 9]>
22-
<script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
23-
<script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
24-
<![endif]-->
25-
</head>
26-
<body>
27-
28-
<div class="starter-template">
29-
<div class="container">
30-
<div class="row">
31-
<div class="col-md-2">
32-
<img class="logo img-responsive" src="${request.static_url('artcon_z:static/pyramid.png')}" alt="pyramid web framework">
33-
</div>
34-
<div class="col-md-10">
35-
<div class="content">
36-
<p tal:condition="not logged_in">
37-
<a href="${request.application_url}/register">Register</a>
38-
</p>
39-
<p tal:condition="logged_in" class="pull-right">
40-
<a href="${request.application_url}/logout">Logout</a>
41-
</p>
42-
<p>You can return to the
43-
<a href="${request.application_url}">FrontPage</a>.
44-
</p>
45-
<form action="${save_url}" method="post">
46-
<div class="form-group">
47-
<select name="user_type">
48-
<tal:block tal:repeat="user_type user_types">
49-
<option tal:condition="python: int(user_type.id) != int(user_type_id)"
50-
tal:attributes="value user_type.id"
51-
tal:content="user_type.user_type">
52-
</option>
53-
<option tal:condition="python: int(user_type.id) == int(user_type_id)"
54-
tal:attributes="value user_type.id"
55-
tal:content="user_type.user_type"
56-
selected>
57-
</option>
58-
</tal:block>
59-
</select>
60-
</div>
61-
<div class="form-group">
62-
<input type="text" name="name"
63-
tal:condition="python: user != None"
64-
tal:attributes="value user.name">
65-
<input type="text" name="name"
66-
tal:condition="python: user == None">
67-
</div>
68-
<div class="form-group">
69-
<button type="submit" name="form.submitted" value="Save" class="btn btn-default">Save</button>
70-
</div>
71-
</form>
72-
</div>
73-
</div>
74-
</div>
75-
<div class="row">
76-
<div class="copyright">
77-
Copyright &copy; Pylons Project
78-
</div>
79-
</div>
1+
<html metal:use-macro="load: base.pt">
2+
<div metal:fill-slot="content" class="content">
3+
<form action="${save_url}" method="post">
4+
<div class="form-group">
5+
<select name="user_type">
6+
<tal:block tal:repeat="user_type user_types">
7+
<option tal:condition="python: int(user_type.id) != int(user_type_id)"
8+
tal:attributes="value user_type.id"
9+
tal:content="user_type.user_type">
10+
</option>
11+
<option tal:condition="python: int(user_type.id) == int(user_type_id)"
12+
tal:attributes="value user_type.id"
13+
tal:content="user_type.user_type"
14+
selected>
15+
</option>
16+
</tal:block>
17+
</select>
8018
</div>
81-
</div>
82-
83-
84-
<!-- Bootstrap core JavaScript
85-
================================================== -->
86-
<!-- Placed at the end of the document so the pages load faster -->
87-
<script src="//oss.maxcdn.com/libs/jquery/1.10.2/jquery.min.js"></script>
88-
<script src="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
89-
</body>
19+
<div class="form-group">
20+
<input type="text" name="name"
21+
tal:condition="python: user != None"
22+
tal:attributes="value user.name">
23+
<input type="text" name="name"
24+
tal:condition="python: user == None">
25+
</div>
26+
<div class="form-group">
27+
<button type="submit" name="form.submitted" value="Save" class="btn btn-default">Save</button>
28+
</div>
29+
</form>
30+
</div>
9031
</html>
Lines changed: 14 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,16 @@
1-
<!DOCTYPE html>
2-
<html lang="${request.locale_name}">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta name="description" content="pyramid web application">
8-
<meta name="author" content="Pylons Project">
9-
<link rel="shortcut icon" href="${request.static_url('artcon_z:static/pyramid-16x16.png')}">
10-
11-
<title>${user.name}</title>
12-
13-
<!-- Bootstrap core CSS -->
14-
<link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
15-
16-
<!-- Custom styles for this scaffold -->
17-
<link href="${request.static_url('artcon_z:static/theme.css')}" rel="stylesheet">
18-
19-
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
20-
<!--[if lt IE 9]>
21-
<script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
22-
<script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
23-
<![endif]-->
24-
</head>
25-
<body>
26-
27-
<div class="starter-template">
28-
<div class="container">
29-
<div class="row">
30-
<div class="col-md-2">
31-
<img class="logo img-responsive" src="${request.static_url('artcon_z:static/pyramid.png')}" alt="pyramid web framework">
32-
</div>
33-
<div class="col-md-10">
34-
<div class="content">
35-
<div class="pull-right">
36-
<tal:block tal:condition="not:logged_in">
37-
<p>
38-
<a href="${request.application_url}/login">Login</a>
39-
</p>
40-
<p>
41-
<a href="${request.application_url}/register">Register</a>
42-
</p>
43-
</tal:block>
44-
</div>
45-
<p tal:condition="logged_in" class="pull-right">
46-
<a href="${request.application_url}/logout">Logout</a>
47-
</p>
48-
<div tal:replace="structure content">
49-
User text goes here.
50-
</div>
51-
<p>
52-
<a tal:attributes="href edit_url" href="">
53-
Edit this user
54-
</a>
55-
</p>
56-
<p>
57-
Viewing <strong><span tal:replace="user.name">
58-
User Name Goes Here</span></strong>
59-
</p>
60-
<p>You can return to the
61-
<a href="${request.application_url}">FrontPage</a>.
62-
</p>
63-
</div>
64-
</div>
65-
</div>
66-
<div class="row">
67-
<div class="copyright">
68-
Copyright &copy; Pylons Project
69-
</div>
70-
</div>
71-
</div>
1+
<html metal:use-macro="load: base.pt">
2+
<div metal:fill-slot="content" class="content">
3+
<div tal:replace="structure content">
4+
User text goes here.
725
</div>
73-
74-
75-
<!-- Bootstrap core JavaScript
76-
================================================== -->
77-
<!-- Placed at the end of the document so the pages load faster -->
78-
<script src="//oss.maxcdn.com/libs/jquery/1.10.2/jquery.min.js"></script>
79-
<script src="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
80-
</body>
6+
<p>
7+
<a tal:attributes="href edit_url" href="">
8+
Edit this user
9+
</a>
10+
</p>
11+
<p>
12+
Viewing <strong><span tal:replace="user.name">
13+
User Name Goes Here</span></strong>
14+
</p>
15+
</div>
8116
</html>
Lines changed: 13 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,14 @@
1-
<!DOCTYPE html>
2-
<html lang="${request.locale_name}">
3-
<head>
4-
<meta charset="utf-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta name="description" content="pyramid web application">
8-
<meta name="author" content="Pylons Project">
9-
<link rel="shortcut icon" href="${request.static_url('artcon_z:static/pyramid-16x16.png')}">
10-
11-
<title>Fuck you</title>
12-
13-
<!-- Bootstrap core CSS -->
14-
<link href="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
15-
16-
<!-- Custom styles for this scaffold -->
17-
18-
<link href="${request.static_url('artcon_z:static/theme.css')}" rel="stylesheet">
19-
20-
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
21-
<!--[if lt IE 9]>
22-
<script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
23-
<script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
24-
<![endif]-->
25-
</head>
26-
27-
<body>
28-
29-
<div class="starter-template">
30-
<div class="container">
31-
<div class="row">
32-
<div class="col-md-2">
33-
<img class="logo img-responsive" src="${request.static_url('artcon_z:static/pyramid.png')}" alt="pyramid web framework">
34-
</div>
35-
<div class="col-md-10">
36-
<div class="content">
37-
<p tal:condition="not logged_in">
38-
<a href="${request.application_url}/register">Register</a>
39-
</p>
40-
<p tal:condition="logged_in" class="pull-right">
41-
<a href="${request.application_url}/logout">Logout</a>
42-
</p>
43-
<p>You can return to the
44-
<a href="${request.application_url}">FrontPage</a>.
45-
</p>
46-
<p>
47-
<a href="${ request.route_url('add_user', user_type_id=user_type.id) }">Add a new ${user_type.user_type}</a>
48-
</p>
49-
<table>
50-
<tbody>
51-
<tr tal:repeat="user users">
52-
<td><a href="${ request.route_url('view_user', user_id=user.id) }">${user.name}<a></td>
53-
</tr>
54-
</tbody>
55-
</table>
56-
</div>
57-
</div>
58-
</div>
59-
<div class="row">
60-
<div class="copyright">
61-
Copyright &copy; Pylons Project
62-
</div>
63-
</div>
64-
</div>
65-
</div>
66-
67-
68-
<!-- Bootstrap core JavaScript
69-
================================================== -->
70-
<!-- Placed at the end of the document so the pages load faster -->
71-
<script src="//oss.maxcdn.com/libs/jquery/1.10.2/jquery.min.js"></script>
72-
<script src="//oss.maxcdn.com/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
73-
</body>
1+
<html metal:use-macro="load: base.pt">
2+
<div metal:fill-slot="content" class="content">
3+
<p>
4+
<a href="${ request.route_url('add_user', user_type_id=user_type.id) }">Add a new ${user_type.user_type}</a>
5+
</p>
6+
<table>
7+
<tbody>
8+
<tr tal:repeat="user users">
9+
<td><a href="${ request.route_url('view_user', user_id=user.id) }">${user.name}<a></td>
10+
</tr>
11+
</tbody>
12+
</table>
13+
</div>
7414
</html>

0 commit comments

Comments
 (0)