Add latest ungluing to desktop page

foundation/home
jonahmania 2018-05-14 16:57:52 -04:00
parent 7583c06982
commit d78dc33342
2 changed files with 90 additions and 0 deletions

View File

@ -222,6 +222,68 @@ function put_un_in_cookie2(){
</div>
</div>
{% endif %}
<div class="jsmodule">
<h3 class="module-title latest-ungluing">Latest Ungluing</h3>
<div class="jsmod-content latest-ungluing">
<ul class="ungluingwhat">
{% for event in events %}
{% comment %}
events are tuples of date, object, and string representing object type
{% endcomment %}
<li>
{% with event.1 as object %}
{% if event.2 == "pledge" %}
{% if object.user%}
<span class="user-avatar">
<a href="{% url 'supporter' object.user.username %}"><img src="{{ object.user.profile.avatar_url }}" title="{{ object.user.username }}" alt="Avatar for {{ object.user.username }}" /></a>
</span>
<span class="user-book-info">
<a href="{% url 'supporter' object.user.username %}">{{ object.user.username }}</a><br />
{% if object.campaign.type == 1 %}
pledged to unglue
{% elif object.campaign.type == 2 %}
bought a copy of
{% elif object.campaign.type == 3 %}
supported
{% endif %}<br />
<a class="user-book-name" href="{% url 'work' object.campaign.work_id %}">{{ object.campaign.work.title }}</a>
</span>
{% else %}
<span class="user-avatar">
<img src="/static/images/header/anonuser.png" title="Anonymous User" alt="Avatar for Anonymous User" />
</span>
<span class="user-book-info">
Anonymous User<br />
supported <br />
<a class="user-book-name" href="{% url 'work' object.campaign.work_id %}">{{ object.campaign.work.title }}</a>
</span>
{% endif %}
{% elif event.2 == "comment" %}
<span class="user-avatar">
<a href="{% url 'supporter' object.user.username %}"><img src="{{ object.user.profile.avatar_url }}" title="{{ object.user.username }}" alt="Avatar for {{ object.user.username }}" /></a>
</span>
<span class="user-book-info">
<a href="{% url 'supporter' object.user.username %}">{{ object.user.username }}</a><br />
commented on<br />
<a class="user-book-name" href="{% url 'work' object.content_object.id %}?tab=2">{{ object.content_object.title }}</a>
</span>
{% elif event.2 == "wish" %}
<span class="user-avatar">
<a href="{% url 'supporter' object.wishlist.user.username %}"><img src="{{ object.wishlist.user.profile.avatar_url }}" title="{{ object.wishlist.user.username }}" alt="Avatar for {{ object.wishlist.user.username }}" /></a>
</span>
<span class="user-book-info">
<a href="{% url 'supporter' object.wishlist.user.username %}">{{ object.wishlist.user.username }}</a><br />
faved<br />
<a class="user-book-name" href="{% url 'work' object.work_id %}">{{ object.work.title }}</a>
</span>
{% endif %}
{% endwith %}
</li>
{% endfor %}
</ul>
</div>
<div class="jsmodule">
<h3 class="module-title">Donate!</h3>
<div class="jsmod-content">

View File

@ -50,6 +50,10 @@
width: 100%;
}
}
.latest-ungluing {
display: none;
}
}
@include breakpoint(medium up) {
@ -138,3 +142,27 @@
display: none;
}
.jsmod-content {
ul {
margin: 0;
list-style-type: none;
li {
display: flex;
margin-bottom: 10px;
.user-avatar {
padding-top: 6px;
a img {
max-width: none;
width: 34px;
border-radius: 2px;
}
}
.user-book-info {
margin-left: 10px;
.user-book-name {
font-weight: normal;
}
}
}
}
}