Skip to content
This repository
Browse code

added letters to user actions page

changed some copy
  • Loading branch information...
commit 707587a543a4adc7646ba05dbe99445b83f2c338 1 parent c642607
OpenCongress authored
2  app/models/user.rb
@@ -152,6 +152,8 @@ class User < ActiveRecord::Base
152 152
   
153 153
   has_one :political_notebook
154 154
   has_many :notebook_items, :through => :political_notebook
  155
+
  156
+  has_many :contact_congress_letters
155 157
   
156 158
 #  has_many :bill_comments
157 159
   def self.human_attribute_name(attr, options = {})
15  app/views/contact_congress_letters/show.html.haml
@@ -5,11 +5,16 @@
5 5
 .contact_congress_letter
6 6
   - if @contact_congress_letter.bill
7 7
     #bill
8  
-      This letter was sent regarding:
9  
-      %strong= link_to truncate("#{@contact_congress_letter.bill.typenumber} #{@contact_congress_letter.bill.title_common}", :length => 170), bill_path(@contact_congress_letter.bill)
10  
-      - if @contact_congress_letter.formageddon_threads.first.formageddon_sender
11  
-        by
12  
-        = link_to @contact_congress_letter.formageddon_threads.first.formageddon_sender.login, user_profile_path(@contact_congress_letter.formageddon_threads.first.formageddon_sender.login)
  8
+      This letter was sent by OpenCongress user
  9
+      = link_to @contact_congress_letter.formageddon_threads.first.formageddon_sender.login, user_profile_path(@contact_congress_letter.formageddon_threads.first.formageddon_sender.login)
  10
+      on
  11
+      = @contact_congress_letter.formageddon_threads.first.created_at.strftime('%B %d, %Y')
  12
+      = case @contact_congress_letter.disposition when 'support': 'in support of' when 'oppose': 'in opposition to' else 'tracking' end
  13
+      %strong
  14
+        = "#{link_to(truncate(@contact_congress_letter.bill.typenumber + ' ' + @contact_congress_letter.bill.title_common, :length => 170), bill_path(@contact_congress_letter.bill))}.".html_safe
  15
+      Privacy setting:
  16
+      = @contact_congress_letter.formageddon_threads.first.privacy
  17
+      
13 18
   #recipients{ :class => "num#{@contact_congress_letter.formageddon_threads.size}" }
14 19
     .to To:
15 20
     %ul
34  app/views/profile/actions.html.erb
@@ -19,6 +19,40 @@
19 19
 
20 20
 <div id="linkcontent">
21 21
 		<div class="my_left">
  22
+		  
  23
+<h3 class="dark"><%= user_name("My","'s") %> Letters to Congress</h3>
  24
+<% if @user.contact_congress_letters.empty? %>
  25
+  <p>No letters to Congress written yet.</p>
  26
+<% else %>
  27
+
  28
+
  29
+  <ul class="grid_16">
  30
+    <li class="grid_16">
  31
+      <span class="grid_2"><strong>Date</strong></span>
  32
+      <span class="grid_3"><strong>To</strong></span>
  33
+      <span class="grid_6"><strong>Regarding</strong></span>
  34
+      <span class="grid_2"><strong>Privacy</strong></span>
  35
+    </li>
  36
+    <% @user.contact_congress_letters.each do |l| %>
  37
+      <li class="grid_16 margin-bottom">
  38
+        <div class="grid_2"><%= l.formageddon_threads.first.created_at.strftime('%B %d, %Y')%> </div>
  39
+        <div class="grid_3">
  40
+          <% l.formageddon_threads.each do |t| %>
  41
+            <%= link_to_person(t.formageddon_recipient) %><br />
  42
+          <% end %>
  43
+        </div>
  44
+        <div class="grid_6"><%= l.bill.typenumber %> <%= l.bill.title_common %></div>
  45
+        <div class="grid_2">
  46
+          <%= l.formageddon_threads.first.privacy %>
  47
+        </div>
  48
+        <div class="grid_1">
  49
+          <%= link_to "View", contact_congress_letter_path(l), :class => 'button silver small' %>
  50
+        </div>
  51
+      </li>
  52
+    <% end %>    
  53
+  </ul>
  54
+<% end %>
  55
+
22 56
 		<h3 class="dark"><%= user_name("My","'s") %> Comments</h3>
23 57
 		<p style="text-align:center;clear:both;"><%= will_paginate(@my_comments) %></p>
24 58
 		  <% if @my_comments.empty? %>
5  public/stylesheets/contact_congress_letters.css
@@ -1101,10 +1101,11 @@ padding-bottom: 0px;
1101 1101
 text-align: center;
1102 1102
 font-size: 16px;
1103 1103
 height: 30px;
  1104
+line-height: 1.5em;
1104 1105
 padding-top: 20px ;
1105 1106
 padding-bottom: 40px ;
1106  
-
1107  
-width: 100%;
  1107
+margin: 0 auto;
  1108
+width: 60%;
1108 1109
 }
1109 1110
 
1110 1111
 #comments-container{

0 notes on commit 707587a

Please sign in to comment.
Something went wrong with that request. Please try again.