Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-03-03 13:13:03 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-03-03 19:39:30 +0300
commit5bb6a85b902c6096970d6c82bb63cae7985e55e8 (patch)
tree4621bdcade58234a3c97d6198ff7adde776a4d45 /app/views/explore
parent8fd5aeee7fee7506c44674d61f794ff8685b90e6 (diff)
Refactor projects filtering by name
Reuse same search form and behavior for dashboard#projects, group#projects and admin#projects. Repsect all other options like sorting, personal filter when search projects by name. Create FilterableList JS class to handle identical behaviour of projects and groups lists. This change also makes filtering and sorting availabe on explore#projects and explore#groups no matter if you are logged in or not. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/explore')
-rw-r--r--app/views/explore/groups/_nav.html.haml8
-rw-r--r--app/views/explore/groups/index.html.haml2
-rw-r--r--app/views/explore/projects/_nav.html.haml27
-rw-r--r--app/views/explore/projects/index.html.haml7
4 files changed, 27 insertions, 17 deletions
diff --git a/app/views/explore/groups/_nav.html.haml b/app/views/explore/groups/_nav.html.haml
new file mode 100644
index 00000000000..c8d95b52156
--- /dev/null
+++ b/app/views/explore/groups/_nav.html.haml
@@ -0,0 +1,8 @@
+.top-area
+ %ul.nav-links
+ = nav_link(page: explore_groups_path) do
+ = link_to explore_groups_path do
+ Explore Groups
+ .nav-controls
+ = render 'shared/groups/search_form'
+ = render 'shared/groups/dropdown'
diff --git a/app/views/explore/groups/index.html.haml b/app/views/explore/groups/index.html.haml
index 7f1bacc91cb..8374f5a009f 100644
--- a/app/views/explore/groups/index.html.haml
+++ b/app/views/explore/groups/index.html.haml
@@ -5,7 +5,7 @@
= render 'dashboard/groups_head'
- else
= render 'explore/head'
-
+ = render 'nav'
- if @groups.present?
= render 'groups'
diff --git a/app/views/explore/projects/_nav.html.haml b/app/views/explore/projects/_nav.html.haml
index 614b5431779..e0a2a1e9c96 100644
--- a/app/views/explore/projects/_nav.html.haml
+++ b/app/views/explore/projects/_nav.html.haml
@@ -1,10 +1,17 @@
-%ul.nav-links
- = nav_link(page: [trending_explore_projects_path, explore_root_path]) do
- = link_to trending_explore_projects_path do
- Trending
- = nav_link(page: starred_explore_projects_path) do
- = link_to starred_explore_projects_path do
- Most stars
- = nav_link(page: explore_projects_path) do
- = link_to explore_projects_path do
- All
+.top-area
+ %ul.nav-links
+ = nav_link(page: [trending_explore_projects_path, explore_root_path]) do
+ = link_to trending_explore_projects_path do
+ Trending
+ = nav_link(page: starred_explore_projects_path) do
+ = link_to starred_explore_projects_path do
+ Most stars
+ = nav_link(page: explore_projects_path) do
+ = link_to explore_projects_path do
+ All
+
+ .nav-controls
+ - unless current_user
+ = render 'shared/projects/search_form'
+ = render 'shared/projects/dropdown'
+ = render 'filter'
diff --git a/app/views/explore/projects/index.html.haml b/app/views/explore/projects/index.html.haml
index 42b50481b9d..ec461755103 100644
--- a/app/views/explore/projects/index.html.haml
+++ b/app/views/explore/projects/index.html.haml
@@ -6,10 +6,5 @@
- else
= render 'explore/head'
-.top-area
- = render 'explore/projects/nav'
-
- .nav-controls
- = render 'filter'
-
+= render 'explore/projects/nav'
= render 'projects', projects: @projects