configurable angular debug info

stable
Juanfran 2015-03-04 13:20:38 +01:00
parent 4f86b6e19a
commit 029d984e7c
15 changed files with 44 additions and 32 deletions

View File

@ -36,7 +36,7 @@ taiga.generateUniqueSessionIdentifier = ->
taiga.sessionId = taiga.generateUniqueSessionIdentifier() taiga.sessionId = taiga.generateUniqueSessionIdentifier()
configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEventsProvider, tgLoaderProvider) -> configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEventsProvider, tgLoaderProvider, $compileProvider) ->
$routeProvider.when("/", $routeProvider.when("/",
{templateUrl: "project/projects.html", resolve: {loader: tgLoaderProvider.add()}}) {templateUrl: "project/projects.html", resolve: {loader: tgLoaderProvider.add()}})
@ -224,6 +224,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
linewidth: "The subject must have a maximum size of %s" linewidth: "The subject must have a maximum size of %s"
}) })
$compileProvider.debugInfoEnabled(window.taigaConfig.debugInfo)
init = ($log, $i18n, $config, $rootscope, $auth, $events, $analytics) -> init = ($log, $i18n, $config, $rootscope, $auth, $events, $analytics) ->
$i18n.initialize($config.get("defaultLanguage")) $i18n.initialize($config.get("defaultLanguage"))
$log.debug("Initialize application") $log.debug("Initialize application")
@ -281,6 +283,7 @@ module.config([
"$provide", "$provide",
"$tgEventsProvider", "$tgEventsProvider",
"tgLoaderProvider", "tgLoaderProvider",
"$compileProvider",
configure configure
]) ])

View File

@ -520,7 +520,6 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
module.controller("BacklogController", BacklogController) module.controller("BacklogController", BacklogController)
############################################################################# #############################################################################
## Backlog Directive ## Backlog Directive
############################################################################# #############################################################################
@ -537,29 +536,25 @@ BacklogDirective = ($repo, $rootscope) ->
if $scope.stats? if $scope.stats?
removeDoomlineDom() removeDoomlineDom()
elements = getUsItems()
stats = $scope.stats stats = $scope.stats
total_points = stats.total_points total_points = stats.total_points
current_sum = stats.assigned_points current_sum = stats.assigned_points
for element in elements for us, i in $scope.visibleUserstories
scope = element.scope() current_sum += us.total_points
if not scope.us?
continue
current_sum += scope.us.total_points
if current_sum > total_points if current_sum > total_points
addDoomLineDom(element) domElement = $el.find('.backlog-table-body .us-item-row')[i]
addDoomLineDom(domElement)
break break
removeDoomlineDom = -> removeDoomlineDom = ->
$el.find(".doom-line").remove() $el.find(".doom-line").remove()
addDoomLineDom = (element) -> addDoomLineDom = (element) ->
element?.before(doomLineTemplate({})) $(element).before(doomLineTemplate({}))
getUsItems = -> getUsItems = ->
rowElements = $el.find('.backlog-table-body .us-item-row') rowElements = $el.find('.backlog-table-body .us-item-row')

View File

@ -0,0 +1,13 @@
module = angular.module("taigaCommon")
BindScope = (config) ->
if !config.debugInfo
jQuery.fn.scope = () -> this.data('scope')
link = ($scope, $el) ->
if !config.debugInfo
$el.data('scope', $scope)
return {link: link}
module.directive("tgBindScope", ["$tgConfig", BindScope])

View File

@ -11,7 +11,7 @@ section.attachments
input(id="add-attach", type="file", multiple="multiple") input(id="add-attach", type="file", multiple="multiple")
.attachment-body.sortable .attachment-body.sortable
.single-attachment(ng-repeat="attach in ctrl.attachments|filter:ctrl.filterAttachments track by attach.id" tg-attachment="attach") .single-attachment(ng-repeat="attach in ctrl.attachments|filter:ctrl.filterAttachments track by attach.id" tg-attachment="attach", tg-bind-scope)
.single-attachment(ng-repeat="file in ctrl.uploadingAttachments") .single-attachment(ng-repeat="file in ctrl.uploadingAttachments")
.attachment-name .attachment-name

View File

@ -1,4 +1,4 @@
div.row.us-item-row(ng-repeat="us in visibleUserstories track by us.id", tg-draggable, ng-class="{blocked: us.is_blocked}") div.row.us-item-row(ng-repeat="us in visibleUserstories track by us.id", tg-bind-scope, ng-class="{blocked: us.is_blocked}")
div.user-stories div.user-stories
div.tags-block(tg-colorize-tags="us.tags", tg-colorize-tags-type="backlog") div.tags-block(tg-colorize-tags="us.tags", tg-colorize-tags-type="backlog")
div.user-story-name div.user-story-name

