stronghold (auth) & begin assignee

This commit is contained in:
Élie Bouttier 2014-08-02 20:38:12 -07:00
parent 7f91c790ec
commit 153a40ca54
3 changed files with 36 additions and 24 deletions

View file

@ -171,6 +171,8 @@ class Event(models.Model):
REFERENCE = 9 REFERENCE = 9
COMMENT = 10 COMMENT = 10
DESCRIBE = 11 DESCRIBE = 11
ASSIGN = 12
UNASSIGN = 13
issue = models.ForeignKey(Issue, related_name="%(class)ss") issue = models.ForeignKey(Issue, related_name="%(class)ss")
@ -202,7 +204,8 @@ class Event(models.Model):
def glyphicon(self): def glyphicon(self):
if self.code == Event.COMMENT or self.code == Event.DESCRIBE: if self.code == Event.COMMENT \
or self.code == Event.DESCRIBE:
return "pencil" return "pencil"
elif self.code == Event.CLOSE: elif self.code == Event.CLOSE:
return "ban-circle" return "ban-circle"
@ -210,18 +213,18 @@ class Event(models.Model):
return "refresh" return "refresh"
elif self.code == Event.RENAME: elif self.code == Event.RENAME:
return "transfer" return "transfer"
elif self.code == Event.ADD_LABEL: elif self.code == Event.ADD_LABEL \
or self.code == Event.DEL_LABEL:
return "tag" return "tag"
elif self.code == Event.DEL_LABEL: elif self.code == Event.SET_MILESTONE \
return "tag" or self.code == Event.CHANGE_MILESTONE \
elif self.code == Event.SET_MILESTONE: or self.code == Event.DEL_MILESTONE:
return "road"
elif self.code == Event.CHANGE_MILESTONE:
return "road"
elif self.code == Event.DEL_MILESTONE:
return "road" return "road"
elif self.code == Event.REFERENCE: elif self.code == Event.REFERENCE:
return "transfer" return "transfer"
elif self.code == Event.ASSIGN \
or self.code == Event.UNASSIGN:
return "user"
else: else:
return "cog" return "cog"

View file

@ -96,17 +96,13 @@
{% if labels.count %} {% if labels.count %}
{% for label in labels %} {% for label in labels %}
<li role="presentation"> <li role="presentation">
<a href="{% url 'add-label-to-issue' project.name issue.id label.id %}"> <a href="{% url 'add-label-to-issue' project.name issue.id label.id %}"><span class="label" style="{{ label.style }}">{{ label }}</span></a>
<span class="label" style="{{ label.style }}">{{ label }}</span>
</a>
</li> </li>
{% endfor %} {% endfor %}
<li role="presentation" class="divider"></li> <li role="presentation" class="divider"></li>
{% endif %} {% endif %}
<li role="presentation"> <li role="presentation">
<a href="{% url 'add-label' project.name %}?issue={{ issue.id }}"> <a href="{% url 'add-label' project.name %}?issue={{ issue.id }}"><button class="btn btn-success btn-xs btn-block">New label...</button></a>
<button class="btn btn-success btn-xs btn-block">New label...</button>
</a>
</li> </li>
</ul> </ul>
</div> </div>
@ -115,12 +111,8 @@
{% if issue.labels.count %} {% if issue.labels.count %}
{% for label in issue.labels.all %} {% for label in issue.labels.all %}
<div class="row"> <div class="row">
<a href="{% url 'remove-label-from-issue' project.name issue.id label.id %}"> <a href="{% url 'remove-label-from-issue' project.name issue.id label.id %}"><span class="glyphicon glyphicon-remove remove-label"></span></a>
<span class="glyphicon glyphicon-remove remove-label"></span> <a href="{% url 'list-issue' project.name %}?q=is:open%20label:{{ label.name }}"><span class="label" style="{{ label.style }}">{{ label }}</span></a>
</a>
<a href="{% url 'list-issue' project.name %}?q=is:open%20label:{{ label.name }}">
<span class="label" style="{{ label.style }}">{{ label }}</span>
</a>
</div> </div>
{% endfor %} {% endfor %}
{% else %} {% else %}
@ -130,9 +122,7 @@
<h5> <h5>
<b>Milestons</b> <b>Milestons</b>
<div class="pull-right"> <div class="pull-right">
<a href="#"> <a href="#"><button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-cog"></span></button></a>
<button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-plus"></span></button>
</a>
</div> </div>
</h5> </h5>
{% if issue.milestones.count %} {% if issue.milestones.count %}
@ -142,6 +132,18 @@
{% else %} {% else %}
No milestone No milestone
{% endif %} {% endif %}
<hr>
<h5>
<b>Assignee</b>
<div class="pull-right">
<a href="#"><button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-cog"></span></button></a>
</div>
</h5>
{% if issue.assignee %}
<a href="{% url 'list-issue' project.name %}?q=is:open%20author:{{ assignee.username }}"><b>{{ assignee.username }}</b></a>
{% else %}
No one assigned
{% endif %}
</div> </div>
</div> </div>

View file

@ -37,6 +37,9 @@ INSTALLED_APPS = (
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.humanize',
'stronghold',
'django_markdown', 'django_markdown',
'crispy_forms', 'crispy_forms',
'colorful', 'colorful',
@ -51,6 +54,8 @@ MIDDLEWARE_CLASSES = (
'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'stronghold.middleware.LoginRequiredMiddleware',
) )
ROOT_URLCONF = 'issuetracker.urls' ROOT_URLCONF = 'issuetracker.urls'
@ -87,6 +92,8 @@ USE_TZ = True
STATIC_URL = '/static/' STATIC_URL = '/static/'
LOGIN_URL = '/login'
LOGIN_REDIRECT_URL='/' LOGIN_REDIRECT_URL='/'
CRISPY_TEMPLATE_PACK = 'bootstrap3' CRISPY_TEMPLATE_PACK = 'bootstrap3'