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

issue_4211 Record ip addresses on new works #1980

Merged
merged 8 commits into from
Jan 9, 2015

Conversation

zz9pzza
Copy link
Contributor

@zz9pzza zz9pzza commented Jan 6, 2015

This is lacking css, and I want to see if it passes our tests however I think it looks reasonable.

https://code.google.com/p/otwarchive/issues/detail?id=4211

@@ -246,6 +246,7 @@ def new
@series = current_user.series.uniq
@unposted = current_user.unposted_work

@work.ip_address= request.remote_ip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know what I'm going to say... spaces on either sign of operators, please. @work.ip_address = request.remote_ip, in both places.

<dd class="stats">
<% end %><!-- end of cache -->

<%= work_meta_list(@work, @chapter) %>
<% if logged_in_as_admin? %>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there are two <dt> elements here -- the one on line 68 that contains the actual IP address data should be changed to a <dd> (the closing tag on line 74 is correct). Also, <dt> and <dd> elements can only ever have the <dl> element as the direct parent, but right now, their parent is a <dd> element. They'll need to be moved outside the stats <dd> so their parent element becomes the <dl> that surrounds the entire meta section.

For class names, we try to use single words separated by spaces rather than smashing words together. <dt class="ip"> and <dd class="ip"> would be sufficient here.

Lastly, there are some indenting issues -- so once you put all the changes in, it should be like this (starting on line 63):

  <%= work_meta_list(@work, @chapter) %>
</dd>
<% if logged_in_as_admin? %>
  <dt class="ip">
    <%= ts('IP Address:') %>
  </dt>
  <dd class="ip">
    <% if @work.ip_address.nil? %>
      <%= ts('No address recorded') %>
    <% else %>
      <%= @work.ip_address %>
    <% end %>
  </dd>
<% end %>

<dt class="ip">
<%= ts('IP Address:') %>
</dt>
<dd class="ip">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look because you mentioned CSS problems, and it looks okay to me:
ip_address_4211

Which browser are you having a problem with, or what do you want it to look like?

Also, the indenting here is still a bit wrong. The if/else/end is inside the dd, so everything belonging to it needs to move over two more spaces:

<dd class="ip">
  <% if @work.ip_address.nil? %>
    <%= ts('No address recorded') %>
  <% else %>
    <%= @work.ip_address %>
  <% end %>
</dd>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do as you ask, not convinced it feels right though :) as the it then are not seen in the page that is outputted.

remove_index "works", "ip_address"
remove_column :works, :ip_address
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at body end.

def self.down
remove_index "works", "ip_address"
remove_column :works, :ip_address
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end at 10, 3 is not aligned with def at 7, 2

@zz9pzza zz9pzza changed the title issue_4211 Record ip addresses on new works, this is lacking css issue_4211 Record ip addresses on new works Jan 8, 2015
sarken added a commit that referenced this pull request Jan 9, 2015
issue_4211 Record ip addresses on new works
@sarken sarken merged commit 9fa5dd9 into otwcode:master Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants