From 5a011e8571461609654e939dc6d8221951b73923 Mon Sep 17 00:00:00 2001 From: Erez Freiberger Date: Tue, 19 Feb 2019 22:54:26 +0200 Subject: [PATCH] adding angel name --- app/views/camps/_edit_point_of_contact.haml | 4 ++++ app/views/camps/show.html.erb | 3 ++- config/locales/en.yml | 1 + config/locales/he.yml | 1 + ...20190219203141_add_dream_point_of_contact_name_to_camp.rb | 5 +++++ db/schema.rb | 3 ++- 6 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20190219203141_add_dream_point_of_contact_name_to_camp.rb diff --git a/app/views/camps/_edit_point_of_contact.haml b/app/views/camps/_edit_point_of_contact.haml index 4c5f4b57..71b028af 100755 --- a/app/views/camps/_edit_point_of_contact.haml +++ b/app/views/camps/_edit_point_of_contact.haml @@ -1,5 +1,9 @@ = simple_form_for @camp, :html => {:dir => I18n.t(:html_direction), :id => 'camp-form' } do |form| .combo + = t(:angel_name) + = form.text_field :dream_point_of_contact_name, :maxlength => 64, :class => "form-control" + .combo + = t(:contact_email) = form.text_field :dream_point_of_contact_email, :maxlength => 64, :class => "form-control" .submit = form.submit t(:update_point_of_contact), id: 'done-camp', class: 'btn btn-success' diff --git a/app/views/camps/show.html.erb b/app/views/camps/show.html.erb index 03a783de..73331467 100644 --- a/app/views/camps/show.html.erb +++ b/app/views/camps/show.html.erb @@ -370,7 +370,8 @@  <%=t :form_dream_point_of_contact_email %>
- <% if @camp.creator == current_user %> + <% if @camp.creator == current_user && @camp.dream_point_of_contact_name && @camp.dream_point_of_contact_email %> + <%= @camp.dream_point_of_contact_name %>
<%= @camp.dream_point_of_contact_email %> <% elsif current_user.guide || current_user.admin %> <%= render 'edit_point_of_contact' %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 05c8d10c..6403dfb1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -478,6 +478,7 @@ en: contact_name: Contact Name contact_alternative_name: Contact Name contact_email: Contact Email + angel_name: Angel name save_camp: Save and continue done_camp: Done update_point_of_contact: Update contact diff --git a/config/locales/he.yml b/config/locales/he.yml index a5c67662..32456b0f 100755 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -411,6 +411,7 @@ he: contact_name: "שם הקבוצה/אמן" contact_alternative_name: "שם החולם" contact_email: "אימייל" + angel_name: "שם המלאכית" save_camp: "שמור והמשך" done_camp: "סיימתי" update_point_of_contact: "עדכן איש קשר" diff --git a/db/migrate/20190219203141_add_dream_point_of_contact_name_to_camp.rb b/db/migrate/20190219203141_add_dream_point_of_contact_name_to_camp.rb new file mode 100644 index 00000000..4da7c5da --- /dev/null +++ b/db/migrate/20190219203141_add_dream_point_of_contact_name_to_camp.rb @@ -0,0 +1,5 @@ +class AddDreamPointOfContactNameToCamp < ActiveRecord::Migration + def change + add_column :camps, :dream_point_of_contact_name, :string, :limit => 64 + end +end diff --git a/db/schema.rb b/db/schema.rb index e2654a8a..db84f617 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: 20190218195040) do +ActiveRecord::Schema.define(version: 20190219203141) do create_table "active_admin_comments", force: :cascade do |t| t.string "namespace", :index=>{:name=>"index_active_admin_comments_on_namespace"} @@ -178,6 +178,7 @@ t.integer "requested_funds" t.integer "requested_funds_fallback" t.boolean "approved_status", :default=>false + t.string "dream_point_of_contact_name", :limit=>64 end create_table "grants", force: :cascade do |t|