Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make it possible to collapse stories

  • Loading branch information...
commit 78d334bb84ea2b7e2894e5cb1333bc73a3105ee5 1 parent cbf6f6d
@haugstrup authored
View
6 TODO.txt
@@ -17,9 +17,3 @@ Overall
Other
toggle to only show stories i'm involved in (PO or developer)
collapse stories and save setting in localstorage
-
-
-
-For tonight:
- - edit time left
- - collapse/expand stories and save setting in localstorage
View
62 public/scrumboard.css
@@ -58,25 +58,25 @@ other bg: #cbe8a5
background:#9bd13c;
}
-.state-0 .story-item h3,
-#main .dragging-0 h3 {
- border-bottom:1px solid #eed7d3;
+.state-0 .story-item .story-item-details,
+#main .dragging-0 .story-item-details {
+ border-top:1px solid #eed7d3;
}
-.state-1 .story-item h3,
-#main .dragging-1 h3 {
- border-bottom:1px solid #f8dfc8;
+.state-1 .story-item .story-item-details,
+#main .dragging-1 .story-item-details {
+ border-top:1px solid #f8dfc8;
}
-.state-2 .story-item h3,
-#main .dragging-2 h3 {
- border-bottom:1px solid #c4def8;
+.state-2 .story-item .story-item-details,
+#main .dragging-2 .story-item-details {
+ border-top:1px solid #c4def8;
}
-.state-3 .story-item h3,
-#main .dragging-3 h3 {
- border-bottom:1px solid #eeeeee;
+.state-3 .story-item .story-item-details,
+#main .dragging-3 .story-item-details {
+ border-top:1px solid #eeeeee;
}
-.state-4 .story-item h3,
-#main .dragging-4 h3 {
- border-bottom:1px solid #cbe8a5;
+.state-4 .story-item .story-item-details,
+#main .dragging-4 .story-item-details {
+ border-top:1px solid #cbe8a5;
}
/* Colors end */
@@ -103,7 +103,7 @@ other bg: #cbe8a5
top:24px;
left:0;
z-index:10;
- padding-left:210px;
+ padding-left:185px;
background:#F1F1EF;
@@ -122,10 +122,10 @@ other bg: #cbe8a5
.header h1,
.story-header {
float:left;
- width:200px;
+ width:175px;
}
.user-list {
- margin:1em 0.5em 0 0;
+ margin:0.5em 0.5em 0 0;
}
.user-list img {
vertical-align:middle;
@@ -134,9 +134,31 @@ other bg: #cbe8a5
line-height:20px;
}
.story-group h2 {
- font-size:14px;
+ font-size:12px;
line-height:150%;
font-weight:bold;
+ padding-left:14px;
+ position:relative;
+ cursor:pointer;
+}
+.story-group h2 .toggle {
+ position:absolute;
+ top:5px;
+ left:0;
+ width:0px;
+ height:0px;
+ border-left:5px solid transparent;
+ border-right:5px solid transparent;
+ border-top:5px solid #555;
+ font-size:0px;
+ line-height:0px;
+}
+.story-group.collapsed h2 .toggle {
+ border-top:5px solid transparent;
+ border-bottom:5px solid transparent;
+ border-left:5px solid #555;
+ left:2px;
+ top:3px;
}
.story-item-state {
min-height:62px;
@@ -177,7 +199,7 @@ other bg: #cbe8a5
background:#ccc;
color:#333;
line-height:11px;
- cursor:pointer;
+/* cursor:pointer;*/
}
.story-item .spinner {
position:absolute;
View
64 public/scrumboard.js
@@ -24,7 +24,7 @@
var total_width = $(window).width()-10;
$('.story-group').width(total_width);
- total_width = total_width-200; // width of the story-header
+ total_width = total_width-175; // width of the story-header
var count = $('#stories').data('count');
var wrapper_width = Math.floor(total_width/count);
$('.story, .state,.header h1').width(wrapper_width);
@@ -80,10 +80,72 @@
}
});
});
+
+ var collapsedData = getCollapsedData().split(',');
+ if (typeof collapsedData === 'object') {
+ $.each(collapsedData, function(index, value){
+ if (typeof value === 'string') {
+ $('#story-'+value).addClass('collapsed').find('.user-list,.state').hide();
+ }
+ });
+ }
+ }
+
+ function onScrumBoardToggleClick(elmTarget, e) {
+ var elmParent = elmTarget.parents('.story-group');
+ elmParent.find('.user-list, .state').toggle();
+ elmParent.toggleClass('collapsed');
+ if (elmParent.hasClass('collapsed')) {
+ addCollapsed(elmParent.attr('data-id'));
+ }
+ else {
+ removeCollapsed(elmParent.attr('data-id'));
+ }
+ }
+
+ function getCollapsedData() {
+ var data = false;
+ if (typeof localStorage !== 'undefined' ) {
+ data = localStorage.getItem("collapsedList");
+ }
+ return data ? data : '';
+ }
+ function addCollapsed(id) {
+ if (typeof(localStorage) !== 'undefined' ) {
+ var data = getCollapsedData();
+ var return_value = '';
+ if (typeof data === 'string') {
+ data = data.split(',');
+ if ($.inArray(id, data) == -1) {
+ data.push(id);
+ }
+ return_value = data.join(',');
+ }
+ else {
+ return_value = id;
+ }
+ localStorage.setItem("collapsedList", return_value);
+ }
+ }
+ function removeCollapsed(id) {
+ if (typeof(localStorage) !== 'undefined' ) {
+ var data = getCollapsedData();
+ var return_value = '';
+ if (typeof data === 'string') {
+ data = data.split(',');
+ var idx = data.indexOf(id);
+ if (idx != -1) {
+ data.splice(idx, 1);
+ }
+ return_value = data.join(',');
+ }
+ localStorage.setItem("collapsedList", return_value);
+ }
}
Podio.Event.bind(Podio.Event.Types.init, onInit);
Podio.Event.UI.bind('click', '#dashboard ul.stories > li', onDashBoardStoryClick);
Podio.Event.UI.bind('click', '#switch-view', onDashBoardToggleClick);
+ Podio.Event.UI.bind('click', '.story-group h2', onScrumBoardToggleClick);
})(window, jQuery);
View
2  views/_item.html.php
@@ -3,7 +3,7 @@
<?php if ($item->time_left > 0) : ?><div class="timeleft tooltip" title="Original estimate: <?= $item->estimate ?> hrs"><?= $item->time_left ?></div><?php endif; ?>
<a target="_BLANK" href="<?= $item->link ?>"><?= $item->title ?></a>
</h3>
- <div class="story-item-details">
+ <div class="story-item-details" <?php if (!$item->responsible) { print 'style="display:none;"'; } ?>>
<?php if ($item->responsible) : ?>
<div class="responsible">
<?//= substr($item->responsible['name'], 0, strpos($item->responsible['name'], ' ')); ?>
View
4 views/_story.html.php
@@ -1,6 +1,6 @@
-<div class="story-group" id="story-<?= $story->item_id ?>">
+<div class="story-group" id="story-<?= $story->item_id ?>" data-id="<?= $story->item_id ?>">
<div class="story-header">
- <h2><?= $story->title ?></h2>
+ <h2><div class="toggle"></div><?= $story->title ?></h2>
<?php if ($story->product_owner) : ?>
<ul class="user-list">
<li>
Please sign in to comment.
Something went wrong with that request. Please try again.