-
Notifications
You must be signed in to change notification settings - Fork 3
/
author.html
51 lines (44 loc) · 1.35 KB
/
author.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
<script>
var update_author = function() {
var data = {name:$("#author-name").val(),
slug:$("#author-slug").val(),
bio:$("#author-bio").val()};
update_model("author", {{ author.pk }}, data);
}
$(document).ready(function() {
$("#author-details").hover(
function(){},
function(){
var data = {name:$("#author-name").val(),
slug:$("#author-slug").val(),
bio:$("#author-bio").val()};
update_model("author", {{ author.pk }}, data);
})});
</script>
<div class="author-picture">
<img src="{{ author.get_picture_url }}" alt="An picture of {{ author.name }}" >
<form action="/editor/add_author_picture/" method="post" enctype="multipart/form-data">
<input type="file" name="file" >
<input type="hidden" name="pk" value="{{ author.pk }}">
<input type="hidden" name="model" value="author">
<br>
<input type="submit" value="Change Picture">
</form>
</div>
<div id="author-details" class="author-details">
<ul>
<li>
<table>
<tr>
<td>Name</td><td> <input id="author-name" value="{{ author.name }}"></td>
</tr>
<tr>
<td>Slug</td><td> <input id="author-slug" value="{{ author.slug }}"></td>
</tr>
</table>
<li>
<p> A brief biography, written in Markdown. </p>
<textarea id="author-bio">{{ author.bio }}</textarea>
</li>
</ul>
</div>