Adjust send_email field to multiple options.
This commit is contained in:
1 parent
3caa63bb46
commit
d2edc29945
6 files changed
+44
-5
No files matched your search
@@ -391,7 +391,7 @@ class Admin::AsksController < OrbitAdminController
|
||||
end
|
||||
temp_params = temp_params.merge({reviewer: current_user.member_profile, review_time: DateTime.now})
|
||||
@ask_question.update_attributes(temp_params)
|
||||
if @ask_question.send_email
|
||||
if @ask_question.send_email?
|
||||
build_email(@ask_question)
|
||||
end
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ class AskQuestion
|
||||
|
||||
field :reply, type: String
|
||||
field :comment, type: String
|
||||
field :send_email, type: Boolean, default: false
|
||||
field :situation, type: String, default: "is_email_not_confirmed" # 預設email未驗證
|
||||
field :send_email, type: Integer, default: 0
|
||||
field :email_id
|
||||
field :verify_email_id
|
||||
field :custom_values, type: Hash, default: {}
|
||||
@@ -75,5 +75,9 @@ class AskQuestion
|
||||
def display_format_string(num, str_length)
|
||||
format("%0#{str_length}d", num)
|
||||
end
|
||||
|
||||
def send_email?
|
||||
self.send_email == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -97,9 +97,34 @@
|
||||
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<%= f.label :send_email %><%= f.radio_button :send_email, 1, checked: @ask_question.send_email? %><%= t('ask.yes') %>
|
||||
|
||||
<%= f.radio_button :send_email, 0, checked: !@ask_question.send_email? %><%= t('ask.no') %>
|
||||
<%= f.label :send_email, class: "control-label muted" %>
|
||||
|
||||
<div class="controls">
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :send_email, 1 %>
|
||||
<%= t('ask.system_Email') %>
|
||||
</label>
|
||||
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :send_email, 0 %>
|
||||
<%= t('ask.no') %>
|
||||
</label>
|
||||
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :send_email, 2 %>
|
||||
<%= t('ask.phone') %>
|
||||
</label>
|
||||
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :send_email, 3 %>
|
||||
<%= t('ask.fax') %>
|
||||
</label>
|
||||
|
||||
<label class="radio inline">
|
||||
<%= f.radio_button :send_email, 4 %>
|
||||
<%= t('ask.paper') %>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user