Files
danbooru/app/helpers/components_helper.rb
evazion 1e778dbbf6 posts: factor out post navbar into component.
* Factor out the post navbar into a component. The post navbar is the
  part of the post containing the current search, the list of pools, and
  the list of favgroups, along with next/prev navigation links.

* Change navbar markup: remove various unused CSS classes/IDs, change
  pools to use same markup as favgroups, replace nested <div>'s with
  flat <ul>/<li> list.

* Use CSS to truncate long searches/pool names/favgroup names if they're
  too wide for the screen (especially on mobile).
2021-01-29 21:46:21 -06:00

26 lines
681 B
Ruby

module ComponentsHelper
def post_preview(post, **options)
render PostPreviewComponent.new(post: post, **options)
end
def post_previews_html(posts, **options)
render PostPreviewComponent.with_collection(posts, **options)
end
def render_comment(comment, **options)
render CommentComponent.new(comment: comment, **options)
end
def render_comment_section(post, **options)
render CommentSectionComponent.new(post: post, **options)
end
def render_post_votes(post, **options)
render PostVotesComponent.new(post: post, **options)
end
def render_post_navbar(post, **options)
render PostNavbarComponent.new(post: post, **options)
end
end