Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move over pinax-points templates #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "admin/change_list.html" %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is at the wrong path.

Since this is an admin override I think you want it at the path:

pinax/templates/templates/admin/pinax/points/awardedpointvalue/change_list.html

but not entirely sure. It might be:

pinax/templates/templates/admin/pinax_points/awardedpointvalue/change_list.html

Because of the app lable: https://github.com/pinax/pinax-points/blob/master/pinax/points/apps.py#L8

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - those long paths got me 😆

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This admin file looks out of place to not be in the points directory. Are you sure it should be in its own separate admin folder in pinax-templates? If pinax-points were included in a starter project, perhaps the admin templates would be in the project templates folder. https://github.com/jaydenwindle/pinax-templates/tree/move_pinax_points_templates/pinax/templates/templates/pinax


{% load i18n %}

{% block object-tools %}
{% if has_add_permission %}
<ul class="object-tools">
<li>
<a href="one_off_points/">{% trans "Award one-off points" %}</a>
</li>
<li>
<a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
</a>
</li>
</ul>
{% endif %}
{% endblock %}
35 changes: 35 additions & 0 deletions pinax/templates/templates/pinax/points/one_off_points.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{% extends "admin/base_site.html" %}

{% load i18n admin_modify adminmedia %}

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to ship static as part of the apps either. This should be moved into starter project sass.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, this is part of the admin system. hm...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, these templates are pretty tightly tied to the admin system. Feels a bit odd to put them side by side with the rest of the pinax templates given the differences. If there's a better way to do this I'd love to hear!


{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="../../">{% trans "Home" %}</a>
&rsaquo;
<a href="../">{{ opts.app_label|capfirst }}</a>
&rsaquo;
<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo;
{% trans "Award one-off points" %}
</div>
{% endblock %}

{% block content %}
<div id="content-main">
<h1>{% trans "Issue one-off point rewards" %}</h1>

<form method="POST" action="">
{% csrf_token %}
{% for fieldset in form %}
{% include "admin/includes/fieldset.html" %}
{% endfor %}

<div class="submit-row">
{% trans "Award" as submit_text %}
<input type="submit" value="{{ submit_text }}" class="default" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the use of <button> now but not sure this should hold things up.

</div>
</form>
</div>
{% endblock %}