<a><button></button></a> -> <a class="btn"></a>

This commit is contained in:
Élie Bouttier 2014-08-14 19:32:09 -07:00
parent 780aea341b
commit 8a0d8a6514
16 changed files with 43 additions and 43 deletions

View file

@ -16,7 +16,7 @@ from colorful.fields import RGBColorField
import json import json
from issue.templatetags.issue_tags import same_milestone, same_label, labeled from issue.templatetags.issue_tags import same_milestone, same_label, label_style, labeled
class User(auth.models.User): class User(auth.models.User):
@ -335,8 +335,9 @@ class Event(models.Model):
action = 'added' action = 'added'
else: else:
action = 'removed' action = 'removed'
description = '%s the <a href="%s">%s</a> label' \ description = '%s the <a href="%s" class="label" ' \
% (action, same_label(label), labeled(label)) 'style="%s">%s</a> label' \
% (action, same_label(label), label_style(label), label)
elif self.code == Event.SET_MILESTONE or self.code == Event.UNSET_MILESTONE: elif self.code == Event.SET_MILESTONE or self.code == Event.UNSET_MILESTONE:
milestone = Milestone(name=args['milestone'], milestone = Milestone(name=args['milestone'],
project=self.issue.project) project=self.issue.project)

View file

@ -10,7 +10,7 @@
<h1> <h1>
Global permissions Global permissions
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'list-global-permission' %}"><button class="btn btn-warning">Go back to list</button></a> <a href="{% url 'list-global-permission' %}" class="btn btn-warning">Go back to list</a>
</div> </div>
</div> </div>

View file

@ -12,7 +12,7 @@
<h1> <h1>
Global permissions Global permissions
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'add-global-permission' %}"><button class="btn btn-success">Add new permission</button></a> <a href="{% url 'add-global-permission' %}" class="btn btn-success">Add new permission</a>
</div> </div>
</h1> </h1>
</div> </div>
@ -46,8 +46,8 @@
<td class="text-center"><a href="{% url 'toggle-global-permission' perm.id 'manage-team' %}">{{ perm.manage_team|boolean }}</a></td> <td class="text-center"><a href="{% url 'toggle-global-permission' perm.id 'manage-team' %}">{{ perm.manage_team|boolean }}</a></td>
<td class="text-center"><a href="{% url 'toggle-global-permission' perm.id 'manage-global-permission' %}">{{ perm.manage_global_permission|boolean }}</a></td> <td class="text-center"><a href="{% url 'toggle-global-permission' perm.id 'manage-global-permission' %}">{{ perm.manage_global_permission|boolean }}</a></td>
<td class="text-center"> <td class="text-center">
<a href="{% url 'edit-global-permission' perm.id %}"><button class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span> Edit</button></a> <a href="{% url 'edit-global-permission' perm.id %}" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span> Edit</a>
<a href="{% url 'delete-global-permission' perm.id %}"><button class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span> Delete</button></a> <a href="{% url 'delete-global-permission' perm.id %}" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View file

@ -35,11 +35,11 @@
<a href="{% same_author event.author %}"><b>{{ event.author}}</b></a> {{ event }} {{ event.date|naturaltime }} <a href="{% same_author event.author %}"><b>{{ event.author}}</b></a> {{ event }} {{ event.date|naturaltime }}
{% if event.code == event.DESCRIBE %} {% if event.code == event.DESCRIBE %}
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'edit-issue' project.name issue.id %}"><button class="btn btn-primary btn-xs">Edit</button></a> <a href="{% url 'edit-issue' project.name issue.id %}" class="btn btn-primary btn-xs">Edit</a>
</div> </div>
{% elif event.code == event.COMMENT %} {% elif event.code == event.COMMENT %}
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'edit-comment' project.name issue.id event.id %}"><button class="btn btn-primary btn-xs">Edit</button></a> <a href="{% url 'edit-comment' project.name issue.id event.id %}" class="btn btn-primary btn-xs">Edit</a>
</div> </div>
{% endif %} {% endif %}
</div> </div>
@ -60,23 +60,23 @@
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<a href="{% url 'comment-issue' project.name issue.id %}"><button class="btn btn-default btn-block">Add a comment</button></a> <a href="{% url 'comment-issue' project.name issue.id %}" class="btn btn-default btn-block">Add a comment</a>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<a href="{% url 'edit-issue' project.name issue.id %}"><button class="btn btn-default btn-block">Edit this issue</button></a> <a href="{% url 'edit-issue' project.name issue.id %}" class="btn btn-default btn-block">Edit this issue</a>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
{% if issue.closed %} {% if issue.closed %}
<a href="{% url 'reopen-issue' project.name issue.id %}"><button class="btn btn-default btn-block">Reopen this issue</button></a> <a href="{% url 'reopen-issue' project.name issue.id %}" class="btn btn-default btn-block">Reopen this issue</a>
{% else %} {% else %}
<a href="{% url 'close-issue' project.name issue.id %}"><button class="btn btn-default btn-block">Close this issue</button></a> <a href="{% url 'close-issue' project.name issue.id %}" class="btn btn-default btn-block">Close this issue</a>
{% endif %} {% endif %}
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<a href="{% url 'delete-issue' project.name issue.id %}"><button class="btn btn-default btn-block">Delete this issue</button></a> <a href="{% url 'delete-issue' project.name issue.id %}" class="btn btn-default btn-block">Delete this issue</a>
</div> </div>
</div> </div>

