Browse Source

fix: message template simple type

tags/v3.2.0
yystopf 4 years ago
parent
commit
0581c59a84
3 changed files with 6 additions and 2 deletions
  1. +4
    -0
      app/models/message_template.rb
  2. +1
    -1
      app/views/admins/message_templates/_form.html.erb
  3. +1
    -1
      app/views/admins/message_templates/_list.html.erb

+ 4
- 0
app/models/message_template.rb 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

+ 1
- 1
app/views/admins/message_templates/_form.html.erb 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>



+ 1
- 1
app/views/admins/message_templates/_list.html.erb 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>


Loading…
Cancel
Save