diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-03-03 15:09:58 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-03-03 15:09:58 +0300 |
commit | 7455d950bcd0152ee30c024a30a652886970ac3f (patch) | |
tree | c8aded95124437644a8f32b9370000fc11360c93 /app/views/projects/forks | |
parent | 7e710acc1c72de7d11ad393ee3e111e250e0cb66 (diff) |
Refactor projects list
1. Fix double bottom border if pagination
2. Fix broken search on forks page
4. Remove duplicate js logic
4. Remove unused show all link
5. Remove duplicate “no project” message in different views
After this merge request you can easily render shared projects template
with all necessary html/js included to make searchable list with
pagination. All you need to provide is controller that returns
projects list with seach nad pagination and render html form with
project-filter-form id and text field with filter_projects name.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects/forks')
-rw-r--r-- | app/views/projects/forks/_projects.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/forks/index.html.haml | 25 |
2 files changed, 11 insertions, 16 deletions
diff --git a/app/views/projects/forks/_projects.html.haml b/app/views/projects/forks/_projects.html.haml new file mode 100644 index 00000000000..2946e6dcbd0 --- /dev/null +++ b/app/views/projects/forks/_projects.html.haml @@ -0,0 +1,2 @@ += render 'shared/projects/list', projects: projects, use_creator_avatar: true, + forks: true, show_last_commit_as_description: true diff --git a/app/views/projects/forks/index.html.haml b/app/views/projects/forks/index.html.haml index ace22625d1d..4bcf2d9d533 100644 --- a/app/views/projects/forks/index.html.haml +++ b/app/views/projects/forks/index.html.haml @@ -4,8 +4,9 @@ == #{pluralize(@total_forks_count, 'fork')}: #{full_count_title} .nav-controls - = search_field_tag :filter_projects, nil, placeholder: 'Search forks', class: 'projects-list-filter project-filter-form-field form-control input-short', - spellcheck: false, data: { 'filter-selector' => 'span.namespace-name' } + = form_tag request.original_url, method: :get, class: 'project-filter-form', id: 'project-filter-form' do |f| + = search_field_tag :filter_projects, nil, placeholder: 'Search forks', class: 'projects-list-filter project-filter-form-field form-control input-short', + spellcheck: false, data: { 'filter-selector' => 'span.namespace-name' } .dropdown %button.dropdown-toggle.btn.sort-forks{type: 'button', 'data-toggle' => 'dropdown'} @@ -38,18 +39,10 @@ Fork -.projects-list-holder - - if @forks.blank? - %ul.content-list - %li - .nothing-here-block No forks to show - - else - = render 'shared/projects/list', projects: @forks, use_creator_avatar: true, - forks: true, show_last_commit_as_description: true += render 'projects', projects: @forks - - if @private_forks_count > 0 - %ul.projects-list.private-forks-notice - %li.project-row - = icon('lock fw', base: 'circle', class: 'fa-lg private-fork-icon') - %strong= pluralize(@private_forks_count, 'private fork') - %span you have no access to. +- if @private_forks_count > 0 + .private-forks-notice + = icon('lock fw', base: 'circle', class: 'fa-lg private-fork-icon') + %strong= pluralize(@private_forks_count, 'private fork') + %span you have no access to. |