Commit b77ecd48 authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff

Replace aspect_membership_dropdown with aspect-membership-dropdown

parent 473cc251
......@@ -116,7 +116,7 @@ Handlebars.registerHelper("isCurrentProfilePage", function(id, diasporaHandle, o
});
Handlebars.registerHelper('aspectMembershipIndicator', function(contact,in_aspect) {
if(!app.aspect || !app.aspect.get('id')) return '<div class="aspect_membership_dropdown placeholder"></div>';
if(!app.aspect || !app.aspect.get('id')) return '<div class="aspect-membership-dropdown placeholder"></div>';
var html = "<i class=\"entypo-";
if( in_aspect === 'in_aspect' ) {
......
......@@ -5,7 +5,7 @@ app.pages.GettingStarted = app.views.Base.extend({
templateName: false,
subviews: {
".aspect_membership_dropdown": "aspectMembershipView"
".aspect-membership-dropdown": "aspectMembershipView"
},
initialize: function(opts) {
......
......@@ -229,7 +229,7 @@ app.Router = Backbone.Router.extend({
},
renderAspectMembershipDropdowns: function($context) {
$context.find(".aspect_membership_dropdown.placeholder").each(function() {
$context.find(".aspect-membership-dropdown.placeholder").each(function() {
var personId = $(this).data("personId");
var view = new app.views.AspectMembership({person: app.contacts.findWhere({"person_id": personId}).person});
$(this).html(view.render().$el);
......
......@@ -9,7 +9,7 @@
*/
app.views.AspectMembership = app.views.Base.extend({
templateName: "aspect_membership_dropdown",
className: "btn-group aspect-dropdown aspect_membership_dropdown",
className: "btn-group aspect-dropdown aspect-membership-dropdown",
subviews: {
".newAspectContainer": "aspectCreateView"
......@@ -124,7 +124,7 @@ app.views.AspectMembership = app.views.Base.extend({
// show an error flash msg
_displayError: function(model, resp) {
this._done();
this.dropdown.closest(".aspect_membership_dropdown").removeClass("open"); // close the dropdown
this.dropdown.closest(".aspect-membership-dropdown").removeClass("open"); // close the dropdown
app.flashMessages.handleAjaxError(resp);
},
......
......@@ -4,7 +4,7 @@ app.views.Contact = app.views.Base.extend({
templateName: 'contact',
subviews: {
".aspect_membership_dropdown": "AspectMembershipView"
".aspect-membership-dropdown": "AspectMembershipView"
},
events: {
......
......@@ -4,7 +4,7 @@ app.views.ProfileHeader = app.views.Base.extend({
templateName: 'profile_header',
subviews: {
".aspect_membership_dropdown": "aspectMembershipView"
".aspect-membership-dropdown": "aspectMembershipView"
},
events: {
......
......@@ -18,7 +18,7 @@ var List = {
if (data.contacts) {
var contacts = new app.collections.Contacts(data.contacts);
$(".aspect_membership_dropdown.placeholder").each(function() {
$(".aspect-membership-dropdown.placeholder").each(function() {
var personId = $(this).data("personId");
var view = new app.views.AspectMembership({person: contacts.findWhere({"person_id": personId}).person});
$(this).html(view.render().$el);
......
......@@ -94,7 +94,7 @@
margin-right: 10px;
opacity: 1;
}
& > .pull-right > .aspect_membership_dropdown { display: none; }
& > .pull-right > .aspect-membership-dropdown { display: none; }
}
.ajax-loader {
border-bottom: 1px solid $border-grey;
......
......@@ -65,7 +65,7 @@
margin-bottom: 5px;
}
.btn-group.aspect_membership_dropdown { margin: 0 !important; }
.btn-group.aspect-membership-dropdown { margin: 0 !important; }
}
#hovercard_container {
......
......@@ -96,6 +96,6 @@
opacity: 0;
}
.btn-group.aspect_membership_dropdown { margin: 5px 0; }
.btn-group.aspect-membership-dropdown { margin: 5px 0; }
}
}
......@@ -20,7 +20,7 @@
width: 50px;
height: 50px;
}
.btn-group.aspect_membership_dropdown { margin: 12px 0; }
.btn-group.aspect-membership-dropdown { margin: 12px 0; }
.thats_you {
line-height: 50px;
margin-right: 10px;
......
......@@ -33,7 +33,7 @@
{{else}} {{#if is_blocked}}
<a href="#" id="unblock_user_button" class="btn btn-danger">{{t 'people.stop_ignoring'}}</a>
{{else}}
<div class="placeholder aspect_membership_dropdown"></div>
<div class="placeholder aspect-membership-dropdown"></div>
{{/if}}{{/if}}
</div>
{{/if}}
......
.placeholder.aspect_membership_dropdown
.placeholder.aspect-membership-dropdown
......@@ -6,7 +6,7 @@
- if note.target.present?
- gon_load_contact(note.contact)
.pull-right
.aspect_membership_dropdown.placeholder{data: {person_id: note.target.id}}
.aspect-membership-dropdown.placeholder{data: {person_id: note.target.id}}
.media-object.pull-left
= person_image_link note.actors.first, :size => :thumb_small, :class => 'hovercardable'
......
- unless person == current_user.person
.aspect_membership_dropdown.placeholder{data: {person_id: person.id}}
.aspect-membership-dropdown.placeholder{data: {person_id: person.id}}
-else
%span.thats_you
= t("people.person.thats_you")
......@@ -30,7 +30,7 @@ Feature: following and being followed
When I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page
And I press the first ".aspect_membership_dropdown .dropdown-toggle"
And I press the first ".aspect-membership-dropdown .dropdown-toggle"
And I press the first "a" within ".add_aspect"
And I fill in "aspect_name" with "Super People" in the aspect creation modal
......
......@@ -15,13 +15,13 @@ module AspectCukeHelpers
end
def toggle_aspect_via_ui(aspect_name)
aspects_dropdown = find(".aspect_membership_dropdown .dropdown-toggle", match: :first)
aspects_dropdown = find(".aspect-membership-dropdown .dropdown-toggle", match: :first)
aspects_dropdown.trigger "click"
selected_aspect_count = all(".aspect_membership_dropdown.open .dropdown-menu li.selected").length
aspect = find(".aspect_membership_dropdown.open .dropdown-menu li", text: aspect_name)
selected_aspect_count = all(".aspect-membership-dropdown.open .dropdown-menu li.selected").length
aspect = find(".aspect-membership-dropdown.open .dropdown-menu li", text: aspect_name)
aspect_selected = aspect["class"].include? "selected"
aspect.trigger "click"
expect(find(".aspect_membership_dropdown .dropdown-menu", visible: false)).to have_no_css(".loading")
expect(find(".aspect-membership-dropdown .dropdown-menu", visible: false)).to have_no_css(".loading")
# close dropdown
page.should have_no_css('#profile.loading')
......@@ -31,7 +31,7 @@ module AspectCukeHelpers
end
def aspect_dropdown_visible?
expect(find('.aspect_membership_dropdown.open')).to be_visible
expect(find('.aspect-membership-dropdown.open')).to be_visible
end
end
World(AspectCukeHelpers)
......
......@@ -119,7 +119,7 @@ describe NotificationsController, :type => :controller do
eve.share_with(alice.person, eve.aspects.first)
get :index, params: {per_page: 5}
expect(Nokogiri(response.body).css(".aspect_membership_dropdown")).not_to be_empty
expect(Nokogiri(response.body).css(".aspect-membership-dropdown")).not_to be_empty
end
it 'succeeds on mobile' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment