app/views/people/show.html.haml in artfully_ose-1.2.0.pre.23 vs app/views/people/show.html.haml in artfully_ose-1.2.0.pre.24
- old
+ new
@@ -1,24 +1,62 @@
+- content_for :custom_js do
+ = javascript_include_tag "relationships"
- in_section :people
- content_for :title do
#{@person}
=render "header"
.row
.span4
+
-unless @person.dummy?
- %p= link_to "Edit #{@person.possessive} Info", '#edit-person', 'data-toggle' => 'modal'
- = render :partial => 'comp_membership', :locals => { :person => @person }
- = render @person.address
+ %p= render :partial => 'work_with_menu', :locals => {:person => @person}
+ = render @person.address unless @person.address.new_record?
%ul
- @person.phones.each do |phone|
%li
%span.muted= phone.kind
= phone.number
+ -with_kit(:relationships) do
+ %section
+ - if @person.household.present?
+ %h5
+ == Household (#{link_to "view", @person.household})
+ %ul
+ - @person.household.individuals.where('id != ?', @person.id).each do |individual|
+ %li
+ %span.starable-spacer
+ ✭
+ %span.muted
+ = link_to(individual, polymorphic_url(individual))
+
+ %h5 Relationships
+ - struct = relationships_struct(@person)
+ %ul
+ - struct[:starred].each do |relationship|
+ %li
+ %span.starred.starable{"data-person-id" => relationship.person.id, "data-type" => 'relationship', "data-action-id" => relationship.id, :class => (relationship.starred? ? "active" : "not-active") }
+ ✭
+ %span.muted= relationship.relation.description.humanize
+ = link_to(relationship.other(@person), polymorphic_url(relationship.other(@person)))
+
+ - @person.relationships.unstarred.where(:relation_id => struct[:single]).each do |relationship|
+ %li
+ %span.starred.starable{"data-person-id" => relationship.person.id, "data-type" => 'relationship', "data-action-id" => relationship.id, :class => (relationship.starred? ? "active" : "not-active") }
+ ✭
+ %span.muted= relationship.relation.description.humanize
+ = link_to(relationship.other(@person), polymorphic_url(relationship.other(@person)))
+ - struct[:grouped].each do |group|
+ %li
+ %span.starable-spacer
+ ✭
+ %span.muted
+ == #{Relation.find(group[:relation]).description.titleize.pluralize} (#{group[:count]}) #{link_to("View All", polymorphic_url([@person, :relationships], :relation_id => group[:relation]))} >
+
%section#email-subscription
%h5 Email Lists
= form_for @person do |form|
.do-not-email
= form.label :do_not_email, :class => "checkbox" do
@@ -38,11 +76,11 @@
#notes
.row-fluid
.span3
%h3 Notes
.span9
- = icon_link_to("Add", new_person_note_path(@person, :format => :html), 'icon-plus-sign', 'btn new-note-link', '')
+ = icon_link_to("Add", new_person_note_path(@person, :format => :html), 'fa-plus-circle', 'btn new-note-link', '')
.person-inline-form.new-note-form{:style => 'display:none;'}
= form_for [@person, Note.new] do |form|
= form.text_area :text, :size => "125x5", :class => 'input-xxlarge', :placeholder => "This is a good place for little nuggets about #{@person} you don't want to forget..."
= form.submit "Save", :class => "btn btn-primary"
= link_to 'Cancel', '#', :onclick => "$('.new-note-form').hide()", :class => 'btn'
@@ -66,11 +104,11 @@
#actions
.row-fluid
.span3
%h3 Action Feed
.span9
- = icon_link_to("Add", new_person_action_path(@person, :format => :html, :type => :hear), 'icon-plus-sign', 'btn new-action-link', '')
+ = icon_link_to("Add", new_person_action_path(@person, :format => :html, :type => :hear), 'fa-plus-circle', 'btn new-action-link', '')
.person-inline-form.action-form.new-action-form{:style => 'display:none;'}
= render :partial => 'actions/inline', :locals => {:target => @person, :action => @new_action}
%table.table-condensed.sortedstar.table#action-list
@@ -83,12 +121,12 @@
%tbody
- if @actions.empty?
%tr
%td
%td
- %td
- %td
+ %td
+ %td
No actions for this
= @person.individual? ? "individual." : "record."
- else
= render :partial => 'actions/action', :collection => @actions
@@ -106,6 +144,6 @@
%h3 MailChimp List Subscription
.modal-body
%p #{@person} will receive an email from MailChimp confirming their addition to this list
.modal-footer
%button(class="btn" data-dismiss="modal" aria-hidden="true") Cancel
- %button(class="btn btn-primary") OK
\ No newline at end of file
+ %button(class="btn btn-primary") OK