fix: message template simple type

This commit is contained in:
yystopf 2021-09-18 18:50:45 +08:00
parent d957e0544f
commit 0581c59a84
3 changed files with 6 additions and 2 deletions

View File

@ -64,4 +64,8 @@ class MessageTemplate <ApplicationRecord
def self.receivers_string(receivers)
receivers.pluck(:id).join(",")
end
def simple_type
self.type.split("::")[-1]
end
end

View File

@ -1,5 +1,5 @@
<div class="box search-form-container project-list-form">
<div style="line-height: 38px;" class="flex-1"><%= type == "create" ? "新建" : "编辑" %>消息模版</div>
<div style="line-height: 38px;" class="flex-1"><%= type == "create" ? "新建" : "编辑" %><%= @message_template.simple_type %>消息模版</div>
<%= link_to "返回", admins_message_templates_path, class: "btn btn-default pull-right" %>
</div>

View File

@ -15,7 +15,7 @@
<% message_template = message_template_type.constantize.last%>
<tr class="project-language-item-<%= message_template.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td><%= message_template.type.split("::")[1] %></td>
<td><%= message_template.simple_type %></td>
<td>
<%= message_template.sys_notice.to_s.truncate(200) %>
</td>