Permalink
Browse files

milestone assignment board is roughly working

  • Loading branch information...
1 parent 4d8dd08 commit 093a2cd79913e047535f60985e6fcc97ff3899e9 @rauhryan rauhryan committed Jan 9, 2013
View
@@ -6,3 +6,4 @@ tmp/
.sass-cache
#*.min.css
app.build.js
+.powenv
View
@@ -13,12 +13,11 @@ def build_backlog(user_name, repo)
:milestone => m.merge(:_data => embedded_data(m["description"])),
:issues => issues.find_all {|i| i["milestone"] && i["milestone"]["number"] == m["number"]}
}
- }
-
- #by_milestone = by_milestone.delete_if{|x| x.nil? || x.empty? }.sort_by {|m| m["due_on"] || "0"}
+ }.sort_by { |m| m[:milestone]["_data"]["order"] || m[:milestone]["number"].to_f}
return :milestones => milestones,
:unassigned => {:issues => issues.find_all {|i| i.milestone.nil? }, :milestone => {:title => "No milestone"}},
+ :assignees => github.assignees(user_name, repo).map{|a| a},
other_labels: github.labels(user_name, repo).reject { |l| @huboard_patterns.any?{|p| p.match(l["name"]) } }
end
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -4,8 +4,6 @@
margin-right: 20px;
position: relative;
box-sizing: border-box;
- border: 1px solid #e5e5e5;
- background: #f3f3f3;
margin-top: 0;
color: #555;
&:before, &:after {
@@ -49,7 +49,7 @@
top:0;
left:-640px;
- .board {
+ .board, .filters {
background: #fff;
border-right: 1px solid #ccc;
}
@@ -73,19 +73,62 @@
@include box-sizing(border-box);
}
+
+.backlog {
+ white-space: nowrap;
+ overflow-x: auto;
+ .column {
+ float: none;
+ display: inline-block;
+ }
+}
+.sidebar {
+ .backlog {
+ .column {
+ width: 209px;
+ }
+ }
+}
+
.column h3 {
line-height: 20px;
margin-bottom: 10px;
padding: 10px;
+ border: 1px solid #e5e5e5;
+ background: #f3f3f3;
font-size: 100%;
+}
+
+.board .column h3 {
@extend .arrow;
}
.column ul {
margin:0;
padding: 0;
}
+.backlog {
+ .dim {
+ opacity: 0.6;
+ }
+ .active {
+ }
+}
+.board {
+ .dim {
+ opacity: 0.6;
+ @include transition (opacity 0.6s, ease-out);
+ @include transition (filter 0.6s, ease-out);
+ @include prefixer(filter, grayscale(100%) opacity(80%));
+ @include box-shadow(inset 0 0px 1px rgba(0,0,0, 0.3));
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
+ }
+ .active {
+ }
+
+}
+
.column li {
list-style: none;
padding: 5px 5px 34px 5px;
@@ -98,16 +141,6 @@
&.assignee-accept {
border-color: #0069D6;
}
- &.dim {
- opacity: 0.6;
- @include transition (opacity 0.6s, ease-out);
- @include transition (filter 0.6s, ease-out);
- @include prefixer(filter, grayscale(100%) opacity(80%));
- @include box-shadow(inset 0 0px 1px rgba(0,0,0, 0.3));
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
- }
- &.active {
- }
.card-labels {
position: absolute;
bottom: -3px;

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,2 +1,2 @@
-<div class="board">
+<div class="backlog">
</div>
@@ -3,13 +3,15 @@ define(["../collections/issues",
"./columnView",
"./sidebarView",
"./headerView",
+ "./assigneeView",
"../events/postal",
"./cssView"],
function (issues,
template,
columnView,
sidebarView,
headerView,
+ assigneeView,
postal) {
var calculateTallest = function (){
@@ -69,9 +71,13 @@ define(["../collections/issues",
var board = $(_.template(template, data)),
noneBoard = board.clone(),
noneColumn = data.unassigned,
- rest = data.milestones,
+ grouped = _.groupBy(data.milestones, function (m){
+ return m.milestone._data.status || "backlog";
+ }),
+ rest = (grouped.wip || []).concat(grouped.backlog),
sidebar = new sidebarView({data:data,params:this.params}),
searchView = new headerView(),
+ assigneesView = new assigneeView({data:data, params: this.params}),
self = this;
$(noneBoard).append(new columnView({column: noneColumn, user:this.user,repo:this.repo}).render().el);
@@ -80,18 +86,20 @@ define(["../collections/issues",
_.each(rest, function (label){
var column = new columnView({column: label, user:self.user,repo:self.repo});
- var markup = $(column.render().el).css({width:width + "%"});
+ var markup = $(column.render().el).css({width:260 + "px"});
$(board).append(markup);
});
$("#stage").append(board);
$("#drawer","#main-stage")
+ //.append(noneBoard)
.append(sidebar.render().el)
.find(".toggle-drawer").show();
//$(".sidebar-wrapper").append(userFilter.render().el).show();
$(".sidebar-wrapper")
+ //.append(sidebar.render().el)
.append(noneBoard)
.show();
@@ -9,7 +9,7 @@ define(["text!../templates/card.html","../models/card", "../events/postal"],func
postal.subscribe("Filter.Simple", $.proxy(this.simpleFilter, this));
postal.subscribe("Filter.Complex", $.proxy(this.complexFilter, this));
- postal.socket(params.user + "/" + params.repo,"Moved." + params.issue.number, $.proxy(this.onMoved,this));
+ //postal.socket(params.user + "/" + params.repo,"Moved." + params.issue.number, $.proxy(this.onMoved,this));
postal.socket(params.user + "/" + params.repo,"Closed." + params.issue.number, $.proxy(this.onClosed,this));
postal.socket(params.user + "/" + params.repo,"Assigned." + params.issue.number, $.proxy(this.onAssigned,this));
@@ -99,7 +99,6 @@ define(["text!../templates/card.html","../models/card", "../events/postal"],func
this.transition();
},
drop: function(ev,order){
- this.issue.reorder({order:order});
}
});
@@ -6,8 +6,8 @@ define(["text!../templates/column.html","./cardView","../events/postal"],functio
this.repo = params.repo;
this.user = params.user;
- postal.subscribe("Moved.Socket." + params.column.index, $.proxy(this.onSocket,this));
- postal.socket(params.user + "/" + params.repo, "Opened." + params.column.index, $.proxy(this.onOpened,this))
+ //postal.subscribe("Moved.Socket." + params.column.index, $.proxy(this.onSocket,this));
+ //postal.socket(params.user + "/" + params.repo, "Opened." + params.column.index, $.proxy(this.onOpened,this))
},
onOpened: function(issue){
var card = new CardView({issue: issue, user: this.user, repo: this.repo});
@@ -4,8 +4,6 @@ define(["../events/postal","./filterView"], function (postal, filterView) {
tagName: "ul",
className: "filters",
initialize: function (params) {
- this.milestones = _.map(params.data.milestones,
- function(m) {return m.milestone;});
this.login = params.params.login;
this.labels = params.data.other_labels;
},
@@ -35,33 +33,6 @@ define(["../events/postal","./filterView"], function (postal, filterView) {
});
});
- var grouped = _.groupBy(this.milestones, function (milestone) {
- return milestone._data.status || "backlog";
- });
-
- var combined = (grouped.wip || []).concat(grouped.backlog || []);
- var milestoneViews = _.map(combined, function (milestone) {
- return new filterView({color: "#0069D6", name: milestone.title, count: milestone.open_issues,
- condition: function (issue) { return issue.milestone && issue.milestone.title.toLocaleLowerCase() === milestone.title.toLocaleLowerCase();}}).render().el;
- });
- var noMilestone = new filterView({color: "#0069D6", name: "No milestone assigned",
- condition: function (issue) { return !issue.milestone; }}).render().el;
-
- $this.append("<h5>Milestones</h5>");
- $this.append(noMilestone);
- $this.append(milestoneViews);
- $(milestoneViews.concat(noMilestone)).click(function(ev) {
- ev.preventDefault();
- var $this = $(this),
- $clicked = $this.data("filter");
- var othersActive = _(milestoneViews.concat(noMilestone)).filter(function(v) {
- var data = $(v).data("filter");
- return $clicked.cid !== data.cid && data.state !== 0;
- });
- _(othersActive).each(function(v) {
- $(v).trigger("clear");
- });
- });
var labels = _.map(this.labels, function(label) {
return new filterView({color: "#" + label.color, name: label.name, condition: function (issue) { return _.any(issue.labels, function(l){ return l.name.toLocaleLowerCase() === label.name.toLocaleLowerCase();})}}).render().el;

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -8,12 +8,12 @@
<li>
<a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/milestones">Milestones</a>
</li>
- <li>
- <a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/board">Tasks</a>
- </li>
<li class="active">
<a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/backlog">Backlog</a>
</li>
+ <li>
+ <a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/board">Tasks</a>
+ </li>
<% end %>
View
@@ -8,12 +8,12 @@
<li>
<a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/milestones">Milestones</a>
</li>
- <li class="active">
- <a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/board">Tasks</a>
- </li>
<li >
<a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/backlog">Backlog</a>
</li>
+ <li class="active">
+ <a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/board">Tasks</a>
+ </li>
<% end %>
View
@@ -17,11 +17,11 @@
<li class="active">
<a href="/<%=@parameters[:user]%>/<%=@parameters[:repo]%>/milestones">Milestones</a>
</li>
- <li>
- <a href="/<%=@parameters[:user]%>/<%=@parameters[:repo]%>/board">Tasks</a>
- </li>
<li >
<a href="/<%= h @parameters[:user]%>/<%= h @parameters[:repo]%>/backlog">Backlog</a>
</li>
+ <li>
+ <a href="/<%=@parameters[:user]%>/<%=@parameters[:repo]%>/board">Tasks</a>
+ </li>
<% end %>

0 comments on commit 093a2cd

Please sign in to comment.