View file

@ -21,9 +21,9 @@
{% endif %} {% endif %}
<div class="pull-right"> <div class="pull-right">
{% if issue %} {% if issue %}
<a href="{% url 'show-issue' project.name issue.id %}"><button class="btn btn-warning">Go back to issue</button></a> <a href="{% url 'show-issue' project.name issue.id %}" class="btn btn-warning">Go back to issue</a>
{% else %} {% else %}
<a href="{% url 'list-issue' project.name %}"><button class="btn btn-warning">Go back to issues</button></a> <a href="{% url 'list-issue' project.name %}" class="btn btn-warning">Go back to issues</a>
{% endif %} {% endif %}
</div> </div>
</h1> </h1>

View file

@ -18,11 +18,11 @@
<div class="input-group"> <div class="input-group">
<div class="dropdown"> <div class="dropdown">
{% if is_all_query %} {% if is_all_query %}
<a href="{% url 'list-issue' project.name %}"><button type="button" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-remove"> Reset filter</span></button></a> <a href="{% url 'list-issue' project.name %}" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-remove"> Reset filter</span></a>
{% endif %} {% endif %}
<a href="{% url 'list-issue' project.name %}?q=is:open{% if is_all_query %} {{ is_all_query }}{% endif %}"><button type="button" class="btn btn-default btn-sm{{ is_open }}">Open</button></a> <a href="{% url 'list-issue' project.name %}?q=is:open{% if is_all_query %} {{ is_all_query }}{% endif %}" class="btn btn-default btn-sm{{ is_open }}">Open</a>
<a href="{% url 'list-issue' project.name %}?q=is:close{% if is_all_query %} {{ is_all_query }}{% endif %}"><button type="button" class="btn btn-default btn-sm{{ is_close }}">Close</button></a> <a href="{% url 'list-issue' project.name %}?q=is:close{% if is_all_query %} {{ is_all_query }}{% endif %}" class="btn btn-default btn-sm{{ is_close }}">Close</a>
<a href="{% url 'list-issue' project.name %}?q={% if is_all_query %}{{ is_all_query }}{% else %}*{% endif %}"><button type="button" class="btn btn-default btn-sm{{ is_all }}">Both</button></a> <a href="{% url 'list-issue' project.name %}?q={% if is_all_query %}{{ is_all_query }}{% else %}*{% endif %}" class="btn btn-default btn-sm{{ is_all }}">Both</a>
</div> </div>
</div> </div>
</div> </div>
@ -37,7 +37,7 @@
{% if perm.create_issue %} {% if perm.create_issue %}
<div class="form-group"> <div class="form-group">
<div class="input-group"> <div class="input-group">
<a href="{% url 'add-issue' project.name %}"><button class="btn btn-success" type="button">New issue</button></a> <a href="{% url 'add-issue' project.name %}" class="btn btn-success">New issue</a>
</div> </div>
</div> </div>
{% endif %} {% endif %}
@ -59,7 +59,7 @@
{% endif %} {% endif %}
<a href="{% url 'show-issue' project.name issue.id %}"><b>{{ issue }}</b></a> <a href="{% url 'show-issue' project.name issue.id %}"><b>{{ issue }}</b></a>
{% for label in issue.labels.all %} {% for label in issue.labels.all %}
<a href="{% same_label label %}">{% labeled label %}</a> <a href="{% same_label label %}" class="label" style="{% label_style label %}">{{ label }}</a>
{% endfor %} {% endfor %}
<br /> <br />
<small>#{{ issue.id }} opened by <a href="{% same_author issue.author %}"><b>{{ issue.author.username }}</b></a> {{ issue.opened_at|naturaltime }}</small> <small>#{{ issue.id }} opened by <a href="{% same_author issue.author %}"><b>{{ issue.author.username }}</b></a> {{ issue.opened_at|naturaltime }}</small>

