Sitelet https://github.com/errbit/errbit/pull/3167/files
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class UsersController < ApplicationController
layout "errbit"
layout "errbit", except: :index
Comment thread
biow0lf marked this conversation as resolved.

def index
@users = policy_scope(User)
Expand Down
6 changes: 3 additions & 3 deletions app/views/kaminari/_first_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="first">
<%= link_to_unless current_page.first?, t("views.pagination.first").html_safe, url, remote: remote %>
</span>
<li class="page-item">
<%= link_to_unless current_page.first?, t("views.pagination.first").html_safe, url, remote: remote, class: "page-link" %>
</li>
4 changes: 3 additions & 1 deletion app/views/kaminari/_gap.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page gap"><%= t("views.pagination.truncate").html_safe %></span>
<li class="page-item disabled">
<%= link_to t("views.pagination.truncate").html_safe, "#", class: "page-link" %>
Comment thread
biow0lf marked this conversation as resolved.
</li>
6 changes: 3 additions & 3 deletions app/views/kaminari/_last_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="last">
<%= link_to_unless current_page.last?, t("views.pagination.last").html_safe, url, remote: remote %>
</span>
<li class="page-item">
<%= link_to_unless current_page.last?, t("views.pagination.last").html_safe, url, remote: remote, class: "page-link" %>
</li>
6 changes: 3 additions & 3 deletions app/views/kaminari/_next_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="next">
<%= link_to_unless current_page.last?, t("views.pagination.next").html_safe, url, rel: "next", remote: remote %>
</span>
<li class="page-item">
<%= link_to_unless current_page.last?, t("views.pagination.next").html_safe, url, rel: "next", remote: remote, class: "page-link" %>
</li>
12 changes: 9 additions & 3 deletions app/views/kaminari/_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page<%= " current" if page.current? %>">
<%= link_to_unless page.current?, page, url, {remote: remote, rel: page.rel} %>
</span>
<% if page.current? %>
<li class="page-item active">
<%= content_tag :a, page, data: { remote: remote }, rel: page.rel, class: "page-link" %>
Comment thread
biow0lf marked this conversation as resolved.
</li>
<% else %>
<li class="page-item">
<%= link_to page, url, remote: remote, rel: page.rel, class: "page-link" %>
</li>
<% end %>
28 changes: 14 additions & 14 deletions app/views/kaminari/_paginator.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
remote: data-remote
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<nav class="pagination" role="navigation" aria-label="pager">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.display_tag? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<% unless current_page.out_of_range? %>
<%= paginator.render do %>
<nav>
Comment thread
biow0lf marked this conversation as resolved.
<ul class="pagination">
Comment thread
biow0lf marked this conversation as resolved.
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| %>
<% if page.left_outer? || page.right_outer? || page.inside_window? %>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end %>
<% end %>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
Comment thread
biow0lf marked this conversation as resolved.
<% end %>
</ul>
</nav>
<% end -%>
<% end %>
6 changes: 3 additions & 3 deletions app/views/kaminari/_prev_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="prev">
<%= link_to_unless current_page.first?, t("views.pagination.previous").html_safe, url, rel: "prev", remote: remote %>
</span>
<li class="page-item">
<%= link_to_unless current_page.first?, t("views.pagination.previous").html_safe, url, rel: "prev", remote: remote, class: "page-link" %>
</li>
71 changes: 41 additions & 30 deletions app/views/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,47 @@
</span>
<% end %>

<table class="users">
<thead>
<tr>
<% if Errbit::Config.use_gravatar %>
<th>&nbsp;</th>
<% end %>
<th><%= t(".name") %></th>
<% if Errbit::Config.user_has_username %>
<th><%= t(".username") %></th>
<% end %>
<th class="main"><%= t(".email") %></th>
<th><%= t(".admin") %></th>
</tr>
</thead>
<div class="row">
<div class="col">

<tbody>
<% @users.each do |user| %>
<tr class="user_list">
<% if Errbit::Config.use_gravatar %>
<td><%= gravatar_tag(user.email, s: 24) %></td>
<% end %>
<td class="nowrap"><%= link_to user.name, user_path(user) %></td>
<% if Errbit::Config.user_has_username %>
<td><%= user.username %></td>
<table class="table table-striped table-hover table-bordered">
<thead>
<tr>
<% if Errbit::Config.use_gravatar %>
<th>&nbsp;</th>
<% end %>
<th><%= t(".name") %></th>
<% if Errbit::Config.user_has_username %>
<th><%= t(".username") %></th>
<% end %>
<th><%= t(".email") %></th>
<th><%= t(".admin") %></th>
</tr>
</thead>

<tbody>
<% @users.each do |user| %>
<tr>
<% if Errbit::Config.use_gravatar %>
<td><%= gravatar_tag(user.email, s: 24) %></td>
<% end %>
<td><%= link_to user.name, user_path(user) %></td>
<% if Errbit::Config.user_has_username %>
<td><%= user.username %></td>
<% end %>
<td><%= user.email %></td>
<td><%= user.admin? ? t(".admin_yes") : t(".admin_no") %></td>
</tr>
<% end %>
<td><%= user.email %></td>
<td><%= user.admin? ? t(".admin_yes") : t(".admin_no") %></td>
</tr>
<% end %>
</tbody>
</table>
</tbody>
</table>

</div>
</div>


<%= paginate @users %>
<div class="row">
<div class="col">
<%= paginate @users %>
</div>
</div>
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ en:
title: "Errbit"
errbit: "Errbit"
powered_html: "Powered by %{link} : the open source error catcher."
errbit: # TODO: remove after porting to Bootstrap 5
title: "Errbit"
errbit: "Errbit"
powered_html: "Powered by %{link} : the open source error catcher."

shared:
navigation:
Expand Down
Loading