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()
configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEventsProvider, tgLoaderProvider) ->
configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEventsProvider, tgLoaderProvider, $compileProvider) ->
$routeProvider.when("/",
{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"
})
$compileProvider.debugInfoEnabled(window.taigaConfig.debugInfo)
init = ($log, $i18n, $config, $rootscope, $auth, $events, $analytics) ->
$i18n.initialize($config.get("defaultLanguage"))
$log.debug("Initialize application")
@ -281,6 +283,7 @@ module.config([
"$provide",
"$tgEventsProvider",
"tgLoaderProvider",
"$compileProvider",
configure
])

View File

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

View File

@ -14,7 +14,7 @@ section.custom-fields-table.basic-table
div.table-body
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
span.icon.icon-drag-v
div.custom-name

View File

@ -15,7 +15,7 @@ section.project-values-table
div.project-values-body
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
span.icon.icon-drag-v

View File

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

View File

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

View File

@ -18,7 +18,7 @@ section.project-us-status
div.table-main
div.sortable
form(ng-repeat="value in values")
form(ng-repeat="value in values", tg-bind-scope)
div.row.table-main.visualization
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",
tg-kanban-sortable,
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",
tg-kanban-userstory, ng-model="us",
tg-kanban-userstory, ng-model="us", tg-bind-scope,
ng-class="ctrl.getCardClass(s.id)")
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
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.row.title
div.user-stories Issues
@ -23,7 +23,7 @@ script(type="text/ng-template", id="search-issues")
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.row.title
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
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.row.title
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
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.row.title
div.user-stories Wiki page
@ -80,4 +80,3 @@ script(type="text/ng-template", id="search-wikipages")
span.icon.icon-issues
span.title It looks like nothing was found with your search criteria.
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-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
a.us-name.clickable(tg-nav="project-userstories-detail:project=project.slug,ref=us.ref",
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 points
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",
tg-taskboard-task)
tg-taskboard-task, tg-bind-scope)
include ../components/taskboard-task
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
span Unassigned tasks
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",
tg-taskboard-task)
tg-taskboard-task, tg-bind-scope)
include ../components/taskboard-task

View File

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