View File

@ -14,7 +14,7 @@ section.custom-fields-table.basic-table
div.table-body div.table-body
div.js-sortable div.js-sortable
form.js-form(ng-repeat="attr in customAttributes track by attr.id") form.js-form(ng-repeat="attr in customAttributes track by attr.id", tg-bind-scope)
div.row.single-custom-field.js-view-custom-field div.row.single-custom-field.js-view-custom-field
span.icon.icon-drag-v span.icon.icon-drag-v
div.custom-name div.custom-name

View File

@ -15,7 +15,7 @@ section.project-values-table
div.project-values-body div.project-values-body
div.sortable div.sortable
form(ng-repeat="value in values") form(ng-repeat="value in values", tg-bind-scope)
div.project-values-row.row.table-main.visualization div.project-values-row.row.table-main.visualization
span.icon.icon-drag-v span.icon.icon-drag-v

View File

@ -14,7 +14,7 @@ section.colors-table.admin-status-table
div.table-main div.table-main
div.sortable div.sortable
form(ng-repeat="value in values") form(ng-repeat="value in values", tg-bind-scope)
div.row.table-main.visualization div.row.table-main.visualization
span.icon.icon-drag-v span.icon.icon-drag-v
div.color-column div.color-column

View File

@ -13,7 +13,7 @@ section.colors-table
div.table-main div.table-main
div.sortable div.sortable
form(ng-repeat="value in values") form(ng-repeat="value in values", tg-bind-scope)
div.row.table-main.visualization div.row.table-main.visualization
span.icon.icon-drag-v span.icon.icon-drag-v

View File

@ -18,7 +18,7 @@ section.project-us-status
div.table-main div.table-main
div.sortable div.sortable
form(ng-repeat="value in values") form(ng-repeat="value in values", tg-bind-scope)
div.row.table-main.visualization div.row.table-main.visualization
span.icon.icon-drag-v span.icon.icon-drag-v

View File

@ -37,10 +37,11 @@ div.kanban-table(tg-kanban-squish-column)
ng-repeat="s in usStatusList track by s.id", ng-repeat="s in usStatusList track by s.id",
tg-kanban-sortable, tg-kanban-sortable,
tg-kanban-wip-limit="s.wip_limit", tg-kanban-wip-limit="s.wip_limit",
tg-kanban-column-height-fixer) tg-kanban-column-height-fixer,
tg-bind-scope)
div.kanban-task(ng-repeat="us in usByStatus[s.id] track by us.id", div.kanban-task(ng-repeat="us in usByStatus[s.id] track by us.id",
tg-kanban-userstory, ng-model="us", tg-kanban-userstory, ng-model="us", tg-bind-scope,
ng-class="ctrl.getCardClass(s.id)") ng-class="ctrl.getCardClass(s.id)")
div.kanban-column-intro(ng-if="s.is_archived", tg-kanban-archived-status-intro="s") div.kanban-column-intro(ng-if="s.is_archived", tg-kanban-archived-status-intro="s")

View File

@ -1,7 +1,7 @@
section.search-result-table section.search-result-table
script(type="text/ng-template", id="search-issues") script(type="text/ng-template", id="search-issues")
div.search-result-table-container(ng-class="{'hidden': !issues.length}") div.search-result-table-container(ng-class="{'hidden': !issues.length}", tg-bind-scope)
div.search-result-table-header div.search-result-table-header
div.row.title div.row.title
div.user-stories Issues div.user-stories Issues
@ -23,7 +23,7 @@ script(type="text/ng-template", id="search-issues")
script(type="text/ng-template", id="search-userstories") script(type="text/ng-template", id="search-userstories")
div.search-result-table-container(ng-class="{'hidden': !userstories.length}") div.search-result-table-container(ng-class="{'hidden': !userstories.length}", tg-bind-scope)
div.search-result-table-header div.search-result-table-header
div.row.title div.row.title
div.user-stories User Stories div.user-stories User Stories
@ -44,7 +44,7 @@ script(type="text/ng-template", id="search-userstories")
span Maybe try one of the tabs above or search again span Maybe try one of the tabs above or search again
script(type="text/ng-template", id="search-tasks") script(type="text/ng-template", id="search-tasks")
div.search-result-table-container(ng-class="{'hidden': !tasks.length}") div.search-result-table-container(ng-class="{'hidden': !tasks.length}", tg-bind-scope)
div.search-result-table-header div.search-result-table-header
div.row.title div.row.title
div.user-stories Task div.user-stories Task
@ -65,7 +65,7 @@ script(type="text/ng-template", id="search-tasks")
span Maybe try one of the tabs above or search again span Maybe try one of the tabs above or search again
script(type="text/ng-template", id="search-wikipages") script(type="text/ng-template", id="search-wikipages")
div.search-result-table-container(ng-class="{'hidden': !wikipages.length}") div.search-result-table-container(ng-class="{'hidden': !wikipages.length}", tg-bind-scope)
div.search-result-table-header div.search-result-table-header
div.row.title div.row.title
div.user-stories Wiki page div.user-stories Wiki page
@ -80,4 +80,3 @@ script(type="text/ng-template", id="search-wikipages")
span.icon.icon-issues span.icon.icon-issues
span.title It looks like nothing was found with your search criteria. span.title It looks like nothing was found with your search criteria.
span Maybe try one of the tabs above or search again span Maybe try one of the tabs above or search again

