update backend index table for expired bulletins
This commit is contained in:
parent
26c78f46cc
commit
c65d1da3bf
|
@ -2,3 +2,6 @@
|
||||||
Place all the styles related to the matching controller here.
|
Place all the styles related to the matching controller here.
|
||||||
They will automatically be included in application.css.
|
They will automatically be included in application.css.
|
||||||
*/
|
*/
|
||||||
|
.table .expired{
|
||||||
|
color: #BE2E2E;
|
||||||
|
}
|
|
@ -60,6 +60,10 @@ class Bulletin
|
||||||
mail = Email.find(self.email_id) rescue nil
|
mail = Email.find(self.email_id) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def expired?
|
||||||
|
(self.deadline < Time.now) rescue false
|
||||||
|
end
|
||||||
|
|
||||||
def destroy_email
|
def destroy_email
|
||||||
mail = Email.find(self.email_id) rescue nil
|
mail = Email.find(self.email_id) rescue nil
|
||||||
mail.destroy if !mail.nil?
|
mail.destroy if !mail.nil?
|
||||||
|
|
|
@ -13,10 +13,16 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @bulletins.each do |b| %>
|
<% @bulletins.each do |b| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= b.status_for_table %></td>
|
<td>
|
||||||
|
<%= b.status_for_table %>
|
||||||
|
</td>
|
||||||
<td><%= b.category.title %></td>
|
<td><%= b.category.title %></td>
|
||||||
<td>
|
<td>
|
||||||
|
<% if b.expired? %>
|
||||||
|
<%= b.title %> <span class='label'><%= t(:expired) %></span>
|
||||||
|
<% else %>
|
||||||
<a href="<%=page_for_bulletin(b)%>" target="_blank"><%= b.title %></a>
|
<a href="<%=page_for_bulletin(b)%>" target="_blank"><%= b.title %></a>
|
||||||
|
<% end %>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills">
|
<ul class="nav nav-pills">
|
||||||
<li><a href="#" class="detail-row" onclick="$('#<%= "#{b.id.to_s}-detail" %>').slideToggle(300); return false;"><%= t(:detail) %></a></li>
|
<li><a href="#" class="detail-row" onclick="$('#<%= "#{b.id.to_s}-detail" %>').slideToggle(300); return false;"><%= t(:detail) %></a></li>
|
||||||
|
@ -28,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><%= format_value b.postdate %></td>
|
<td><%= format_value b.postdate %></td>
|
||||||
<td><%= format_value b.deadline %></td>
|
<td class="<%= b.expired? ? "expired" : "" %>"><%= format_value b.deadline %></td>
|
||||||
<td><%= b.update_user.user_name %></td>
|
<td><%= b.update_user.user_name %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="footable-row-detail">
|
<tr class="footable-row-detail">
|
||||||
|
|
Loading…
Reference in New Issue