Commit 9fddd5b4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Refactoring & restyle pagination:

- remove admin kaminari theme. Use gitlab theme everywhere
- use bootstrap styled for gitlab admin themes
- dont reload page when change issue filter
parent 52ad34fd
......@@ -12,7 +12,7 @@ function initIssuesSearch() {
if (terms.length >= 2 || terms.length == 0) {
$.get(href, { 'status': status, 'terms': terms, 'milestone_id': milestone_id }, function(response) {
$('#issues-table').html(response);
$('.issues-holder').html(response);
});
}
}
......
......@@ -69,13 +69,6 @@ fieldset legend { font-size: 17px; }
/** PAGINATION **/
.gitlab_pagination {
span a { color: $link_color; }
.prev, .next, .current, .page a {
padding: 10px;
}
.current {
border-bottom: 2px solid $style_color;
}
}
.tab-content {
......
......@@ -77,7 +77,7 @@ input.check_all_issues {
@media (min-width: 800px) { .issues_bulk_update select { width: 120px; } }
@media (min-width: 1200px) { .issues_bulk_update select { width: 160px; } }
#issues-table-holder {
.issues-holder {
.issues_filters {
}
......
......@@ -34,4 +34,4 @@
%td.bgred
= link_to 'Edit', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small"
= link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
= paginate @groups, theme: "admin"
= paginate @groups, theme: "gitlab"
......@@ -56,6 +56,4 @@
= link_to 'Destroy', [project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
- if @projects.blank?
%p.nothing_here_message 0 projects matches
- else
%li.bottom
= paginate @projects, theme: "gitlab"
= paginate @projects, theme: "gitlab"
......@@ -40,4 +40,4 @@
= link_to 'Edit', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn btn-small"
= link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
= paginate @teams, theme: "admin"
= paginate @teams, theme: "gitlab"
......@@ -58,5 +58,4 @@
- else
= link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-small btn-remove"
= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn btn-small btn-remove"
%li.bottom
= paginate @admin_users, theme: "gitlab"
= paginate @admin_users, theme: "gitlab"
= render @issues
.ui-box
.title
= check_box_tag "check_all_issues", nil, false, class: "check_all_issues left"
.clearfix
.issues_bulk_update.hide
= form_tag bulk_update_project_issues_path(@project), method: :post do
%span.update_issues_text Update selected issues with  
.left
= select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status")
= select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
= select_tag('update[milestone_id]', options_from_collection_for_select(issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")
= hidden_field_tag 'update[issues_ids]', []
= hidden_field_tag :status, params[:status]
= button_tag "Save", class: "btn update_selected_issues btn-small btn-save"
.issues_filters
= form_tag project_issues_path(@project), method: :get, remote: true do
= select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
= select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
= select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")
= hidden_field_tag :status, params[:status]
%ul.well-list.issues-list
= render @issues
- if @issues.blank?
%li
%h4.nothing_here_message Nothing to show here
- if @issues.present?
%li.bottom
.left= paginate @issues, remote: true, theme: "gitlab"
.pull-right
%span.issue_counter #{@issues.total_count}
issues for this filter
- else
%li
%h4.nothing_here_message Nothing to show here
.pull-right
%span.issue_counter #{@issues.total_count}
issues for this filter
= paginate @issues, remote: true, theme: "gitlab"
......@@ -19,30 +19,8 @@
.row
.span3
= render 'filter', entity: 'issue'
.span9
%div#issues-table-holder.ui-box
.title
= check_box_tag "check_all_issues", nil, false, class: "check_all_issues left"
.clearfix
.issues_bulk_update.hide
= form_tag bulk_update_project_issues_path(@project), method: :post do
%span.update_issues_text Update selected issues with  
.left
= select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status")
= select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
= select_tag('update[milestone_id]', options_from_collection_for_select(issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")
= hidden_field_tag 'update[issues_ids]', []
= hidden_field_tag :status, params[:status]
= button_tag "Save", class: "btn update_selected_issues btn-small btn-save"
.issues_filters
= form_tag project_issues_path(@project), method: :get do
= select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
= select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
= select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")
= hidden_field_tag :status, params[:status]
%ul#issues-table.well-list.issues-list
= render "issues"
.span9.issues-holder
= render "issues"
:javascript
$(function(){
......
:plain
$('#issues-table').html("#{escape_javascript(render('issues'))}");
$('.issues-holder').html("#{escape_javascript(render('issues'))}");
History.replaceState({path: "#{request.url}"}, document.title, "#{request.url}");
issuesPage();
-# Link to the "First" page
-# available local variables
-# url: url to the first page
-# current_page: a page object for the currently displayed page
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.first
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
-# Non-link tag that stands for skipped pages...
-# available local variables
-# current_page: a page object for the currently displayed page
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li{class: "page"}
%span.page.gap
= raw(t 'views.pagination.truncate')
-# Link to the "Last" page
-# available local variables
-# url: url to the last page
-# current_page: a page object for the currently displayed page
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.last
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
-# Link to the "Next" page
-# available local variables
-# url: url to the next page
-# current_page: a page object for the currently displayed page
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li.next
= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote
-# Link showing page number
-# available local variables
-# page: a page object for "this" page
-# url: url to this page
-# current_page: a page object for the currently displayed page
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li{class: "page#{' active' if page.current?}"}
= link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil}
-# The container tag
-# available local variables
-# current_page: a page object for the currently displayed page
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
-# paginator: the paginator that renders the pagination tags inside
= paginator.render do
%div.pagination
%ul
= 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
= next_page_tag unless current_page.last?
-# Link to the "Previous" page
-# available local variables
-# url: url to the previous page
-# current_page: a page object for the currently displayed page
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li{class: "prev" }
= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote
......@@ -4,5 +4,6 @@
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.page.gap
= raw(t 'views.pagination.truncate')
%li{class: "page"}
%span.page.gap
= raw(t 'views.pagination.truncate')
......@@ -5,5 +5,5 @@
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.next
%li.next
= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote
......@@ -6,5 +6,5 @@
-# num_pages: total number of pages
-# 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.next? ? 'next' : page.prev? ? 'prev' : nil}
%li{class: "page#{' active' if page.current?}"}
= link_to page, url, {remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil}
......@@ -6,11 +6,12 @@
-# remote: data-remote
-# paginator: the paginator that renders the pagination tags inside
= paginator.render do
%nav.gitlab_pagination
= prev_page_tag
- each_page do |page|
- if page.left_outer? || page.right_outer? || page.inside_window?
= page_tag page
- elsif !page.was_truncated?
= gap_tag
= next_page_tag
%div.pagination
%ul
= 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
= next_page_tag unless current_page.last?
......@@ -5,5 +5,5 @@
-# num_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.prev
%li{class: "prev" }
= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote
......@@ -25,11 +25,11 @@
- if @merge_requests.blank?
%li
%h4.nothing_here_message Nothing to show here
- if @merge_requests.present?
%li.bottom
.left= paginate @merge_requests, theme: "gitlab"
.pull-right
%span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter
- if @merge_requests.present?
.pull-right
%span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter
= paginate @merge_requests, theme: "gitlab"
:javascript
$(merge_requestsPage);
......@@ -17,4 +17,4 @@
- unless @projects.present?
%h3.nothing_here_message No public projects
= paginate @projects, theme: "admin"
= paginate @projects, theme: "gitlab"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment