Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! I cleaned up your code for you! #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
2 changes: 1 addition & 1 deletion app/controllers/account_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def signup
rescue ActiveRecord::RecordInvalid
render :action => 'signup'
end

def logout
self.current_user.forget_me if logged_in?
cookies.delete :auth_token
Expand Down
6 changes: 3 additions & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def authenticated?(password)
end

def remember_token?
remember_token_expires_at && Time.now.utc < remember_token_expires_at
remember_token_expires_at && Time.now.utc < remember_token_expires_at
end

# These create and unset the fields required for remembering users between browser closes
Expand All @@ -51,13 +51,13 @@ def forget_me
end

protected
# before filter
# before filter
def encrypt_password
return if password.blank?
self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--") if new_record?
self.crypted_password = encrypt(password)
end

def password_required?
crypted_password.blank? || !password.blank?
end
Expand Down
94 changes: 47 additions & 47 deletions app/views/account/index.rhtml
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
<h1>In the Caboose.</h1>

<% content_for 'poem' do -%>
"Train delayed? and what's to say?"
"Blocked by last night's snow they say."
Seven hours or so to wait;
Well, that's pleasant! but there's the freight.
Depot loafing no one fancies,
We'll try the caboose and take our chances.
Cool this morning in Watertown,
Somewhat frosty___mercury down;
Enter caboose___roaring fire,
With never an air-hole; heat so dire
That we shrivel and pant; we are roasted through-
Outside, thermometer thirty-two.
We start with a jerk and suddenly stop.
"What's broke?" says one; another "What's up?",
"Oh, nothing," they answer, "That's our way:
You must stand the jerking, sorry to say."
We "stand it" with oft this painful thought:
Are our heads on yet, or are they not?
Comrades in misery___let me see;
Girl like a statue opposite me;
Back and forth the others jostle___
She never winks, nor moves a muscle;
See her, as she sits there now;
She's "well balanced," anyhow.
Woman in trouble, tearful eyes,
Sits by the window, softly cries,
Pity___for griefs we may not know,
For breasts that ache, for tears that flow,
Though we know not why. Her eyelids red
Tell a sorrowful tale___some hope is dead.
Man who follows the Golden Rule,
And lends his papers___a pocket full,
Has a blank book___once in a minute
Has an idea, and writes it in it.
Guess him? Yes, of course I can,
He's a___well___a newspaper man.
Blue-eyed fairy, wrapped in fur;
Sweet young mother tending her.
Fairy thinks it's "awful far,"
Wants to get off this "naughty car."
So do we, young golden-hair;
"Train delayed? and what's to say?"
"Blocked by last night's snow they say."
Seven hours or so to wait;
Well, that's pleasant! but there's the freight.
Depot loafing no one fancies,
We'll try the caboose and take our chances.

Cool this morning in Watertown,
Somewhat frosty___mercury down;
Enter caboose___roaring fire,
With never an air-hole; heat so dire
That we shrivel and pant; we are roasted through-
Outside, thermometer thirty-two.

We start with a jerk and suddenly stop.
"What's broke?" says one; another "What's up?",
"Oh, nothing," they answer, "That's our way:
You must stand the jerking, sorry to say."
We "stand it" with oft this painful thought:
Are our heads on yet, or are they not?

Comrades in misery___let me see;
Girl like a statue opposite me;
Back and forth the others jostle___
She never winks, nor moves a muscle;
See her, as she sits there now;
She's "well balanced," anyhow.

Woman in trouble, tearful eyes,
Sits by the window, softly cries,
Pity___for griefs we may not know,
For breasts that ache, for tears that flow,
Though we know not why. Her eyelids red
Tell a sorrowful tale___some hope is dead.

Man who follows the Golden Rule,
And lends his papers___a pocket full,
Has a blank book___once in a minute
Has an idea, and writes it in it.
Guess him? Yes, of course I can,
He's a___well___a newspaper man.

Blue-eyed fairy, wrapped in fur;
Sweet young mother tending her.
Fairy thinks it's "awful far,"
Wants to get off this "naughty car."
So do we, young golden-hair;
All this crowd are with you there!
<% end -%>

Expand Down
24 changes: 12 additions & 12 deletions app/views/group/showrunentries.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Sorry, there are not any records for this run.
<th> Relevance </th>
<th> Message </th>
</tr>
<%

<%
count=1
for relImage in @entries
cur_t = @new_entries[count-1]

case cur_t[0] #gives the relevance for this judgment
when nil
color = 'white' #white
Expand All @@ -39,27 +39,27 @@ Sorry, there are not any records for this run.
color = 'yellow' #Database Error
end
%>





<tr id="row_<%= relImage.id %>" BGCOLOR="<%= color %>">
<td ><%= relImage.rank %></td>
<td><%= relImage.topic.iclef_topic_number %></td>
<td ><%= link_to(image_tag(relImage.record.image_full_path, html_options={:size =>"70x70"}), :controller => "record", :action => "show", :id => relImage.record.id)%> </td>
<td><%= relImage.record.title %></td>
<td><%= relImage.record.caption %></td>
<td><%= relImage.record.caption %></td>
<td><%= relImage.record.parsed_caption %></td>
<td align="center" ><%= number_with_precision(relImage.score,2) %></td>
<td><%= cur_t[0] %></td>
<td><%= message %></td>
</tr>
<%
<%
count= count+1
end
end
%>

</table>
<% end %>
<%= will_paginate @entries %>
26 changes: 13 additions & 13 deletions app/views/group/showrunentries.rhtml.wjh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Sorry, there are not any records for this run.

<% else %>

<table border="1" width="100%" >
<tr>
<th> Rank </th>
Expand All @@ -17,12 +17,12 @@ Sorry, there are not any records for this run.
<th> Relevance </th>
<th> Message </th>
</tr>
<%

<%
count=1
for relImage in @entries
cur_t = @new_entries[count-1]

case cur_t[0] #gives the relevance for this judgment
when nil
color = 'white' #white
Expand All @@ -40,27 +40,27 @@ Sorry, there are not any records for this run.
color = 'yellow' #Database Error
end
%>





<tr id="row_<%= relImage.id %>" BGCOLOR="<%= color %>">
<td ><%= relImage.rank %></td>
<td><%= relImage.topic.iclef_topic_number %></td>
<td ><%= link_to(image_tag(relImage.record.image_full_path, html_options={:size =>"70x70"}), :controller => "record", :action => "show", :id => relImage.record.id)%> </td>
<td><%= relImage.record.title %></td>
<td><%= relImage.record.caption %></td>
<td><%= relImage.record.caption %></td>
<td><%= relImage.record.parsed_caption %></td>
<td align="center" ><%= number_with_precision(relImage.score,2) %></td>
<td><%= cur_t[0] %></td>
<td><%= message %></td>
</tr>
<%
<%
count= count+1
end
end
%>

</table>
<% end %>
<%= will_paginate @entries %>
10 changes: 5 additions & 5 deletions app/views/group/showruntopics.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<th> Topic No. </th>
<th> Total Number of Images </th>
</tr>



<%

<%
for r in @runEntriesByTopic
%>
%>

<tr>
<td align = "center" ><a href="<%= url_for :controller=> :group, :action => :showrunentries, :topic_id=> r[3], :run_name_id => @runID %>" target='footer' onClick="top.header.location='<%= url_for :controller=> :group, :action => :showgroupheader, :topic_id=> r[3] %>';"><%= r[0] %></a></td>
<td align = "center" ><%= r[2] %></td>

</tr>
<%
end
<%
end
%>
</table>
10 changes: 5 additions & 5 deletions app/views/group/showruntopics.rhtml.wjh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<th> Topic No. </th>
<th> Total Number of Images </th>
</tr>



<%

<%
for r in @runEntriesByTopic
%>
%>

<tr>
<td align = "center" ><%= link_to r[0], :action => 'showrunentries', :topic_id => r[3], :run_name_id => @runID %></td>
<td align = "center" ><%= r[2] %></td>

</tr>
<%
end
<%
end
%>
</table>
Loading