Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
68bfcd05
Commit
68bfcd05
authored
Jan 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add public filter to admin projects
parent
122acb22
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
34 deletions
+73
-34
app/assets/stylesheets/application.scss
app/assets/stylesheets/application.scss
+1
-0
app/assets/stylesheets/sections/admin.scss
app/assets/stylesheets/sections/admin.scss
+5
-0
app/controllers/admin/projects_controller.rb
app/controllers/admin/projects_controller.rb
+1
-0
app/controllers/public/projects_controller.rb
app/controllers/public/projects_controller.rb
+1
-0
app/views/admin/projects/index.html.haml
app/views/admin/projects/index.html.haml
+42
-33
app/views/help/index.html.haml
app/views/help/index.html.haml
+2
-0
app/views/help/public_area.html.haml
app/views/help/public_area.html.haml
+16
-0
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+1
-1
app/views/public/projects/index.html.haml
app/views/public/projects/index.html.haml
+3
-0
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/assets/stylesheets/application.scss
View file @
68bfcd05
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
@import
"sections/profile.scss"
;
@import
"sections/profile.scss"
;
@import
"sections/login.scss"
;
@import
"sections/login.scss"
;
@import
"sections/editor.scss"
;
@import
"sections/editor.scss"
;
@import
"sections/admin.scss"
;
@import
"highlight/white.scss"
;
@import
"highlight/white.scss"
;
@import
"highlight/dark.scss"
;
@import
"highlight/dark.scss"
;
...
...
app/assets/stylesheets/sections/admin.scss
0 → 100644
View file @
68bfcd05
.admin-filter
form
{
label
{
width
:
110px
;
}
.controls
{
margin-left
:
130px
;
}
.form-actions
{
padding-left
:
130px
;
background
:
#fff
}
}
app/controllers/admin/projects_controller.rb
View file @
68bfcd05
...
@@ -4,6 +4,7 @@ class Admin::ProjectsController < AdminController
...
@@ -4,6 +4,7 @@ class Admin::ProjectsController < AdminController
def
index
def
index
@projects
=
Project
.
scoped
@projects
=
Project
.
scoped
@projects
=
@projects
.
where
(
namespace_id:
params
[
:namespace_id
])
if
params
[
:namespace_id
].
present?
@projects
=
@projects
.
where
(
namespace_id:
params
[
:namespace_id
])
if
params
[
:namespace_id
].
present?
@projects
=
@projects
.
where
(
public:
true
)
if
params
[
:public_only
].
present?
@projects
=
@projects
.
where
(
namespace_id:
nil
)
if
params
[
:namespace_id
]
==
Namespace
.
global_id
@projects
=
@projects
.
where
(
namespace_id:
nil
)
if
params
[
:namespace_id
]
==
Namespace
.
global_id
@projects
=
@projects
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@projects
=
@projects
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
20
)
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
20
)
...
...
app/controllers/public/projects_controller.rb
View file @
68bfcd05
...
@@ -7,5 +7,6 @@ class Public::ProjectsController < ApplicationController
...
@@ -7,5 +7,6 @@ class Public::ProjectsController < ApplicationController
def
index
def
index
@projects
=
Project
.
public
@projects
=
Project
.
public
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
20
)
end
end
end
end
app/views/admin/projects/index.html.haml
View file @
68bfcd05
%h3
.page_title
%h3
.page_title
Projects
(
#{
Project
.
count
}
)
Projects
=
link_to
'New Project'
,
new_project_path
,
class:
"btn small right"
=
link_to
'New Project'
,
new_project_path
,
class:
"btn small right"
%br
=
form_tag
admin_projects_path
,
method: :get
,
class:
'form-inline'
do
=
select_tag
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
],
:all
),
class:
"chosen xlarge"
,
prompt:
"Project namespace"
=
text_field_tag
:name
,
params
[
:name
],
class:
"xlarge"
=
submit_tag
"Search"
,
class:
"btn submit primary"
%table
%hr
%thead
%tr
.row
%th
.span4
Name
.admin-filter
%i
.icon-sort-down
=
form_tag
admin_projects_path
,
method: :get
,
class:
'form-inline'
do
%th
Path
.control-group
%th
Team Members
=
label_tag
:name
,
'Name:'
,
class:
'control-label'
%th
Owner
.controls
%th
Last Commit
=
text_field_tag
:name
,
params
[
:name
],
class:
"span2"
%th
Edit
%th
.cred
Danger Zone!
.control-group
=
label_tag
:namespace_id
,
'Namespace:'
,
class:
'control-label'
.controls
=
select_tag
:namespace_id
,
namespaces_options
(
params
[
:namespace_id
],
:all
),
class:
"chosen span2"
,
prompt:
"Any"
.control-group
=
label_tag
:public_only
,
'Public Only'
,
class:
'control-label'
.controls
=
check_box_tag
:public_only
,
1
,
params
[
:public_only
]
.form-actions
=
submit_tag
"Search"
,
class:
"btn submit primary"
=
link_to
"Reset"
,
admin_projects_path
,
class:
"btn"
.span8
.ui-box
%h5
.title
Projects (
#{
@projects
.
total_count
}
)
%ul
.well-list
-
@projects
.
each
do
|
project
|
-
@projects
.
each
do
|
project
|
%tr
%li
%td
-
if
project
.
public
%i
.icon-unlock.cred
-
else
%i
.icon-lock.cgreen
=
link_to
project
.
name_with_namespace
,
[
:admin
,
project
]
=
link_to
project
.
name_with_namespace
,
[
:admin
,
project
]
%td
.right
%span
.monospace
=
project
.
path_with_namespace
+
".git"
=
link_to
'Edit'
,
edit_admin_project_path
(
project
),
id:
"edit_
#{
dom_id
(
project
)
}
"
,
class:
"btn small"
%td
=
project
.
users_projects
.
count
=
link_to
'Destroy'
,
[
:admin
,
project
],
confirm:
"REMOVE
#{
project
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn small danger"
%td
-
if
@projects
.
blank?
-
if
project
.
owner
%p
.nothing_here_message
0 projects matches
=
link_to
project
.
owner
.
name
,
[
:admin
,
project
.
owner
]
-
else
-
else
(deleted)
%li
.bottom
%td
=
last_commit
(
project
)
=
paginate
@projects
,
theme:
"admin"
%td
=
link_to
'Edit'
,
edit_admin_project_path
(
project
),
id:
"edit_
#{
dom_id
(
project
)
}
"
,
class:
"btn small"
%td
.bgred
=
link_to
'Destroy'
,
[
:admin
,
project
],
confirm:
"REMOVE
#{
project
.
name
}
? Are you sure?"
,
method: :delete
,
class:
"btn small danger"
=
paginate
@projects
,
theme:
"admin"
app/views/help/index.html.haml
View file @
68bfcd05
...
@@ -47,3 +47,5 @@
...
@@ -47,3 +47,5 @@
%li
%li
%span
=
link_to
"System Hooks"
,
help_system_hooks_path
%span
=
link_to
"System Hooks"
,
help_system_hooks_path
%li
%span
=
link_to
"Public Area"
,
help_public_area_path
app/views/help/public_area.html.haml
0 → 100644
View file @
68bfcd05
%h3
.page_title
Public Area
.back_link
=
link_to
help_path
do
←
to index
%hr
%p
Public area - is part of application with public access.
%br
It used to list all projects with public read-only access.
%br
If you enable public http access to the project - it will appears there
%br
Follow
#{
link_to
"this link"
,
public_root_path
}
to visit Public Area
app/views/layouts/application.html.haml
View file @
68bfcd05
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
%span
.count
=
current_user
.
cared_merge_requests
.
opened
.
count
%span
.count
=
current_user
.
cared_merge_requests
.
opened
.
count
=
nav_link
(
path:
'search#show'
)
do
=
nav_link
(
path:
'search#show'
)
do
=
link_to
"Search"
,
search_path
=
link_to
"Search"
,
search_path
=
nav_link
(
path:
'help#index'
)
do
=
nav_link
(
controller: :help
)
do
=
link_to
"Help"
,
help_path
=
link_to
"Help"
,
help_path
.content
=
yield
.content
=
yield
app/views/public/projects/index.html.haml
View file @
68bfcd05
...
@@ -12,3 +12,6 @@
...
@@ -12,3 +12,6 @@
.right
.right
%span
.monospace.tiny
%span
.monospace.tiny
git clone
#{
project
.
http_url_to_repo
}
git clone
#{
project
.
http_url_to_repo
}
=
paginate
@projects
,
theme:
"admin"
config/routes.rb
View file @
68bfcd05
...
@@ -35,6 +35,7 @@ Gitlab::Application.routes.draw do
...
@@ -35,6 +35,7 @@ Gitlab::Application.routes.draw do
get
'help/markdown'
=>
'help#markdown'
get
'help/markdown'
=>
'help#markdown'
get
'help/ssh'
=>
'help#ssh'
get
'help/ssh'
=>
'help#ssh'
get
'help/raketasks'
=>
'help#raketasks'
get
'help/raketasks'
=>
'help#raketasks'
get
'help/public_area'
=>
'help#public_area'
#
#
# Public namespace
# Public namespace
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment