Commit 16b49124be59aa74a35f855fd4e0d75f100051de

Authored by Andrey Vakarev
1 parent a35a1298

Remove unused methods

app/helpers/application_helper.rb
... ... @@ -8,10 +8,6 @@ module ApplicationHelper
8 8 "#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon"
9 9 end
10 10  
11   - def fixed_mode?
12   - true
13   - end
14   -
15 11 def request_protocol
16 12 request.ssl? ? "https" : "http"
17 13 end
... ... @@ -20,32 +16,6 @@ module ApplicationHelper
20 16 "#{request_protocol}://#{GIT_HOST["host"]}/"
21 17 end
22 18  
23   - def body_class(default_class = nil)
24   - main = content_for(:body_class).blank? ?
25   - default_class :
26   - content_for(:body_class)
27   -
28   - [main, "collapsed"].join(" ")
29   - end
30   -
31   - def commit_name(project, commit)
32   - if project.commit.id == commit.id
33   - "master"
34   - else
35   - commit.id
36   - end
37   - end
38   -
39   - def admin_namespace?
40   - controller.class.name.split("::").first=="Admin"
41   - end
42   -
43   - def projects_namespace?
44   - !current_page?(root_url) &&
45   - controller.controller_name != "keys" &&
46   - !admin_namespace?
47   - end
48   -
49 19 def last_commit(project)
50 20 if project.repo_exists?
51 21 time_ago_in_words(project.commit.committed_date) + " ago"
... ... @@ -62,7 +32,7 @@ module ApplicationHelper
62 32 [ "Tag", @project.tags ]
63 33 ]
64 34  
65   - # If reference is commit id -
  35 + # If reference is commit id -
66 36 # we should add it to branch/tag selectbox
67 37 if(@ref && !options.flatten.include?(@ref) &&
68 38 @ref =~ /^[0-9a-zA-Z]{6,52}$/)
... ... @@ -114,10 +84,6 @@ module ApplicationHelper
114 84 Devise.omniauth_providers.include?(:ldap)
115 85 end
116 86  
117   - def layout
118   - controller.send :_layout
119   - end
120   -
121 87 def app_theme
122 88 if current_user && current_user.theme_id == 1
123 89 "ui_basic"
... ... @@ -126,7 +92,4 @@ module ApplicationHelper
126 92 end
127 93 end
128 94  
129   - def string_to_utf8 str
130   - Gitlab::Encode.utf8 str
131   - end
132 95 end
... ...
app/helpers/commits_helper.rb
1 1 module CommitsHelper
2   - def old_line_number(line, i)
3   -
4   - end
5   -
6   - def new_line_number(line, i)
7   -
8   - end
9   -
10   - def more_commits_link
11   - offset = params[:offset] || 0
12   - limit = params[:limit] || 100
13   - link_to "More", project_commits_path(@project, :offset => offset.to_i + limit.to_i, :limit => limit),
14   - :remote => true, :class => "lite_button vm", :style => "text-align:center; width:930px; ", :id => "more-commits-link"
15   - end
16   -
17 2 def commit_msg_with_link_to_issues(project, message)
18 3 return '' unless message
19 4 out = ''
... ...
app/helpers/dashboard_helper.rb
1 1 module DashboardHelper
2   - def dashboard_feed_path(project, object)
3   - case object.class.name.to_s
4   - when "Issue" then project_issue_path(project, project.issues.find(object.id))
5   - when "Commit" then project_commit_path(project, project.repo.commits(object.id).first)
6   - when "MergeRequest" then project_merge_request_path(project, object.id)
7   - when "Note"
8   - then
9   - note = object
10   - case note.noteable_type
11   - when "Issue" then project_issue_path(project, note.noteable_id)
12   - when "Snippet" then project_snippet_path(project, note.noteable_id)
13   - when "Commit" then project_commit_path(project, :id => note.noteable_id)
14   - when "MergeRequest" then project_merge_request_path(project, note.noteable_id)
15   - else wall_project_path(project)
16   - end
17   - else wall_project_path(project)
18   - end
19   - rescue
20   - "#"
21   - end
22   -
23   - def dashboard_feed_title(object)
24   - klass = object.class.to_s.split("::").last
25   -
26   - title = case klass
27   - when "Note" then markdown(object.note)
28   - when "Issue" then object.title
29   - when "Commit" then object.safe_message
30   - when "MergeRequest" then object.title
31   - else return "Project Wall"
32   - end
33   -
34   - truncate(sanitize(title, :tags => []), :length => 60)
35   - end
36 2 end
... ...
app/helpers/issues_helper.rb
1 1 module IssuesHelper
2   - def sort_class
3   - if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0")
4   - "handle"
5   - end
6   - end
7   -
8 2 def project_issues_filter_path project, params = {}
9 3 params[:f] ||= cookies['issue_filter']
10 4 project_issues_path project, params
... ...
app/helpers/projects_helper.rb
1 1 module ProjectsHelper
2   - def view_mode_style(type)
3   - cookies["project_view"] ||= "tile"
4   - cookies["project_view"] == type ? nil : "display:none"
5   - end
6   -
7   - def load_note_parent(id, type, project)
8   - case type
9   - when "Issue" then @project.issues.find(id)
10   - when "Commit" then @project.repo.commits(id).first
11   - when "Snippet" then @project.snippets.find(id)
12   - else
13   - true
14   - end
15   - rescue
16   - nil
17   - end
18   -
19   - def repository_tab_class
20   - end
21   -
22 2 end
... ...