diff --git a/issue/models.py b/issue/models.py index be9df93..3e6daac 100644 --- a/issue/models.py +++ b/issue/models.py @@ -171,6 +171,8 @@ class Event(models.Model): REFERENCE = 9 COMMENT = 10 DESCRIBE = 11 + ASSIGN = 12 + UNASSIGN = 13 issue = models.ForeignKey(Issue, related_name="%(class)ss") @@ -202,7 +204,8 @@ class Event(models.Model): 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" elif self.code == Event.CLOSE: return "ban-circle" @@ -210,18 +213,18 @@ class Event(models.Model): return "refresh" elif self.code == Event.RENAME: return "transfer" - elif self.code == Event.ADD_LABEL: + elif self.code == Event.ADD_LABEL \ + or self.code == Event.DEL_LABEL: return "tag" - elif self.code == Event.DEL_LABEL: - return "tag" - elif self.code == Event.SET_MILESTONE: - return "road" - elif self.code == Event.CHANGE_MILESTONE: - return "road" - elif self.code == Event.DEL_MILESTONE: + elif self.code == Event.SET_MILESTONE \ + or self.code == Event.CHANGE_MILESTONE \ + or self.code == Event.DEL_MILESTONE: return "road" elif self.code == Event.REFERENCE: return "transfer" + elif self.code == Event.ASSIGN \ + or self.code == Event.UNASSIGN: + return "user" else: return "cog" diff --git a/issue/templates/issue/issue.html b/issue/templates/issue/issue.html index 9f89d5b..ad3a38b 100644 --- a/issue/templates/issue/issue.html +++ b/issue/templates/issue/issue.html @@ -96,17 +96,13 @@ {% if labels.count %} {% for label in labels %}
  • - - {{ label }} - + {{ label }}
  • {% endfor %} {% endif %}
  • - - - +
  • @@ -115,12 +111,8 @@ {% if issue.labels.count %} {% for label in issue.labels.all %}
    - - - - - {{ label }} - + + {{ label }}
    {% endfor %} {% else %} @@ -130,9 +122,7 @@
    Milestons
    - - - +
    {% if issue.milestones.count %} @@ -142,6 +132,18 @@ {% else %} No milestone {% endif %} +
    +
    + Assignee +
    + +
    +
    + {% if issue.assignee %} + {{ assignee.username }} + {% else %} + No one assigned + {% endif %} diff --git a/issuetracker/settings.py b/issuetracker/settings.py index e94e7d6..5246b0d 100644 --- a/issuetracker/settings.py +++ b/issuetracker/settings.py @@ -37,6 +37,9 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', + 'django.contrib.humanize', + + 'stronghold', 'django_markdown', 'crispy_forms', 'colorful', @@ -51,6 +54,8 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + + 'stronghold.middleware.LoginRequiredMiddleware', ) ROOT_URLCONF = 'issuetracker.urls' @@ -87,6 +92,8 @@ USE_TZ = True STATIC_URL = '/static/' +LOGIN_URL = '/login' + LOGIN_REDIRECT_URL='/' CRISPY_TEMPLATE_PACK = 'bootstrap3'