Changeset 7d40d80 in RedSur
- Timestamp:
- Sep 21, 2015, 10:58:18 AM (9 years ago)
- Branches:
- master, PerfilGrupal, modelo_minuta, profile_fields
- Children:
- 0b91e90
- Parents:
- 8a77187
- Location:
- app
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
app/assets/javascripts/app/models/person.js
ra99ef39 r7d40d80 52 52 isGroup: function() { 53 53 return this.get('is_group'); 54 }, 55 56 contacts: function() { 57 return this.get('contacts'); 54 58 } 55 59 -
app/assets/javascripts/app/router.js
r412c4bc r7d40d80 84 84 app.publisher = app.publisher || new app.views.Publisher({collection : app.stream.items}); 85 85 86 console.log("ROUTER1"); 87 console.log("app.stream.items",app.stream.items.models); 86 88 var streamFacesView = new app.views.StreamFaces({collection : app.stream.items}); 87 89 … … 138 140 app.publisher.setSelectedAspects(ids); 139 141 142 console.log("ROUTER"); 143 console.log("app.stream.items",app.stream.items); 140 144 var streamFacesView = new app.views.StreamFaces({collection : app.stream.items}); 141 145 … … 164 168 el: $('body > .container-fluid') 165 169 }); }); 170 166 171 } 167 172 }); -
app/assets/javascripts/app/views/profile_sidebar_view.js
r412c4bc r7d40d80 3 3 app.views.ProfileSidebar = app.views.Base.extend({ 4 4 templateName: 'profile_sidebar', 5 6 subviews: { 7 '#selected_aspect_contacts':'selectedContacts' 8 }, 5 9 6 10 presenter: function() { … … 12 16 _shouldShowProfileInfo: function() { 13 17 return (this.model.isSharing() || this.model.get('is_own_profile')); 18 }, 19 20 // Subviews 21 selectedContacts: function(){ 22 23 console.log("SELECTED CONTACTS",this.model.contacts()); 24 25 26 return new app.views.StreamFaces({people : this.model.contacts()}); 27 //return new app.views.StreamFaces({people : this.model.contacts}); 28 29 /* 30 app.stream = new app.models.Stream(); 31 app.stream.fetch(); 32 console.log(JSON.stringify(app.stream.items)); 33 streamFacesView = new app.views.StreamFaces({collection : app.stream.items}); 34 console.log(streamFacesView.render().el); 35 $('#selected_aspect_contacts .content').html(streamFacesView.render().el); 36 */ 37 38 14 39 } 15 40 }); -
app/assets/javascripts/app/views/stream_faces_view.js
r412c4bc r7d40d80 9 9 tooltipSelector : ".avatar", 10 10 11 initialize : function(){ 12 this.updatePeople(); 13 app.stream.items.bind("add", this.updatePeople, this); 11 initialize : function(opts){ 12 if (opts.people){ 13 this.people = opts.people ; 14 } else { 15 this.updatePeople(); 16 app.stream.items.bind("add", this.updatePeople, this); 17 } 14 18 }, 15 19 … … 26 30 .value() 27 31 .slice(0,15); 32 console.log("PEOPLE",this.collection); 28 33 29 34 this.render(); -
app/assets/templates/profile_sidebar_tpl.jst.hbs
r412c4bc r7d40d80 1 2 {{#if is_group}} 3 <!-- Código de HAML tomado de 'main_stream.html.haml' 4 #selected_aspect_contacts.section 5 .title.no_icon 6 %h5.stream_title 7 = @stream.title 8 .content 9 --> 10 <div id="selected_aspect_contacts"> 11 </div> 12 13 {{/if}} 1 14 2 15 <div id="profile_photo" class="profile_photo"> … … 5 18 {{/linkToPerson}} 6 19 </div> 20 7 21 8 22 {{#if show_profile_info}} -
app/presenters/person_presenter.rb
ra99ef39 r7d40d80 15 15 is_own_profile: own_profile?, 16 16 is_group: group?, 17 contacts: fetch_contacts 17 18 }) 18 19 end … … 45 46 person = @presentable 46 47 person.profile.group? 48 end 49 50 def fetch_contacts 51 person = @presentable 52 user = person.owner 53 contact_hash = [] 54 person_contacts = Contact.contact_contacts_for(user, person) 55 person_contacts.each do |p| 56 contact_hash.push({ 57 avatar: AvatarPresenter.new(p.profile).base_hash, 58 diaspora_id: p.diaspora_handle, 59 guid: p.guid, 60 id: p.id, 61 name: p.name 62 }) 63 end 64 contact_hash 47 65 end 48 66 -
app/views/people/show.html.haml
ra99ef39 r7d40d80 17 17 #profile 18 18 -# here be JS 19 #selected_aspect_contacts.section20 .title.no_icon21 %h5.stream_title22 //= @stream.title23 .content24 25 19 26 20 .span9
Note: See TracChangeset
for help on using the changeset viewer.