Skip to content

Commit

Permalink
added letters to user actions page
Browse files Browse the repository at this point in the history
changed some copy
  • Loading branch information
opencongress committed Jul 10, 2011
1 parent c642607 commit 707587a
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 7 deletions.
2 changes: 2 additions & 0 deletions app/models/user.rb
Expand Up @@ -152,6 +152,8 @@ class User < ActiveRecord::Base


has_one :political_notebook has_one :political_notebook
has_many :notebook_items, :through => :political_notebook has_many :notebook_items, :through => :political_notebook

has_many :contact_congress_letters


# has_many :bill_comments # has_many :bill_comments
def self.human_attribute_name(attr, options = {}) def self.human_attribute_name(attr, options = {})
Expand Down
15 changes: 10 additions & 5 deletions app/views/contact_congress_letters/show.html.haml
Expand Up @@ -5,11 +5,16 @@
.contact_congress_letter .contact_congress_letter
- if @contact_congress_letter.bill - if @contact_congress_letter.bill
#bill #bill
This letter was sent regarding: This letter was sent by OpenCongress user
%strong= link_to truncate("#{@contact_congress_letter.bill.typenumber} #{@contact_congress_letter.bill.title_common}", :length => 170), bill_path(@contact_congress_letter.bill) = link_to @contact_congress_letter.formageddon_threads.first.formageddon_sender.login, user_profile_path(@contact_congress_letter.formageddon_threads.first.formageddon_sender.login)
- if @contact_congress_letter.formageddon_threads.first.formageddon_sender on
by = @contact_congress_letter.formageddon_threads.first.created_at.strftime('%B %d, %Y')
= link_to @contact_congress_letter.formageddon_threads.first.formageddon_sender.login, user_profile_path(@contact_congress_letter.formageddon_threads.first.formageddon_sender.login) = case @contact_congress_letter.disposition when 'support': 'in support of' when 'oppose': 'in opposition to' else 'tracking' end
%strong
= "#{link_to(truncate(@contact_congress_letter.bill.typenumber + ' ' + @contact_congress_letter.bill.title_common, :length => 170), bill_path(@contact_congress_letter.bill))}.".html_safe
Privacy setting:
= @contact_congress_letter.formageddon_threads.first.privacy

#recipients{ :class => "num#{@contact_congress_letter.formageddon_threads.size}" } #recipients{ :class => "num#{@contact_congress_letter.formageddon_threads.size}" }
.to To: .to To:
%ul %ul
Expand Down
34 changes: 34 additions & 0 deletions app/views/profile/actions.html.erb
Expand Up @@ -19,6 +19,40 @@


<div id="linkcontent"> <div id="linkcontent">
<div class="my_left"> <div class="my_left">

<h3 class="dark"><%= user_name("My","'s") %> Letters to Congress</h3>
<% if @user.contact_congress_letters.empty? %>
<p>No letters to Congress written yet.</p>
<% else %>


<ul class="grid_16">
<li class="grid_16">
<span class="grid_2"><strong>Date</strong></span>
<span class="grid_3"><strong>To</strong></span>
<span class="grid_6"><strong>Regarding</strong></span>
<span class="grid_2"><strong>Privacy</strong></span>
</li>
<% @user.contact_congress_letters.each do |l| %>
<li class="grid_16 margin-bottom">
<div class="grid_2"><%= l.formageddon_threads.first.created_at.strftime('%B %d, %Y')%> </div>
<div class="grid_3">
<% l.formageddon_threads.each do |t| %>
<%= link_to_person(t.formageddon_recipient) %><br />
<% end %>
</div>
<div class="grid_6"><%= l.bill.typenumber %> <%= l.bill.title_common %></div>
<div class="grid_2">
<%= l.formageddon_threads.first.privacy %>
</div>
<div class="grid_1">
<%= link_to "View", contact_congress_letter_path(l), :class => 'button silver small' %>
</div>
</li>
<% end %>
</ul>
<% end %>

<h3 class="dark"><%= user_name("My","'s") %> Comments</h3> <h3 class="dark"><%= user_name("My","'s") %> Comments</h3>
<p style="text-align:center;clear:both;"><%= will_paginate(@my_comments) %></p> <p style="text-align:center;clear:both;"><%= will_paginate(@my_comments) %></p>
<% if @my_comments.empty? %> <% if @my_comments.empty? %>
Expand Down
5 changes: 3 additions & 2 deletions public/stylesheets/contact_congress_letters.css
Expand Up @@ -1101,10 +1101,11 @@ padding-bottom: 0px;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
height: 30px; height: 30px;
line-height: 1.5em;
padding-top: 20px ; padding-top: 20px ;
padding-bottom: 40px ; padding-bottom: 40px ;

margin: 0 auto;
width: 100%; width: 60%;
} }


#comments-container{ #comments-container{
Expand Down

0 comments on commit 707587a

Please sign in to comment.