Commit 16b49124be59aa74a35f855fd4e0d75f100051de
1 parent
a35a1298
Exists in
master
and in
4 other branches
Remove unused methods
Showing
5 changed files
with
1 additions
and
113 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -8,10 +8,6 @@ module ApplicationHelper | @@ -8,10 +8,6 @@ module ApplicationHelper | ||
8 | "#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon" | 8 | "#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon" |
9 | end | 9 | end |
10 | 10 | ||
11 | - def fixed_mode? | ||
12 | - true | ||
13 | - end | ||
14 | - | ||
15 | def request_protocol | 11 | def request_protocol |
16 | request.ssl? ? "https" : "http" | 12 | request.ssl? ? "https" : "http" |
17 | end | 13 | end |
@@ -20,32 +16,6 @@ module ApplicationHelper | @@ -20,32 +16,6 @@ module ApplicationHelper | ||
20 | "#{request_protocol}://#{GIT_HOST["host"]}/" | 16 | "#{request_protocol}://#{GIT_HOST["host"]}/" |
21 | end | 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 | def last_commit(project) | 19 | def last_commit(project) |
50 | if project.repo_exists? | 20 | if project.repo_exists? |
51 | time_ago_in_words(project.commit.committed_date) + " ago" | 21 | time_ago_in_words(project.commit.committed_date) + " ago" |
@@ -62,7 +32,7 @@ module ApplicationHelper | @@ -62,7 +32,7 @@ module ApplicationHelper | ||
62 | [ "Tag", @project.tags ] | 32 | [ "Tag", @project.tags ] |
63 | ] | 33 | ] |
64 | 34 | ||
65 | - # If reference is commit id - | 35 | + # If reference is commit id - |
66 | # we should add it to branch/tag selectbox | 36 | # we should add it to branch/tag selectbox |
67 | if(@ref && !options.flatten.include?(@ref) && | 37 | if(@ref && !options.flatten.include?(@ref) && |
68 | @ref =~ /^[0-9a-zA-Z]{6,52}$/) | 38 | @ref =~ /^[0-9a-zA-Z]{6,52}$/) |
@@ -114,10 +84,6 @@ module ApplicationHelper | @@ -114,10 +84,6 @@ module ApplicationHelper | ||
114 | Devise.omniauth_providers.include?(:ldap) | 84 | Devise.omniauth_providers.include?(:ldap) |
115 | end | 85 | end |
116 | 86 | ||
117 | - def layout | ||
118 | - controller.send :_layout | ||
119 | - end | ||
120 | - | ||
121 | def app_theme | 87 | def app_theme |
122 | if current_user && current_user.theme_id == 1 | 88 | if current_user && current_user.theme_id == 1 |
123 | "ui_basic" | 89 | "ui_basic" |
@@ -126,7 +92,4 @@ module ApplicationHelper | @@ -126,7 +92,4 @@ module ApplicationHelper | ||
126 | end | 92 | end |
127 | end | 93 | end |
128 | 94 | ||
129 | - def string_to_utf8 str | ||
130 | - Gitlab::Encode.utf8 str | ||
131 | - end | ||
132 | end | 95 | end |
app/helpers/commits_helper.rb
1 | module CommitsHelper | 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 | def commit_msg_with_link_to_issues(project, message) | 2 | def commit_msg_with_link_to_issues(project, message) |
18 | return '' unless message | 3 | return '' unless message |
19 | out = '' | 4 | out = '' |
app/helpers/dashboard_helper.rb
1 | module DashboardHelper | 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 | end | 2 | end |
app/helpers/issues_helper.rb
1 | module IssuesHelper | 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 | def project_issues_filter_path project, params = {} | 2 | def project_issues_filter_path project, params = {} |
9 | params[:f] ||= cookies['issue_filter'] | 3 | params[:f] ||= cookies['issue_filter'] |
10 | project_issues_path project, params | 4 | project_issues_path project, params |
app/helpers/projects_helper.rb
1 | module ProjectsHelper | 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 | end | 2 | end |