lin
This commit is contained in:
parent
ed84ec633f
commit
2e11d76652
|
@ -46,7 +46,7 @@ class Contestnotification < ActiveRecord::Base
|
||||||
|
|
||||||
# returns latest news for contests visible by user
|
# returns latest news for contests visible by user
|
||||||
def self.latest(user = User.current, count = 5)
|
def self.latest(user = User.current, count = 5)
|
||||||
visible(user).includes([:author, :contest]).order("#{Contestnotifications.table_name}.created_on DESC").limit(count).all
|
visible(user).includes([:author, :contest]).order("#{Contestnotifications.table_name}.created_at DESC").limit(count).all
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
|
|
||||||
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
|
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
|
||||||
<%= l(:label_news) %>
|
<%= l(:label_news) %>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<%= link_to(l(:label_news_new),
|
<%= link_to(l(:label_news_new),
|
||||||
new_contest_contestnotification_path(@contest),
|
new_contest_contestnotification_path(@contest),
|
||||||
:class => 'icon icon-add',
|
:class => 'icon icon-add',
|
||||||
:onclick => 'showAndScrollTo("add-contestnotifications", "contestnotifications_title"); return false;') %>
|
:onclick => 'showAndScrollTo("add-contestnotifications", "contestnotifications_title"); return false;') %>
|
||||||
|
|
||||||
<% if @contest && User.current.allowed_to?(:manage_contestnotifications, @contest) %>
|
<% if @contest && User.current.allowed_to?(:manage_contestnotifications, @contest) %>
|
||||||
<div id="add-contestnotifications" class="add_frame" style="display:none;">
|
<div id="add-contestnotifications" class="add_frame" style="display:none;">
|
||||||
|
@ -36,10 +35,11 @@
|
||||||
<table width="580px" border="0">
|
<table width="580px" border="0">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" valign="top">
|
<td colspan="2" valign="top">
|
||||||
<strong><%= link_to_user(contestnotifications.author) if contestnotifications.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span><span><%#= link_to h(contestnotifications.title), contest_contestnotification_path(contestnotifications) %></span>
|
<strong><%= link_to_user(contestnotifications.author) if contestnotifications.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter">
|
||||||
<span style="float: right"><%= delete_link contest_contestnotification_path(contestnotifications) if User.current.allowed_to?(:manage_contestnotifications, @contest) %> </span>
|
<%= l(:label_project_notice) %></span><span><%= link_to h(contestnotifications.title), contest_contestnotification_path(@contest, contestnotifications) %></span>
|
||||||
</td>
|
<span style="float: right"><%= delete_link contest_contestnotification_path(@contest, contestnotifications) if true || User.current.allowed_to?(:manage_contestnotifications, @contest) %> </span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="580px">
|
<td colspan="2" width="580px">
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>
|
<td align="left"><span class="font_lighter"> <%= l :label_update_time %>
|
||||||
<%= format_time(contestnotifications.created_at) %></span></td>
|
<%= format_time(contestnotifications.created_at) %></span></td>
|
||||||
<td width="350" align="right" class="a"><%#= link_to l(:label_project_newother), contest_contestnotification_path(contestnotifications) %><%#= "(#{l(:label_x_comments, :count => contestnotifications.comments_count)})" if(contestnotifications.comments_count >= 0)%></td>
|
<td width="350" align="right" class="a"><%= link_to l(:label_project_newother), contest_contestnotification_path(@contest, contestnotifications) %><%= "(#{l(:label_x_comments, :count => contestnotifications.comments.count)})" if(contestnotifications.comments.count >= 0)%></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue