Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added letters to user actions page

changed some copy
  • Loading branch information...
commit 707587a543a4adc7646ba05dbe99445b83f2c338 1 parent c642607
@opencongress authored
View
2  app/models/user.rb
@@ -152,6 +152,8 @@ class User < ActiveRecord::Base
has_one :political_notebook
has_many :notebook_items, :through => :political_notebook
+
+ has_many :contact_congress_letters
# has_many :bill_comments
def self.human_attribute_name(attr, options = {})
View
15 app/views/contact_congress_letters/show.html.haml
@@ -5,11 +5,16 @@
.contact_congress_letter
- if @contact_congress_letter.bill
#bill
- This letter was sent regarding:
- %strong= link_to truncate("#{@contact_congress_letter.bill.typenumber} #{@contact_congress_letter.bill.title_common}", :length => 170), bill_path(@contact_congress_letter.bill)
- - if @contact_congress_letter.formageddon_threads.first.formageddon_sender
- by
- = link_to @contact_congress_letter.formageddon_threads.first.formageddon_sender.login, user_profile_path(@contact_congress_letter.formageddon_threads.first.formageddon_sender.login)
+ This letter was sent by OpenCongress user
+ = link_to @contact_congress_letter.formageddon_threads.first.formageddon_sender.login, user_profile_path(@contact_congress_letter.formageddon_threads.first.formageddon_sender.login)
+ on
+ = @contact_congress_letter.formageddon_threads.first.created_at.strftime('%B %d, %Y')
+ = 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}" }
.to To:
%ul
View
34 app/views/profile/actions.html.erb
@@ -19,6 +19,40 @@
<div id="linkcontent">
<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>
<p style="text-align:center;clear:both;"><%= will_paginate(@my_comments) %></p>
<% if @my_comments.empty? %>
View
5 public/stylesheets/contact_congress_letters.css
@@ -1101,10 +1101,11 @@ padding-bottom: 0px;
text-align: center;
font-size: 16px;
height: 30px;
+line-height: 1.5em;
padding-top: 20px ;
padding-bottom: 40px ;
-
-width: 100%;
+margin: 0 auto;
+width: 60%;
}
#comments-container{
Please sign in to comment.
Something went wrong with that request. Please try again.