Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several project view adjustments in CSS #17

Merged
merged 26 commits into from
Aug 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
06cf548
Several project view adjustments in CSS, adding font-awesome to use t…
akitaonrails Aug 26, 2016
e7876a5
Fixing failing specs (specially feature specs for removing the projec…
akitaonrails Aug 26, 2016
c7baa1f
move icon styles into proper file
adbatista Aug 26, 2016
4f3ccf3
small refactor in screen.scss
adbatista Aug 26, 2016
cd6556d
add autoprefixer
adbatista Aug 26, 2016
6d7df35
user pointer cursor in estimatives
adbatista Aug 26, 2016
9c54ddb
Small CSS Adjustments to save more space between the columns in the p…
akitaonrails Aug 27, 2016
000fa9b
Adding a simple collapsible sidebar
akitaonrails Aug 27, 2016
21e3a5a
Repurposing the simple sidebar to not be the kind that is hidden in t…
akitaonrails Aug 27, 2016
bedd725
FIXME for some reason it seems like Backbone.sync actions such as add…
akitaonrails Aug 27, 2016
4e4ee22
Adjusting forms to be inside a grid and have proper margins
akitaonrails Aug 27, 2016
b86aa0a
Fixing most of Devise’s templates to fit mobile screens properly
akitaonrails Aug 27, 2016
0c0dac5
Use material icons for all task types
rscardinho Aug 28, 2016
da34ec5
Fixing failing specs. Removing the unnecessary ‘.story’ class from th…
akitaonrails Aug 28, 2016
07e2bf6
Adjusting the add icon to the ‘add story’ button
akitaonrails Aug 28, 2016
ba1271b
Rewriting the initial column view toggle to reflect on the link states
akitaonrails Aug 28, 2016
9d81939
Use image sprite on estimating points
rscardinho Aug 28, 2016
63c4051
Fix story type icon position on popover
rscardinho Aug 29, 2016
36283b5
Link the ColumnViews to the ProjectView
akitaonrails Aug 29, 2016
cabd9a0
Moving the story link to the top of the story card
akitaonrails Aug 29, 2016
b9493af
Estimates can’t be zero
akitaonrails Aug 29, 2016
e4c7e3c
sorting the requested by and owned by columns in the story form
akitaonrails Aug 29, 2016
416e7c4
Adding icons to the column toggles in the menu
akitaonrails Aug 29, 2016
a420bc5
Adjusting the inputs to be smaller in the story view
akitaonrails Aug 29, 2016
18d5fd6
Adding more explanations to the velocity override simulation box
akitaonrails Aug 29, 2016
1c5422b
Removing unnecessary devise links CSS class
akitaonrails Aug 29, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ gem 'devise', '~> 3.5.4'
gem 'devise-async'
gem 'dotenv-rails'
gem 'font_assets', github: "ericallam/font_assets", branch: 'master'
gem 'material_icons'
gem 'friendly_id', '~> 5.1.0'
gem 'foreman'
gem 'rails-i18n'
Expand All @@ -30,6 +31,7 @@ gem 'sass-rails'
gem 'uglifier', '>= 2.5.3'
gem 'compass-rails'
gem 'coffee-rails'
gem "autoprefixer-rails"

gem 'bootstrap-sass', '~> 3.3.5'
gem 'ejs'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ GEM
libv8 (3.16.14.15)
mail (2.6.4)
mime-types (>= 1.16, < 4)
material_icons (2.2.0)
railties (>= 3.2)
method_source (0.8.2)
mime-types (2.99.2)
mini_portile2 (2.1.0)
Expand Down Expand Up @@ -334,6 +336,7 @@ PLATFORMS

DEPENDENCIES
attachinary
autoprefixer-rails
bootstrap-sass (~> 3.3.5)
cancancan (~> 1.10)
capybara
Expand Down Expand Up @@ -361,6 +364,7 @@ DEPENDENCIES
jquery-ui-rails
kgio
letter_opener
material_icons
newrelic_rpm
pg
pg_search
Expand Down
Binary file added app/assets/images/points.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,16 @@

$(function() {
$('.tag-tooltip').tooltip();

$(".menu-toggle").click(function(e) {
e.preventDefault();
$("#sidebar-wrapper").toggle();
});

executeAttachinary();
});

function executeAttachinary() {
$('.attachinary-input').attachinary({ template: $('#attachinary_template').html() });
}

6 changes: 5 additions & 1 deletion app/assets/javascripts/collections/user_collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ if (typeof Fulcrum == 'undefined') {
Fulcrum.UserCollection = Backbone.Collection.extend({
model: Fulcrum.User,

comparator: function(user) {
return user.get('name');
},

forSelect: function() {
return this.map(function(user) {
return this.sort().map(function(user) {
return [user.get('name'),user.id];
});
}
Expand Down
25 changes: 15 additions & 10 deletions app/assets/javascripts/project.boot.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
$(function() {
var columnViews = {};

$('[data-column-view]').each(function() {
var data = $(this).data();
var column = new Fulcrum.ColumnView({
el: $(this),
id: data.columnView,
name: I18n.t('projects.show.' + data.columnView),
sortable: data.connect !== undefined
}).render();
});
columnViews[data.columnView] = column;
column.render();

if (data.hideable !== false) {
new Fulcrum.ColumnVisibilityButtonView({ columnView: column })
.render().$el
.appendTo('#column-toggles');
$("<li></li>").
append(new Fulcrum.ColumnVisibilityButtonView({ columnView: column }).render().$el).
appendTo('#column-toggles');
}

if (data.connect) {
Expand All @@ -24,21 +28,22 @@ $(function() {
});

$('[data-project]').each(function() {
var data = $(this).data();
var project = new Fulcrum.Project(data.project);
var view = new Fulcrum.ProjectView({ model: project });
var search = new Fulcrum.ProjectSearchView({ model: project, el: $('#form_search') });
var data = $(this).data();
var project = new Fulcrum.Project(data.project);
var view = new Fulcrum.ProjectView({ model: project });
var search = new Fulcrum.ProjectSearchView({ model: project, el: $('#form_search') });
var velocity = new Fulcrum.ProjectVelocityView({ model: project, el: $('#velocity') });

project.users.reset(data.users);
project.current_user = new Fulcrum.User(data.currentUser);

view.addColumnViews(columnViews);
view.velocityView = velocity;
view.searchView = search;
view.searchView = search;
view.scaleToViewport();
$(window).resize(view.scaleToViewport);

setInterval(function() { project.fetch(); }, 10 * 1000);
setInterval(function() { project.fetch(); }, 10 * 1000); // every 10 seconds

window.md = new Markdown.Converter();
window.projectView = view;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/templates/project_velocity.jst.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= I18n.t("velocity") %>
<span id="velocity_value">
<i class="mi mi-18">trending_up</i>
<%= project.velocity() %>
</span>
14 changes: 10 additions & 4 deletions app/assets/javascripts/templates/project_velocity_override.jst.ejs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<form>
<form id="override-velocity">
<ul>
<li><%= I18n.t("override velocity") %>:
<li><%= I18n.t("override.velocity") %>:
<input name="override" size=2 value=<%= project.velocity() %> />
</li>
<li>
<button name="revert" value="revert"><%= I18n.t("revert") %></button>
<button name="apply" value="apply"><%= I18n.t("apply") %></button>
<div class="btn-group">
<button name="revert" value="revert" class="btn btn-default btn-xs"><%= I18n.t("revert") %></button>
<button name="apply" value="apply" class="btn btn-primary btn-xs"><%= I18n.t("apply") %></button>
</div>
</li>
<li>
<p><%= I18n.t("override.explanation_1") %></p>
<p><%= I18n.t("override.explanation_2") %></p>
</li>
</ul>
</form>
24 changes: 15 additions & 9 deletions app/assets/javascripts/templates/story.jst.ejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<% if (story.estimable()) { %>
<div class="state-actions">
<div class="state-actions estimates">
<form>
<% _.each(story.point_values(), function(value) { %>
<input type="button" class="estimate" value="<%= value %>"/>
<% if (value > 0) { %>
<span class="estimate estimate-<%= value %> input" data-value="<%= value %>" id="estimate-<%= value %>"></span>
<% } %>
<% }); %>
</form>
</div>
Expand All @@ -20,16 +22,20 @@
<a class="icon icons-throbber" title="<%= I18n.t('saving') %>"></a>
<% } %>
<span class="popover-activate">
<span class="icon icons-<%= story.get('story_type') %> story_type" title="<%= story.story_type %>: <%= story.id %>">
<%= story.story_type %>
</span>
<% if (story.get('story_type') == 'feature') { %>
<i class="mi md-star md-20">star</i>
<% } %>
<% if (story.estimated()) { %>
<span class="estimate estimate_<%= story.get('estimate') %>">
<%= story.get('estimate') %>
</span>
<span class="estimate estimate-<%= story.get('estimate') %>"></span>
<% } %>
<% if (story.get('story_type') == 'chore') { %>
<i class="mi md-dark md-20">settings</i>
<% } %>
<% if (story.get('story_type') == 'bug') { %>
<i class="mi md-bug md-20">bug_report</i>
<% } %>
<% if (story.hasDetails()) { %>
<span class="icon icons-details"></span>
<i class="mi md-14 md-dark details">question_answer</i>
<% } %>
</span>
</div>
Expand Down
10 changes: 9 additions & 1 deletion app/assets/javascripts/templates/story_hover.jst.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<div class="small">
<span class="icons">
<span class="icon icons-<%= story.get('story_type') %>"></span>
<% if (story.get('story_type') == 'feature') { %>
<i class="story-hover mi md-20 md md-star">star</i>
<% } %>
<% if (story.get('story_type') == 'chore') { %>
<i class="story-hover mi md-20 md-dark">settings</i>
<% } %>
<% if (story.get('story_type') == 'bug') { %>
<i class="story-hover mi md-20 md-bug">bug_report</i>
<% } %>
<span class="text"><%= story.get('story_type') %></span>
<% if (story.get('estimated')) { %>
<span class="estimate estimate_<%= story.get('estimate') %>"><%= story.get('estimate') %></span>
Expand Down
22 changes: 20 additions & 2 deletions app/assets/javascripts/views/column_visibility_button_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,30 @@ Fulcrum.ColumnVisibilityButtonView = Backbone.View.extend({

initialize: function() {
_.bindAll(this, 'setClassName');
this.$el.attr('class','hide_'+this.options.columnView.id);
this.$el.attr('class','hide_'+this.options.columnView.id );
this.options.columnView.on('visibilityChanged', this.setClassName);
},

render: function() {
this.$el.html(this.options.columnView.name());
var icon = "";
switch(this.options.columnView.id) {
case 'done' :
icon = '<i class="mi md-18">done</i> ';
break;
case 'in_progress' :
icon = '<i class="mi md-18">inbox</i> ';
break;
case 'backlog' :
icon = '<i class="mi md-18">list</i> ';
break;
case 'chilly_bin' :
icon = '<i class="mi md-18">ac_unit</i> ';
break;
case 'search_results' :
icon = '<i class="mi md-18">search</i> ';
break;
}
this.$el.html(icon + this.options.columnView.name());
this.setClassName();
return this;
},
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/views/form_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Fulcrum.FormView = Backbone.View.extend({

options = _.defaults(options, { attrs: { class: [] } });

options.attrs.class = 'form-control ' +options.attrs.class.join(' ');
options.attrs.class = 'form-control input-sm ' +options.attrs.class.join(' ');

var select = this.make('select', _.extend({name: name}, options.attrs));

Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/views/keycut_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ Fulcrum.KeycutView = Backbone.View.extend({
template: JST['templates/keycut_view'],
tagName: 'div',
id: 'keycut-help',

events: {
'click a.close' : 'closeWindow'
},

render: function() {
$('#main').append($(this.el).html(this.template));
return this;
},

closeWindow : function(){
$('#'+this.id).fadeOut(
function() {$('#'+this.id).remove();}
);
}
});
});
2 changes: 1 addition & 1 deletion app/assets/javascripts/views/note_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Fulcrum.NoteForm = Fulcrum.FormView.extend({
$(div).append('<br/>');
$(div).append(textarea);

var submit = this.make('input', {id: 'note_submit', type: 'button', value: 'Add note', class: 'add-note'});
var submit = this.make('input', {id: 'note_submit', type: 'button', value: 'Add note', class: 'add-note btn btn-default btn-xs'});
$(div).append(submit);
this.$el.html(div);

Expand Down
56 changes: 47 additions & 9 deletions app/assets/javascripts/views/project_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ if (typeof Fulcrum == 'undefined') {
}

Fulcrum.ProjectView = Backbone.View.extend({
columns: {},

initialize: function() {

this.columns = {};

_.bindAll(this, 'addStory', 'addAll', 'render');

this.model.stories.on('add', this.addStory);
Expand All @@ -16,7 +15,6 @@ Fulcrum.ProjectView = Backbone.View.extend({
this.model.on('change:userVelocity', this.addAll);

var that = this;

this.model.stories.fetch({
success: function() {
that.addAll();
Expand All @@ -26,6 +24,13 @@ Fulcrum.ProjectView = Backbone.View.extend({

// Triggered when the 'Add Story' button is clicked
newStory: function() {
if ($(window).width() <= 992) {
_.each(this.columns, function(column, columnId) {
if(columnId != 'chilly_bin')
if(!column.hidden())
column.toggle();
});
}
this.model.stories.add([{
events: [], files: [], editing: true
}]);
Expand Down Expand Up @@ -65,11 +70,9 @@ Fulcrum.ProjectView = Backbone.View.extend({
$(".loading_screen").show();
var that = this;

$('#done').html("");
$('#in_progress').html("");
$('#backlog').html("");
$('#chilly_bin').html("");
$('#search_results').html("");
_.each(this.columns, function(column, columnId) {
column.$el.find('.storycolumn').html("");
});

this.model.rebuildIterations();

Expand Down Expand Up @@ -107,11 +110,22 @@ Fulcrum.ProjectView = Backbone.View.extend({
scaleToViewport: function() {
var storyTableTop = $('table.stories tbody').offset().top;

var extra = 40;
var extra = 20;

var height = $(window).height() - (storyTableTop + extra);

$('.storycolumn').css('height', height + 'px');

if ($(window).width() <= 992) {
_.each(this.columns, function(column, columnId) {
if(columnId != 'in_progress')
if(!column.hidden())
column.toggle();
});
$('#form_search').hide();
} else {
$('#form_search').show();
}
},

notice: function(message) {
Expand All @@ -122,9 +136,33 @@ Fulcrum.ProjectView = Backbone.View.extend({
this.columns[id] = view;
},

addColumnViews: function(columns) {
var that = this;
_.each(columns, function(column, columnId) {
column.on('visibilityChanged', that.checkColumnViewsVisibility);
that.addColumnView(columnId, column);
});
},

// make sure there is at least one column opened
checkColumnViewsVisibility: function() {
if (window.projectView === undefined)
return;

var filtered = _.filter(window.projectView.columns, function(column, columnId) {
if(!column.hidden())
return true;
});

if(filtered.length == 0) {
window.projectView.columns['in_progress'].toggle();
}
},

usernames: function() {
return this.model.users
.map(function(user) { return user.get('username'); })
.sort();
},

});
Loading