diff --git a/app/controllers/management/users_controller.rb b/app/controllers/management/users_controller.rb index 61eaf953179d25dd84bdeaf0c1414021824dde03..ba214e2a073b7a7c1cede017a36c210dbdf8dad4 100644 --- a/app/controllers/management/users_controller.rb +++ b/app/controllers/management/users_controller.rb @@ -3,7 +3,7 @@ class Management::UsersController < ManagementController before_action :set_roles, only: [:new, :edit] def index - @users = User.includes(:roles).all + @users = User.includes(:roles).all.order(:name).page(params[:page]).per(params[:limit]) end # GET /users/1 @@ -79,6 +79,7 @@ class Management::UsersController < ManagementController @curators << user unless !(user.roles[0].name == "curator") end end + @curators = Kaminari.paginate_array(@curators).page(params[:page]).per(params[:limit]) end def admins @@ -89,6 +90,7 @@ class Management::UsersController < ManagementController @admins << user unless !(user.roles[0].name == "admin") end end + @admins = Kaminari.paginate_array(@admins).page(params[:page]).per(params[:limit]) end private diff --git a/app/views/kaminari/management_theme/_first_page.html.erb b/app/views/kaminari/management_theme/_first_page.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..36e26a3d4f2bb4d4844ca4d30d984624f58e74a9 --- /dev/null +++ b/app/views/kaminari/management_theme/_first_page.html.erb @@ -0,0 +1,3 @@ +<li> + <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %> +<li> diff --git a/app/views/kaminari/management_theme/_gap.html.erb b/app/views/kaminari/management_theme/_gap.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..6d3a1490ca4991f2849daccd5c11a3da0ca604d5 --- /dev/null +++ b/app/views/kaminari/management_theme/_gap.html.erb @@ -0,0 +1,3 @@ +<li class='disabled'> + <%= content_tag :a, raw(t 'views.pagination.truncate') %> +</li> diff --git a/app/views/kaminari/management_theme/_last_page.html.erb b/app/views/kaminari/management_theme/_last_page.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..fb619eaa79a18f5f76c0e36186ec6fb6ec9e3885 --- /dev/null +++ b/app/views/kaminari/management_theme/_last_page.html.erb @@ -0,0 +1,3 @@ +<li> + <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %> +</li> diff --git a/app/views/kaminari/management_theme/_next_page.html.erb b/app/views/kaminari/management_theme/_next_page.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..15e10e4f92be81ca070cc94fa7e35483a9754db6 --- /dev/null +++ b/app/views/kaminari/management_theme/_next_page.html.erb @@ -0,0 +1,3 @@ +<li> + <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %> +</li> diff --git a/app/views/kaminari/management_theme/_page.html.erb b/app/views/kaminari/management_theme/_page.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..87c6206f8d903b0e74dbbb784509c6027ff67f35 --- /dev/null +++ b/app/views/kaminari/management_theme/_page.html.erb @@ -0,0 +1,9 @@ +<% if page.current? %> + <li class='ls-active'> + <%= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)) %> + </li> +<% else %> + <li> + <%= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)) %> + </li> +<% end %> diff --git a/app/views/kaminari/management_theme/_paginator.html.erb b/app/views/kaminari/management_theme/_paginator.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..a930b0f92937f0aaf4493069c1a8089749ed75ea --- /dev/null +++ b/app/views/kaminari/management_theme/_paginator.html.erb @@ -0,0 +1,15 @@ +<%= paginator.render do -%> + <ul class="ls-pagination"> + <%= 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? %> + </ul> +<% end -%> diff --git a/app/views/kaminari/management_theme/_prev_page.html.erb b/app/views/kaminari/management_theme/_prev_page.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..d94a50a9654e0cd63bd77d728408b8aa696e380c --- /dev/null +++ b/app/views/kaminari/management_theme/_prev_page.html.erb @@ -0,0 +1,3 @@ +<li> + <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %> +</li> diff --git a/app/views/management/carousels/edit.html.erb b/app/views/management/carousels/edit.html.erb index f4fbf007c6561345b05e782ffd7b72154ea73bc0..bf1d1e17a834ca36414cef22924d8b6643677a1c 100644 --- a/app/views/management/carousels/edit.html.erb +++ b/app/views/management/carousels/edit.html.erb @@ -1,5 +1,5 @@ -<h1 class="ls-title-intro ls-ico-users">Carrossel</h1> +<h1 class="ls-title-intro ls-ico-star">Carrossel</h1> <ol class="ls-breadcrumb"> <li><%= link_to 'Carrosséis', management_carousels_path %></li> diff --git a/app/views/management/carousels/index.html.erb b/app/views/management/carousels/index.html.erb index 6ea5335f18d6e18d5b0350be8931569ae2f69771..8df788ba5e0cb830f41c8860c937775ccede9179 100644 --- a/app/views/management/carousels/index.html.erb +++ b/app/views/management/carousels/index.html.erb @@ -1,5 +1,5 @@ -<h1 class="ls-title-intro ls-ico-users">Carrossel</h1> +<h1 class="ls-title-intro ls-ico-star">Carrossel</h1> <a href="<%= new_management_carousel_path %>" class="ls-btn-primary" aria-expanded="false" role="combobox">Cadastrar diff --git a/app/views/management/carousels/new.html.erb b/app/views/management/carousels/new.html.erb index 23ab3e1cca473ef4c66e7ac22f4b3b74ed3b770e..df7cf6f8ae9ee49c9717396b442b9944f744b315 100644 --- a/app/views/management/carousels/new.html.erb +++ b/app/views/management/carousels/new.html.erb @@ -1,5 +1,5 @@ -<h1 class="ls-title-intro ls-ico-users">Carrossel</h1> +<h1 class="ls-title-intro ls-ico-star">Carrossel</h1> <ol class="ls-breadcrumb"> <li><%= link_to 'Carrosséis', management_carousels_path %></li> diff --git a/app/views/management/complaints/index.html.erb b/app/views/management/complaints/index.html.erb index 8fec592834e1440f070463db171b7562e8036ab0..f90655da6f963dc13b3716bee0150719e64eee8a 100644 --- a/app/views/management/complaints/index.html.erb +++ b/app/views/management/complaints/index.html.erb @@ -1,4 +1,4 @@ -<h1 class="ls-title-intro ls-ico-stats">Denúncias</h1> +<h1 class="ls-title-intro ls-ico-bullhorn">Denúncias</h1> <div class="ls-box-filter"> diff --git a/app/views/management/complaints/show.html.erb b/app/views/management/complaints/show.html.erb index 4a706713209327af4adebe76f2c2e9165a0247ec..9719fd761ef1c8a66604b581717025615da13082 100644 --- a/app/views/management/complaints/show.html.erb +++ b/app/views/management/complaints/show.html.erb @@ -1,4 +1,4 @@ -<h1 class="ls-title-intro ls-ico-stats">Denúncias</h1> +<h1 class="ls-title-intro ls-ico-bullhorn">Denúncias</h1> <div class="ls-box-filter"> @@ -123,4 +123,4 @@ </div> -</div> \ No newline at end of file +</div> diff --git a/app/views/management/institutions/index.html.erb b/app/views/management/institutions/index.html.erb index d7e667fa6d655beed2489b5764729a3bf04d8891..a1638dc956e28344aebd22131158ae904e3a3730 100644 --- a/app/views/management/institutions/index.html.erb +++ b/app/views/management/institutions/index.html.erb @@ -1,4 +1,4 @@ -<h1 class="ls-title-intro ls-ico-users">Instituições</h1> +<h1 class="ls-title-intro ls-ico-list2">Instituições</h1> <a href="<%= new_management_institution_path %>" class="ls-btn-primary" aria-expanded="false" role="combobox">Cadastrar nova</a> diff --git a/app/views/management/institutions/new.html.erb b/app/views/management/institutions/new.html.erb index e5100e69aed9e334e42a69a9d9c0af04fa6db0d8..0db30d33ca24851bced997873390bcc901f2d4b3 100644 --- a/app/views/management/institutions/new.html.erb +++ b/app/views/management/institutions/new.html.erb @@ -1,4 +1,4 @@ -<h1 class="ls-title-intro ls-ico-users">Instituição</h1> +<h1 class="ls-title-intro ls-ico-list2">Instituição</h1> <ol class="ls-breadcrumb"> <li><%= link_to 'Instituição', management_institutions_path %></li> diff --git a/app/views/management/users/admins.html.erb b/app/views/management/users/admins.html.erb index 87d84d49a6d264e1db68bf48d2ba51f1ee540664..2c8834891beb4ac3f6e0be0747762ef3c6145e00 100644 --- a/app/views/management/users/admins.html.erb +++ b/app/views/management/users/admins.html.erb @@ -83,29 +83,27 @@ </table> <div class="ls-pagination-filter"> - <ul class="ls-pagination"> - <li><a href="#">« Anterior</a></li> - <li class="ls-active"><a href="#">1</a></li> - <li><a href="#">2</a></li> - <li><a href="#">3</a></li> - <li><a href="#" class="hidden-xs">4</a></li> - <li><a href="#" class="hidden-xs">5</a></li> - <li><a href="#">Próximo »</a></li> - </ul> - - <div class="ls-filter-view"> - <label for=""> - Exibir - <div class="ls-custom-select ls-field-sm"> - <select name="" id=""> - <option value="10">10</option> - <option value="30">30</option> - <option value="50">50</option> - <option value="100">100</option> - </select> - </div> - Ãtens por página - </label> - </div> + <%= paginate @admins, :theme => 'management_theme', :window => 2 %> + <div class="ls-filter-view"> + <label for=""> + Exibir   + <div class="ls-custom-select ls-field-sm"> + <%= form_tag ("admins"), method: :get, id: "limit_form" do %> + <%= select_tag :limit, options_for_select([25, 50, 100, 150], selected: params[:limit] || 25) %> + <%end%> + </div> +   itens por página. + </label> + </div> </div> + <% end %> + +<script type="text/javascript" > + $(function(){ + $('#limit').change( + function() { + $('#limit_form').submit(); + }); + }); +</script> diff --git a/app/views/management/users/curators.html.erb b/app/views/management/users/curators.html.erb index 720b04eeac6bdbacc015bf930715b12d7ded22a7..10e0ec39e43ebee301b77428ecf59dbd3ec72248 100644 --- a/app/views/management/users/curators.html.erb +++ b/app/views/management/users/curators.html.erb @@ -83,29 +83,27 @@ </table> <div class="ls-pagination-filter"> - <ul class="ls-pagination"> - <li><a href="#">« Anterior</a></li> - <li class="ls-active"><a href="#">1</a></li> - <li><a href="#">2</a></li> - <li><a href="#">3</a></li> - <li><a href="#" class="hidden-xs">4</a></li> - <li><a href="#" class="hidden-xs">5</a></li> - <li><a href="#">Próximo »</a></li> - </ul> - - <div class="ls-filter-view"> - <label for=""> - Exibir - <div class="ls-custom-select ls-field-sm"> - <select name="" id=""> - <option value="10">10</option> - <option value="30">30</option> - <option value="50">50</option> - <option value="100">100</option> - </select> - </div> - Ãtens por página - </label> - </div> + <%= paginate @curators, :theme => 'management_theme', :window => 2 %> + <div class="ls-filter-view"> + <label for=""> + Exibir   + <div class="ls-custom-select ls-field-sm"> + <%= form_tag ("curators"), method: :get, id: "limit_form" do %> + <%= select_tag :limit, options_for_select([25, 50, 100, 150], selected: params[:limit] || 25) %> + <%end%> + </div> +   itens por página. + </label> + </div> </div> + <% end %> + +<script type="text/javascript" > + $(function(){ + $('#limit').change( + function() { + $('#limit_form').submit(); + }); + }); +</script> diff --git a/app/views/management/users/index.html.erb b/app/views/management/users/index.html.erb index a48ce9277ca77aefd456c0e9d68c5210303568c8..345f7baf7957789981d83623bb2108a865c38b0d 100644 --- a/app/views/management/users/index.html.erb +++ b/app/views/management/users/index.html.erb @@ -87,28 +87,26 @@ </table> <div class="ls-pagination-filter"> - <ul class="ls-pagination"> - <li><a href="#">« Anterior</a></li> - <li class="ls-active"><a href="#">1</a></li> - <li><a href="#">2</a></li> - <li><a href="#">3</a></li> - <li><a href="#" class="hidden-xs">4</a></li> - <li><a href="#" class="hidden-xs">5</a></li> - <li><a href="#">Próximo »</a></li> - </ul> - + <%= paginate @users, :theme => 'management_theme', :window => 2 %> <div class="ls-filter-view"> <label for=""> - Exibir + Exibir   <div class="ls-custom-select ls-field-sm"> - <select name="" id=""> - <option value="10">10</option> - <option value="30">30</option> - <option value="50">50</option> - <option value="100">100</option> - </select> + <%= form_tag ("users"), method: :get, id: "limit_form" do %> + <%= select_tag :limit, options_for_select([25, 50, 100, 150], selected: params[:limit] || 25) %> + <%end%> </div> - Ãtens por página +   itens por página. </label> </div> </div> + + +<script type="text/javascript" > +$(function(){ + $('#limit').change( + function() { + $('#limit_form').submit(); + }); +}); +</script> diff --git a/app/views/shared/management/_nav_menu.html.erb b/app/views/shared/management/_nav_menu.html.erb index 91e1b4206b675da9cbeeb7ca00451b64926105bd..313799a237b3c6ea24b197aeca8a13f9224e7037 100644 --- a/app/views/shared/management/_nav_menu.html.erb +++ b/app/views/shared/management/_nav_menu.html.erb @@ -13,9 +13,9 @@ <li><%= link_to "Acessos", accesses_management_statistics_path, class: 'ls-submenu-item' %></li> </ul> </li> - <li><%= link_to "Instituições", management_institutions_path, class: 'ls-submenu-item' %></li> + <li><%= link_to "Instituições", management_institutions_path, class: 'ls-ico-list2' %></li> <li class="ls-submenu"> - <a href="#" class="ls-ico-stats">Usuários e permissões</a> + <a href="#" class="ls-ico-user">Usuários e permissões</a> <ul role="menu"> <li><%= link_to "Usuários", management_users_path, class: 'ls-submenu-item' %></li> <li><%= link_to "Curadores", curators_management_users_path, class: 'ls-submenu-item' %></li> @@ -23,10 +23,9 @@ </ul> </li> <li><%= link_to "Denúncias", management_complaints_path, class: 'ls-ico-bullhorn' %> - <li> + <li> <%= link_to "Voltar ao Portal", root_path, class: 'ls-ico-chevron-left' %> </li> </ul> - - <li> <%= link_to "Voltar ao Portal", root_path %> </li> + </nav> diff --git a/app/views/shared/management/_user_account.html.erb b/app/views/shared/management/_user_account.html.erb index 3c66c0596e8f631350be9a82239714e763e1f1b1..5fce7a301a385a49ad405539ad3b41aa0623daaa 100644 --- a/app/views/shared/management/_user_account.html.erb +++ b/app/views/shared/management/_user_account.html.erb @@ -4,7 +4,6 @@ </a> <nav class="ls-dropdown-nav ls-user-menu"> <ul> - <li><%= link_to "Voltar para o Portal", root_path %></li> <li><%= link_to "Conta", me_users_path%></li> <li><%= link_to "Sair", destroy_user_session_path, method: 'delete' %></li> </ul>