View File

@ -3,7 +3,7 @@ header(tg-backlog-sprint-header, ng-model="sprint")
div.sprint-progress-bar(tg-progress-bar="100 * sprint.closed_points / sprint.total_points") div.sprint-progress-bar(tg-progress-bar="100 * sprint.closed_points / sprint.total_points")
div.sprint-table div.sprint-table
div.row.milestone-us-item-row(ng-repeat="us in sprint.user_stories track by us.id") div.row.milestone-us-item-row(ng-repeat="us in sprint.user_stories track by us.id", tg-bind-scope)
div.column-us div.column-us
a.us-name.clickable(tg-nav="project-userstories-detail:project=project.slug,ref=us.ref", a.us-name.clickable(tg-nav="project-userstories-detail:project=project.slug,ref=us.ref",
tg-bo-title="'#' + us.ref + ' ' + us.subject", tg-bo-title="'#' + us.ref + ' ' + us.subject",

View File

@ -22,9 +22,9 @@ div.taskboard-table(tg-taskboard-squish-column)
span(ng-bind="us.total_points") span(ng-bind="us.total_points")
span points span points
include ../components/addnewtask include ../components/addnewtask
div.taskboard-tasks-box.task-column(ng-repeat="st in taskStatusList track by st.id", tg-taskboard-sortable, class="squish-status-{{st.id}}", ng-class="{'column-fold':statusesFolded[st.id]}") div.taskboard-tasks-box.task-column(ng-repeat="st in taskStatusList track by st.id", tg-taskboard-sortable, class="squish-status-{{st.id}}", ng-class="{'column-fold':statusesFolded[st.id]}", tg-bind-scope)
div.taskboard-task(ng-repeat="task in usTasks[us.id][st.id] track by task.id", div.taskboard-task(ng-repeat="task in usTasks[us.id][st.id] track by task.id",
tg-taskboard-task) tg-taskboard-task, tg-bind-scope)
include ../components/taskboard-task include ../components/taskboard-task
div.task-row(ng-init="us = null", ng-class="{'row-fold':usFolded[null]}") div.task-row(ng-init="us = null", ng-class="{'row-fold':usFolded[null]}")
@ -34,7 +34,7 @@ div.taskboard-table(tg-taskboard-squish-column)
h3.us-title h3.us-title
span Unassigned tasks span Unassigned tasks
include ../components/addnewtask.jade include ../components/addnewtask.jade
div.taskboard-tasks-box.task-column(ng-repeat="st in taskStatusList track by st.id", tg-taskboard-sortable, class="squish-status-{{st.id}}", ng-class="{'column-fold':statusesFolded[st.id]}") div.taskboard-tasks-box.task-column(ng-repeat="st in taskStatusList track by st.id", tg-taskboard-sortable, class="squish-status-{{st.id}}", ng-class="{'column-fold':statusesFolded[st.id]}", tg-bind-scope)
div.taskboard-task(ng-repeat="task in usTasks[null][st.id] track by task.id", div.taskboard-task(ng-repeat="task in usTasks[null][st.id] track by task.id",
tg-taskboard-task) tg-taskboard-task, tg-bind-scope)
include ../components/taskboard-task include ../components/taskboard-task

View File

@ -8,5 +8,6 @@
"termsOfServiceUrl": null, "termsOfServiceUrl": null,
"maxUploadFileSize": null, "maxUploadFileSize": null,
"gitHubClientId": null, "gitHubClientId": null,
"contribPlugins": [] "contribPlugins": [],
"debugInfo": false
} }