(超级管理员)系统升级通知的页面调整

dev_SaaS
cxt 6 years ago
parent d23e266f58
commit dbddd9ddc8

@ -3127,6 +3127,7 @@ end
notice = SystemUpdateNotice.last
if notice.present? && notice.end_time > Time.now
notice.update_attributes(:end_time => params[:end_time], :start_time => params[:start_time], :subject => params[:subject], :notes => params[:notes])
UserSystemNotice.where(:notice_type => notice.notice_type).destroy_all
else
notice_type = UserSystemNotice.find_by_sql("select max(notice_type) as max_notice_type from user_system_notices").first.try(:max_notice_type).to_i + 1
SystemUpdateNotice.create(:end_time => params[:end_time], :start_time => params[:start_time], :subject => params[:subject], :notes => params[:notes], :notice_type => notice_type)

@ -2372,7 +2372,7 @@ class UsersController < ApplicationController
if @user.certification == 3
@user.update_column('certification', 0)
@noticed = true
notice = SystemUpdateNotice.first
notice = SystemUpdateNotice.last
if notice.present? && notice.end_time > Time.now && notice.start_time >= Time.now - 21600 && User.current.user_system_notices.where(:notice_type => notice.notice_type).count == 0
@noticed_update = true
end

@ -117,7 +117,7 @@
<% end %>
<% notice = SystemUpdateNotice.first %>
<% notice = SystemUpdateNotice.last %>
<% if @noticed_update || ((User.current.certification == 1 || params[:controller] != "welcome") && notice.present? && notice.end_time > Time.now && notice.start_time >= (Time.now - 21600) && User.current.user_system_notices.where(:notice_type => notice.notice_type).count == 0) %>
var htmlvalue = "<%= escape_javascript(render :partial => 'account/user_update_notice', :locals => {:notice => notice})%>";
pop_box_new(htmlvalue, 500, 380);

@ -11,8 +11,10 @@
<tr>
<%= form_for '', :url => edit_update_notice_managements_path(), :html => {:id => 'edit_update_notice_form', :method => "post"} do |f| %>
<td>
<input type="text" placeholder="请选择开始时间" readonly name="start_time" value="<%= format_time @notice.try(:start_time) %>" class="winput-240-35 mt10 mb15" id="notice_begin_time"/><br/>
<input type="text" placeholder="请选择结束时间" readonly name="end_time" value="<%= format_time @notice.try(:end_time) %>" class="winput-240-35 mb10" id="notice_end_time"/>
<input type="text" placeholder="请选择开始时间" readonly name="start_time" value="<%= @notice.try(:end_time) && @notice.try(:end_time) > Time.now ? format_time(@notice.try(:start_time)) : "" %>"
class="winput-240-35 mt10 mb15" id="notice_begin_time"/><br/>
<input type="text" placeholder="请选择结束时间" readonly name="end_time" value="<%= @notice.try(:end_time) && @notice.try(:end_time) > Time.now ? format_time(@notice.try(:end_time)) : "" %>"
class="winput-240-35 mb10" id="notice_end_time"/>
</td>
<td>
<input class="winput-240-35" name="subject" value="<%= @notice.try(:subject) ? @notice.try(:subject) : ' educoder系统升级暂停服务通知' %>" id="upgradeTitleText"/>

@ -107,7 +107,7 @@
<% end %>
<% end %>
<% notice = SystemUpdateNotice.first %>
<% notice = SystemUpdateNotice.last %>
<% if User.current.certification == 1 && notice.present? && notice.end_time > Time.now && notice.start_time >= (Time.now - 21600) && User.current.user_system_notices.where(:notice_type => notice.notice_type).count == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'account/user_update_notice', :locals => {:notice => notice})%>";
pop_box_new(htmlvalue, 500, 380);

Loading…
Cancel
Save