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
iv
gitlab-ce
Commits
3ba392b3
Commit
3ba392b3
authored
Nov 03, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new ref switch
parent
5f900772
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1314 additions
and
50 deletions
+1314
-50
app/assets/images/chosen-sprite.png
app/assets/images/chosen-sprite.png
+0
-0
app/assets/javascripts/chosen.jquery.js
app/assets/javascripts/chosen.jquery.js
+901
-0
app/assets/stylesheets/chosen.css
app/assets/stylesheets/chosen.css
+367
-0
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+13
-0
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+7
-13
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+9
-0
app/views/commits/index.html.haml
app/views/commits/index.html.haml
+5
-20
app/views/projects/_refs.html.haml
app/views/projects/_refs.html.haml
+8
-0
app/views/projects/_tree.html.haml
app/views/projects/_tree.html.haml
+4
-17
No files found.
app/assets/images/chosen-sprite.png
0 → 100644
View file @
3ba392b3
396 Bytes
app/assets/javascripts/chosen.jquery.js
0 → 100644
View file @
3ba392b3
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/chosen.css
0 → 100644
View file @
3ba392b3
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/projects.css.scss
View file @
3ba392b3
...
...
@@ -706,3 +706,16 @@ table.highlighttable pre{
line-height
:
16px
!
important
;
font-size
:
12px
!
important
;
}
.project-refs-form
{
span
{
background
:
none
!
important
;
position
:static
!
important
;
width
:auto
!
important
;
height
:
auto
!
important
;
}
}
.project-refs-select
{
width
:
200px
;
}
app/controllers/application_controller.rb
View file @
3ba392b3
...
...
@@ -57,20 +57,14 @@ class ApplicationController < ActionController::Base
end
def
load_refs
@branch
=
unless
params
[
:branch
].
blank?
params
[
:branch
]
unless
params
[
:ref
].
blank?
@ref
=
params
[
:ref
]
else
nil
end
@tag
=
unless
params
[
:tag
].
blank?
params
[
:tag
]
else
nil
end
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
@tag
=
params
[
:tag
].
blank?
?
nil
:
params
[
:tag
]
@ref
=
@branch
||
@tag
||
"master"
end
end
def
render_404
render
:file
=>
File
.
join
(
Rails
.
root
,
"public"
,
"404"
),
:layout
=>
false
,
:status
=>
"404"
...
...
app/helpers/application_helper.rb
View file @
3ba392b3
...
...
@@ -32,6 +32,15 @@ module ApplicationHelper
"Never"
end
def
grouped_options_refs
options
=
[
[
"Branch"
,
@repo
.
heads
.
map
(
&
:name
)
],
[
"Tag"
,
@project
.
tags
]
]
grouped_options_for_select
(
options
,
@ref
)
end
def
markdown
(
text
)
RDiscount
.
new
(
text
,
:autolink
,
:no_pseudo_protocols
,
:safelink
,
:smart
,
:filter_html
).
to_html
.
html_safe
end
...
...
app/views/commits/index.html.haml
View file @
3ba392b3
-
content_for
(
:body_class
,
"project-page commits-page"
)
.left
=
form_tag
project_commits_path
(
@project
),
:method
=>
:get
do
=
select_tag
"branch"
,
options_for_select
(
@repo
.
heads
.
map
(
&
:name
),
@branch
),
:onchange
=>
"this.form.submit();"
,
:class
=>
""
,
:prompt
=>
"Branches"
.left
=
form_tag
project_commits_path
(
@project
),
:method
=>
:get
do
=
select_tag
"tag"
,
options_for_select
(
@project
.
tags
,
@tag
),
:onchange
=>
"this.form.submit();"
,
:class
=>
""
,
:prompt
=>
"Tags"
.clear
%br
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
%a.right.button.blue{:href => "#"} EDIT
%h2
.icon
%span
%a
.project-name
{
:href
=>
"#"
}
%i
.arrow
>
Project
%d
%a
{
:href
=>
"#"
}
=
@
ref
=
link_to
project_commits_path
(
@project
)
do
=
@
project
.
name
-
if
params
[
:path
]
%d
\/
%a
{
:href
=>
"#"
}=
params
[
:path
].
split
(
"/"
).
join
(
" / "
)
.right
=
render
"projects/refs"
%div
{
:id
=>
dom_id
(
@project
)}
=
render
"commits"
app/views/projects/_refs.html.haml
0 → 100644
View file @
3ba392b3
=
form_tag
project_commits_path
(
@project
),
:method
=>
:get
,
:class
=>
"project-refs-form"
do
=
select_tag
"ref"
,
grouped_options_refs
,
:onchange
=>
"this.form.submit();"
,
:class
=>
"project-refs-select"
:javascript
$
(
function
(){
$
(
'
.project-refs-select
'
).
chosen
();
})
app/views/projects/_tree.html.haml
View file @
3ba392b3
.left
=
form_tag
tree_project_path
(
@project
),
:method
=>
:get
do
=
select_tag
"branch"
,
options_for_select
(
@repo
.
heads
.
map
(
&
:name
),
@branch
),
:onchange
=>
"this.form.submit();"
,
:class
=>
""
,
:prompt
=>
"Branches"
.left
=
form_tag
tree_project_path
(
@project
),
:method
=>
:get
do
=
select_tag
"tag"
,
options_for_select
(
@project
.
tags
,
@tag
),
:onchange
=>
"this.form.submit();"
,
:class
=>
""
,
:prompt
=>
"Tags"
.clear
%br
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
...
...
@@ -14,14 +5,9 @@
#tree-breadcrumbs
%h2
.icon
%span
=
link_to
tree_project_path
(
@project
,
:path
=>
nil
,
:commit_id
=>
@commit
.
try
(
:id
)),
:remote
=>
true
,
:class
=>
'project-name'
do
%i
.arrow
>
=
@project
.
name
%d
%a
{
:href
=>
"#"
}
=
@ref
=
link_to
tree_project_path
(
@project
,
:path
=>
nil
,
:commit_id
=>
@commit
.
try
(
:id
)),
:remote
=>
true
do
=
@project
.
name
-
if
params
[
:path
]
-
part_path
=
""
-
params
[
:path
].
split
(
"
\/
"
).
each
do
|
part
|
...
...
@@ -30,7 +16,8 @@
-
part_path
=
part
\/
=
link_to
truncate
(
part
,
:length
=>
40
),
tree_file_project_path
(
@project
,
:path
=>
part_path
,
:commit_id
=>
@commit
.
try
(
:id
),
:branch
=>
@branch
,
:tag
=>
@tag
),
:remote
=>
:true
.right
=
render
"projects/refs"
.clear
#tree-content-holder
...
...
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