Skip to content

Commit

Permalink
Refactor extract articles view_counter_note partial
Browse files Browse the repository at this point in the history
  • Loading branch information
veganstraightedge committed Mar 2, 2025
1 parent 1653abb commit 532999f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/views/admin/articles/_article.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<%= render "/admin/articles/children_articles_badge", article: article %>
</div>

<div class="col-4 text-right">
<div class="col-4 text-end">
<%= number_with_delimiter article.page_views %> Views

<% if article.english? %>
Expand Down Expand Up @@ -44,7 +44,7 @@
<% end %>
</div>

<div class="col-md-2 d-none d-md-block text-right">
<div class="col-md-2 d-none d-md-block text-end">
<p class="m-0"><%= number_with_delimiter article.page_views %> Views</p>

<% if article.english? %>
Expand Down
3 changes: 3 additions & 0 deletions app/views/admin/articles/_view_counter_note.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="articles-footer text-end">
<p class="text-muted pt-1">View counts started on <code>2017-08-23</code></p>
</div>
6 changes: 2 additions & 4 deletions app/views/admin/articles/draft.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@
</div>
</div>
<% end %>
</div><!-- .articles -->

<div class="articles-footer row">
<p class="col text-right text-muted p2-3">View counts started on <code>2017-08-23</code></p>
</div>
</div>
<%= render 'view_counter_note' %>

<%= paginate @articles, views_prefix: 'admin', theme: 'twitter-bootstrap-4' %>
4 changes: 1 addition & 3 deletions app/views/admin/articles/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
<% end %>
</div><!-- .articles -->

<div class="articles-footer text-end">
<p class="text-muted pt-1">View counts started on <code>2017-08-23</code></p>
</div>
<%= render 'view_counter_note' %>

<%= paginate @articles, views_prefix: 'admin', theme: 'twitter-bootstrap-4' %>

0 comments on commit 532999f

Please sign in to comment.