View file

@ -16,7 +16,7 @@
New label New label
{% endif %} {% endif %}
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'list-label' project.name %}"><button class="btn btn-warning">Go back to labels</button></a> <a href="{% url 'list-label' project.name %}" class="btn btn-warning">Go back to labels</a>
</div> </div>
</h1> </h1>
</div> </div>

View file

@ -13,7 +13,7 @@
Labels Labels
{% if perm.manage_tags %} {% if perm.manage_tags %}
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'add-label' project.name %}"><button class="btn btn-success">New label</button></a> <a href="{% url 'add-label' project.name %}" class="btn btn-success">New label</a>
</div> </div>
{% endif %} {% endif %}
</h1> </h1>
@ -24,14 +24,14 @@
{% for label in labels %} {% for label in labels %}
<tr> <tr>
<td> <td>
<a href="{% same_label label %}"><button class="btn" style="{% label_style label %}"><span class="glyphicon glyphicon-tag" style="font-size: 100%;"></span> {{ label }}</button></a> <a href="{% same_label label %}" class="btn" style="{% label_style label %}"><span class="glyphicon glyphicon-tag" style="font-size: 100%;"></span> {{ label }}</a>
{% if perm.manage_tags or perm.delete_tags %} {% if perm.manage_tags or perm.delete_tags %}
<div class="pull-right"> <div class="pull-right">
{% if perm.manage_tags %} {% if perm.manage_tags %}
<a href="{% url 'edit-label' project.name label.id %}"><button class="btn btn-primary"><span class="glyphicon glyphicon-edit"></span> Edit</button></a> <a href="{% url 'edit-label' project.name label.id %}" class="btn btn-primary"><span class="glyphicon glyphicon-edit"></span> Edit</a>
{% endif %} {% endif %}
{% if perm.delete_tags %} {% if perm.delete_tags %}
<a href="{% url 'delete-label' project.name label.id %}"><button class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Delete</button></a> <a href="{% url 'delete-label' project.name label.id %}" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Delete</a>
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}

View file

@ -20,7 +20,7 @@
New milestone New milestone
{% endif %} {% endif %}
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'list-milestone' project.name %}"><button class="btn btn-warning">Go back to milestones</button></a> <a href="{% url 'list-milestone' project.name %}" class="btn btn-warning">Go back to milestones</a>
</div> </div>
</h1> </h1>
</div> </div>

View file

@ -10,11 +10,11 @@
<h1> <h1>
Milestone Milestone
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'list-milestone' project.name %}?show=open"><button class="btn btn-default btn-sm{% if show == 'open' %} active{% endif %}">Open</button></a> <a href="{% url 'list-milestone' project.name %}?show=open" class="btn btn-default btn-sm{% if show == 'open' %} active{% endif %}">Open</a>
<a href="{% url 'list-milestone' project.name %}?show=close"><button class="btn btn-default btn-sm{% if show == 'close' %} active{% endif %}">Close</button></a> <a href="{% url 'list-milestone' project.name %}?show=close" class="btn btn-default btn-sm{% if show == 'close' %} active{% endif %}">Close</a>
<a href="{% url 'list-milestone' project.name %}?show=all"><button class="btn btn-default btn-sm{% if show == 'all' %} active{% endif %}">All</button></a> <a href="{% url 'list-milestone' project.name %}?show=all" class="btn btn-default btn-sm{% if show == 'all' %} active{% endif %}">All</a>
{% if perm.manage_tags %} {% if perm.manage_tags %}
<a href="{% url 'add-milestone' project.name %}"><button class="btn btn-success">New milestone</button></a> <a href="{% url 'add-milestone' project.name %}" class="btn btn-success">New milestone</a>
{% endif %} {% endif %}
</div> </div>
</h1> </h1>
@ -40,7 +40,7 @@
{% endif %} {% endif %}
</div> </div>
<b style="font-size: 200%;"> <b style="font-size: 200%;">
<a href="{% url 'list-issue' project.name %}?q=is:open%20milestone:{{ milestone.name }}">{{ milestone }}</a> <span class="glyphicon glyphicon-road"></span> <a href="{% url 'list-issue' project.name %}?q=is:open%20milestone:{{ milestone.name }}">{{ milestone }}</a>
</b> </b>
&#160; &#160;
<small> <small>

