From 871bb40fd7c5dc3ffcb5513448ffd3a5ddca91fc Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Wed, 4 Feb 2015 23:18:30 +0300 Subject: [PATCH] #369: Updated pagination for commits --- .../projects/git/commits/_paginate.html.haml | 13 ------------- .../projects/git/commits/_paginate.html.slim | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 app/views/projects/git/commits/_paginate.html.haml create mode 100644 app/views/projects/git/commits/_paginate.html.slim diff --git a/app/views/projects/git/commits/_paginate.html.haml b/app/views/projects/git/commits/_paginate.html.haml deleted file mode 100644 index 6c5798177..000000000 --- a/app/views/projects/git/commits/_paginate.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -- prev_text, next_text = t('will_paginate.previous_label'), t('will_paginate.next_label') -%ul.pager - - if @page == 1 - %li.disabled - %a= prev_text - - else - %li - %a{ href: commits_path(@project, treeish: @treeish, page: (@page - 1))}= prev_text - %li - - if @last_page - %a= next_text - - else - %a{ href: commits_path(@project, treeish: @treeish, page: (@page + 1))}= next_text diff --git a/app/views/projects/git/commits/_paginate.html.slim b/app/views/projects/git/commits/_paginate.html.slim new file mode 100644 index 000000000..e4b2b91e5 --- /dev/null +++ b/app/views/projects/git/commits/_paginate.html.slim @@ -0,0 +1,17 @@ +- unless @page == 1 && @last_page + - prev_text, next_text = t('will_paginate.previous_label'), t('will_paginate.next_label') + ul.pager + - if @page == 1 + li.disabled + a= prev_text + - else + li + a href=commits_path(@project, treeish: @treeish, page: (@page - 1)) + = prev_text + - if @last_page + li.disabled + a= next_text + - else + li + a href=commits_path(@project, treeish: @treeish, page: (@page + 1)) + = next_text