fmartingr
/
shelfzilla
Archived
1
0
Fork 0

PJAX: Allowing pjax only for volume actions

This commit is contained in:
Felipe Martín 2015-04-13 19:59:50 +00:00
parent 7a79d3a943
commit 4b976978cf
7 changed files with 29 additions and 29 deletions

View File

@ -32,21 +32,21 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a data-pjax-unnav class="navbar-brand" data-pjax href="{% url "homepage" %}">Shelfzilla</a> <a class="navbar-brand"href="{% url "homepage" %}">Shelfzilla</a>
</div> </div>
<!-- Collect the nav links, forms, and other content for toggling --> <!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse"> <div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li data-pjax-nav {% if navigation.section == "series" %}class="active"{% endif %}> <li {% if navigation.section == "series" %}class="active"{% endif %}>
<a data-pjax href="{% url "series.list" %}">{% trans "Series" %}</a> <a href="{% url "series.list" %}">{% trans "Series" %}</a>
</li> </li>
<li data-pjax-nav {% if navigation.section == "publishers" %}class="active"{% endif %}> <li {% if navigation.section == "publishers" %}class="active"{% endif %}>
<a data-pjax href="{% url 'publishers.list' %}">{% trans "Publishers" %}</a> <a href="{% url 'publishers.list' %}">{% trans "Publishers" %}</a>
</li> </li>
<!-- <!--
<li data-pjax-nav {% if navigation.section == "faqs" %}class="active"{% endif %}> <li {% if navigation.section == "faqs" %}class="active"{% endif %}>
<a data-pjax href="{% url 'faq.list' %}">{% trans "Faq" %}</a> <a href="{% url 'faq.list' %}">{% trans "Faq" %}</a>
</li> </li>
--> -->
</ul> </ul>
@ -57,14 +57,14 @@
&nbsp;{{ user.username }}</a> &nbsp;{{ user.username }}</a>
</li> </li>
{% if user.is_superuser %} {% if user.is_superuser %}
<li><a data-pjax-unnav href="/admin/" title="Admin" data-toggle="tooltip" data-placement="bottom"><i class="glyphicon glyphicon-tower"></i></a></li> <li><a href="/admin/" title="Admin" data-toggle="tooltip" data-placement="bottom"><i class="glyphicon glyphicon-tower"></i></a></li>
{% endif %} {% endif %}
<!-- <li><a data-pjax-unnav href="{% url 'profile' user.username %}" data-pjax <!-- <li><a href="{% url 'profile' user.username %}"
title="{% trans "Profile" %}" data-toggle="tooltip" data-placement="bottom"> title="{% trans "Profile" %}" data-toggle="tooltip" data-placement="bottom">
<i class="glyphicon glyphicon-user"></i> <i class="glyphicon glyphicon-user"></i>
</a> </a>
</li> --> </li> -->
<li><a data-pjax-unnav href="{% url "logout" %}" <li><a href="{% url "logout" %}"
title="{% trans "Logout" %}" data-toggle="tooltip" data-placement="bottom"> title="{% trans "Logout" %}" data-toggle="tooltip" data-placement="bottom">
<i class="glyphicon glyphicon-off"></i> <i class="glyphicon glyphicon-off"></i>
</a> </a>
@ -84,7 +84,7 @@
</ul> </ul>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<form class="navbar-form navbar-right" role="search" <form class="navbar-form navbar-right" role="search"
method="post" action="{% url "search" %}" data-pjax> method="post" action="{% url "search" %}">
{% csrf_token %} {% csrf_token %}
<div class="form-search search-only"> <div class="form-search search-only">
<i class="search-icon glyphicon glyphicon-search"></i> <i class="search-icon glyphicon glyphicon-search"></i>

View File

@ -14,7 +14,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-sm-9" data-pjax-container="profile"> <div class="col-sm-9">
{% comment %} {% comment %}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">

View File

@ -27,9 +27,9 @@
{% for item in letter.list %} {% for item in letter.list %}
<li class="list-group-item"> <li class="list-group-item">
{% if item.slug %} {% if item.slug %}
<a href="{% url "publishers.detail" item.pk item.slug %}" data-pjax>{{ item.name }}</a> <a href="{% url "publishers.detail" item.pk item.slug %}">{{ item.name }}</a>
{% else %} {% else %}
<a href="{% url "publishers.detail" item.pk %}" data-pjax>{{ item.name }}</a> <a href="{% url "publishers.detail" item.pk %}">{{ item.name }}</a>
{% endif %} {% endif %}
</li> </li>
{% endfor %} {% endfor %}

View File

@ -11,9 +11,9 @@
{% for item in items %} {% for item in items %}
<li class="list-group-item"> <li class="list-group-item">
{% if item.slug %} {% if item.slug %}
<a href="{% url "series.detail" item.pk item.slug %}" data-pjax>{{ item.name }}</a> <a href="{% url "series.detail" item.pk item.slug %}">{{ item.name }}</a>
{% else %} {% else %}
<a href="{% url "series.detail" item.pk %}" data-pjax>{{ item.name }}</a> <a href="{% url "series.detail" item.pk %}">{{ item.name }}</a>
{% endif %} {% endif %}
</li> </li>
{% empty %} {% empty %}

View File

