Commit baef45e9c183d4dedd1c76c0bd1854b46d7ccb1a

Authored by Nathan Broadbent
1 parent 892c84ea
Exists in master and in 1 other branch production

Added #url to issue trackers, for links on apps#index table

app/models/issue_tracker.rb
@@ -27,5 +27,7 @@ class IssueTracker @@ -27,5 +27,7 @@ class IssueTracker
27 # Allows us to set the issue tracker class from a single form. 27 # Allows us to set the issue tracker class from a single form.
28 def type; self._type; end 28 def type; self._type; end
29 def type=(t); self._type=t; end 29 def type=(t); self._type=t; end
  30 +
  31 + def url; nil; end
30 end 32 end
31 33
app/models/issue_trackers/fogbugz_tracker.rb
@@ -40,5 +40,9 @@ class IssueTrackers::FogbugzTracker < IssueTracker @@ -40,5 +40,9 @@ class IssueTrackers::FogbugzTracker < IssueTracker
40 def body_template 40 def body_template
41 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/fogbugz_body.txt.erb")) 41 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/fogbugz_body.txt.erb"))
42 end 42 end
  43 +
  44 + def url
  45 + "http://#{account}.fogbugz.com/"
  46 + end
43 end 47 end
44 48
app/models/issue_trackers/github_issues_tracker.rb
@@ -32,4 +32,8 @@ class IssueTrackers::GithubIssuesTracker < IssueTracker @@ -32,4 +32,8 @@ class IssueTrackers::GithubIssuesTracker < IssueTracker
32 def body_template 32 def body_template
33 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/github_issues_body.txt.erb").gsub(/^\s*/, '')) 33 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/github_issues_body.txt.erb").gsub(/^\s*/, ''))
34 end 34 end
  35 +
  36 + def url
  37 + "https://github.com/#{project_id}/issues"
  38 + end
35 end 39 end
app/models/issue_trackers/lighthouse_tracker.rb
@@ -2,7 +2,7 @@ class IssueTrackers::LighthouseTracker < IssueTracker @@ -2,7 +2,7 @@ class IssueTrackers::LighthouseTracker < IssueTracker
2 Label = "lighthouseapp" 2 Label = "lighthouseapp"
3 Fields = [ 3 Fields = [
4 [:account, { 4 [:account, {
5 - :placeholder => "abc from abc.lighthouseapp.com" 5 + :placeholder => "abc from http://abc.lighthouseapp.com"
6 }], 6 }],
7 [:api_token, { 7 [:api_token, {
8 :placeholder => "API Token for your account" 8 :placeholder => "API Token for your account"
@@ -37,5 +37,9 @@ class IssueTrackers::LighthouseTracker < IssueTracker @@ -37,5 +37,9 @@ class IssueTrackers::LighthouseTracker < IssueTracker
37 def body_template 37 def body_template
38 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/lighthouseapp_body.txt.erb").gsub(/^\s*/, '')) 38 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/lighthouseapp_body.txt.erb").gsub(/^\s*/, ''))
39 end 39 end
  40 +
  41 + def url
  42 + "http://#{account}.lighthouseapp.com"
  43 + end
40 end 44 end
41 45
app/models/issue_trackers/mingle_tracker.rb
@@ -3,7 +3,7 @@ class IssueTrackers::MingleTracker < IssueTracker @@ -3,7 +3,7 @@ class IssueTrackers::MingleTracker < IssueTracker
3 Fields = [ 3 Fields = [
4 [:account, { 4 [:account, {
5 :label => "Mingle URL", 5 :label => "Mingle URL",
6 - :placeholder => "abc from http://abc.fogbugz.com/" 6 + :placeholder => "http://mingle.example.com/"
7 }], 7 }],
8 [:project_id, { 8 [:project_id, {
9 :placeholder => "Mingle project" 9 :placeholder => "Mingle project"
@@ -56,5 +56,11 @@ class IssueTrackers::MingleTracker < IssueTracker @@ -56,5 +56,11 @@ class IssueTrackers::MingleTracker < IssueTracker
56 hash 56 hash
57 end 57 end
58 end 58 end
  59 +
  60 + def url
  61 + acc_url = account.start_with?('http') ? account : "http://#{account}"
  62 + URI.parse("#{acc_url}/projects/#{project_id}").to_s
  63 + rescue URI::InvalidURIError
  64 + end
59 end 65 end
60 66
app/models/issue_trackers/pivotal_labs_tracker.rb
@@ -24,5 +24,9 @@ class IssueTrackers::PivotalLabsTracker < IssueTracker @@ -24,5 +24,9 @@ class IssueTrackers::PivotalLabsTracker < IssueTracker
24 def body_template 24 def body_template
25 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/pivotal_body.txt.erb")) 25 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/pivotal_body.txt.erb"))
26 end 26 end
  27 +
  28 + def url
  29 + "https://www.pivotaltracker.com/"
  30 + end
27 end 31 end
28 32
app/models/issue_trackers/redmine_tracker.rb
@@ -50,5 +50,11 @@ class IssueTrackers::RedmineTracker < IssueTracker @@ -50,5 +50,11 @@ class IssueTrackers::RedmineTracker < IssueTracker
50 def body_template 50 def body_template
51 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/textile_body.txt.erb")) 51 @@body_template ||= ERB.new(File.read(Rails.root + "app/views/issue_trackers/textile_body.txt.erb"))
52 end 52 end
  53 +
  54 + def url
  55 + acc_url = account.start_with?('http') ? account : "http://#{account}"
  56 + URI.parse("#{acc_url}?project_id=#{project_id}").to_s
  57 + rescue URI::InvalidURIError
  58 + end
53 end 59 end
54 60