Initial work on issues detail.
parent
7196c5406c
commit
61b9bbdea1
|
@ -21,11 +21,15 @@
|
|||
|
||||
@taiga = taiga = {}
|
||||
|
||||
configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $compileProvider, $gmUrlsProvider) ->
|
||||
configure = ($routeProvider, $locationProvider, $httpProvider, $provide,
|
||||
$compileProvider, $gmUrlsProvider) ->
|
||||
|
||||
$routeProvider.when("/project/:pslug/backlog", {templateUrl: "/partials/backlog.html"})
|
||||
$routeProvider.when("/project/:pslug/taskboard/:id", {templateUrl: "/partials/taskboard.html"})
|
||||
$routeProvider.when("/project/:pslug/issues", {templateUrl: "/partials/issues.html"})
|
||||
$routeProvider.when("/project/:pslug/search", {templateUrl: "/partials/search.html"})
|
||||
$routeProvider.when("/project/:pslug/issues/:issueref",
|
||||
{templateUrl: "/partials/issues-detail.html"})
|
||||
|
||||
$routeProvider.when("/login", {templateUrl: "/partials/login.html"})
|
||||
$routeProvider.when("/register", {templateUrl: "/partials/register.html"})
|
||||
|
|
|
@ -164,7 +164,8 @@ urls = {
|
|||
"project-backlog": "/project/:project/backlog",
|
||||
"project-taskboard": "/project/:project/taskboard/:sprint",
|
||||
"project-issues": "/project/:project/issues",
|
||||
"project-search": "/project/:project/search"
|
||||
"project-search": "/project/:project/search",
|
||||
"project-issues-detail": "/project/:project/issues/:ref"
|
||||
}
|
||||
|
||||
init = ($log, $navurls) ->
|
||||
|
|
|
@ -76,6 +76,7 @@ NavigationUrlsDirective = ($navurls, $auth, $q, $location) ->
|
|||
options.user = user.username if user
|
||||
|
||||
url = $navurls.resolve(name)
|
||||
|
||||
fullUrl = formatUrl(url, options)
|
||||
$location.url(fullUrl)
|
||||
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
###
|
||||
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
|
||||
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
|
||||
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File: modules/issues/detail.coffee
|
||||
###
|
||||
|
||||
taiga = @.taiga
|
||||
|
||||
mixOf = @.taiga.mixOf
|
||||
trim = @.taiga.trim
|
||||
toString = @.taiga.toString
|
||||
joinStr = @.taiga.joinStr
|
||||
groupBy = @.taiga.groupBy
|
||||
bindOnce = @.taiga.bindOnce
|
||||
|
||||
module = angular.module("taigaIssues")
|
||||
|
||||
#############################################################################
|
||||
## Issue Detail Controller
|
||||
#############################################################################
|
||||
|
||||
class IssueDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||
@.$inject = [
|
||||
"$scope",
|
||||
"$rootScope",
|
||||
"$tgRepo",
|
||||
"$tgConfirm",
|
||||
"$tgResources",
|
||||
"$routeParams",
|
||||
"$q",
|
||||
"$location"
|
||||
]
|
||||
|
||||
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q, @location) ->
|
||||
@scope.issueRef = @params.issueref
|
||||
@scope.sectionName = "Issues"
|
||||
|
||||
promise = @.loadInitialData()
|
||||
promise.then null, ->
|
||||
console.log "FAIL" #TODO
|
||||
|
||||
loadProject: ->
|
||||
return @rs.projects.get(@scope.projectId).then (project) =>
|
||||
@scope.project = project
|
||||
@scope.issueStatusById = groupBy(project.issue_statuses, (x) -> x.id)
|
||||
@scope.severityById = groupBy(project.severities, (x) -> x.id)
|
||||
@scope.priorityById = groupBy(project.priorities, (x) -> x.id)
|
||||
@scope.membersById = groupBy(project.memberships, (x) -> x.user)
|
||||
return project
|
||||
|
||||
loadIssue: ->
|
||||
return @rs.issues.get(@scope.projectId, @scope.issueId).then (issue) =>
|
||||
@scope.issue = issue
|
||||
return issue
|
||||
|
||||
loadInitialData: ->
|
||||
params = {
|
||||
pslug: @params.pslug
|
||||
issueref: @params.issueref
|
||||
}
|
||||
|
||||
promise = @repo.resolve(params).then (data) =>
|
||||
@scope.projectId = data.project
|
||||
@scope.issueId = data.issue
|
||||
return data
|
||||
|
||||
return promise.then(=> @.loadProject())
|
||||
.then(=> @.loadUsersAndRoles())
|
||||
.then(=> @.loadIssue())
|
||||
|
||||
module.controller("IssueDetailController", IssueDetailController)
|
||||
|
||||
|
||||
#############################################################################
|
||||
## Issue Main Directive
|
||||
#############################################################################
|
||||
|
||||
IssueDirective = ($log, $location) ->
|
||||
linkSidebar = ($scope, $el, $attrs, $ctrl) ->
|
||||
|
||||
|
||||
|
||||
|
||||
link = ($scope, $el, $attrs) ->
|
||||
$ctrl = $el.controller()
|
||||
linkSidebar($scope, $el, $attrs, $ctrl)
|
||||
|
||||
return {link:link}
|
||||
|
||||
|
||||
module.directive("tgIssueDetail", ["$log", "$tgLocation", IssueDirective])
|
||||
|
||||
|
||||
#############################################################################
|
||||
## TagLine (possible should be moved as generic directive)
|
||||
#############################################################################
|
||||
|
||||
TagLineDirective = ($log) ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgTagLine", ["$log", TagLineDirective])
|
|
@ -16,7 +16,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File: modules/issues.coffee
|
||||
# File: modules/issues/list.coffee
|
||||
###
|
||||
|
||||
taiga = @.taiga
|
||||
|
|
|
@ -25,6 +25,9 @@ taiga = @.taiga
|
|||
resourceProvider = ($repo) ->
|
||||
service = {}
|
||||
|
||||
service.get = (projectId, issueId) ->
|
||||
return $repo.queryOne("issues", issueId)
|
||||
|
||||
service.list = (projectId, filters) ->
|
||||
params = {project: projectId}
|
||||
params = _.extend({}, params, filters or {})
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
extends dummy-layout
|
||||
|
||||
block head
|
||||
title Taiga Project management web application with scrum in mind!
|
||||
|
||||
block content
|
||||
div.wrapper(tg-issue-detail, ng-controller="IssueDetailController as ctrl",
|
||||
ng-init="section='issues'")
|
||||
div.main.us-detail
|
||||
div.us-detail-header
|
||||
include views/components/mainTitle
|
||||
a.button.button-green(href="", title="Edit") Edit
|
||||
section.us-story-main-data
|
||||
h2.us-title
|
||||
span.us-number(tg-bo-html="issue.ref")
|
||||
span.us-name(ng-bind="issue.subject")
|
||||
|
||||
// div.blocked-warning
|
||||
// span.icon.icon-warning
|
||||
// p.blocked Blocked!
|
||||
// p We need Pilar to make a prototype out of this or we are not sure
|
||||
// a.button.button-red.button-block(href="", title="Unblock US") Unblock
|
||||
|
||||
div.user-story-tags(tg-tag-line, ng-model="issue.tags")
|
||||
span
|
||||
- for(var y = 0; y < 6; y++)
|
||||
include views/components/tag
|
||||
input(type="text", placeholder="Write tag...")
|
||||
section.us-content(tg-bind-html="issue.description_html")
|
||||
|
||||
// include views/modules/attachments
|
||||
section.us-activity
|
||||
ul.us-activity-tabs
|
||||
li
|
||||
a.active(href="#")
|
||||
span.icon.icon-bulk
|
||||
span.tab-title Comments
|
||||
|
||||
li
|
||||
a(href="#")
|
||||
span.icon.icon-issues
|
||||
span.tab-title Activity
|
||||
include views/modules/comments
|
||||
// include views/modules/activity
|
||||
sidebar.menu-secondary.sidebar
|
||||
h1
|
||||
span Open
|
||||
span.us-detail-status In progress
|
||||
div.us-detail-progress-bar
|
||||
div.current-progress
|
||||
span.tasks-completed 6/7 tasks completed
|
||||
ul.points-per-role
|
||||
li.total
|
||||
span.points 10
|
||||
span.role total
|
||||
|
||||
li(ng-repeat="role in roles track by role.id")
|
||||
span.points 10
|
||||
span.role UX
|
||||
|
||||
section.us-detail-assigned-to
|
||||
div.user-avatar
|
||||
a.avatar(href="", title="Assigned to")
|
||||
img(src="http://thecodeplayer.com/u/uifaces/18.jpg", alt="username")
|
||||
div.assigned-to
|
||||
span.assigned-title Assigned to
|
||||
span.user-assigned Anler Hernández
|
||||
|
||||
section.watchers
|
||||
div.watchers-header
|
||||
span.title watchers
|
||||
a.icon.icon-plus(href="", title="Add watcher")
|
||||
div.watchers-content
|
||||
- for(var y=0; y<5; y++)
|
||||
div.watcher-single
|
||||
div.watcher-avatar
|
||||
a.avatar(href="", title="Assigned to")
|
||||
img(src="http://thecodeplayer.com/u/uifaces/32.jpg", alt="username")
|
||||
a.watcher-name(href="", title="Jesús Espino") Jesús Espino
|
||||
|
||||
section.us-detail-settings
|
||||
a.button.button-gray(href="", title="Client requirement") Client requirement
|
||||
a.button.button-gray(href="", title="Team requirement") Team requirement
|
||||
a.button.button-red(href="", title="Block") Block
|
|
@ -7,22 +7,18 @@ block content
|
|||
div.wrapper.issues(tg-issues, ng-controller="IssuesController as ctrl", ng-init="section='issues'")
|
||||
sidebar.menu-secondary.extrabar.filters-bar
|
||||
include views/modules/filters
|
||||
//- TODO: Please delete this once filters are working correctly
|
||||
sidebar.menu-secondary.sidebar.filters-container
|
||||
// TODO: maybe everything related to this section
|
||||
// should be done in one unique include?
|
||||
header
|
||||
h1 Filters
|
||||
include views/modules/search-in
|
||||
include views/modules/filter-tags
|
||||
|
||||
section.main.issues-page
|
||||
header
|
||||
include views/components/mainTitle
|
||||
|
||||
include views/modules/list-filters
|
||||
include views/modules/issues-table
|
||||
|
||||
// Paginator is rended using js.
|
||||
div.paginator.issues-paginator
|
||||
//-Included paginator via JS
|
||||
div.lightbox.lightbox_add-issue.hidden
|
||||
|
||||
div.hidden.lightbox.lightbox_add-issue
|
||||
include views/modules/lightbox_add-issue
|
||||
div.lightbox.lightbox_add-bulk
|
||||
include views/modules/lightbox_add-bulk
|
||||
|
|
|
@ -9,6 +9,7 @@ section.issues-table.basic-table
|
|||
div.level-field(tg-issue-severity="issue")
|
||||
div.level-field(tg-issue-priority="issue")
|
||||
div.subject
|
||||
a(href="", tg-bo-html="issue.subject")
|
||||
a(href="", tg-nav="project-issues-detail:project=project.slug,ref=issue.ref",
|
||||
tg-bo-html="issue.subject")
|
||||
div.issue-field(tg-issue-status="issue")
|
||||
div.assigned-field(tg-issue-assignedto="issue")
|
||||
|
|
Loading…
Reference in New Issue