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
7e0726b1
Commit
7e0726b1
authored
Jun 03, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #890 from avakarev/clean-up-helpers
Clean up helpers
parents
a35a1298
6ee4548c
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1 addition
and
134 deletions
+1
-134
app/helpers/admin/projects_helper.rb
app/helpers/admin/projects_helper.rb
+0
-2
app/helpers/admin/users_helper.rb
app/helpers/admin/users_helper.rb
+0
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+1
-38
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+0
-15
app/helpers/dashboard_helper.rb
app/helpers/dashboard_helper.rb
+0
-36
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+0
-6
app/helpers/keys_helper.rb
app/helpers/keys_helper.rb
+0
-2
app/helpers/profile_helper.rb
app/helpers/profile_helper.rb
+0
-2
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+0
-22
app/helpers/team_members_helper.rb
app/helpers/team_members_helper.rb
+0
-2
app/helpers/user_issues_helper.rb
app/helpers/user_issues_helper.rb
+0
-2
app/helpers/user_merge_requests_helper.rb
app/helpers/user_merge_requests_helper.rb
+0
-3
app/helpers/wikis_helper.rb
app/helpers/wikis_helper.rb
+0
-2
No files found.
app/helpers/admin/projects_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
Admin::ProjectsHelper
end
app/helpers/admin/users_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
Admin::UsersHelper
end
app/helpers/application_helper.rb
View file @
7e0726b1
...
...
@@ -8,10 +8,6 @@ module ApplicationHelper
"
#{
gravatar_host
}
/avatar/
#{
Digest
::
MD5
.
hexdigest
(
user_email
.
downcase
)
}
?s=
#{
size
}
&d=identicon"
end
def
fixed_mode?
true
end
def
request_protocol
request
.
ssl?
?
"https"
:
"http"
end
...
...
@@ -20,32 +16,6 @@ module ApplicationHelper
"
#{
request_protocol
}
://
#{
GIT_HOST
[
"host"
]
}
/"
end
def
body_class
(
default_class
=
nil
)
main
=
content_for
(
:body_class
).
blank?
?
default_class
:
content_for
(
:body_class
)
[
main
,
"collapsed"
].
join
(
" "
)
end
def
commit_name
(
project
,
commit
)
if
project
.
commit
.
id
==
commit
.
id
"master"
else
commit
.
id
end
end
def
admin_namespace?
controller
.
class
.
name
.
split
(
"::"
).
first
==
"Admin"
end
def
projects_namespace?
!
current_page?
(
root_url
)
&&
controller
.
controller_name
!=
"keys"
&&
!
admin_namespace?
end
def
last_commit
(
project
)
if
project
.
repo_exists?
time_ago_in_words
(
project
.
commit
.
committed_date
)
+
" ago"
...
...
@@ -62,7 +32,7 @@ module ApplicationHelper
[
"Tag"
,
@project
.
tags
]
]
# If reference is commit id -
# If reference is commit id -
# we should add it to branch/tag selectbox
if
(
@ref
&&
!
options
.
flatten
.
include?
(
@ref
)
&&
@ref
=~
/^[0-9a-zA-Z]{6,52}$/
)
...
...
@@ -114,10 +84,6 @@ module ApplicationHelper
Devise
.
omniauth_providers
.
include?
(
:ldap
)
end
def
layout
controller
.
send
:_layout
end
def
app_theme
if
current_user
&&
current_user
.
theme_id
==
1
"ui_basic"
...
...
@@ -126,7 +92,4 @@ module ApplicationHelper
end
end
def
string_to_utf8
str
Gitlab
::
Encode
.
utf8
str
end
end
app/helpers/commits_helper.rb
View file @
7e0726b1
module
CommitsHelper
def
old_line_number
(
line
,
i
)
end
def
new_line_number
(
line
,
i
)
end
def
more_commits_link
offset
=
params
[
:offset
]
||
0
limit
=
params
[
:limit
]
||
100
link_to
"More"
,
project_commits_path
(
@project
,
:offset
=>
offset
.
to_i
+
limit
.
to_i
,
:limit
=>
limit
),
:remote
=>
true
,
:class
=>
"lite_button vm"
,
:style
=>
"text-align:center; width:930px; "
,
:id
=>
"more-commits-link"
end
def
commit_msg_with_link_to_issues
(
project
,
message
)
return
''
unless
message
out
=
''
...
...
app/helpers/dashboard_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
DashboardHelper
def
dashboard_feed_path
(
project
,
object
)
case
object
.
class
.
name
.
to_s
when
"Issue"
then
project_issue_path
(
project
,
project
.
issues
.
find
(
object
.
id
))
when
"Commit"
then
project_commit_path
(
project
,
project
.
repo
.
commits
(
object
.
id
).
first
)
when
"MergeRequest"
then
project_merge_request_path
(
project
,
object
.
id
)
when
"Note"
then
note
=
object
case
note
.
noteable_type
when
"Issue"
then
project_issue_path
(
project
,
note
.
noteable_id
)
when
"Snippet"
then
project_snippet_path
(
project
,
note
.
noteable_id
)
when
"Commit"
then
project_commit_path
(
project
,
:id
=>
note
.
noteable_id
)
when
"MergeRequest"
then
project_merge_request_path
(
project
,
note
.
noteable_id
)
else
wall_project_path
(
project
)
end
else
wall_project_path
(
project
)
end
rescue
"#"
end
def
dashboard_feed_title
(
object
)
klass
=
object
.
class
.
to_s
.
split
(
"::"
).
last
title
=
case
klass
when
"Note"
then
markdown
(
object
.
note
)
when
"Issue"
then
object
.
title
when
"Commit"
then
object
.
safe_message
when
"MergeRequest"
then
object
.
title
else
return
"Project Wall"
end
truncate
(
sanitize
(
title
,
:tags
=>
[]),
:length
=>
60
)
end
end
app/helpers/issues_helper.rb
View file @
7e0726b1
module
IssuesHelper
def
sort_class
if
can?
(
current_user
,
:admin_issue
,
@project
)
&&
(
!
params
[
:f
]
||
params
[
:f
]
==
"0"
)
"handle"
end
end
def
project_issues_filter_path
project
,
params
=
{}
params
[
:f
]
||=
cookies
[
'issue_filter'
]
project_issues_path
project
,
params
...
...
app/helpers/keys_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
KeysHelper
end
app/helpers/profile_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
ProfileHelper
end
app/helpers/projects_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
ProjectsHelper
def
view_mode_style
(
type
)
cookies
[
"project_view"
]
||=
"tile"
cookies
[
"project_view"
]
==
type
?
nil
:
"display:none"
end
def
load_note_parent
(
id
,
type
,
project
)
case
type
when
"Issue"
then
@project
.
issues
.
find
(
id
)
when
"Commit"
then
@project
.
repo
.
commits
(
id
).
first
when
"Snippet"
then
@project
.
snippets
.
find
(
id
)
else
true
end
rescue
nil
end
def
repository_tab_class
end
end
app/helpers/team_members_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
TeamMembersHelper
end
app/helpers/user_issues_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
UserIssuesHelper
end
app/helpers/user_merge_requests_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
UserMergeRequestsHelper
end
app/helpers/wikis_helper.rb
deleted
100644 → 0
View file @
a35a1298
module
WikisHelper
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