Skip to content

Commit 7679552

Browse files
committed
fixed type column wrapping ion the user activity tab
1 parent 78c1f6e commit 7679552

2 files changed

Lines changed: 26 additions & 40 deletions

File tree

app/assets/stylesheets/utilities.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ span.spoiler {
359359
overflow-wrap: anywhere;
360360
}
361361

362+
.wrap-word {
363+
overflow-wrap: break-word;
364+
}
365+
362366
.nowrap {
363367
white-space: nowrap;
364368
}

app/views/users/_activity_items.html.erb

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,28 @@
1010
<tr class="<%= deleted_item?(i) ? 'deleted-content' : '' %>">
1111
<% if i.class == Post %>
1212
<% type_name = (i.question? ? 'Question' : (i.article? ? 'Article' : 'Answer')) %>
13-
<td>
14-
<span class="h-fw-bold">
15-
<%= type_name %>
16-
</span>
17-
</td>
13+
<td class="wrap-word"><span class="h-fw-bold"><%= type_name %></span></td>
1814
<td>&mdash;</td>
1915
<td class="h-fs-caption">
2016
<% working_title = i.answer? ? "A: #{i.parent.title}" : i.title %>
2117
<strong><%= working_title %></strong><br>
2218
<%= i.body_plain[0..300] + ((i.body_plain.length > 300) ? "..." : "") %><br>
23-
<%= link_to '(more)', generic_share_link(i), 'aria-label': "More information about #{type_name} #{working_title}" %>
19+
<%= link_to '(more)',
20+
generic_share_link(i),
21+
'aria-label': "More information about #{type_name} #{working_title}" %>
2422
</td>
2523
<td>&mdash;</td>
2624
<% elsif i.class == Comment %>
27-
<td>
28-
Comment
29-
</td>
30-
<td>
31-
<%= link_to "Post #" + i.post.id.to_s, generic_share_link(i.post) %>
32-
</td>
25+
<td class="wrap-word">Comment</td>
26+
<td><%= link_to "Post #" + i.post.id.to_s, generic_share_link(i.post) %></td>
3327
<td class="h-fs-caption">
34-
<%= i.content[0..300] + ((i.content.length > 300) ? "..." : "") %><br>
28+
<%= i.content[0..300] + ((i.content.length > 300) ? '...' : '') %><br>
3529
<%= link_to '(more)', comment_link(i), 'aria-label': 'More information about comment' %>
3630
</td>
3731
<td>&mdash;</td>
3832
<% elsif i.class == PostHistory %>
39-
<td>
40-
Edit
41-
</td>
42-
<td>
43-
<%= link_to "Post #" + i.post.id.to_s, generic_share_link(i.post) %>
44-
</td>
33+
<td class="wrap-word">Edit</td>
34+
<td><%= link_to "Post #" + i.post.id.to_s, generic_share_link(i.post) %></td>
4535
<td class="h-fs-caption">
4636
<% if i.comment %>
4737
<em><%= i.post_history_type.name.gsub("_", " ").capitalize %></em>:<br><%= i.comment %>
@@ -51,38 +41,32 @@
5141
</td>
5242
<td>&mdash;</td>
5343
<% elsif i.class == SuggestedEdit %>
54-
<td>
55-
Suggested Edit
56-
</td>
57-
<td>
58-
<%= link_to "Post #" + i.post.id.to_s, generic_share_link(i.post) %>
59-
</td>
44+
<td class="wrap-word">Suggested Edit</td>
45+
<td><%= link_to "Post #" + i.post.id.to_s, generic_share_link(i.post) %></td>
6046
<td class="h-fs-caption">
6147
<em>Suggested edit</em>:<br><%= i.comment %><br>
62-
<%= link_to '(more)', suggested_edit_url(i.id), 'aria-label': "More information about suggested edit #{i.comment}" %>
48+
<%= link_to '(more)',
49+
suggested_edit_url(i.id),
50+
'aria-label': "More information about suggested edit #{i.comment}" %>
6351
</td>
6452
<td>
65-
<%= (i.pending? ? "pending" : (i.approved? ? "helpful" : "declined")) %>
53+
<%= (i.pending? ? 'pending' : (i.approved? ? 'helpful' : 'declined')) %>
6654
</td>
6755
<% elsif mod && i.class == ModWarning %>
68-
<td>
69-
<span class="h-fw-bold h-c-red-700">Warning</span>
70-
</td>
56+
<td class="wrap-word"><span class="h-fw-bold h-c-red-700">Warning</span></td>
7157
<td>&mdash;</td>
7258
<td class="h-fs-caption">
7359
<%= i.body[0..300] + ((i.body.length > 300) ? "..." : "") %>
7460
</td>
7561
<td>&mdash;</td>
7662
<% elsif mod && i.class == Flag %>
63+
<td class="wrap-word">Flag</td>
7764
<td>
78-
Flag
79-
</td>
80-
<td>
81-
<% if i.post_type == 'Post' %>
65+
<% if i.post_type == 'Post' %>
8266
<%= link_to "Post #" + i.post.id.to_s, generic_share_link(i.post)%>
83-
<% elsif i.post_type == 'Comment' %>
84-
<%= link_to "Comment thread: " + i.post.comment_thread.title, comment_link(i.post) %>
85-
<% end %>
67+
<% elsif i.post_type == 'Comment' %>
68+
<%= link_to "Comment thread: " + i.post.comment_thread.title, comment_link(i.post) %>
69+
<% end %>
8670
</td>
8771
<td class="h-fs-caption">
8872
<%= i.reason[0..300] + ((i.reason.length > 300) ? "..." : "") %><br>
@@ -91,9 +75,7 @@
9175
<%= i.status || "pending" %>
9276
</td>
9377
<% else %>
94-
<td>
95-
<span class="badge is-tag is-muted">Unknown</span>
96-
</td>
78+
<td class="wrap-word"><span class="badge is-tag is-muted">Unknown</span></td>
9779
<td>&mdash;</td>
9880
<td><%= i.class %></td>
9981
<td>&mdash;</td>

0 commit comments

Comments
 (0)