Skip to content

Commit

Permalink
Partial implementation of an author editing view for LFE.
Browse files Browse the repository at this point in the history
  • Loading branch information
lethain committed Jun 2, 2008
1 parent b96fd63 commit fe0ad73
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions editor/urls.py
Expand Up @@ -6,6 +6,7 @@
(r'^comments/$', 'comments'),
(r'^blogroll/$', 'blogroll'),
(r'^files/$', 'files'),
(r'^authors/$', 'authors'),

(r'^projects/$', 'projects'),
(r'^projects/create/$', 'create_project'),
Expand Down
7 changes: 7 additions & 0 deletions editor/views.py
Expand Up @@ -114,6 +114,13 @@ def project_body(request, id):
{'object':project,
'resources':resources},
RequestContext(request,{}))

@login_required
def authors(request):
authors = Author.objects.all()
return render_to_response('lifeflow/editor/authors.html',
{'authors':authors},
RequestContext(request,{}))



Expand Down
7 changes: 5 additions & 2 deletions media/lifeflow/editor/editor.css
Expand Up @@ -377,19 +377,22 @@ div.blogs div.controls {
}


div.authors {
width: 100%;
}

div.files {
width: 100%;
}

div.files div.selections {
div.selections {
width: 210px;
float: left;
height: 100%;
}


div.files div.selections select {
div.selections select {
width: 100%;
}

Expand Down
22 changes: 22 additions & 0 deletions templates/lifeflow/editor/author.html
@@ -0,0 +1,22 @@
<div class="author-picture">

</div>
<div class="author-details">
<ul>
<li>
<table>
<tr>
<td>Name</td><td> {{ author.name}} </td>
</tr>
<tr>
<td>Slug</td><td> {{ author.slug }}</td>
</tr>
</table>

<li>
<p> A brief biography, written in Markdown. </p>
<textarea id="author-bio">{{ author.bio }}</textarea>
</li>

</ul>
</div>
22 changes: 22 additions & 0 deletions templates/lifeflow/editor/authors.html
@@ -0,0 +1,22 @@
{% extends "lifeflow/editor/base.html" %}


{% block body %}

<div class="authors">
<div class="selections" id="authors-list">
<a class="button positive" id="add-author"> Create </a>
<a class="button negative" id="delete-author"> Delete </a>
<select id="authors" size="20">
{% for author in authors %}
<option value="{{ author.pk }}"> {{ author.name }}</option>
{% endfor %}
</select>
</div>
<div class="author">
{% with authors.0 as author %}
{% include "lifeflow/editor/author.html" %}
{% endwith %}
</div>
</div>
{% endblock %}
1 change: 1 addition & 0 deletions templates/lifeflow/editor/base.html
Expand Up @@ -24,6 +24,7 @@
<a class="left" href="/editor/comments/">comments</a>
<a class="left" href="/editor/projects/">projects</a>
<a class="left" href="/editor/files/">files</a>
<a class="left" href="/editor/authors/">authors</a>
<a class="left" href="/editor/blogroll/">blogroll</a>
{% endif %}
</div>
Expand Down

0 comments on commit fe0ad73

Please sign in to comment.