@ -18,7 +18,7 @@
<div><strong><a href="{{ volume.series.get_absolute_url }}">{{ volume.series.name }}</a></strong></div> <div><strong><a href="{{ volume.series.get_absolute_url }}">{{ volume.series.name }}</a></strong></div>
{% endif %} {% endif %}
{% if type == 'slim' %} {% if type == 'slim' %}
<a href="{{ volume.series.get_absolute_url }}" data-pjax> <a href="{{ volume.series.get_absolute_url }}">
<h4 class="media-heading"> <h4 class="media-heading">
{% if show_language and volume.language %} {% if show_language and volume.language %}
<img src="{% static "images/flags/"|add:volume.language.code|add:'.gif' code %}" /> <img src="{% static "images/flags/"|add:volume.language.code|add:'.gif' code %}" />
@ -39,7 +39,7 @@
<div><span class="label label-primary">{{ volume.collection.name }}</span></div> <div><span class="label label-primary">{{ volume.collection.name }}</span></div>
{% endif %} {% endif %}
{% if show_publisher %} {% if show_publisher %}
<div><a href="{{ volume.publisher.get_absolute_url }}" data-pjax>{{ volume.publisher }}</a></div> <div><a href="{{ volume.publisher.get_absolute_url }}">{{ volume.publisher }}</a></div>
{% endif %} {% endif %}
{% if volume.release_date %} {% if volume.release_date %}
<div>{{ volume.release_date|date:"F Y" }}</div> <div>{{ volume.release_date|date:"F Y" }}</div>

View File

@ -10,11 +10,11 @@
<ul class="pagination"> <ul class="pagination">
{% for letter in letters %} {% for letter in letters %}
<li {% if current_letter == letter|lower %}class="active"{% endif %}> <li {% if current_letter == letter|lower %}class="active"{% endif %}>
<a href="{% url 'series.list' %}?letter={{ letter|lower }}" data-pjax>{{ letter }}</a> <a href="{% url 'series.list' %}?letter={{ letter|lower }}">{{ letter }}</a>
</li> </li>
{% endfor %} {% endfor %}
<li {% if current_letter == 'other' %}class="active"{% endif %}> <li {% if current_letter == 'other' %}class="active"{% endif %}>
<a href="{% url 'series.list' %}?letter=other" data-pjax>{% trans "other" %}</a> <a href="{% url 'series.list' %}?letter=other">{% trans "other" %}</a>
</li> </li>
</ul> </ul>
</div> </div>
@ -29,9 +29,9 @@
{% for item in items %} {% for item in items %}
<li class="list-group-item"> <li class="list-group-item">
{% if item.slug %} {% if item.slug %}
<a href="{% url "series.detail" item.pk item.slug %}" data-pjax>{{ item.name }}</a> <a href="{% url "series.detail" item.pk item.slug %}">{{ item.name }}</a>
{% else %} {% else %}
<a href="{% url "series.detail" item.pk %}" data-pjax>{{ item.name }}</a> <a href="{% url "series.detail" item.pk %}">{{ item.name }}</a>
{% endif %} {% endif %}
</li> </li>
{% empty %} {% empty %}
@ -49,9 +49,9 @@
{% for item in letter.list %} {% for item in letter.list %}
<li class="list-group-item"> <li class="list-group-item">
{% if item.slug %} {% if item.slug %}
<a href="{% url "series.detail" item.pk item.slug %}" data-pjax>{{ item.name }}</a> <a href="{% url "series.detail" item.pk item.slug %}">{{ item.name }}</a>
{% else %} {% else %}
<a href="{% url "series.detail" item.pk %}" data-pjax>{{ item.name }}</a> <a href="{% url "series.detail" item.pk %}">{{ item.name }}</a>
{% endif %} {% endif %}
</li> </li>
{% empty %} {% empty %}

View File

@ -23,18 +23,18 @@
<img src="{{ item.avatar }}" class="max-width-100" /> <img src="{{ item.avatar }}" class="max-width-100" />
</div> </div>
<div class="list-group"> <div class="list-group">
<a data-pjax-nav href="{% url 'profile' item.username %}" data-pjax class="list-group-item {% if section == 'summary' %}active{% endif %}"> <a href="{% url 'profile' item.username %}" class="list-group-item {% if section == 'summary' %}active{% endif %}">
{% trans "Summary" %}</a> {% trans "Summary" %}</a>
{% if item.have_volumes.count > 0 %} {% if item.have_volumes.count > 0 %}
<a data-pjax-nav href="{% url 'profile' item.username 'collection' %}" data-pjax="profile" class="list-group-item {% if section == 'collection' %}active{% endif %}"> <a href="{% url 'profile' item.username 'collection' %}" class="list-group-item {% if section == 'collection' %}active{% endif %}">
{% trans "Collection" %}</a> {% trans "Collection" %}</a>
{% endif %} {% endif %}
{% if item.wishlisted_volumes.count > 0 %} {% if item.wishlisted_volumes.count > 0 %}
<a data-pjax-nav href="{% url 'profile' item.username 'wishlist' %}" data-pjax="profile" class="list-group-item {% if section == 'wishlist' %}active{% endif %}"> <a href="{% url 'profile' item.username 'wishlist' %}" class="list-group-item {% if section == 'wishlist' %}active{% endif %}">
{% trans "Wishlist" %}</a> {% trans "Wishlist" %}</a>
{% endif %} {% endif %}
{% comment %} {% comment %}
<a data-pjax-nav href="{% url 'profile' item.username 'achievements' %}" data-pjax="profile" class="list-group-item {% if section == 'achievements' %}active{% endif %}"> <a href="{% url 'profile' item.username 'achievements' %}" class="list-group-item {% if section == 'achievements' %}active{% endif %}">
{% trans "Achievements" %}</a> {% trans "Achievements" %}</a>
{% endcomment %} {% endcomment %}
</div> </div>
@ -47,7 +47,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="col-sm-9" data-pjax-container="profile"> <div class="col-sm-9">
{% block profile_content %} {% block profile_content %}
{% include "users/profile/summary.html" %} {% include "users/profile/summary.html" %}
{% endblock %} {% endblock %}