From 65d2a47c3217c46c6193761a30f29ce2f45f531f Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 21 Feb 2017 18:21:35 +0800 Subject: [PATCH] modified something --- app/models/dayoff.rb | 4 ++-- app/views/admin/dayoffs/_form.html.erb | 2 ++ app/views/plugin/memberlog/_profile.html.erb | 7 ++++--- config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/models/dayoff.rb b/app/models/dayoff.rb index a21e3c0..45454f1 100644 --- a/app/models/dayoff.rb +++ b/app/models/dayoff.rb @@ -2,9 +2,9 @@ class Dayoff < PersonalPluginIntro include Mongoid::Document include Mongoid::Timestamps - + # validates :dayoff_description, :presence => true - belongs_to :member_log + belongs_to :member_log, :dependent => :destroy field :dayoff_description, localize: true diff --git a/app/views/admin/dayoffs/_form.html.erb b/app/views/admin/dayoffs/_form.html.erb index 8463b17..64309e0 100644 --- a/app/views/admin/dayoffs/_form.html.erb +++ b/app/views/admin/dayoffs/_form.html.erb @@ -40,6 +40,7 @@ <% end %> +
<% @site_in_use_locales.each do |locale| %> @@ -61,6 +62,7 @@ +
diff --git a/app/views/plugin/memberlog/_profile.html.erb b/app/views/plugin/memberlog/_profile.html.erb index 24f225a..1ea1d15 100644 --- a/app/views/plugin/memberlog/_profile.html.erb +++ b/app/views/plugin/memberlog/_profile.html.erb @@ -23,8 +23,8 @@ <%= b.start_dayoff.strftime('%Y-%m-%d') %>~ <%= b.end_dayoff.strftime('%Y-%m-%d') %> <%= link_to content_tag(:i, nil, :class => 'icon-edit') +' '+ t('edit'),'/admin/members/'+@member.to_param+'/dayoffs/'+b.id+'/edit', :class => "btn btn-danger btn-mini"%> - <%= link_to content_tag(:i, nil, :class => 'icons-trash') +' '+ t(:delete_), admin_dayoff_path(id: b.id, member_profile_id: @member.id), :class => "btn btn-danger btn-mini", method: :delete, remote: true, data: { confirm: t('sure?') } %> - + <% end %> <% end %> @@ -37,7 +37,7 @@ <%= t('memberlog.checkin') %> - <%= t('memberlog.checkout') %> + <%= t('memberlog.checkout') %> <%= t('memberlog.excuse') %> @@ -46,6 +46,7 @@ <%= link_to memberlog.created_at.strftime('%Y-%m-%d (%a) %R'), admin_memberlog_path(memberlog.id), :data => {"target" => "#logModal", "toggle" => "modal"} %> +