From a9674df10ce9e91a63183e2ce0cbf5cb3a4682a6 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Thu, 18 Aug 2011 07:54:49 +0800 Subject: [PATCH] Extracted issue tracker fields into partial --- app/views/apps/_fields.html.haml | 67 +------------------------------------------------------------------ app/views/apps/_issue_tracker_fields.html.haml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 66 deletions(-) create mode 100644 app/views/apps/_issue_tracker_fields.html.haml diff --git a/app/views/apps/_fields.html.haml b/app/views/apps/_fields.html.haml index f8df8be..b14a65d 100644 --- a/app/views/apps/_fields.html.haml +++ b/app/views/apps/_fields.html.haml @@ -45,70 +45,5 @@ = f.check_box :resolve_errs_on_deploy = f.label :resolve_errs_on_deploy, 'Resolve errs on deploy' -%fieldset - %legend Issue tracker - = f.fields_for :issue_tracker do |w| - %div.issue_tracker.nested - %div.choose - = label_tag :type_none, :for => label_for_attr(w, 'type_issuetracker'), :class => "label_radio none" do - = w.radio_button :type, "IssueTracker", 'data-section' => 'none' - (None) - = label_tag :type_lighthouseapp, :for => label_for_attr(w, 'type_lighthousetracker'), :class => "label_radio lighthouseapp" do - = w.radio_button :type, "LighthouseTracker", 'data-section' => 'lighthouse' - Lighthouse - = label_tag :type_redmine, :for => label_for_attr(w, 'type_redminetracker'), :class => "label_radio redmine" do - = w.radio_button :type, "RedmineTracker", 'data-section' => 'redmine' - Redmine - = label_tag :type_pivotal, :for => label_for_attr(w, 'type_pivotallabstracker'), :class => "label_radio pivotal" do - = w.radio_button :type, "PivotalLabsTracker", 'data-section' => 'pivotal' - Pivotal Tracker - %br - = label_tag :type_fogbugz, :for => label_for_attr(w, 'type_fogbugztracker'), :class => "label_radio fogbugz" do - = w.radio_button :type, "FogbugzTracker", 'data-section' => 'fogbugz' - FogBugz - = label_tag :type_fogbugz, :for => label_for_attr(w, 'type_mingletracker'), :class => "label_radio mingle" do - = w.radio_button :type, "MingleTracker", 'data-section' => 'mingle' - Mingle - - %div.tracker_params.none{:class => (w.object && !(w.object.class < IssueTracker)) ? 'chosen' : nil} - %p When no issue tracker has been configured, you will be able to leave comments on errors. - %div.tracker_params.lighthouse{:class => w.object.is_a?(LighthouseTracker) ? 'chosen' : nil} - = w.label :account, "Account" - = w.text_field :account, :placeholder => "abc from abc.lighthouseapp.com" - = w.label :api_token, "API token" - = w.text_field :api_token, :placeholder => "API Token for your account" - = w.label :project_id, "Project ID" - = w.text_field :project_id - %div.tracker_params.redmine{:class => w.object.is_a?(RedmineTracker) ? 'chosen' : nil} - = w.label :account, "Redmine URL" - = w.text_field :account, :placeholder => "like http://www.redmine.org/" - = w.label :api_token, "API token" - = w.text_field :api_token, :placeholder => "API Token for your account" - = w.label :project_id, "Project ID" - = w.text_field :project_id - %div.tracker_params.pivotal{:class => w.object.is_a?(PivotalLabsTracker) ? 'chosen' : nil} - = w.label :project_id, "Project ID" - = w.text_field :project_id - = w.label :api_token, "API token" - = w.text_field :api_token, :placeholder => "API Token for your account" - %div.tracker_params.fogbugz{:class => w.object.is_a?(FogbugzTracker) ? 'chosen' : nil} - = w.label :project_id, "Area Name" - = w.text_field :project_id - = w.label :account, "FogBugz URL" - = w.text_field :account, :placeholder => "abc from http://abc.fogbugz.com/" - = w.label :username, 'Username' - = w.text_field :username, :placeholder => 'Username/Email for your account' - = w.label :password, 'Password' - = w.password_field :password, :placeholder => 'Password for your account' - %div.tracker_params.mingle{:class => w.object.is_a?(MingleTracker) ? 'chosen' : nil} - = w.label :account, "Mingle URL" - = w.text_field :account, :placeholder => "http://mingle.yoursite.com/" - = w.label :project_id, "Project ID" - = w.text_field :project_id - = w.label :ticket_properties, "Card Properties (comma separated key=value pairs)" - = w.text_field :ticket_properties, :placeholder => "card_type = Defect, defect_status = Open, priority = Essential" - = w.label :username, 'Sign-in name' - = w.text_field :username, :placeholder => 'Sign-in name for your account' - = w.label :password, 'Password' - = w.password_field :password, :placeholder => 'Password for your account' += render "issue_tracker_fields", :f => f diff --git a/app/views/apps/_issue_tracker_fields.html.haml b/app/views/apps/_issue_tracker_fields.html.haml new file mode 100644 index 0000000..6fad992 --- /dev/null +++ b/app/views/apps/_issue_tracker_fields.html.haml @@ -0,0 +1,67 @@ +%fieldset + %legend Issue tracker + = f.fields_for :issue_tracker do |w| + %div.issue_tracker.nested + %div.choose + = label_tag :type_none, :for => label_for_attr(w, 'type_issuetracker'), :class => "label_radio none" do + = w.radio_button :type, "IssueTracker", 'data-section' => 'none' + (None) + = label_tag :type_lighthouseapp, :for => label_for_attr(w, 'type_lighthousetracker'), :class => "label_radio lighthouseapp" do + = w.radio_button :type, "LighthouseTracker", 'data-section' => 'lighthouse' + Lighthouse + = label_tag :type_redmine, :for => label_for_attr(w, 'type_redminetracker'), :class => "label_radio redmine" do + = w.radio_button :type, "RedmineTracker", 'data-section' => 'redmine' + Redmine + = label_tag :type_pivotal, :for => label_for_attr(w, 'type_pivotallabstracker'), :class => "label_radio pivotal" do + = w.radio_button :type, "PivotalLabsTracker", 'data-section' => 'pivotal' + Pivotal Tracker + %br + = label_tag :type_fogbugz, :for => label_for_attr(w, 'type_fogbugztracker'), :class => "label_radio fogbugz" do + = w.radio_button :type, "FogbugzTracker", 'data-section' => 'fogbugz' + FogBugz + = label_tag :type_fogbugz, :for => label_for_attr(w, 'type_mingletracker'), :class => "label_radio mingle" do + = w.radio_button :type, "MingleTracker", 'data-section' => 'mingle' + Mingle + + %div.tracker_params.none{:class => (w.object && !(w.object.class < IssueTracker)) ? 'chosen' : nil} + %p When no issue tracker has been configured, you will be able to leave comments on errors. + %div.tracker_params.lighthouse{:class => w.object.is_a?(LighthouseTracker) ? 'chosen' : nil} + = w.label :account, "Account" + = w.text_field :account, :placeholder => "abc from abc.lighthouseapp.com" + = w.label :api_token, "API token" + = w.text_field :api_token, :placeholder => "API Token for your account" + = w.label :project_id, "Project ID" + = w.text_field :project_id + %div.tracker_params.redmine{:class => w.object.is_a?(RedmineTracker) ? 'chosen' : nil} + = w.label :account, "Redmine URL" + = w.text_field :account, :placeholder => "like http://www.redmine.org/" + = w.label :api_token, "API token" + = w.text_field :api_token, :placeholder => "API Token for your account" + = w.label :project_id, "Project ID" + = w.text_field :project_id + %div.tracker_params.pivotal{:class => w.object.is_a?(PivotalLabsTracker) ? 'chosen' : nil} + = w.label :project_id, "Project ID" + = w.text_field :project_id + = w.label :api_token, "API token" + = w.text_field :api_token, :placeholder => "API Token for your account" + %div.tracker_params.fogbugz{:class => w.object.is_a?(FogbugzTracker) ? 'chosen' : nil} + = w.label :project_id, "Area Name" + = w.text_field :project_id + = w.label :account, "FogBugz URL" + = w.text_field :account, :placeholder => "abc from http://abc.fogbugz.com/" + = w.label :username, 'Username' + = w.text_field :username, :placeholder => 'Username/Email for your account' + = w.label :password, 'Password' + = w.password_field :password, :placeholder => 'Password for your account' + %div.tracker_params.mingle{:class => w.object.is_a?(MingleTracker) ? 'chosen' : nil} + = w.label :account, "Mingle URL" + = w.text_field :account, :placeholder => "http://mingle.yoursite.com/" + = w.label :project_id, "Project ID" + = w.text_field :project_id + = w.label :ticket_properties, "Card Properties (comma separated key=value pairs)" + = w.text_field :ticket_properties, :placeholder => "card_type = Defect, defect_status = Open, priority = Essential" + = w.label :username, 'Sign-in name' + = w.text_field :username, :placeholder => 'Sign-in name for your account' + = w.label :password, 'Password' + = w.password_field :password, :placeholder => 'Password for your account' + -- libgit2 0.21.2