竞赛通知修改2

This commit is contained in:
wanglinchun 2014-05-30 20:52:55 +08:00
parent bf71a38608
commit 09ea833dcb
5 changed files with 151 additions and 7 deletions

View File

@ -0,0 +1,28 @@
<!--<p><%= link_to_project(news.project) + ': ' unless @project %>
<table><tr><td><img src="/images/new/news.png" width="40" height="40"/></td><td><%= link_to h(news.title), news_path(news) %>
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
<% unless news.summary.blank? %></td><td><span class="fontligher"><%=h news.summary %></span><% end %></td>
<td><span class="author"><%= authoring news.created_on, news.author %></span></td></tr></table></p>-->
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><img src="/images/new/news.png" width="40" height="40"/></td>
<td><table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%=link_to contestnotification.author,contestnotification_path(contestnotification)%></strong>
<a class="font_lighter"><%= l(:label_project_newshare) %></a> <%= link_to h(contestnotification.title), news_path(contestnotification) %>
</td>
</tr>
<tr>
<td colspan="2" width="580px" ><p class="font_description"><%=h contestnotification.description%></p></td>
</tr>
<tr>
<td align="left"><a class="font_lighter"> <%= contestnotification.created_on %></a></td>
<td width="200" align="right" class="a"><%= link_to l(:label_project_newother),contestnotification_path(contestnotification)%>
<%= "(#{l(:label_x_comments, :count => contestnotification.comments_count)})" if contestnotification.comments_count > 0 %>
</td>
</tr>
</table></td>
</tr>
</table>

View File

@ -1,4 +1,4 @@
<%= form_for(@contestnotification) do |f| %> <!-- <%= form_for(@contestnotification) do |f| %>
<% if @contestnotification.errors.any? %> <% if @contestnotification.errors.any? %>
<div id="error_explanation"> <div id="error_explanation">
<h2><%= pluralize(@contestnotification.errors.count, "error") %> prohibited this contestnotification from being saved:</h2> <h2><%= pluralize(@contestnotification.errors.count, "error") %> prohibited this contestnotification from being saved:</h2>
@ -38,4 +38,18 @@
<div class="actions"> <div class="actions">
<%= f.submit %> <%= f.submit %>
</div> </div>
<% end %> <% end %> -->
<%= error_messages_for @contestnotification %>
<div class="add_frame_header" >
<% str =l(:label_news_new) %>
</div>
<div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p>
<!-- <p style="margin-left:-10px;"><%= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> -->
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %></p>
<p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @contestnotification} %></p>
</div>
<%= wikitoolbar_for 'news_description' %>

View File

@ -1,6 +1,19 @@
<h1>Editing contestnotification</h1> <!-- <h1>Editing contestnotification</h1>
<%= render 'form' %> <%= render 'form' %>
<%= link_to 'Show', @contestnotification %> | <%= link_to 'Show', @contestnotification %> |
<%= link_to 'Back', contestnotifications_path %> <%= link_to 'Back', contestnotifications_path %> -->
<h3><%=l(:label_news)%></h3>
<%= labelled_form_for @contestnotification, :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= preview_link preview_news_path(:project_id => @contest, :id => @contestnotification), 'news-form' %>
<% end %>
<div id="preview" class="wiki"></div>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'scm' %>
<% end %>

View File

@ -11,6 +11,6 @@
:html => { :id => 'news-form', :multipart => true } do |f| %> :html => { :id => 'news-form', :multipart => true } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %> <%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> <%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
<%= preview_link preview_news_path(:project_id => @project), 'news-form' ,target='preview',{:class => 'whiteButton m3p10'}%> <%= preview_link preview_news_path(:contest_id => @contest), 'news-form' ,target='preview',{:class => 'whiteButton m3p10'}%>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>

View File

@ -1,4 +1,4 @@
<p id="notice"><%= notice %></p> <!-- <p id="notice"><%= notice %></p>
<p> <p>
<b>Contest:</b> <b>Contest:</b>
@ -32,4 +32,93 @@
<%= link_to 'Edit', edit_contestnotification_path(@contestnotification) %> | <%= link_to 'Edit', edit_contestnotification_path(@contestnotification) %> |
<%= link_to 'Back', contestnotifications_path %> <%= link_to 'Back', contestnotifications_path %> -->
<!--begin-->
<div class="contextual">
<%= watcher_link(@contestnotification, User.current) %>
<%= link_to(l(:button_edit),
edit_news_path(@news),
:class => 'icon icon-edit',
:accesskey => accesskey(:edit),
:onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_contestnotification, @contest) %>
<%= delete_link news_path(@contestnotification) if User.current.allowed_to?(:manage_contestnotification, @contest) %>
</div>
<h3><strong><%=h @contestnotification.title %></strong></h3>
<% if authorize_for('contestnotification', 'edit') %>
<div id="edit-news" style="display:none;">
<%= labelled_form_for :contestnotification, @contestnotification, :url => contestnotification_path(@contestnotification),
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<%= preview_link preview_contestnotification_path(:contest_id => @contest, :id => @contestnotification), 'news-form',target='preview',{:class => ''} %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
<% end %>
<div id="preview" class="wiki"></div>
</div>
<% end %>
<div id="comments" style="margin-bottom:16px;">
<div style="margin:15px">
<span class="font_description"> <%= textilizable(@contestnotification, :description) %> </span>
<br/>
<%= link_to_attachments @contestnotification %>
<br/>
<!--add comment-->
<% if @contestnotification.commentable? %>
<p>
<%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %>
</p>
<%= form_tag({:controller => 'comments', :action => 'create', :id => @contestnotification}, :id => "add_comment_form", :style => "display:none;") do %>
<div class="box">
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'comment_comments' %>
</div>
<p>
<%= submit_tag l(:button_add) %>
</p>
<% end %>
<% end %>
<% html_title @contestnotification.title -%>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
<!--dispaly comments-->
<div class="line_heng"></div>
</div>
<h3 class="comments"><%= l(:label_comment_plural) %></h3>
<% comments = @comments.reverse %>
<% comments.each do |comment| %>
<% next if comment.new_record? %>
<table width="660px" border="0" align="center">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(comment.author), :class => "avatar")%></td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= link_to_user(comment.author) if comment.respond_to?(:author) %> </strong><span class="font_lighter"><%= l(:label_project_newadd) %></span><%= l(:label_comment_plural) %></td>
</tr>
<tr>
<td colspan="2" width="580px" >
<p class="font_description">
<%= textilizable(comment.comments) %>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(comment.created_on) %></span></td>
<td width="200" align="right" class="a"><%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @contestnotification, :comment_id => comment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %></td>
</tr>
</table></td>
</tr>
</table>
<% end if @comments.any? %>
</div>
<!--end-->