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
Jérome Perrin
gitlab-ce
Commits
bb35ef2f
Commit
bb35ef2f
authored
Nov 16, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix branch/tag select
parent
f0b86c5f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
6 deletions
+29
-6
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+8
-0
app/controllers/refs_controller.rb
app/controllers/refs_controller.rb
+10
-0
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-1
app/views/commits/index.html.haml
app/views/commits/index.html.haml
+1
-1
app/views/projects/_refs.html.haml
app/views/projects/_refs.html.haml
+2
-1
app/views/refs/_tree.html.haml
app/views/refs/_tree.html.haml
+1
-1
config/routes.rb
config/routes.rb
+6
-2
No files found.
app/assets/stylesheets/projects.css.scss
View file @
bb35ef2f
...
@@ -377,3 +377,11 @@ body.dashboard.project-page .news-feed .project-updates a.project-update span.up
...
@@ -377,3 +377,11 @@ body.dashboard.project-page .news-feed .project-updates a.project-update span.up
body
.dashboard.project-page
.news-feed
.project-updates
a
.project-update
span
.update-author
{
color
:
#999
;
font-weight
:
normal
;
font-style
:
italic
;}
body
.dashboard.project-page
.news-feed
.project-updates
a
.project-update
span
.update-author
{
color
:
#999
;
font-weight
:
normal
;
font-style
:
italic
;}
body
.dashboard.project-page
.news-feed
.project-updates
a
.project-update
span
.update-author
strong
{
font-weight
:
bold
;
font-style
:
normal
;}
body
.dashboard.project-page
.news-feed
.project-updates
a
.project-update
span
.update-author
strong
{
font-weight
:
bold
;
font-style
:
normal
;}
/* eo Dashboard Page */
/* eo Dashboard Page */
/* Breadcrumbs fix */
#tree-breadcrumbs
{
width
:
100%
;
overflow
:
hidden
;
height
:
45px
;
}
app/controllers/refs_controller.rb
View file @
bb35ef2f
...
@@ -8,6 +8,16 @@ class RefsController < ApplicationController
...
@@ -8,6 +8,16 @@ class RefsController < ApplicationController
before_filter
:authorize_read_project!
before_filter
:authorize_read_project!
before_filter
:require_non_empty_project
before_filter
:require_non_empty_project
def
switch
new_path
=
if
params
[
:destination
]
==
"tree"
tree_project_ref_path
(
@project
,
params
[
:ref
])
else
project_commits_path
(
@project
,
:ref
=>
params
[
:ref
])
end
redirect_to
new_path
end
#
#
# Repository preview
# Repository preview
#
#
...
...
app/helpers/application_helper.rb
View file @
bb35ef2f
...
@@ -46,7 +46,7 @@ module ApplicationHelper
...
@@ -46,7 +46,7 @@ module ApplicationHelper
"Never"
"Never"
end
end
def
grouped_options_refs
def
grouped_options_refs
(
destination
=
:tree
)
options
=
[
options
=
[
[
"Branch"
,
@repo
.
heads
.
map
(
&
:name
)
],
[
"Branch"
,
@repo
.
heads
.
map
(
&
:name
)
],
[
"Tag"
,
@project
.
tags
]
[
"Tag"
,
@project
.
tags
]
...
...
app/views/commits/index.html.haml
View file @
bb35ef2f
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
\/
\/
%a
{
:href
=>
"#"
}=
params
[
:path
].
split
(
"/"
).
join
(
" / "
)
%a
{
:href
=>
"#"
}=
params
[
:path
].
split
(
"/"
).
join
(
" / "
)
.right
=
render
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
project_commits_path
(
@project
)
}
.right
=
render
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
:commits
}
%div
{
:id
=>
dom_id
(
@project
)}
%div
{
:id
=>
dom_id
(
@project
)}
#commits_list
=
render
"commits"
#commits_list
=
render
"commits"
...
...
app/views/projects/_refs.html.haml
View file @
bb35ef2f
=
form_tag
destination
,
:method
=>
:get
,
:class
=>
"project-refs-form"
do
=
form_tag
switch_project_refs_path
(
@project
)
,
:method
=>
:get
,
:class
=>
"project-refs-form"
do
=
select_tag
"ref"
,
grouped_options_refs
,
:onchange
=>
"this.form.submit();"
,
:class
=>
"project-refs-select"
=
select_tag
"ref"
,
grouped_options_refs
,
:onchange
=>
"this.form.submit();"
,
:class
=>
"project-refs-select"
=
hidden_field_tag
:destination
,
destination
:javascript
:javascript
$
(
function
(){
$
(
function
(){
...
...
app/views/refs/_tree.html.haml
View file @
bb35ef2f
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
\/
\/
=
link_to
truncate
(
part
,
:length
=>
40
),
tree_file_project_ref_path
(
@project
,
@ref
,
:path
=>
part_path
),
:remote
=>
:true
=
link_to
truncate
(
part
,
:length
=>
40
),
tree_file_project_ref_path
(
@project
,
@ref
,
:path
=>
part_path
),
:remote
=>
:true
.right
=
render
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
tree_project_ref_path
(
@project
,
@ref
)
}
.right
=
render
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
:tree
}
.clear
.clear
#tree-content-holder
#tree-content-holder
...
...
config/routes.rb
View file @
bb35ef2f
...
@@ -36,15 +36,19 @@ Gitlab::Application.routes.draw do
...
@@ -36,15 +36,19 @@ Gitlab::Application.routes.draw do
end
end
resources
:refs
,
:only
=>
[],
:path
=>
"/"
do
resources
:refs
,
:only
=>
[],
:path
=>
"/"
do
collection
do
get
"switch"
end
member
do
member
do
get
"tree"
get
"tree"
,
:constraints
=>
{
:id
=>
/[a-zA-Z.0-9_\-]+/
}
get
"blob"
get
"blob"
# tree viewer
# tree viewer
get
"tree/:path"
=>
"refs#tree"
,
get
"tree/:path"
=>
"refs#tree"
,
:as
=>
:tree_file
,
:as
=>
:tree_file
,
:constraints
=>
{
:constraints
=>
{
:id
=>
/[a-zA-Z0-9_\-]+/
,
:id
=>
/[a-zA-Z
.
0-9_\-]+/
,
:path
=>
/.*/
:path
=>
/.*/
}
}
end
end
...
...
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