forked from mozilla/kitsune
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add outbox view. [bug 654428]
* Refactor CSS to share between inbox and outbox. * Factor up linked avatars and usernames to macros. * Fix PEP8 violation in inbox view.
- Loading branch information
James Socol
committed
May 9, 2011
1 parent
ff07f67
commit b7035e5
Showing
6 changed files
with
87 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{% macro avatar_link(user) -%} | ||
<a href="{{ profile_url(user) }}"><img src="{{ profile_avatar(user) }}" height="48" width="48"></a> | ||
{%- endmacro %} | ||
|
||
{% macro name_link(user, name=None) -%} | ||
<a href="{{ profile_url(user) }}">{% if name %}{{ name }}{% else %}{{ display_name(user) }}{% endif %}</a> | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{% extends "messages/base.html" %} | ||
{% from "messages/includes/macros.html" import avatar_link, name_link %} | ||
{% set title = _('Sent Messages') %} | ||
{% set crumbs = [(url('messages.inbox'), _('Messages')), | ||
(None, title)] %} | ||
|
||
{% block content %} | ||
<article id="outbox" class="main message-list"> | ||
<h1>{{ title }}</h1> | ||
{% if msgs %} | ||
<ol> | ||
{% for message in msgs %} | ||
<li> | ||
<span class="avatar"> | ||
{% if message.recipients > 1 -%} | ||
{{ avatar_link(request.user) }} | ||
{% else %} | ||
{{ avatar_link(message.recipient) }} | ||
{% endif %} | ||
</span> | ||
<span class="to user"> | ||
{% if message.recipients > 1 -%} | ||
{{ name_link(request.user, name=_('You')) }} | ||
{% else %} | ||
{{ name_link(message.recipient) }} | ||
{%- endif %} | ||
{{ datetimeformat(message.created) }} | ||
</span> | ||
<a href="{# TODO: url('messages.read_outgoing', message.id) #}"> | ||
{{ message.message|truncate(length=200) }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
{% else %} | ||
<p>{{ _('There are no messages here.') }}</p> | ||
{% endif %} | ||
</article> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,60 @@ | ||
article#inbox ol { | ||
article.message-list ol { | ||
list-style: none; | ||
} | ||
|
||
article#inbox li { | ||
article.message-list li { | ||
background-position: 1px center; | ||
background-repeat: no-repeat; | ||
border-top: 1px solid #eeeeee; | ||
border-bottom: 1px solid #eeeeee; | ||
height: 48px; | ||
padding: 3px 3px 3px 15px; | ||
} | ||
|
||
article#inbox li > a { | ||
article.message-list li > a { | ||
display: block; | ||
height: 42px; | ||
padding-top: 6px; | ||
} | ||
|
||
article#inbox li:first-child { | ||
border-top: none; | ||
article.message-list li:first-child { | ||
border-top: 1px solid #eeeeee; | ||
} | ||
|
||
article#inbox li.unread { | ||
article.message-list li.unread { | ||
background-color: #EFF9FF; | ||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABSSURBVChTY3z/8z8DIcCIrGjyugdw9blBCnA2E5yFrAIoiMyFKkJTAdEJFwQpwqoCWR3COjyup64iZN+iWQqRglqHVR1cEOEmNHXIXJQQx+VBADueHcvXWTPwAAAAAElFTkSuQmCC); | ||
} | ||
|
||
article#inbox li.replied { | ||
article.message-list li.replied { | ||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABRSURBVChTY/z//z8DIcCEpqB5xQNMLSiKsKoA6mGEW4dLRW2EAtQkXCogVoMU4VcBVQQ0EL//oNbhV4dwONxeTA0oQYDLPBSTcLkMPcSxqgMA/5QdFJd/yTgAAAAASUVORK5CYII=); | ||
} | ||
|
||
article#inbox span.avatar, | ||
article#inbox span.from { | ||
article.message-list span.avatar, | ||
article.message-list span.user { | ||
display: block; | ||
float: left; | ||
} | ||
|
||
article#inbox span.avatar { | ||
article.message-list span.avatar { | ||
padding-right: 5px; | ||
width: 48px; | ||
} | ||
|
||
article#inbox span.avatar img { | ||
article.message-list span.avatar img { | ||
border: none; | ||
} | ||
|
||
article#inbox span.from { | ||
article.message-list span.user { | ||
color: #999; | ||
padding-top: 6px; | ||
text-align: center; | ||
width: 100px; | ||
} | ||
|
||
article#inbox span.from a { | ||
article.message-list span.user a { | ||
color: #666; | ||
} | ||
|
||
article#inbox span.from time { | ||
article.message-list span.user time { | ||
display: block; | ||
font-size: 80%; | ||
} |