Commit dbe1bb6

mo khan <mo@mokhan.ca>
2013-06-23 21:13:48
reorganize needs index as per mockup and add twitter feed
1 parent 9c189e9
Changed files (1)
app
views
app/views/needs/index.html.erb
@@ -1,5 +1,5 @@
 <% content_for :javascript do %>
-<script type="text/javascript" charset="utf-8">
+  <script type="text/javascript" charset="utf-8">
 $(function() {
   $('#tags').tagit({ availableTags: [<% @tags.each { |x| %>'<%= x %>',<% } %>] });
 });
@@ -8,57 +8,47 @@ $(function() {
 <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/flick/jquery-ui.css">
 
 <div class="row">
-  <div class="span12">
+  <div class="span5">
     <% if user_signed_in? %>
+      <h1>I need...</h1>
       <%= form_for(Need.new, :class => "form-horizontal") do |f| %>
         <div class="control-group">
-          <label class="control-label" for="description">I need</label>
-          <div class="controls">
-            <%= f.text_area :description, cols: 160, rows: 2, :class => "span12" %>
-          </div>
+        <label class="control-label" for="description">I need</label>
+        <div class="controls">
+          <%= f.text_area :description, cols: 160, rows: 2, :class => "span12" %>
         </div>
-        <div class="control-group">
-          <%= f.label :address, :class => "control-label" %>
-          <div class="controls">
-            <%= f.text_field :address %>
-          </div>
+      </div>
+      <div class="control-group">
+        <%= f.label :address, :class => "control-label" %>
+        <div class="controls">
+          <%= f.text_field :address %>
         </div>
-        <div class="control-group">
-          <label class="control-label" for="description">tags</label>
-          <div class="controls">
-            <input name="need_tags" type="text" id="tags" value="" class="input-xxlarge" autocomplete="off" placeholder="e.g. trucks, sunnyside" />
-          </div>
+      </div>
+      <div class="control-group">
+        <label class="control-label" for="description">tags</label>
+        <div class="controls">
+          <input name="need_tags" type="text" id="tags" value="" class="input-xxlarge" autocomplete="off" placeholder="e.g. trucks, sunnyside" />
         </div>
-        <div class="control-group">
-          <div class="controls">
-            <%= f.submit "Submit" %>
-          </div>
+      </div>
+      <div class="control-group">
+        <div class="controls">
+          <%= f.submit "Send" %>
         </div>
-      <% end %>
-    <% else %>
-      <%= link_to "I need...", new_user_registration_path, :class => "btn btn-primary" %>
+      </div>
     <% end %>
-  </div>
-</div>
-
-<div class="row">
-  <div class="span12">
+  <% else %>
+    <%= link_to "I need...", new_user_registration_path, :class => "btn btn-primary" %>
+  <% end %>
+    <h2>Recently needed:</h2>
     <table class="table">
-      <tr>
-        <th></th>
-        <th></th>
-        <th>Need</th>
-        <th>Tags</th>
-        <th></th>
-      </tr>
       <% @needs.each do |need| %>
-      <tr>
+        <tr>
         <td><%= gravatar_for(need.user) %></td> 
         <td><%= need.user.name %></td>
-        <td> I need <%= need.description %></td>
-        <td><span> <i class="icon-tags"></i> </span>
-        <% need.tags.each do |tag| -%>
-          <a href="<%= url_for tag_path(tag.name) %>"><span class="label"><%= tag.name %></span></a>
+        <td> I need <%= need.description %>
+        <span> <i class="icon-tags"></i> </span>
+          <% need.tags.each do |tag| -%>
+            <a href="<%= url_for tag_path(tag.name) %>"><span class="label"><%= tag.name %></span></a>
         <% end -%>
         </td>
         <td><%= link_to "Help", need_path(need), :class => "btn" %></td>
@@ -66,4 +56,12 @@ $(function() {
     <% end %>
     </table>
   </div>
+  <div class="span5">
+    <h1>I have...</h1>
+  </div>
+  <div class="span2">
+    <h2>Updates</h2>
+    <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/search?q=%23yycflood"  data-widget-id="348909521470648320">Tweets about "#yycflood"</a>
+    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+  </div>
 </div>