added date for installed modules

This commit is contained in:
Harry Bomrah 2016-01-05 15:37:45 +08:00
parent 94d91a4956
commit e384ecff3c
2 changed files with 8 additions and 3 deletions

View File

@ -34,7 +34,9 @@ class Admin::AdminModulesController < OrbitAdminController
def revoke_list
rm = RegisteredModule.find(params[:id]) rescue nil
@registered_sites = site_list_with_module(rm, true)
slwm = site_list_with_module(rm, true)
@registered_sites = slwm.first
@times = slwm.last
render :layout => false
end
@ -117,6 +119,7 @@ class Admin::AdminModulesController < OrbitAdminController
def site_list_with_module(rm,access=nil)
registered_sites = []
times = []
if !rm.nil?
rss = RegisteredSite.active
rss.each do |rs|
@ -127,10 +130,11 @@ class Admin::AdminModulesController < OrbitAdminController
end
if im.count > 0
registered_sites << rs
times << im.created_at.strftime("%Y-%m-%d %H:%M") rescue ""
end
end
end
registered_sites
[registered_sites, times]
end

View File

@ -2,10 +2,11 @@
<% if @registered_sites.blank? %>
<span>Sorry no sites active or this module is not installed anywhere.</span>
<% else %>
<% @registered_sites.each do |rs|%>
<% @registered_sites.each_with_index do |rs, index|%>
<label>
<input type="checkbox" name="websites[]" value="<%= rs.id.to_s %>" />
<a href="<%= "http://" + rs.site_domain %>" target="_blank"><%= rs.title || rs.site_domain %></a>
<span class="pull-right"><%= @times[index] %></span>
</label>
<% end %>
<% end %>