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
Léo-Paul Géneau
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{
...
@@ -706,3 +706,16 @@ table.highlighttable pre{
line-height
:
16px
!
important
;
line-height
:
16px
!
important
;
font-size
:
12px
!
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
...
@@ -57,20 +57,14 @@ class ApplicationController < ActionController::Base
end
end
def
load_refs
def
load_refs
@branch
=
unless
params
[
:branch
].
blank?
unless
params
[
:ref
].
blank?
params
[
:branch
]
@ref
=
params
[
:ref
]
else
else
nil
@branch
=
params
[
:branch
].
blank?
?
nil
:
params
[
:branch
]
end
@tag
=
params
[
:tag
].
blank?
?
nil
:
params
[
:tag
]
@tag
=
unless
params
[
:tag
].
blank?
params
[
:tag
]
else
nil
end
@ref
=
@branch
||
@tag
||
"master"
@ref
=
@branch
||
@tag
||
"master"
end
end
end
def
render_404
def
render_404
render
:file
=>
File
.
join
(
Rails
.
root
,
"public"
,
"404"
),
:layout
=>
false
,
:status
=>
"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
...
@@ -32,6 +32,15 @@ module ApplicationHelper
"Never"
"Never"
end
end
def
grouped_options_refs
options
=
[
[
"Branch"
,
@repo
.
heads
.
map
(
&
:name
)
],
[
"Tag"
,
@project
.
tags
]
]
grouped_options_for_select
(
options
,
@ref
)
end
def
markdown
(
text
)
def
markdown
(
text
)
RDiscount
.
new
(
text
,
:autolink
,
:no_pseudo_protocols
,
:safelink
,
:smart
,
:filter_html
).
to_html
.
html_safe
RDiscount
.
new
(
text
,
:autolink
,
:no_pseudo_protocols
,
:safelink
,
:smart
,
:filter_html
).
to_html
.
html_safe
end
end
...
...
app/views/commits/index.html.haml
View file @
3ba392b3
-
content_for
(
:body_class
,
"project-page commits-page"
)
-
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
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
-#-if can? current_user, :admin_project, @project
%a.right.button.blue{:href => "#"} EDIT
%a.right.button.blue{:href => "#"} EDIT
%h2
.icon
%h2
.icon
%span
%span
%a
.project-name
{
:href
=>
"#"
}
%i
.arrow
>
Project
%d
%d
%a
{
:href
=>
"#"
}
=
link_to
project_commits_path
(
@project
)
do
=
@
ref
=
@
project
.
name
-
if
params
[
:path
]
-
if
params
[
:path
]
\/
%d
%a
{
:href
=>
"#"
}=
params
[
:path
].
split
(
"/"
).
join
(
" / "
)
%a
{
:href
=>
"#"
}=
params
[
:path
].
split
(
"/"
).
join
(
" / "
)
.right
=
render
"projects/refs"
%div
{
:id
=>
dom_id
(
@project
)}
%div
{
:id
=>
dom_id
(
@project
)}
=
render
"commits"
=
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
-#%a.right.button{:href => "#"} Download
-#-if can? current_user, :admin_project, @project
-#-if can? current_user, :admin_project, @project
...
@@ -14,14 +5,9 @@
...
@@ -14,14 +5,9 @@
#tree-breadcrumbs
#tree-breadcrumbs
%h2
.icon
%h2
.icon
%span
%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
%d
%a
{
:href
=>
"#"
}
=
link_to
tree_project_path
(
@project
,
:path
=>
nil
,
:commit_id
=>
@commit
.
try
(
:id
)),
:remote
=>
true
do
=
@ref
=
@project
.
name
-
if
params
[
:path
]
-
if
params
[
:path
]
-
part_path
=
""
-
part_path
=
""
-
params
[
:path
].
split
(
"
\/
"
).
each
do
|
part
|
-
params
[
:path
].
split
(
"
\/
"
).
each
do
|
part
|
...
@@ -30,7 +16,8 @@
...
@@ -30,7 +16,8 @@
-
part_path
=
part
-
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
=
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
.clear
#tree-content-holder
#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