Skip to content

Commit

Permalink
Photo styling
Browse files Browse the repository at this point in the history
  • Loading branch information
theHerb committed Apr 8, 2013
1 parent 3bcf9a0 commit 0161851
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ GEM
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
uglifier (1.3.0)
uglifier (2.0.1)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
uuidtools (2.1.3)
Expand Down
9 changes: 5 additions & 4 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ DEVISE
ROUTING


!!!STYLING
STYLING
PHOTO
Show page needs work

STATUS
!!!STATUS
!!!Show styling
Need to update the status_index view to prevent users from deleting other users posts *DONE*
Require JSON/AJAX when posting new status. Don't need show page. *DONE* changed redirect_to path

Expand All @@ -41,13 +42,13 @@ FRIENDS


PHOTO
!!!Paginate *DONE*
Paginate *DONE*
Commentable *DONE*
Voting
Public / Private
Testing
Performance - cache on view all page
!!!Default Name *DONE*
Default Name *DONE*

SEARCH
simple search
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/comments.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.comment {
border-bottom: solid 1px #CCC;
padding: 5px 0px;
margin-bottom: 10px;
}

.comment p {
Expand All @@ -18,6 +19,10 @@
.comment.hover .admin {
display: inline;
}

.created {
font-style: italic;
}
.avatar {
height: 100px;
width: 100px;
Expand Down
9 changes: 8 additions & 1 deletion app/assets/stylesheets/photos.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

.photo_image {
margin-top: 20px;
margin-botton: 20px;
margin-bottom: 20px;

}

Expand All @@ -15,4 +15,11 @@

}

.processing{
text-align: justify;
width: 200px;
height: 100px;
color: #000000;
}


1 change: 1 addition & 0 deletions app/models/photo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def perform(id, key)
photo.key = key
photo.remote_image_url = photo.image.direct_fog_url(with_path: true)
photo.save!
photo.update_column(:image_processed, true)
end
end

Expand Down
9 changes: 5 additions & 4 deletions app/views/comments/_comments.html.erb
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<% @comments.each do |comment| %>

<div class= "span8 offset2">
<div class="comment">
<div class = "row">

<div class= "span1 offset2">
<div class= "span1">
<% user = User.find(comment.user_id) %>
<%= link_to image_tag(user.gravatar_url), profile_path(user) %>
</div>


<div class= "span8">
<div class= "span7">
<strong><%= user.profile_name %></strong>
<p><%= comment.content %></p>
<div class="meta">
<div class="created">
<%= time_ago_in_words(comment.created_at) + " ago" %>
</div>
</div>


</div>
</div>
</div>

<% end %>
4 changes: 2 additions & 2 deletions app/views/comments/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= form_for [@commentable, @comment] do |f| %>
<%= simple_form_for [@commentable, @comment] do |f| %>
<% if @comment.errors.any? %>
<div class="error_messages">
<h2>Please correct the following errors.</h2>
Expand All @@ -14,6 +14,6 @@
<%= f.text_area :content, rows: 4, cols: 800 %>
</div>
<div class="actions">
<%= f.submit %>
<%= f.button :submit, 'Add Comment' %>
</div>
<% end %>
10 changes: 6 additions & 4 deletions app/views/photos/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<% title "Photos" %>
<div class = "page-header">
<h1>All of the Photos</h1>
</div>

<%= direct_upload_form_for @uploader do |f| %>
<p><%= f.file_field :image %></p>
Expand All @@ -16,7 +13,12 @@
<div id="home_page">
<% @photos.each do |photo| %>
<div class="item">
<div><%= link_to image_tag(photo.image_url(:thumb)), photo %></div>
<% if photo.image_processed? %>
<div><%= link_to image_tag(photo.image_url(:thumb)), photo %></div>
<% else %>
<div class="processing">Processing Image...</div>
<% end %>

</div>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/statuses/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
<%= f.input :content %>

<div class="form-actions">
<%= f.button :submit %>
<%= f.button :submit, 'Post Status' %>
</div>
<% end %>
5 changes: 5 additions & 0 deletions db/migrate/20130408170018_add_image_processed_to_photos.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddImageProcessedToPhotos < ActiveRecord::Migration
def change
add_column :photos, :image_processed, :boolean
end
end
11 changes: 6 additions & 5 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20130402024856) do
ActiveRecord::Schema.define(:version => 20130408170018) do

create_table "admins", :force => true do |t|
t.string "email", :default => "", :null => false
Expand Down Expand Up @@ -47,12 +47,13 @@

create_table "photos", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "image"
t.integer "user_id"
t.boolean "home_page", :default => false
t.integer "rank", :default => 1
t.boolean "home_page", :default => false
t.integer "rank"
t.boolean "image_processed"
end

add_index "photos", ["user_id"], :name => "index_photos_on_user_id"
Expand Down

0 comments on commit 0161851

Please sign in to comment.