View file

@ -10,7 +10,7 @@
<h1> <h1>
New project New project
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'list-project' %}"><button class="btn btn-warning">Go back to list</button></a> <a href="{% url 'list-project' %}" class="btn btn-warning">Go back to list</a>
</div> </div>
</h1> </h1>
</div> </div>

View file

@ -10,7 +10,7 @@
<h1> <h1>
Edit project Edit project
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'list-issue' project.name %}"><button class="btn btn-warning">Go back to issues</button></a> <a href="{% url 'list-issue' project.name %}" class="btn btn-warning">Go back to issues</a>
</div> </div>
</h1> </h1>
</div> </div>

View file

@ -12,7 +12,7 @@
Projects Projects
{% if perm.create_project %} {% if perm.create_project %}
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'add-project' %}"><button class="btn btn-success">Add project</button></a> <a href="{% url 'add-project' %}" class="btn btn-success">Add project</a>
</div> </div>
{% endif %} {% endif %}
</h1> </h1>

View file

@ -12,7 +12,7 @@
<h1> <h1>
Permissions of '{{ project }}' project Permissions of '{{ project }}' project
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'list-project-permission' project.name %}"><button class="btn btn-warning">Go back to list</button></a> <a href="{% url 'list-project-permission' project.name %}" class="btn btn-warning">Go back to list</a>
</div> </div>
</div> </div>

View file

@ -14,7 +14,7 @@
<h1> <h1>
Permissions of '{{ project }}' project Permissions of '{{ project }}' project
<div class="pull-right"> <div class="pull-right">
<a href="{% url 'add-project-permission' project.name %}"><button class="btn btn-success">Add new permission</button></a> <a href="{% url 'add-project-permission' project.name %}" class="btn btn-success">Add new permission</a>
</div> </div>
</h1> </h1>
</div> </div>
@ -57,8 +57,8 @@
<td class="text-center"><a href="{% url 'toggle-project-permission' project.name perm.id 'delete-tags' %}">{{ perm.delete_tags|boolean }}</a></td> <td class="text-center"><a href="{% url 'toggle-project-permission' project.name perm.id 'delete-tags' %}">{{ perm.delete_tags|boolean }}</a></td>
<td class="text-center"><a href="{% url 'toggle-project-permission' project.name perm.id 'manage-project-permission' %}">{{ perm.manage_project_permission|boolean }}</a></td> <td class="text-center"><a href="{% url 'toggle-project-permission' project.name perm.id 'manage-project-permission' %}">{{ perm.manage_project_permission|boolean }}</a></td>
<td class="text-center"> <td class="text-center">
<a href="{% url 'edit-project-permission' project.name perm.id %}"><button class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span> Edit</button></a> <a href="{% url 'edit-project-permission' project.name perm.id %}" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span> Edit</a>
<a href="{% url 'delete-project-permission' project.name perm.id %}"><button class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span> Delete</button></a> <a href="{% url 'delete-project-permission' project.name perm.id %}" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span> Delete</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View file

@ -15,7 +15,7 @@ def label_style(label):
else: else:
fg = '#000' fg = '#000'
style = "background-color: {bg}; color: {fg};" style = "background-color: {bg}; color: {fg}; vertical-align: middle;"
return style.format(bg=label.color, fg=fg) return style.format(bg=label.color, fg=fg)
@ -23,8 +23,7 @@ def label_style(label):
@register.simple_tag @register.simple_tag
def labeled(label): def labeled(label):
html = '<span class="label" style="{style} ' \ html = '<span class="label" style="{style}">{name}</span>'
'vertical-align: middle;">{name}</span>'
return mark_safe(html.format(style=label_style(label), return mark_safe(html.format(style=label_style(label),
name=escape(label.name))) name=escape(label.name)))