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
Boxiang Sun
gitlab-ce
Commits
4df4b381
Commit
4df4b381
authored
Dec 12, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:gitlabhq/gitlabhq
parents
5bc97fbd
7b7549be
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
16 deletions
+33
-16
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+23
-12
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-0
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+0
-2
app/views/refs/_tree.html.haml
app/views/refs/_tree.html.haml
+7
-1
lib/utils.rb
lib/utils.rb
+2
-1
No files found.
app/assets/stylesheets/projects.css.scss
View file @
4df4b381
...
@@ -477,6 +477,17 @@ body.project-page table.no-borders td{
...
@@ -477,6 +477,17 @@ body.project-page table.no-borders td{
#tree-content-holder
{
float
:left
;
width
:
100%
;
}
#tree-content-holder
{
float
:left
;
width
:
100%
;
}
#tree-readme-holder
{
float
:left
;
width
:
100%
;
.readme
{
@include
round-borders-all
(
4px
);
padding
:
4px
15px
;
background
:
#F7F7F7
;
}
}
/* Commit Page */
/* Commit Page */
...
...
app/helpers/application_helper.rb
View file @
4df4b381
require
'digest/md5'
require
'digest/md5'
module
ApplicationHelper
module
ApplicationHelper
include
Utils
::
CharEncode
def
gravatar_icon
(
user_email
)
def
gravatar_icon
(
user_email
)
gravatar_host
=
request
.
ssl?
?
"https://secure.gravatar.com"
:
"http://www.gravatar.com"
gravatar_host
=
request
.
ssl?
?
"https://secure.gravatar.com"
:
"http://www.gravatar.com"
...
...
app/helpers/commits_helper.rb
View file @
4df4b381
module
CommitsHelper
module
CommitsHelper
include
Utils
::
CharEncode
def
old_line_number
(
line
,
i
)
def
old_line_number
(
line
,
i
)
end
end
...
...
app/views/refs/_tree.html.haml
View file @
4df4b381
...
@@ -35,6 +35,12 @@
...
@@ -35,6 +35,12 @@
-
contents
.
select
{
|
i
|
i
.
is_a?
(
Grit
::
Blob
)}.
each
do
|
content
|
-
contents
.
select
{
|
i
|
i
.
is_a?
(
Grit
::
Blob
)}.
each
do
|
content
|
=
render
:partial
=>
"refs/tree_item"
,
:locals
=>
{
:content
=>
content
}
=
render
:partial
=>
"refs/tree_item"
,
:locals
=>
{
:content
=>
content
}
-
if
content
=
contents
.
select
{
|
c
|
c
.
is_a?
(
Grit
::
Blob
)
and
c
.
name
=~
/^readme\.(md|markdown)$/i
}.
first
#tree-readme-holder
%h3
=
content
.
name
.readme
=
markdown
(
encode
content
.
data
)
:javascript
:javascript
$
(
function
(){
$
(
function
(){
$
(
'
select#branch
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
$
(
'
select#branch
'
).
selectmenu
({
style
:
'
popup
'
,
width
:
200
});
...
...
lib/utils.rb
View file @
4df4b381
...
@@ -18,13 +18,14 @@ module Utils
...
@@ -18,13 +18,14 @@ module Utils
module
CharEncode
module
CharEncode
def
encode
(
string
)
def
encode
(
string
)
return
''
unless
string
cd
=
CharDet
.
detect
(
string
)
cd
=
CharDet
.
detect
(
string
)
if
cd
.
confidence
>
0.6
if
cd
.
confidence
>
0.6
string
.
force_encoding
(
cd
.
encoding
)
string
.
force_encoding
(
cd
.
encoding
)
end
end
string
.
encode
(
"utf-8"
,
:undef
=>
:replace
,
:replace
=>
"?"
,
:invalid
=>
:replace
)
string
.
encode
(
"utf-8"
,
:undef
=>
:replace
,
:replace
=>
"?"
,
:invalid
=>
:replace
)
rescue
rescue
"Invalid
code e
ncoding"
"Invalid
E
ncoding"
end
end
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