Refactor and minor styling

This commit is contained in:
augier 2015-08-14 18:40:09 +02:00
parent 281d1a9161
commit 450bf4f4ba
11 changed files with 32 additions and 30 deletions

View file

@ -31,7 +31,7 @@ app.views.AspectsList = app.views.Base.extend({
}, },
appendAspect: function(aspect) { appendAspect: function(aspect) {
$("#aspects_list > *:last").before(new app.views.Aspect({ $("#aspects_list > .hoverable:last").before(new app.views.Aspect({
model: aspect, attributes: {'data-aspect_id': aspect.get('id')} model: aspect, attributes: {'data-aspect_id': aspect.get('id')}
}).render().el); }).render().el);
}, },

View file

@ -1,10 +1,10 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
app.views.Sidebar = app.views.Base.extend({ app.views.Sidebar = app.views.Base.extend({
el: '.rightbar', el: ".rightbar",
events: { events: {
'click input#invite_code': 'selectInputText' "click input#invite_code": "selectInputText"
}, },
selectInputText: function(event) { selectInputText: function(event) {

View file

@ -80,11 +80,11 @@
@import 'post-content'; @import 'post-content';
/* right bar */ /* right bar */
@import 'sidebar'; @import 'navbar_right';
/* contacts */ /* contacts */
@import 'contacts'; @import 'contacts';
@import 'leftnavbar'; @import 'navbar_left';
/* code */ /* code */
@import 'new_styles/code'; @import 'new_styles/code';

View file

@ -25,8 +25,9 @@ $red: #A80000;
$blue: #3F8FBA; $blue: #3F8FBA;
$dark-blue: darken(#0984C8,10%); $dark-blue: darken(#0984C8,10%);
$right-sidebar-background: #f0f0f0; $sidebars-background: #f0f0f0;
$right-sidebar-sub-background: darken($right-sidebar-background, 12%); $sidebars-sub-background: darken($sidebars-background, 12%);
$left-navbar-drawer-background: darken($sidebars-background, 6%);
/* colors : http://www.colourlovers.com/palette/2134203/Awezome_in_argyle */ /* colors : http://www.colourlovers.com/palette/2134203/Awezome_in_argyle */
$cyan : rgb(8,204,249); $cyan : rgb(8,204,249);
@ -36,7 +37,3 @@ $lime-green : rgb(143, 199,10);
$orange : rgb(237, 165, 13); $orange : rgb(237, 165, 13);
$turquoise : rgb(8, 224, 173); $turquoise : rgb(8, 224, 173);
$sand : rgb(245, 239, 237); $sand : rgb(245, 239, 237);
$left-navbar-background: #f0f0f0;
$left-navbar-drawer-background: darken($left-navbar-background, 6%);
$left-navbar-sub-background: darken($left-navbar-background, 12%); /* Only visible in large screens (BS3: visible-lg) */

View file

@ -1,18 +1,20 @@
/* Fixed backgrounds are a common practice to avoid height issues */ /* Fixed backgrounds are a common practice to avoid height issues */
#left-navbar-fixed-sub-background { #left-navbar-fixed-sub-background {
background: $left-navbar-sub-background; background: $sidebars-sub-background;
position: fixed; position: fixed;
height: 100%; height: 100%;
} }
#left-navbar-fixed-background { #left-navbar-fixed-background {
background: $left-navbar-background; background: $sidebars-background;
border-right: 1px solid $light-grey;
position: fixed; position: fixed;
height: 100%; height: 100%;
} }
#left-navbar { #left-navbar {
background: $left-navbar-background; background: $sidebars-background;
border-right: 1px solid $light-grey;
a { a {
color: $link-grey; color: $link-grey;
font-weight: bold; font-weight: bold;

View file

@ -1,21 +1,24 @@
#right-sidebar-fixed-background { #right-sidebar-fixed-background {
height: 100%; height: 100%;
background: $right-sidebar-background; border-left: 1px solid $light-grey;
background: $sidebars-background;
position: fixed; position: fixed;
right: 0; right: 0;
} }
#right-sidebar-fixed-sub-background { #right-sidebar-fixed-sub-background {
height: 100%; height: 100%;
background: $right-sidebar-sub-background; background: $sidebars-sub-background;
position: fixed; position: fixed;
right: 0; right: 0;
} }
.right-sidebar-padder { .right-sidebar-padder {
max-width: 400px; max-width: 400px;
} }
.rightbar { .rightbar {
padding-top: 20px; padding-top: 20px;
background: $right-sidebar-background; border-left: 1px solid $light-grey;
background: $sidebars-background;
.section { .section {
margin-bottom: 20px; margin-bottom: 20px;

View file

@ -7,5 +7,5 @@
<a href="#" class="selectable new_aspect" data-toggle="modal" data-target="#newAspectModal"> <a href="#" class="selectable new_aspect" data-toggle="modal" data-target="#newAspectModal">
{{ t "aspect_navigation.add_an_aspect" }} {{ t "aspect_navigation.add_an_aspect" }}
</a> </a>
<div id="newAspectContainer"></div>
</li> </li>
<div id="newAspectContainer"></div>

View file

@ -21,8 +21,6 @@
= link_to '&times;'.html_safe, getting_started_completed_path, id: "gs-skip-x", class: "close" = link_to '&times;'.html_safe, getting_started_completed_path, id: "gs-skip-x", class: "close"
%div.container-fluid %div.container-fluid
#right-sidebar-fixed-sub-background.col-md-3.visible-lg
#right-sidebar-fixed-background.col-md-3.col-lg-2.hidden-sm.hidden-xs
.row .row
#left-navbar-fixed-sub-background.col-lg-1.visible-lg #left-navbar-fixed-sub-background.col-lg-1.visible-lg
#left-navbar-fixed-background.col-lg-offset-1.col-lg-2.col-md-3.hidden-sm.hidden-xs #left-navbar-fixed-background.col-lg-offset-1.col-lg-2.col-md-3.hidden-sm.hidden-xs
@ -48,6 +46,8 @@
#aspect_stream_container.stream_container #aspect_stream_container.stream_container
= render 'aspects/aspect_stream', stream: @stream = render 'aspects/aspect_stream', stream: @stream
#right-sidebar-fixed-sub-background.col-lg-3.visible-lg
#right-sidebar-fixed-background.col-md-3.col-lg-2.hidden-sm.hidden-xs
.col-md-3.col-lg-2.hidden-xs.hidden-sm.rightbar .col-md-3.col-lg-2.hidden-xs.hidden-sm.rightbar
#selected_aspect_contacts.section #selected_aspect_contacts.section
.title .title

View file

@ -42,10 +42,10 @@ When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name|
end end
When /^I select only "([^"]*)" aspect$/ do |aspect_name| When /^I select only "([^"]*)" aspect$/ do |aspect_name|
click_link 'My aspects' click_link "My aspects"
within('#aspects_list') do within("#aspects_list") do
click_link 'Deselect all' all(".selected").each {|node| node.find(:xpath, "..").click }
current_scope.should have_no_css '.selected' expect(current_scope).to have_no_css ".selected"
end end
step %Q(I select "#{aspect_name}" aspect as well) step %Q(I select "#{aspect_name}" aspect as well)
end end

View file

@ -1,8 +1,8 @@
When(/^I unfollow the "(.*?)" tag$/) do |tag| When(/^I unfollow the "(.*?)" tag$/) do |tag|
within("#tags_list") do within("#tags_list") do
li = find('li', text: tag) li = find("li", text: tag)
li.hover li.hover
li.find('.delete-tag-following').click li.find(".delete-tag-following").click
end end
step 'I confirm the alert' step "I confirm the alert"
end end

View file

@ -18,9 +18,9 @@ describe("app.views.AspectsList", function(){
this.view.render(); this.view.render();
}); });
it('should show the corresponding aspects selected', function(){ it("should show the corresponding aspects selected", function(){
expect(this.view.$('.selected').length).toBe(1); expect(this.view.$(".selected").length).toBe(1);
expect(this.view.$('.selected').parent().text()).toMatch('Work'); expect(this.view.$(".selected").parent().text()).toMatch("Work");
}); });
it("should show all the aspects", function(){ it("should show all the aspects", function(){