Skip to content
Extraits de code Groupes Projets
Valider ac533f83 rédigé par flaburgan's avatar flaburgan
Parcourir les fichiers

Refactor the left bar side menu, improve tag autosuggestion design, close #4271

parent 9ec9ae0c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 202 ajouts et 157 suppressions
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* Update sign out route to a DELETE request [#4068](https://github.com/diaspora/diaspora/issues/4068) * Update sign out route to a DELETE request [#4068](https://github.com/diaspora/diaspora/issues/4068)
* Convert all ActivityStreams::Photo to StatusMessages and drop ActivityStreams::Photo [#4144](https://github.com/diaspora/diaspora/issues/4144) * Convert all ActivityStreams::Photo to StatusMessages and drop ActivityStreams::Photo [#4144](https://github.com/diaspora/diaspora/issues/4144)
* Port the Rails application to strong_parameters in preparation to the upgrade to Rails 4 [#4143](https://github.com/diaspora/diaspora/issues/4143) * Port the Rails application to strong_parameters in preparation to the upgrade to Rails 4 [#4143](https://github.com/diaspora/diaspora/issues/4143)
* Refactor left bar side menu, improve tag autosuggestion design [#4271](https://github.com/diaspora/diaspora/issues/4271), [#4316](https://github.com/diaspora/diaspora/pull/4316)
## Bug fixes ## Bug fixes
* Don't focus comment form on 'show n more comments' [#4265](https://github.com/diaspora/diaspora/issues/4265) * Don't focus comment form on 'show n more comments' [#4265](https://github.com/diaspora/diaspora/issues/4265)
......
...@@ -3,23 +3,16 @@ app.views.Aspect = app.views.Base.extend({ ...@@ -3,23 +3,16 @@ app.views.Aspect = app.views.Base.extend({
tagName: "li", tagName: "li",
className: 'sub_nav_item', className: 'hoverable',
initialize: function(){
if (this.model.get('selected')){
this.$el.addClass('active');
};
},
events: { events: {
'click a.aspect_selector': 'toggleAspect' 'click .icons-check_yes_ok+a': 'toggleAspect'
}, },
toggleAspect: function(evt){ toggleAspect: function(evt) {
if (evt) { evt.preventDefault(); }; if (evt) { evt.preventDefault(); };
this.model.toggleSelected(); this.model.toggleSelected();
this.$el.toggleClass('active'); this.$el.find('.icons-check_yes_ok').toggleClass('selected');
this.$el.find('.icons-check_yes_ok').toggleClass('invisible')
app.router.aspects_stream(); app.router.aspects_stream();
}, },
......
...@@ -7,7 +7,7 @@ app.views.AspectsList = app.views.Base.extend({ ...@@ -7,7 +7,7 @@ app.views.AspectsList = app.views.Base.extend({
'click .toggle_selector' : 'toggleAll' 'click .toggle_selector' : 'toggleAll'
}, },
initialize: function(){ initialize: function() {
this.collection.on('change', this.toggleSelector, this); this.collection.on('change', this.toggleSelector, this);
this.collection.on('change', this.updateStreamTitle, this); this.collection.on('change', this.updateStreamTitle, this);
}, },
...@@ -25,21 +25,19 @@ app.views.AspectsList = app.views.Base.extend({ ...@@ -25,21 +25,19 @@ app.views.AspectsList = app.views.Base.extend({
}).render().el); }).render().el);
}, },
toggleAll: function(evt){ toggleAll: function(evt) {
if (evt) { evt.preventDefault(); }; if (evt) { evt.preventDefault(); };
var aspects = this.$('li:not(:last)') var aspects = this.$('li:not(:last)')
if (this.collection.allSelected()) { if (this.collection.allSelected()) {
this.collection.deselectAll(); this.collection.deselectAll();
aspects.removeClass("active");
aspects.each(function(i){ aspects.each(function(i){
$(this).find('.icons-check_yes_ok').addClass('invisible'); $(this).find('.icons-check_yes_ok').removeClass('selected');
}); });
} else { } else {
this.collection.selectAll(); this.collection.selectAll();
aspects.addClass("active");
aspects.each(function(i){ aspects.each(function(i){
$(this).find('.icons-check_yes_ok').removeClass('invisible'); $(this).find('.icons-check_yes_ok').addClass('selected');
}); });
} }
...@@ -47,7 +45,7 @@ app.views.AspectsList = app.views.Base.extend({ ...@@ -47,7 +45,7 @@ app.views.AspectsList = app.views.Base.extend({
app.router.aspects_stream(); app.router.aspects_stream();
}, },
toggleSelector: function(){ toggleSelector: function() {
var selector = this.$('a.toggle_selector'); var selector = this.$('a.toggle_selector');
if (this.collection.allSelected()) { if (this.collection.allSelected()) {
selector.text(Diaspora.I18n.t('aspect_navigation.deselect_all')); selector.text(Diaspora.I18n.t('aspect_navigation.deselect_all'));
...@@ -56,7 +54,7 @@ app.views.AspectsList = app.views.Base.extend({ ...@@ -56,7 +54,7 @@ app.views.AspectsList = app.views.Base.extend({
} }
}, },
updateStreamTitle: function(){ updateStreamTitle: function() {
$('.stream_title').text(this.collection.toSentence()); $('.stream_title').text(this.collection.toSentence());
} }
}) })
...@@ -2,12 +2,12 @@ app.views.TagFollowing = app.views.Base.extend({ ...@@ -2,12 +2,12 @@ app.views.TagFollowing = app.views.Base.extend({
templateName: "tag_following", templateName: "tag_following",
className : "unfollow", className : "hoverable",
tagName: "li", tagName: "li",
events : { events : {
"click .tag_following_delete": "destroyModel" "click .delete_tag_following": "destroyModel"
}, },
initialize : function(){ initialize : function(){
...@@ -30,4 +30,4 @@ app.views.TagFollowing = app.views.Base.extend({ ...@@ -30,4 +30,4 @@ app.views.TagFollowing = app.views.Base.extend({
}) })
} }
}); });
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
@import '_mixins.css.scss' @import '_mixins.css.scss'
@import '_flash_messages.scss' @import '_flash_messages.scss'
@import 'new_styles/_spinner' @import 'new_styles/_spinner'
@import 'sidebar.css.scss'
/* ===== sprites ===== */ /* ===== sprites ===== */
...@@ -1060,10 +1061,6 @@ ul#settings_nav ...@@ -1060,10 +1061,6 @@ ul#settings_nav
#thumbnails #thumbnails
:line-height 14px :line-height 14px
#aspect_list
:margin 0
:padding 0
.dull .dull
:color #aaa :color #aaa
:text-align center :text-align center
...@@ -1150,24 +1147,6 @@ input[type="search"] ...@@ -1150,24 +1147,6 @@ input[type="search"]
form form
:display relative :display relative
.inline_aspect_listing
:margin 0
:padding 0
:display inline
> li
:display inline
:font
:weight normal
&:after
:content ", "
&:last-child
&:before
:content "and "
&:after
:content "."
#user_photo_uploader #user_photo_uploader
.avatar .avatar
@include border-radius(5px) @include border-radius(5px)
...@@ -1811,31 +1790,6 @@ ul#press_logos ...@@ -1811,31 +1790,6 @@ ul#press_logos
:margin :margin
:top 8px :top 8px
#home_user_badge
:position relative
img
:position absolute
:left 0
h4
:position relative
:top 14px
:padding
:bottom 5px
:text-overflow ellipsis
:overflow hidden
:white-space nowrap
a
:color inherit
:margin
:bottom 54px
:padding
:left 60px
.icons-monotone_email_letter_round .icons-monotone_email_letter_round
:height 128px :height 128px
:width 128px :width 128px
...@@ -2439,20 +2393,10 @@ ul.left_nav ...@@ -2439,20 +2393,10 @@ ul.left_nav
:text :text
:decoration none :decoration none
.invisible
:visibility hidden
li li
:position relative :position relative
:width 100% :width 100%
.icons-check_yes_ok
:height 18px
:width 18px
:display inline-block
:margin-left 3px
:vertical-align middle
li.active li.active
> a.home_selector:not(.sub_selected) > a.home_selector:not(.sub_selected)
:font :font
...@@ -2534,18 +2478,12 @@ ul.left_nav ...@@ -2534,18 +2478,12 @@ ul.left_nav
:float right :float right
ul.sub_nav ul.sub_nav
:padding 0 :padding
:left 25px
:margin 0 :margin 0
li li
:width 204px :width 204px
a.toggle_selector,
.new_aspect,
a.tag_selector
:padding
:left 25px
:width 172px
.section .section
.left_nav .left_nav
a.aspect_selector, a.aspect_selector,
......
$bluebg: #e7f2f7;
#home_user_badge {
min-height: 50px;
margin-bottom: 20px;
img {
float: left;
}
h4 {
margin-left: 60px;
padding-top: 15px;
overflow: hidden;
text-overflow: ellipsis;
a {
color: inherit;
font-weight: bold;
}
}
}
#leftNavBar {
float: left;
margin: 0px;
margin-right: 10px;
padding: 0px;
color: #222222;
ul {
padding: 0px;
}
a {
color: #777777;
font-weight: bold;
text-decoration: none;
}
.hoverable {
display: block;
width: 90%;
padding: 4px;
&:hover {
background-color: $bluebg;
}
}
.selectable {
display: block;
margin-left: 21px;
overflow: hidden;
text-overflow: ellipsis;
}
}
#stream_selection {
& > li {
margin-bottom: 10px;
}
.action {
width: 12px;
height: 12px;
display: none;
float: right;
margin: 3px;
}
.hoverable:hover > .action {
display: block;
}
}
#aspects_list {
.icons-check_yes_ok {
height:18px;
width:18px;
background: url('icons/check_yes_ok.png') no-repeat;
float: left;
visibility: hidden;
}
.selected {
visibility: visible;
}
.selected + a {
color: #333333;
}
.modify_aspect {
background: url("icons/pencil.png") no-repeat;
}
}
#tags_list {
.delete_tag_following {
background: url("icons/deletelabel.png") no-repeat;
}
/* ---- override app/stylesheets/vendor/autoSuggest.css ---- */
.tag_input {
width: 100%;
}
.as-result {
margin-top: -1px;
margin-left: 1px;
}
.as-list {
em {
background-color: #aabbcc;
color: black;
padding: 0px;
}
color: black;
position: static; /* override absolute */
margin: 0px;
border-radius: 0px 0px 3px 3px;
box-shadow: 0px 1px 1px #666;
}
.as-result-item.active {
color: black;
text-shadow: none;
background-color: $bluebg;
border-color: $bluebg;
}
/* ---- end override app/stylesheets/vendor/autoSuggest.css ---- */
}
<a href="/aspects/{{id}}/edit" rel="facebox"> <a href="/aspects/{{id}}/edit" class="action modify_aspect" rel="facebox"></a>
<div class="edit icons-pencil" alt="Pencil" title="{{t 'edit'}} {{name}}">
</div>
</a>
{{#if selected}} {{#if selected}}
<div class="icons-check_yes_ok"></div> <div class="icons-check_yes_ok selected"></div>
{{else}} {{else}}
<div class="icons-check_yes_ok invisible"></div> <div class="icons-check_yes_ok"></div>
{{/if}} {{/if}}
<a class="aspect_selector name" data-guid="{{id}}" href="/aspects/query"> {{name}} </a> <a href="/aspects/query" class="selectable" data-guid="{{id}}"> {{name}} </a>
<a class="toggle_selector" href="#"> <li class="hoverable">
{{ t "aspect_navigation.select_all" }} <a class="selectable toggle_selector" href="#">
</a> {{ t "aspect_navigation.select_all" }}
<li> </a>
<a class="new_aspect" href="/aspects/new" rel="facebox">{{ t "aspect_navigation.add_an_aspect" }}</a> </li>
<li class="hoverable">
<a href="/aspects/new" class="selectable new_aspect" rel="facebox">{{ t "aspect_navigation.add_an_aspect" }}</a>
</li> </li>
<li> <li>
<form accept-charset="UTF-8" action="/tag_followings" id="new_tag_following" method="post"> <form id="new_tag_following" accept-charset="UTF-8" action="/tag_followings" method="post">
<input class="tag_input" type="text" name="name" placeholder="{{t "stream.followed_tag.add_a_tag"}}" /> <input class="tag_input" type="text" name="name" placeholder="{{t "stream.followed_tag.add_a_tag"}}" />
</form> </form>
</li> </li>
<a class="tag_selector" href="/tags/{{name}}"> <a href="#" id="unfollow_{{name}}" rel="nofollow" class="action delete_tag_following" title="{{t "delete"}}"><a/>
<a href="/tags/{{name}}" class="selectable">
#{{ name }} #{{ name }}
</a> </a>
<div class="unfollow_icon hidden">
<a href="#" id="unfollow_{{name}}" rel="nofollow" class="delete tag_following_delete" title="{{t "delete"}}">
<div alt="Deletelabel" class="icons-deletelabel"></div>
<a/>
</div>
...@@ -2,8 +2,5 @@ ...@@ -2,8 +2,5 @@
-# licensed under the Affero General Public License version 3 or later. See -# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file. -# the COPYRIGHT file.
%ul#aspect_nav.left_nav.sub = link_to t('streams.aspects.title'), aspects_path, :class => 'hoverable', :rel => 'backbone'
%li.all_aspects %ul#aspects_list
= link_to t('streams.aspects.title'), aspects_path, :class => 'home_selector', :rel => 'backbone'
%ul#aspects_list.sub_nav
...@@ -22,28 +22,22 @@ ...@@ -22,28 +22,22 @@
%br %br
%br %br
.span-5.leftNavBar .span-5#leftNavBar
#home_user_badge #home_user_badge
= owner_image_link = owner_image_link
%h4 %h4
= link_to current_user.first_name, local_or_remote_person_path(current_user.person) = link_to current_user.first_name, local_or_remote_person_path(current_user.person)
.section %ul#stream_selection
%ul.left_nav %li.hoverable
%li = link_to t("streams.activity.title"), activity_stream_path, :rel => 'backbone'
= link_to t("streams.activity.title"), activity_stream_path, :class => 'home_selector', :rel => 'backbone' %li.hoverable
= link_to t('streams.mentions.title'), mentioned_stream_path, :rel => 'backbone'
%ul.left_nav %li.hoverable
%li = link_to t("streams.multi.title"), stream_path, :rel => 'backbone'
= link_to t('streams.mentions.title'), mentioned_stream_path, :class => 'home_selector', :rel => 'backbone' %li.all_aspects
= render 'aspects/aspect_listings', :stream => @stream
%ul.left_nav %li
%li
= link_to t("streams.multi.title"), stream_path, :class => 'home_selector', :rel => 'backbone'
= render 'aspects/aspect_listings', :stream => @stream
#followed_tags_listing
= render 'tags/followed_tags_listings' = render 'tags/followed_tags_listings'
......
...@@ -2,9 +2,5 @@ ...@@ -2,9 +2,5 @@
-# licensed under the Affero General Public License version 3 or later. See -# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file. -# the COPYRIGHT file.
- if user_signed_in? = link_to t('streams.followed_tag.title'), followed_tags_stream_path, :class => 'hoverable'
%ul.left_nav.sub %ul#tags_list
%li
%b=link_to t('streams.followed_tag.title'), followed_tags_stream_path, :class => 'home_selector'
%ul.sub_nav#tags_list
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
- content_for :body_class do - content_for :body_class do
= "tags_show" = "tags_show"
.span-6.tags_people #leftNavBar
%h3 %h3
= t('people', :count => @stream.tagged_people_count) = t('people', :count => @stream.tagged_people_count)
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
%br %br
.section - if user_signed_in?
= render "tags/followed_tags_listings" = render "tags/followed_tags_listings"
.span-15.last .span-15.last
......
...@@ -90,6 +90,7 @@ module Diaspora ...@@ -90,6 +90,7 @@ module Diaspora
mobile.css mobile.css
new-templates.css new-templates.css
rtl.css rtl.css
sidebar.css
} }
# Version of your assets, change this if you want to expire all your assets # Version of your assets, change this if you want to expire all your assets
......
...@@ -37,11 +37,9 @@ Feature: posting ...@@ -37,11 +37,9 @@ Feature: posting
Scenario: can stop following a tag from the tag page Scenario: can stop following a tag from the tag page
When I press "Following #boss" When I press "Following #boss"
And I go to the followed tags stream page And I go to the followed tags stream page
Then I should not see "#boss" within ".left_nav" Then I should not see "#boss" within "#tags_list"
Scenario: can stop following a tag from the homepage Scenario: can stop following a tag from the homepage
When I go to the followed tags stream page When I go to the followed tags stream page
And I hover over the "li.unfollow#tag-following-boss" And I unfollow the "boss" tag
And I follow "unfollow_boss" Then I should not see "#tag-following-boss" within "#tags_list"
And I confirm the alert
Then I should not see "#tag-following-boss" within ".left_nav"
...@@ -39,7 +39,7 @@ Feature: User manages contacts ...@@ -39,7 +39,7 @@ Feature: User manages contacts
And I press "Delete" in the modal window And I press "Delete" in the modal window
And I confirm the alert And I confirm the alert
Then I should be on the aspects page Then I should be on the aspects page
And I should not see "People" within "#aspect_nav" And I should not see "People" within "#aspects_list"
Scenario: Editing the aspect memberships of a contact from the aspect edit facebox Scenario: Editing the aspect memberships of a contact from the aspect edit facebox
Given I am signed in Given I am signed in
......
...@@ -28,11 +28,11 @@ Feature: mentioning a contact from their profile page ...@@ -28,11 +28,11 @@ Feature: mentioning a contact from their profile page
And I append "I am eating a yogurt" to the publisher And I append "I am eating a yogurt" to the publisher
And I press "Share" in the modal window And I press "Share" in the modal window
When I am on the aspects page When I am on the aspects page
And I follow "PostingTo" within "#aspect_nav" And I follow "PostingTo" within "#aspects_list"
Then I should see "I am eating a yogurt" Then I should see "I am eating a yogurt"
When I am on the aspects page When I am on the aspects page
And I follow "NotPostingThingsHere" within "#aspect_nav" And I follow "NotPostingThingsHere" within "#aspects_list"
Then I should see "I am eating a yogurt" Then I should see "I am eating a yogurt"
Scenario: mentioning while posting to just one aspect Scenario: mentioning while posting to just one aspect
......
When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name| When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name|
step %{I hover over the "ul.sub_nav > li:contains('#{aspect_name}')"} within(".all_aspects") do
within("#aspect_nav") do li = find('li', text: aspect_name)
find('a > .edit').click page.execute_script("$('#aspects_list li:contains(\\'#{aspect_name}\\') .modify_aspect').css('display', 'block');") # TODO HACK please replace me by li.hover when capybara will be fixed
li.find('.modify_aspect').click
end end
end end
When /^I select only "([^"]*)" aspect$/ do |aspect_name| When /^I select only "([^"]*)" aspect$/ do |aspect_name|
within('#aspect_nav') do click_link 'My Aspects'
click_link 'Aspects' within('#aspects_list') do
click_link 'Select all' if has_link? 'Select all' click_link 'Select all' if has_link? 'Select all'
click_link 'Deselect all' click_link 'Deselect all'
end end
...@@ -15,7 +16,7 @@ When /^I select only "([^"]*)" aspect$/ do |aspect_name| ...@@ -15,7 +16,7 @@ When /^I select only "([^"]*)" aspect$/ do |aspect_name|
end end
When /^I select "([^"]*)" aspect as well$/ do |aspect_name| When /^I select "([^"]*)" aspect as well$/ do |aspect_name|
within('#aspect_nav') do within('#aspects_list') do
click_link aspect_name click_link aspect_name
end end
step %Q(I should see "#{aspect_name}" aspect selected) step %Q(I should see "#{aspect_name}" aspect selected)
...@@ -23,16 +24,15 @@ end ...@@ -23,16 +24,15 @@ end
Then /^I should see "([^"]*)" aspect selected$/ do |aspect_name| Then /^I should see "([^"]*)" aspect selected$/ do |aspect_name|
aspect = @me.aspects.where(:name => aspect_name).first aspect = @me.aspects.where(:name => aspect_name).first
within("#aspect_nav") do within("#aspects_list") do
page.has_css?("li.active[data-aspect_id='#{aspect.id}']").should be_true page.should have_css "li[data-aspect_id='#{aspect.id}'] .selected"
page.has_no_css?("li.active[data-aspect_id='#{aspect.id}'] .invisible").should be_true
end end
end end
Then /^I should see "([^"]*)" aspect unselected$/ do |aspect_name| Then /^I should see "([^"]*)" aspect unselected$/ do |aspect_name|
aspect = @me.aspects.where(:name => aspect_name).first aspect = @me.aspects.where(:name => aspect_name).first
within("#aspect_nav") do within("#aspects_list") do
page.has_css?("li[data-aspect_id='#{aspect.id}']:not(.active) .invisible", visible: false).should be_true page.should_not have_css "li[data-aspect_id='#{aspect.id}'] .selected"
end end
end end
......
...@@ -208,7 +208,7 @@ end ...@@ -208,7 +208,7 @@ end
When /^I search for "([^\"]*)"$/ do |search_term| When /^I search for "([^\"]*)"$/ do |search_term|
fill_in "q", :with => search_term fill_in "q", :with => search_term
find_field("q").native.send_key(:enter) find_field("q").native.send_key(:enter)
find(".tags_people") find("#leftNavBar")
end end
Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value| Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"$/ do |field, selector, value|
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter