-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcookbook.html
executable file
·82 lines (66 loc) · 2.03 KB
/
cookbook.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Sofia|Droid+Serif|Cabin+Sketch' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="/stylesheets/cookbook.css" />
<title>Cook Nooks!</title>
<script language="javascript" type="text/javascript">
function autofocus(){
document.getElementById('content').focus();
}
</script>
</head>
<body onLoad="autofocus()">
<div id="cookbookTitle">
{{ myCookbook.name }}
</div>
<div id= "cookbookAuthor">
a cookbook by {{myCookbook.user.nickname}}
</div>
<div id="recipecontent">
{% for recipe in recipes %}
<div id="title">
<br></br>
{{ recipe.title }}
</div>
<div id="content">
{{ recipe.content }}
</div>
<div id= "delete">
{% if is_author %}
<a href="/delete/{{recipe.parent.key.name}}/{{recipe.key.name}}">Delete!</a>
{% endif %}
</div>
{% endfor %}
</div>
{% if is_author %}
<br></br>
<form action ="" name="form1" id="form1" method ="post" accept-charset ="utf-8">
<p id="para1">Recipe Title: <br></br> <input type="text" name="title" value= "" id="title"></p>
<p id="para2">Instructions: <br></br> <textarea name="content" rows="6" cols="40" id="content"></textarea></p>
<p id="para3"><input type= "submit" value="Post!"></p>
</form>
{% endif %}
<div id="back">
<a href="\main">Take me back to the main page!</a>
</div>
<div id="deleteBook"><a href="/delete/{{myCookbook.key.name}}">Delete this book (are you sure?)</a></p>
<div id="logoutLink">
{% if loggedIn %}
<a href="{{ logout_url }}">Logout!</a>
{% endif %}
</div>
<div id="error">
{% ifequal error_state 3 %}
Please enter a recipe name!
{% endifequal %}
</div>
<div id="error">
{% ifequal error_state 4 %}
Recipe names can contain letters, digits and underscores only.
{% endifequal %}
</div>
<div id= "credit">
a Sophie Chou creation
</div>
</body>
</html>