<%= f.hidden_field :visibility %>
-
- <%= f.label(:is_test, _('mock project for testing, practice, or educational purposes'), class: 'control-label') %>
-
-
- <%= check_box_tag(:is_test,1, @plan.is_test?) %>
-
+ <%= f.label(:is_test, raw("#{check_box_tag(:is_test,1, @plan.is_test?)} #{_('mock project for testing, practice, or educational purposes')}"), class: 'control-label') %>
diff --git a/db/migrate/20171013152425_add_principal_investigator_phone_to_plans.rb b/db/migrate/20171013152425_add_principal_investigator_phone_to_plans.rb
new file mode 100644
index 0000000..dc39e45
--- /dev/null
+++ b/db/migrate/20171013152425_add_principal_investigator_phone_to_plans.rb
@@ -0,0 +1,5 @@
+class AddPrincipalInvestigatorPhoneToPlans < ActiveRecord::Migration
+ def change
+ add_column :plans, :principal_investigator_phone, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 925db70..a15cd65 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170719114516) do
+ActiveRecord::Schema.define(version: 20171013152425) do
create_table "annotations", force: :cascade do |t|
t.integer "question_id", limit: 4
@@ -228,6 +228,7 @@
t.string "data_contact_email", limit: 255
t.string "data_contact_phone", limit: 255
t.string "principal_investigator_email", limit: 255
+ t.string "principal_investigator_phone"
end
add_index "plans", ["template_id"], name: "index_plans_on_template_id", using: :btree
diff --git a/lib/assets/javascripts/views/plans/edit_details.js b/lib/assets/javascripts/views/plans/edit_details.js
index 84f3535..fd04772 100644
--- a/lib/assets/javascripts/views/plans/edit_details.js
+++ b/lib/assets/javascripts/views/plans/edit_details.js
@@ -7,4 +7,17 @@
$('#plan_visibility').val($(this).is(':checked') ? 'is_test' : 'privately_visible');
});
ariatiseForm({ selector: '.edit_plan' });
+
+ const showHideDataContact = (el) => {
+ if ((el).is(':checked')) {
+ $('div.data-contact').fadeOut();
+ } else {
+ $('div.data-contact').fadeIn();
+ }
+ };
+
+ $('#show_data_contact').click((e) => {
+ showHideDataContact($(e.currentTarget));
+ });
+ showHideDataContact($('#show_data_contact'));
});