Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Phillips committed Feb 13, 2015
2 parents 28ca5b6 + 833ef0c commit 8edaa5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions perma_web/perma/templates/single-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<a href="{% url 'landing' %}">perma.cc<img class="infinity-logo" src="{{ STATIC_URL }}img/infinity-logo2.png"></a>
</div><!--end span 3 -->
<div class="col-sm-6 meta-data">
{% if not linky.user_deleted or request.user.pk == linky.created_by.pk %}
{% if not linky.user_deleted or request.user.pk == linky.created_by_id %}
<a class="submitted_url" href="{{linky.submitted_url}}">{{linky.submitted_title}}</a><br/>

<!--<a class="submitted_url" href="{{linky.submitted_url}}">{{linky.submitted_url}}</a>-->
Expand All @@ -40,12 +40,11 @@
<a class="btn dashboard" href="{% main_url 'dark_archive_link' linky.guid %}">Dark archive</a>
{% elif request.user.is_vesting_org_member and request.user.vesting_org == linky.vesting_org %}
<a class="btn dashboard" href="{% main_url 'dark_archive_link' linky.guid %}">Dark archive</a>
{% elif request.user.pk == linky.created_by.pk %}
{% elif request.user.pk == linky.created_by_id %}
<a class="btn dashboard" href="{% main_url 'dark_archive_link' linky.guid %}">Dark archive</a>
{% endif %}
{% endif %}

{% if request.user.pk == linky.created_by.pk and not linky.vested %}
{% if request.user.pk == linky.created_by_id and not linky.vested %}
<a class="btn user-delete" href="{% main_url 'user_delete_link' linky.guid %}"><i class="icon-trash"></i> Delete</a>
{% endif %}
{% endif %}
Expand Down Expand Up @@ -131,7 +130,7 @@
{# deleted unvested link #}
{% if linky.user_deleted %}
<div class="col-sm-6 col-sm-offset-3 yahowza text-center">
{% if request.user.pk == linky.created_by.pk %}
{% if request.user.pk == linky.created_by_id %}
<h2>You deleted this link.</h2>
{% else %}
<h1 class="cyan">Apologies.</h1><h2>This unvested link was deleted by the user who created it.</h2>
Expand All @@ -141,7 +140,7 @@ <h1 class="cyan">Apologies.</h1><h2>This unvested link was deleted by the user w
{% else %}

{# message for a darchived link that user has permission to access #}
{% if request.user.can_vest or request.user.pk == linky.created_by.pk %}
{% if request.user.can_vest or request.user.pk == linky.created_by_id %}
{% if linky|is_darchive %}
<div class="col-sm-6 col-sm-offset-3 yahowza text-center">
<img class="dark-bulb center" src="{{ STATIC_URL }}img/dark-bulb.png">
Expand All @@ -161,7 +160,7 @@ <h2>This link is in the <span class="dark">dark archive</span> because Perma.cc
<div class="watermark center">

{% if not linky.vested and serve_type != 'live' %}
{% if not linky|is_darchive or request.user.can_vest or request.user.pk == linky.created_by.pk %}
{% if not linky|is_darchive or request.user.can_vest or request.user.pk == linky.created_by_id %}
<div class="watermark-container">
<span class="pull-right">
<span class="glyphicon glyphicon-remove"></span>
Expand Down Expand Up @@ -192,7 +191,7 @@ <h2>Temporary Archive</h2>
</div>
{% endif %}

{% elif linky|is_darchive and not request.user.can_vest and not request.user.pk == linky.created_by.pk %}
{% elif linky|is_darchive and not request.user.can_vest and not request.user.pk == linky.created_by_id %}
<img class="dark-bulb center" src="{{ STATIC_URL }}img/dark-bulb.png">
<h1 class="cyan">Apologies.</h1>
<h2>
Expand Down
2 changes: 1 addition & 1 deletion perma_web/perma/views/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def ssl_redirect(link):
context['warc_url'] = absolute_url(request, context['asset'].warc_url(settings.DIRECT_WARC_HOST))
context['MEDIA_URL'] = absolute_url(request, settings.DIRECT_MEDIA_URL)
context['asset'] = serializers.serialize("json", [context['asset']], fields=['text_capture','image_capture','pdf_capture','warc_capture','base_storage_path'])
context['linky'] = serializers.serialize("json", [context['linky']], fields=['dark_archived','guid','vested','vesting_org','view_count','creation_timestamp','submitted_url','submitted_title'])
context['linky'] = serializers.serialize("json", [context['linky']], fields=['dark_archived','guid','vested','vesting_org','view_count','creation_timestamp','submitted_url','submitted_title','created_by'])
return HttpResponse(json.dumps(context), content_type="application/json")

elif serve_type == 'warc_download':
Expand Down
2 changes: 1 addition & 1 deletion perma_web/perma/views/user_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ def limited_login(request, template_name='registration/login.html',
# This will be set by the main server, e.g. //dashboard.perma.cc,
# but will be readable by any mirror serving //perma.cc.

user_info = serializers.serialize("json", [request.user], fields=['registrar','vesting_org','first_name','last_name','email'])
user_info = serializers.serialize("json", [request.user], fields=['registrar','vesting_org','first_name','last_name','email','is_staff'])

# The cookie should last as long as the login cookie, so cookie logic is copied from SessionMiddleware.
if request.session.get_expire_at_browser_close():
Expand Down

0 comments on commit 8edaa5e

Please sign in to comment.