Skip to content

Commit

Permalink
Messageboard grid: Incomplete rows up to 6 cells (#754)
Browse files Browse the repository at this point in the history
A few forums that use Thredded are configured with a very large width
limit for the messageboards page.

Our current styles only size up to two missing cells correctly (using
`before` and `after` pseudo-elements). This adds support for up to 5
missing cells in incomplete rows.
  • Loading branch information
glebm committed Oct 15, 2018
1 parent a3d901c commit 1bbd40a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/assets/stylesheets/thredded/components/_messageboard.scss
Expand Up @@ -157,6 +157,11 @@
}
}

// A helper class for sizing incomplete rows with more than two missing items.
.thredded--grid-sizer {
@extend %thredded--messageboards-cell-flex;
}

.thredded--messageboard {
@extend %thredded--messageboards-cell-flex;
margin-top: $margin-y;
Expand Down
2 changes: 2 additions & 0 deletions app/views/thredded/messageboards/_grid_sizers.html.erb
@@ -0,0 +1,2 @@
<%# Ensures that cells in incomplete rows are sized correctly (up to 5 missing cells). %>
<i class="thredded--grid-sizer"></i><i class="thredded--grid-sizer"></i><i class="thredded--grid-sizer"></i>
1 change: 1 addition & 0 deletions app/views/thredded/messageboards/index.html.erb
Expand Up @@ -15,6 +15,7 @@
<%= render partial: 'thredded/messageboards/messageboard',
collection: group.messageboards %>
<% end %>
<%= render partial: 'thredded/messageboards/grid_sizers' %>
</div>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/app/models/user.rb
Expand Up @@ -3,7 +3,7 @@
class User < ActiveRecord::Base
validates :name, presence: true

# Finds the post by its ID, or raises {Errors::UserNotFound}.
# Finds the user by their ID or raises {Errors::UserNotFound}.
# @param id [String, Number]
# @return [User]
# @raise [Errors::UserNotFound] if the user with the given ID does not exist.
Expand Down

0 comments on commit 1bbd40a

Please sign in to comment.