Fogbugz #66: Detail view.
This commit is contained in:
parent
64fa26c9b7
commit
c046a91e24
4 changed files with 50 additions and 3 deletions
|
|
@ -75,6 +75,7 @@ class ContactsController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@contact = Contact.find(params[:id])
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
|||
|
|
@ -12,4 +12,23 @@ class Contact < ActiveRecord::Base
|
|||
s += "." unless birth_month.nil?
|
||||
s += birth_year.to_s || ""
|
||||
end
|
||||
|
||||
def address_string
|
||||
s = street || ""
|
||||
s += " "
|
||||
s += housenr || ""
|
||||
s += "·" unless (plz.nil? and place.nil?)
|
||||
s += plz
|
||||
s += " "
|
||||
s += place
|
||||
end
|
||||
|
||||
# very temporary
|
||||
def twitter_username
|
||||
"dummy"
|
||||
end
|
||||
|
||||
def twitter_username_link
|
||||
'<a href="http://twitter.com/' + twitter_username + '">@' + twitter_username + "</a>"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
<%= c.birth_date_string.blank? ? " ".html_safe : c.birth_date_string %>
|
||||
</div>
|
||||
<div class="onecol">
|
||||
_
|
||||
(<%= link_to ">".html_safe, c %>)
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,29 @@
|
|||
<h1>Contacts#show</h1>
|
||||
<p>Find me in app/views/contacts/show.html.erb</p>
|
||||
<div class="row">
|
||||
<div class="threecol">
|
||||
[bild]
|
||||
</div>
|
||||
<div class="sixcol">
|
||||
<span id="show_name"><%= @contact.firstname %> <%= @contact.lastname %></span>
|
||||
<br />
|
||||
<span id="show_birthdate"><%= @contact.birth_date_string %></span>
|
||||
<br />
|
||||
<span id="show_address"><%= @contact.address_string.html_safe %></span>
|
||||
<br />
|
||||
<% @contact.phones.each do |phone| %>
|
||||
<em><%= phone.desc %></em> <%= phone.nr %>
|
||||
<br />
|
||||
<% end %>
|
||||
<% @contact.emails.each do |email| %>
|
||||
<em><%= email.desc %></em> <%= email.address %>
|
||||
<br />
|
||||
<% end %>
|
||||
Twitter:
|
||||
<%= @contact.twitter_username_link.html_safe %>
|
||||
<br />
|
||||
<em>shared friends</em>
|
||||
<br />
|
||||
<em>follow the same</em>
|
||||
<br />
|
||||
</div>
|
||||
<div class="threecol"> </div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue