Remove Issue edition page and some extra deprecated code
parent
c2ee8829be
commit
9cf3ca18f2
|
@ -70,8 +70,6 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
|||
{templateUrl: "/partials/issues.html", resolve: {loader: tgLoaderProvider.add()}})
|
||||
$routeProvider.when("/project/:pslug/issue/:issueref",
|
||||
{templateUrl: "/partials/issues-detail.html"})
|
||||
$routeProvider.when("/project/:pslug/issue/:issueref/edit",
|
||||
{templateUrl: "/partials/issues-detail-edit.html"})
|
||||
|
||||
# Admin
|
||||
$routeProvider.when("/project/:pslug/admin/project-profile/details",
|
||||
|
|
|
@ -71,7 +71,6 @@ urls = {
|
|||
"project-tasks-detail": "/project/:project/task/:ref"
|
||||
|
||||
"project-issues-detail": "/project/:project/issue/:ref"
|
||||
"project-issues-detail-edit": "/project/:project/issue/:ref/edit"
|
||||
|
||||
"project-wiki": "/project/:project/wiki",
|
||||
"project-wiki-page": "/project/:project/wiki/:slug",
|
||||
|
|
|
@ -133,230 +133,6 @@ class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
module.controller("IssueDetailController", IssueDetailController)
|
||||
|
||||
|
||||
#############################################################################
|
||||
## Issue Main Directive
|
||||
#############################################################################
|
||||
|
||||
IssueDirective = ($tgrepo, $log, $location, $confirm, $navUrls, $loading) ->
|
||||
linkSidebar = ($scope, $el, $attrs, $ctrl) ->
|
||||
|
||||
link = ($scope, $el, $attrs) ->
|
||||
$ctrl = $el.controller()
|
||||
linkSidebar($scope, $el, $attrs, $ctrl)
|
||||
|
||||
if $el.is("form")
|
||||
form = $el.checksley()
|
||||
|
||||
$el.on "click", ".save-issue", (event) ->
|
||||
if not form.validate()
|
||||
return
|
||||
|
||||
onSuccess = ->
|
||||
$loading.finish(target)
|
||||
$confirm.notify("success")
|
||||
ctx = {
|
||||
project: $scope.project.slug
|
||||
ref: $scope.issue.ref
|
||||
}
|
||||
$location.path($navUrls.resolve("project-issues-detail", ctx))
|
||||
|
||||
onError = ->
|
||||
$loading.finish(target)
|
||||
$confirm.notify("error")
|
||||
|
||||
target = angular.element(event.currentTarget)
|
||||
$loading.start(target)
|
||||
$tgrepo.save($scope.issue).then(onSuccess, onError)
|
||||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgIssueDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", "$tgNavUrls",
|
||||
"$tgLoading", IssueDirective])
|
||||
|
||||
|
||||
#############################################################################
|
||||
## Issue status directive
|
||||
#############################################################################
|
||||
|
||||
IssueStatusDirective = () ->
|
||||
# TODO: i18n
|
||||
template = _.template("""
|
||||
<h1>
|
||||
<span>
|
||||
<% if (status.is_closed) { %>
|
||||
Closed
|
||||
<% } else { %>
|
||||
Open
|
||||
<% } %>
|
||||
</span>
|
||||
<span class="us-detail-status" style="color:<%= status.color %>"><%= status.name %></span>
|
||||
</h1>
|
||||
<div class="us-created-by">
|
||||
<div class="user-avatar">
|
||||
<img src="<%= owner.photo %>" alt="<%- owner.full_name_display %>" />
|
||||
</div>
|
||||
|
||||
<div class="created-by">
|
||||
<span class="created-title">Created by <%- owner.full_name_display %></span>
|
||||
<span class="created-date"><%- date %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="issue-data">
|
||||
<div class="type-data <% if (editable) { %>clickable<% } %>">
|
||||
<span class="level" style="background-color:<%= type.color %>"></span>
|
||||
<span class="type-status"><%= type.name %></span>
|
||||
<% if (editable) { %>
|
||||
<span class="icon icon-arrow-bottom"></span>
|
||||
<% } %>
|
||||
<span class="level-name">type</span>
|
||||
</div>
|
||||
<div class="severity-data <% if (editable) { %>clickable<% } %>">
|
||||
<span class="level" style="background-color:<%= severity.color %>"></span>
|
||||
<span class="severity-status"><%= severity.name %></span>
|
||||
<% if (editable) { %>
|
||||
<span class="icon icon-arrow-bottom"></span>
|
||||
<% } %>
|
||||
<span class="level-name">severity</span>
|
||||
</div>
|
||||
<div class="priority-data <% if (editable) { %>clickable<% } %>">
|
||||
<span class="level" style="background-color:<%= priority.color %>"></span>
|
||||
<span class="priority-status"><%= priority.name %></span>
|
||||
<% if (editable) { %>
|
||||
<span class="icon icon-arrow-bottom"></span>
|
||||
<% } %>
|
||||
<span class="level-name">priority</span>
|
||||
</div>
|
||||
<div class="status-data <% if (editable) { %>clickable<% } %>">
|
||||
<span class="level" style="background-color:<%= status.color %>"></span>
|
||||
<span class="status-status"><%= status.name %></span>
|
||||
<% if (editable) { %>
|
||||
<span class="icon icon-arrow-bottom"></span>
|
||||
<% } %>
|
||||
<span class="level-name">status</span>
|
||||
</div>
|
||||
</div>
|
||||
""")
|
||||
selectionTypeTemplate = _.template("""
|
||||
<ul class="popover pop-type">
|
||||
<% _.each(types, function(type) { %>
|
||||
<li><a href="" class="type" title="<%- type.name %>"
|
||||
data-type-id="<%- type.id %>"><%- type.name %></a></li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
""")
|
||||
selectionSeverityTemplate = _.template("""
|
||||
<ul class="popover pop-severity">
|
||||
<% _.each(severities, function(severity) { %>
|
||||
<li><a href="" class="severity" title="<%- severity.name %>"
|
||||
data-severity-id="<%- severity.id %>"><%- severity.name %></a></li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
""")
|
||||
selectionPriorityTemplate = _.template("""
|
||||
<ul class="popover pop-priority">
|
||||
<% _.each(priorities, function(priority) { %>
|
||||
<li><a href="" class="priority" title="<%- priority.name %>"
|
||||
data-priority-id="<%- priority.id %>"><%- priority.name %></a></li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
""")
|
||||
selectionStatusTemplate = _.template("""
|
||||
<ul class="popover pop-status">
|
||||
<% _.each(statuses, function(status) { %>
|
||||
<li><a href="" class="status" title="<%- status.name %>"
|
||||
data-status-id="<%- status.id %>"><%- status.name %></a></li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
""")
|
||||
|
||||
link = ($scope, $el, $attrs, $model) ->
|
||||
editable = $attrs.editable?
|
||||
|
||||
renderIssuestatus = (issue) ->
|
||||
owner = $scope.usersById?[issue.owner]
|
||||
date = moment(issue.created_date).format("DD MMM YYYY HH:mm")
|
||||
type = $scope.typeById[issue.type]
|
||||
status = $scope.statusById[issue.status]
|
||||
severity = $scope.severityById[issue.severity]
|
||||
priority = $scope.priorityById[issue.priority]
|
||||
html = template({
|
||||
owner: owner
|
||||
date: date
|
||||
editable: editable
|
||||
status: status
|
||||
severity: severity
|
||||
priority: priority
|
||||
type: type
|
||||
})
|
||||
$el.html(html)
|
||||
$el.find(".type-data").append(selectionTypeTemplate({types:$scope.typeList}))
|
||||
$el.find(".severity-data").append(selectionSeverityTemplate({severities:$scope.severityList}))
|
||||
$el.find(".priority-data").append(selectionPriorityTemplate({priorities:$scope.priorityList}))
|
||||
$el.find(".status-data").append(selectionStatusTemplate({statuses:$scope.statusList}))
|
||||
|
||||
$scope.$watch $attrs.ngModel, (issue) ->
|
||||
if issue?
|
||||
renderIssuestatus(issue)
|
||||
|
||||
if editable
|
||||
$el.on "click", ".type-data", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
$el.find(".pop-type").popover().open()
|
||||
|
||||
$el.on "click", ".type", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
target = angular.element(event.currentTarget)
|
||||
$model.$modelValue.type = target.data("type-id")
|
||||
renderIssuestatus($model.$modelValue)
|
||||
$.fn.popover().closeAll()
|
||||
|
||||
$el.on "click", ".severity-data", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
$el.find(".pop-severity").popover().open()
|
||||
|
||||
$el.on "click", ".severity", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
target = angular.element(event.currentTarget)
|
||||
$model.$modelValue.severity = target.data("severity-id")
|
||||
renderIssuestatus($model.$modelValue)
|
||||
$.fn.popover().closeAll()
|
||||
|
||||
$el.on "click", ".priority-data", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
$el.find(".pop-priority").popover().open()
|
||||
|
||||
$el.on "click", ".priority", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
target = angular.element(event.currentTarget)
|
||||
$model.$modelValue.priority = target.data("priority-id")
|
||||
renderIssuestatus($model.$modelValue)
|
||||
$.fn.popover().closeAll()
|
||||
|
||||
$el.on "click", ".status-data", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
$el.find(".pop-status").popover().open()
|
||||
|
||||
$el.on "click", ".status", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
target = angular.element(event.currentTarget)
|
||||
$model.$modelValue.status = target.data("status-id")
|
||||
renderIssuestatus($model.$modelValue)
|
||||
$.fn.popover().closeAll()
|
||||
|
||||
return {link:link, require:"ngModel"}
|
||||
|
||||
module.directive("tgIssueStatus", IssueStatusDirective)
|
||||
|
||||
|
||||
|
||||
#############################################################################
|
||||
## Issue status display directive
|
||||
#############################################################################
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
extends dummy-layout
|
||||
|
||||
block head
|
||||
title Taiga Your agile, free, and open source project management tool
|
||||
|
||||
block content
|
||||
form.wrapper(tg-issue-detail, ng-controller="IssueDetailController as ctrl",
|
||||
ng-init="section='issues'")
|
||||
div.main.us-detail
|
||||
div.us-detail-header.header-with-actions
|
||||
include views/components/mainTitle
|
||||
.action-buttons
|
||||
a.button.button-green.save-issue(href="", title="Save") Save
|
||||
a.button.button-red.cancel(tg-nav="project-issues-detail:project=project.slug, ref=issue.ref", href="", title="Cancel") Cancel
|
||||
|
||||
section.us-story-main-data
|
||||
div.us-title(ng-class="{blocked: issue.is_blocked}")
|
||||
div.us-edit-name-inner
|
||||
span.us-number(tg-bo-ref="issue.ref")
|
||||
input(type="text", ng-model="issue.subject", data-required="true", data-maxlength="500")
|
||||
p.block-desc-container(ng-show="issue.is_blocked")
|
||||
span.block-description-title Blocked
|
||||
span.block-description(tg-bind-html="issue.blocked_note || 'This issue is blocked'")
|
||||
a.unblock(ng-click="ctrl.unblock()", href="", title="Unblock issue") Unblock
|
||||
|
||||
div(tg-tag-line, editable="true", ng-model="issue.tags")
|
||||
|
||||
section.us-content
|
||||
textarea(placeholder="Write a description of your issue", ng-model="issue.description", tg-markitup)
|
||||
|
||||
tg-attachments(ng-model="issue", type="issue")
|
||||
tg-history(ng-model="issue", type="issue", mode="edit")
|
||||
|
||||
sidebar.menu-secondary.sidebar
|
||||
section.us-status(tg-issue-status, ng-model="issue", editable="true")
|
||||
section.us-assigned-to(tg-assigned-to, ng-model="issue", editable="true")
|
||||
section.watchers(tg-watchers, ng-model="issue", editable="true")
|
||||
|
||||
section.us-detail-settings
|
||||
a.button.button-gray.clickable(title="Click to block the issue", ng-show="!issue.is_blocked", ng-click="ctrl.block()") Block
|
||||
a.button.button-red(title="Click to delete the issue", tg-check-permission="delete_issue", ng-click="ctrl.delete()", href="") Delete
|
||||
|
||||
div.lightbox.lightbox-block.hidden(tg-lb-block, title="Blocking issue", ng-model="issue")
|
||||
|
||||
div.lightbox.lightbox-select-user(tg-lb-assignedto)
|
||||
|
||||
div.lightbox.lightbox-select-user(tg-lb-watchers)
|
|
@ -4,13 +4,11 @@ block head
|
|||
title Taiga Your agile, free, and open source project management tool
|
||||
|
||||
block content
|
||||
div.wrapper(tg-issue-detail, ng-controller="IssueDetailController as ctrl",
|
||||
div.wrapper(ng-controller="IssueDetailController as ctrl",
|
||||
ng-init="section='issues'")
|
||||
div.main.us-detail
|
||||
div.us-detail-header.header-with-actions
|
||||
include views/components/mainTitle
|
||||
.action-buttons
|
||||
a.button.button-green(tg-check-permission="modify_issue", href="", title="Edit", tg-nav="project-issues-detail-edit:project=project.slug,ref=issue.ref") Edit
|
||||
|
||||
section.us-story-main-data
|
||||
div.us-title(ng-class="{blocked: issue.is_blocked}")
|
||||
|
|
Loading…
Reference in New Issue