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
Tatuya Kamada
gitlab-ce
Commits
415516b2
Commit
415516b2
authored
Nov 04, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
8a8fa8b0
687290a0
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1362 additions
and
88 deletions
+1362
-88
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/assets/stylesheets/style.scss
app/assets/stylesheets/style.scss
+1
-1
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+17
-13
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+17
-0
app/models/key.rb
app/models/key.rb
+1
-1
app/views/commits/index.html.haml
app/views/commits/index.html.haml
+5
-20
app/views/layouts/_head_panel.html.erb
app/views/layouts/_head_panel.html.erb
+24
-27
app/views/layouts/admin.html.haml
app/views/layouts/admin.html.haml
+1
-2
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+1
-2
app/views/layouts/devise.html.haml
app/views/layouts/devise.html.haml
+0
-1
app/views/layouts/profile.html.haml
app/views/layouts/profile.html.haml
+1
-2
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-2
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 @
415516b2
396 Bytes
app/assets/javascripts/chosen.jquery.js
0 → 100644
View file @
415516b2
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/chosen.css
0 → 100644
View file @
415516b2
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/projects.css.scss
View file @
415516b2
...
@@ -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/assets/stylesheets/style.scss
View file @
415516b2
...
@@ -292,7 +292,7 @@ body.login-page{background-color: #f1f1f1; padding-top: 10%}
...
@@ -292,7 +292,7 @@ body.login-page{background-color: #f1f1f1; padding-top: 10%}
/* General */
/* General */
#container
{
background-color
:
white
;
overflow
:
hidden
;}
#container
{
background-color
:
white
;
overflow
:
hidden
;}
/*#container{margin: auto; width: 980px; border: 1px solid rgba(0,0,0,.22); border-top: 0; box-shadow: 0 0 0px 4px rgba(0,0,0,.04)}*/
body
.collapsed
#container
{
margin
:
auto
;
width
:
980px
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,.
22
);
border-top
:
0
;
box-shadow
:
0
0
0px
4px
rgba
(
0
,
0
,
0
,.
04
)}
...
...
app/controllers/application_controller.rb
View file @
415516b2
class
ApplicationController
<
ActionController
::
Base
class
ApplicationController
<
ActionController
::
Base
before_filter
:authenticate_user!
before_filter
:authenticate_user!
before_filter
:view_style
protect_from_forgery
protect_from_forgery
helper_method
:abilities
,
:can?
helper_method
:abilities
,
:can?
...
@@ -57,20 +59,14 @@ class ApplicationController < ActionController::Base
...
@@ -57,20 +59,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"
...
@@ -79,4 +75,12 @@ class ApplicationController < ActionController::Base
...
@@ -79,4 +75,12 @@ class ApplicationController < ActionController::Base
def
require_non_empty_project
def
require_non_empty_project
redirect_to
@project
unless
@project
.
repo_exists?
redirect_to
@project
unless
@project
.
repo_exists?
end
end
def
view_style
if
params
[
:view_style
]
==
"collapsed"
cookies
[
:view_style
]
=
"collapsed"
elsif
params
[
:view_style
]
==
"fluid"
cookies
[
:view_style
]
=
""
end
end
end
end
app/helpers/application_helper.rb
View file @
415516b2
...
@@ -4,6 +4,14 @@ module ApplicationHelper
...
@@ -4,6 +4,14 @@ module ApplicationHelper
"http://www.gravatar.com/avatar/
#{
Digest
::
MD5
.
hexdigest
(
user_email
)
}
?s=40&d=identicon"
"http://www.gravatar.com/avatar/
#{
Digest
::
MD5
.
hexdigest
(
user_email
)
}
?s=40&d=identicon"
end
end
def
body_class
(
default_class
=
nil
)
main
=
content_for
(
:body_class
).
blank?
?
default_class
:
content_for
(
:body_class
)
[
main
,
cookies
[
:view_style
]].
join
(
" "
)
end
def
commit_name
(
project
,
commit
)
def
commit_name
(
project
,
commit
)
if
project
.
commit
.
id
==
commit
.
id
if
project
.
commit
.
id
==
commit
.
id
"master"
"master"
...
@@ -32,6 +40,15 @@ module ApplicationHelper
...
@@ -32,6 +40,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/models/key.rb
View file @
415516b2
...
@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base
...
@@ -8,7 +8,7 @@ class Key < ActiveRecord::Base
validates
:key
,
validates
:key
,
:presence
=>
true
,
:presence
=>
true
,
:uniqueness
=>
true
,
:uniqueness
=>
true
,
:length
=>
{
:within
=>
0
..
1
024
}
:length
=>
{
:within
=>
0
..
1
600
}
before_save
:set_identifier
before_save
:set_identifier
after_save
:update_gitosis
after_save
:update_gitosis
...
...
app/views/commits/index.html.haml
View file @
415516b2
-
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
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
project_commits_path
(
@project
)
}
%div
{
:id
=>
dom_id
(
@project
)}
%div
{
:id
=>
dom_id
(
@project
)}
=
render
"commits"
=
render
"commits"
app/views/layouts/_head_panel.html.erb
View file @
415516b2
<!-- Page Header -->
<!-- Page Header -->
<header>
<header>
<h1
class=
"logo"
>
<h1
class=
"logo"
>
<a
href=
"/"
>
GITLAB
</a></h1>
<a
href=
"/"
>
GITLAB
</a>
<div
class=
"login-top"
>
</h1>
<div
class=
"account-box"
>
<%=
link_to
profile_path
,
:class
=>
"pic"
do
%>
<%=
link_to
profile_path
,
:class
=>
"pic"
do
%>
<%=
image_tag
gravatar_icon
(
current_user
.
email
)
%>
<%=
image_tag
gravatar_icon
(
current_user
.
email
)
%>
<%
end
%>
<%
end
%>
<a
href=
"#"
class=
"arrow-up"
></a>
<div
class=
"account-links"
>
<%=
link_to
profile_path
,
:class
=>
"username"
do
%>
<%=
link_to
profile_path
,
:class
=>
"username"
do
%>
<%=
current_user
.
name
%>
<%#= current_user.name %>
Your profile
<%
end
%>
<%
end
%>
<%=
link_to
"Fluid layout"
,
url_for
(
:view_style
=>
'fluid'
)
if
cookies
[
:view_style
]
==
"collapsed"
%>
<%=
link_to
"Fixed layout"
,
url_for
(
:view_style
=>
'collapsed'
)
unless
cookies
[
:view_style
]
==
"collapsed"
%>
<%=
link_to
'Logout'
,
destroy_user_session_path
,
:class
=>
"logout"
,
:method
=>
:delete
%>
<%=
link_to
'Logout'
,
destroy_user_session_path
,
:class
=>
"logout"
,
:method
=>
:delete
%>
</div>
</div>
</div>
<!-- .account-box -->
<div
class=
"search"
>
<div
class=
"search"
>
<%=
text_field_tag
"search"
,
nil
,
:placeholder
=>
"Search"
,
:class
=>
"search-input"
%>
<%=
text_field_tag
"search"
,
nil
,
:placeholder
=>
"Search"
,
:class
=>
"search-input"
%>
</div>
</div>
...
@@ -26,23 +36,10 @@
...
@@ -26,23 +36,10 @@
<span></span>
Admin
<span></span>
Admin
<%
end
%>
<%
end
%>
</nav>
</nav>
</header>
</header>
<!-- eo Page Header -->
<!-- eo Page Header -->
<div
id=
"header-panel"
style=
"display:none"
>
<div
class=
"container"
>
<div
class=
"span-24"
>
<div
class=
"span-10"
>
<span
class=
"search-holder"
>
</span>
</div>
<div
class=
"right"
>
<%=
link_to
truncate
(
@project
.
name
,
:length
=>
20
),
project_path
(
@project
),
:class
=>
"current button"
if
@project
&&
!
@project
.
new_record?
%>
</div>
</div>
</div>
</div>
<%
if
current_user
%>
<%
if
current_user
%>
<%=
javascript_tag
do
%>
<%=
javascript_tag
do
%>
$(function() {
$(function() {
...
...
app/views/layouts/admin.html.haml
View file @
415516b2
...
@@ -6,11 +6,10 @@
...
@@ -6,11 +6,10 @@
=
stylesheet_link_tag
"application"
=
stylesheet_link_tag
"application"
=
javascript_include_tag
"application"
=
javascript_include_tag
"application"
=
csrf_meta_tags
=
csrf_meta_tags
%link
{
:href
=>
"/assets/favicon.png"
,
:rel
=>
"icon"
,
:type
=>
"image/png"
}
/
=
javascript_tag
do
=
javascript_tag
do
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
%body
{
:class
=>
content_for?
(
:body_class
)
?
yield
(
:body_class
)
:
'project-page'
,
:id
=>
yield
(
:boyd_id
)}
%body
{
:class
=>
body_class
(
'project-page'
)
,
:id
=>
yield
(
:boyd_id
)}
#container
#container
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/head_panel"
=
render
:partial
=>
"layouts/head_panel"
...
...
app/views/layouts/application.html.haml
View file @
415516b2
...
@@ -10,11 +10,10 @@
...
@@ -10,11 +10,10 @@
=
stylesheet_link_tag
"application"
=
stylesheet_link_tag
"application"
=
javascript_include_tag
"application"
=
javascript_include_tag
"application"
=
csrf_meta_tags
=
csrf_meta_tags
%link
{
:href
=>
"/assets/favicon.png"
,
:rel
=>
"icon"
,
:type
=>
"image/png"
}
/
=
javascript_tag
do
=
javascript_tag
do
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
%body
{
:class
=>
yield
(
:body_class
)
,
:id
=>
yield
(
:boyd_id
)}
%body
{
:class
=>
body_class
,
:id
=>
yield
(
:boyd_id
)}
#container
#container
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/head_panel"
=
render
:partial
=>
"layouts/head_panel"
...
...
app/views/layouts/devise.html.haml
View file @
415516b2
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
=
stylesheet_link_tag
"application"
=
stylesheet_link_tag
"application"
=
javascript_include_tag
"application"
=
javascript_include_tag
"application"
=
csrf_meta_tags
=
csrf_meta_tags
%link
{
:href
=>
"/assets/favicon.png"
,
:rel
=>
"icon"
,
:type
=>
"image/png"
}
/
=
javascript_tag
do
=
javascript_tag
do
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
...
...
app/views/layouts/profile.html.haml
View file @
415516b2
...
@@ -6,11 +6,10 @@
...
@@ -6,11 +6,10 @@
=
stylesheet_link_tag
"application"
=
stylesheet_link_tag
"application"
=
javascript_include_tag
"application"
=
javascript_include_tag
"application"
=
csrf_meta_tags
=
csrf_meta_tags
%link
{
:href
=>
"/assets/favicon.png"
,
:rel
=>
"icon"
,
:type
=>
"image/png"
}
/
=
javascript_tag
do
=
javascript_tag
do
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
%body
{
:class
=>
content_for?
(
:body_class
)
?
yield
(
:body_class
)
:
'project-page'
,
:id
=>
yield
(
:boyd_id
)}
%body
{
:class
=>
body_class
(
'project-page'
)
,
:id
=>
yield
(
:boyd_id
)}
#container
#container
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/head_panel"
=
render
:partial
=>
"layouts/head_panel"
...
...
app/views/layouts/project.html.haml
View file @
415516b2
...
@@ -6,11 +6,10 @@
...
@@ -6,11 +6,10 @@
=
stylesheet_link_tag
"application"
=
stylesheet_link_tag
"application"
=
javascript_include_tag
"application"
=
javascript_include_tag
"application"
=
csrf_meta_tags
=
csrf_meta_tags
%link
{
:href
=>
"/assets/favicon.png"
,
:rel
=>
"icon"
,
:type
=>
"image/png"
}
/
=
javascript_tag
do
=
javascript_tag
do
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_URI = "
#{
request
.
env
[
"REQUEST_URI"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
REQ_REFFER = "
#{
request
.
env
[
"HTTP_REFERER"
]
}
";
%body
{
:class
=>
content_for?
(
:body_class
)
?
yield
(
:body_class
)
:
'project-page'
,
:id
=>
yield
(
:boyd_id
)}
%body
{
:class
=>
body_class
(
'project-page'
)
,
:id
=>
yield
(
:boyd_id
)}
#container
#container
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/flash"
=
render
:partial
=>
"layouts/head_panel"
=
render
:partial
=>
"layouts/head_panel"
...
...
app/views/projects/_refs.html.haml
0 → 100644
View file @
415516b2
=
form_tag
destination
,
: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 @
415516b2
.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
:partial
=>
"projects/refs"
,
:locals
=>
{
:destination
=>
tree_project_path
(
@project
)
}
.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