Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/2561'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Mar 18, 2020
2 parents 33d70b3 + 5fdada2 commit a9c4b03
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 33 deletions.
13 changes: 4 additions & 9 deletions app/assets/stylesheets/common.scss
Expand Up @@ -2048,16 +2048,11 @@ a.button {
}
}

/* Rules for doing distinct colour of alternate table rows */
/* Customise the background colour of striped tables */

.table0,
.item0 {
background: $offwhite;
}

.table1,
.item1 {
background: #fff;
.table-striped > tbody > tr:nth-child(2n+1) > td,
.table-striped > tbody > tr:nth-child(2n+1) > th {
background-color: $offwhite;
}

/* Rules for OpenID logo */
Expand Down
5 changes: 2 additions & 3 deletions app/views/diary_entries/comments.html.erb
Expand Up @@ -2,7 +2,7 @@
<h1><%= t(".has_commented_on", :display_name => @user.display_name) %></h1>
<% end %>

<table class="messages" width="100%">
<table class="table table-striped" width="100%">
<thead>
<tr>
<th width="25%"><%= t ".post" %></th>
Expand All @@ -11,8 +11,7 @@
</tr>
</thead>
<% @comments.each do |comment| -%>
<% cl = cycle("table0", "table1") %>
<tr class="<%= cl %><%= " deemphasize" unless comment.visible? %>">
<tr class="<%= "deemphasize" unless comment.visible? %>">
<td width="25%"><%= link_to comment.diary_entry.title, diary_entry_path(comment.diary_entry.user, comment.diary_entry) %></td>
<td width="25%"><span title="<%= l comment.created_at, :format => :friendly %>"><%= time_ago_in_words(comment.created_at, :scope => :'datetime.distance_in_words_ago') %></span></td>
<td width="50%" class="richtext"><%= comment.body.to_html %></td>
Expand Down
5 changes: 2 additions & 3 deletions app/views/traces/_trace.html.erb
@@ -1,6 +1,5 @@
<tr>
<% cl = cycle("table0", "table1") %>
<td class="<%= cl %>">
<td>
<% if Settings.status != "gpx_offline" %>
<% if trace.inserted %>
<a href="<%= url_for :controller => "traces", :action => "show", :id => trace.id, :display_name => trace.user.display_name %>"><img src="<%= url_for :controller => "traces", :action => "icon", :id => trace.id, :display_name => trace.user.display_name %>" border="0" alt="" /></a>
Expand All @@ -9,7 +8,7 @@
<% end %>
<% end %>
</td>
<td class="<%= cl %>"><%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
<td><%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
<span class="trace_summary" title="<%= trace.timestamp %>"> ...
<% if trace.inserted %>
(<%= t ".count_points", :count => trace.size %>)
Expand Down
2 changes: 1 addition & 1 deletion app/views/traces/index.html.erb
Expand Up @@ -25,7 +25,7 @@
<% if @traces.size > 0 %>
<%= render :partial => "trace_paging_nav" %>

<table id="trace_list" cellpadding="3">
<table id="trace_list" class="table table-borderless table-striped">
<thead>
<tr>
<th></th>
Expand Down
18 changes: 8 additions & 10 deletions app/views/user_blocks/_block.html.erb
@@ -1,24 +1,22 @@
<tr>
<% c1 = cycle("table0", "table1") %>
<% if show_user_name %>
<td class="<%= c1 %>"><%= link_to h(block.user.display_name), user_path(block.user) %></td>
<td><%= link_to h(block.user.display_name), user_path(block.user) %></td>
<% end %>
<% if show_creator_name %>
<td class="<%= c1 %>"><%= link_to h(block.creator.display_name), user_path(block.creator) %></td>
<td><%= link_to h(block.creator.display_name), user_path(block.creator) %></td>
<% end %>
<td class="<%= c1 %>"><%= h truncate(block.reason) %></td>
<td class="<%= c1 %>"><%= h block_status(block) %></td>
<td class="<%= c1 %>">
<td><%= h truncate(block.reason) %></td>
<td><%= h block_status(block) %></td>
<td>
<% if block.revoker_id.nil? %>
<%= t(".not_revoked") %>
<% else %>
<%= link_to h(block.revoker.display_name), user_path(block.revoker) %>
<% end %>
</td>
<td class="<%= c1 %>"><%= link_to t(".show"), block %></td>
<td class="<%= c1 %>"><% if current_user and current_user.id == block.creator_id and block.active? %><%= link_to t(".edit"), edit_user_block_path(block) %><% end %></td>
<td><%= link_to t(".show"), block %></td>
<td><% if current_user and current_user.id == block.creator_id and block.active? %><%= link_to t(".edit"), edit_user_block_path(block) %><% end %></td>
<% if show_revoke_link %>
<td class="<%= c1 %>"><% if block.active? %><%= link_to t(".revoke"), :controller => "user_blocks", :action => "revoke", :id => block.id %><% end %></td>
<td><% if block.active? %><%= link_to t(".revoke"), :controller => "user_blocks", :action => "revoke", :id => block.id %><% end %></td>
<% end %>
</tr>
2 changes: 1 addition & 1 deletion app/views/user_blocks/_blocks.html.erb
@@ -1,4 +1,4 @@
<table id="block_list" cellpadding="3">
<table id="block_list" class="table table-borderless table-striped table-sm">
<thead>
<tr>
<% if show_user_name %>
Expand Down
4 changes: 1 addition & 3 deletions app/views/users/_user.html.erb
@@ -1,6 +1,4 @@
<% cl = cycle("table0", "table1") %>

<tr class="<%= cl %>">
<tr>
<td>
<%= user_thumbnail(user) %>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/index.html.erb
Expand Up @@ -13,7 +13,7 @@
<%= hidden_field_tag :status, params[:status] if params[:status] %>
<%= hidden_field_tag :ip, params[:ip] if params[:ip] %>
<%= hidden_field_tag :page, params[:page] if params[:page] %>
<table id="user_list">
<table id="user_list" class="table table-borderless table-striped">
<thead>
<tr>
<td colspan="2">
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/diary_entries_controller_test.rb
Expand Up @@ -873,7 +873,7 @@ def test_comments
get :comments, :params => { :display_name => user.display_name }
assert_response :success
assert_template :comments
assert_select "table.messages" do
assert_select "table.table-striped" do
assert_select "tr", :count => 1 # header, no comments
end

Expand All @@ -883,7 +883,7 @@ def test_comments
get :comments, :params => { :display_name => other_user.display_name }
assert_response :success
assert_template :comments
assert_select "table.messages" do
assert_select "table.table-striped" do
assert_select "tr", :count => 2 # header and one comment
end

Expand Down

0 comments on commit a9c4b03

Please sign in to comment.