diff --git a/module/my/css/story.css b/module/my/css/story.css new file mode 100644 index 0000000000..3e00457c7b --- /dev/null +++ b/module/my/css/story.css @@ -0,0 +1,11 @@ +.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;} +.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;} +.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;} +.table td.has-child > a:not(.story-toggle) {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} +.table td.has-child > .story-toggle {color: #838a9d; position: relative; top: 1px;} +.table td.has-child > .story-toggle:hover {color: #006af1; cursor: pointer;} +.table td.has-child > .story-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform:rotate(-90deg); -moz-transform:rotate(-90deg); -o-transform:rotate(-90deg); -webkit-transform:rotate(-90deg); transform: rotate(-90deg);} +.table td.has-child > .story-toggle > .icon:before {text-align: left;} +.table td.has-child > .story-toggle.collapsed > .icon {-ms-transform:rotate(90deg); -moz-transform:rotate(90deg); -o-transform:rotate(90deg); -webkit-transform:rotate(90deg); transform: rotate(90deg);} +.main-table tbody > tr.table-children > td:first-child::before {width: 3px;} +@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;}} diff --git a/module/my/js/story.js b/module/my/js/story.js new file mode 100644 index 0000000000..65996d23e9 --- /dev/null +++ b/module/my/js/story.js @@ -0,0 +1,20 @@ +$(function() +{ + $('#storyList td.has-child .story-toggle').each(function() + { + var $td = $(this).closest('td'); + var labelWidth = 0; + if($td.find('.label').length > 0) labelWidth = $td.find('.label').width(); + $td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60); + }); + + $(document).on('click', '.story-toggle', function(e) + { + var $toggle = $(this); + var id = $(this).data('id'); + var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed'); + $toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed); + e.stopPropagation(); + e.preventDefault(); + }); +}) diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index 88b31b9b38..dd3dada853 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -29,7 +29,7 @@
diff --git a/module/user/model.php b/module/user/model.php index 75c087e95c..a5a677b780 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1857,7 +1857,7 @@ class userModel extends model $personalData = array(); $personalData['createdTodo'] = $this->dao->select($count)->from(TABLE_TODO)->where('account')->eq($account)->fetch('count'); - $personalData['createdStory'] = $this->dao->select($count)->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); + $personalData['createdStory'] = $this->dao->select($count)->from(TABLE_STORY)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('type')->eq('story')->fetch('count'); $personalData['resolvedBug'] = $this->dao->select($count)->from(TABLE_BUG)->where('resolvedBy')->eq($account)->andWhere('deleted')->eq('0')->fetch('count'); $personalData['createdCase'] = $this->dao->select($count)->from(TABLE_CASE)->where('openedBy')->eq($account)->andWhere('deleted')->eq('0')->andWhere('product')->ne(0)->fetch('count'); $personalData['finishedTask'] = $this->dao->select($count)->from(TABLE_TASK)->where('deleted')->eq('0')