Implement sidebar on media page

This commit is contained in:
Jef van Schendel 2011-06-27 22:39:05 +02:00
parent da0683b48c
commit a54e5be78e
3 changed files with 45 additions and 32 deletions

View File

@ -174,12 +174,16 @@ a.mediagoblin_logo:hover {
/* media pages */ /* media pages */
img.media_image { .media_image{
display:block; width:640px;
margin-left:auto;
margin-right:auto;
} }
.media_sidebar{
width:280px;
}
/* media galleries */
ul.media_thumbnail { ul.media_thumbnail {
padding:0px; padding:0px;
} }

View File

@ -19,14 +19,18 @@
{% block mediagoblin_content %} {% block mediagoblin_content %}
{# temporarily, an "image gallery" that isn't one really ;) #} {# temporarily, an "image gallery" that isn't one really ;) #}
{% if media %} {% if media %}
<h1>Media details for {{media.title}}</h1> <div class="grid_8 alpha media_image">
<div>
<img src="{{ request.app.public_store.file_url( <img src="{{ request.app.public_store.file_url(
media.media_files.main) }}" /> media.media_files.main) }}" />
<h1>Media details for {{media.title}}</h1>
<br/>Uploaded: {{ media.created}} <p>
<br/>Description: {{media.description}} <br/>Uploaded: {{ media.created}}
<br/>Description: {{media.description}}
</p>
</div>
<div class="grid_4 omega sidebar">
<p>Uploaded: {{ media.created}}</p>
</div> </div>
{% else %} {% else %}
<p>Sorry, no such media found.<p/> <p>Sorry, no such media found.<p/>

View File

@ -20,28 +20,33 @@
{# temporarily, an "image gallery" that isn't one really ;) #} {# temporarily, an "image gallery" that isn't one really ;) #}
{% if media %} {% if media %}
<h1> <div class="grid_8 alpha media_image">
{{media.title}} <img class="media_image" src="{{ request.app.public_store.file_url(
</h1> media.media_files.main) }}" />
<img class="media_image" src="{{ request.app.public_store.file_url( <h2>
media.media_files.main) }}" /> {{media.title}}
<p> </h2>
Uploaded on <p>
{{ "%4d-%02d-%02d"|format(media.created.year, Uploaded on
media.created.month, media.created.day) }} {{ "%4d-%02d-%02d"|format(media.created.year,
by media.created.month, media.created.day) }}
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home', by
user= media.uploader().username) }}"> <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
{{- media.uploader().username }}</a> user= media.uploader().username) }}">
</p> {{- media.uploader().username }}</a>
{% autoescape False %} </p>
<p>{{ media.description_html }}</p> {% autoescape False %}
{% endautoescape %} <p>{{ media.description_html }}</p>
{% if media['uploader'] == request.user['_id'] %} {% endautoescape %}
<p><a href="{{ request.urlgen('mediagoblin.edit.edit_media', {% if media['uploader'] == request.user['_id'] %}
user= media.uploader().username, <p><a href="{{ request.urlgen('mediagoblin.edit.edit_media',
media= media._id) }}">Edit</a></p> user= media.uploader().username,
{% endif %} media= media._id) }}">Edit</a></p>
{% endif %}
</div>
<div class="grid_4 omega media_sidebar">
<p>This is a sidebar! Yay!</p>
</div>
{% else %} {% else %}
<p>Sorry, no such media found.<p/> <p>Sorry, no such media found.<p/>
{% endif %} {% endif %}