新闻页面调整
This commit is contained in:
parent
7577f4cbbc
commit
8f6b095fdb
|
@ -27,6 +27,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
function submitComment()
|
||||
{
|
||||
$("#add_comment_form").submit();
|
||||
}
|
||||
|
||||
function regexDescription()
|
||||
{
|
||||
var name = $("#news_description").val();
|
||||
|
@ -54,104 +59,71 @@
|
|||
}
|
||||
|
||||
</script>
|
||||
<div class="contextual">
|
||||
<%= watcher_link(@news, 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_news, @project) %>
|
||||
<%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
|
||||
</div>
|
||||
|
||||
<h3><strong><%=h @news.title %></strong></h3>
|
||||
|
||||
<% if authorize_for('news', 'edit') %>
|
||||
<div id="edit-news" style="display:none;">
|
||||
<%= labelled_form_for :news, @news, :url => news_path(@news),
|
||||
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%#= submit_tag l(:button_save) %>
|
||||
<%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'ButtonColor m3p10' %>
|
||||
<%#= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %>
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'ButtonColor m3p10'%>
|
||||
<%= render :partial => 'project_form', :locals => { :f => f, :is_new => 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(@news, :description) %>
|
||||
</span>
|
||||
<br/>
|
||||
<%= link_to_attachments @news %>
|
||||
<br/>
|
||||
<div class="problem_main">
|
||||
<%= link_to image_tag(url_to_avatar(@news.author),:width => 42,:height => 42), user_path(@news.author), :class => "problem_pic fl" %>
|
||||
<div class="problem_txt fl mt5">
|
||||
<h4 class="r_txt_tit mb5"> <%=h @news.title %></h4>
|
||||
<%#= watcher_link(@news, User.current) %>
|
||||
<%= link_to(l(:button_edit),
|
||||
edit_news_path(@news),
|
||||
:class => 'talk_edit fr',
|
||||
:accesskey => accesskey(:edit),
|
||||
:onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
|
||||
<%= delete_link news_path(@news),:class => 'talk_edit fr' if User.current.allowed_to?(:manage_news, @project) %>
|
||||
<div class="cl"></div>
|
||||
<div class="mb5"><%= textAreailizable(@news, :description) %><br /> <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %></div>
|
||||
<%= link_to_attachments_course @news %>
|
||||
<!--<a href="#" class=" link_file">附件:爱覅俄方if.zip(27.5kB)</a> -->
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--add comment-->
|
||||
<% if @news.commentable? %>
|
||||
<p>
|
||||
<div class="msg_box">
|
||||
<%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %>
|
||||
</p>
|
||||
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
|
||||
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
|
||||
<div class="box">
|
||||
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
|
||||
<%= wikitoolbar_for 'comment_comments' %>
|
||||
<%= text_area 'comment', 'comments', :rows => 5, :style => "width:98%" %>
|
||||
|
||||
</div>
|
||||
<p>
|
||||
<%= submit_tag l(:button_add) %>
|
||||
</p>
|
||||
<a onclick="submitComment();" class="blue_btn fr mt10" href="javascript:void(0)" ><%= l(:label_comment_add) %></a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% html_title @news.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" >
|
||||
<span class="font_description">
|
||||
<%= textilizable(comment.comments) %>
|
||||
</span>
|
||||
</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 => @news, :comment_id => comment},
|
||||
<div class="ping_C mb10">
|
||||
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author), :class => "ping_dispic" %></div>
|
||||
<div class="ping_discon">
|
||||
<div class="ping_distop">
|
||||
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %><span class="c_grey fr"><%= format_time(comment.created_on) %></span>
|
||||
<div class="cl"></div>
|
||||
<p><%= textAreailizable(comment.comments) %></p>
|
||||
</div>
|
||||
<div class="ping_disfoot"><%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:method => :delete,
|
||||
:title => l(:button_delete) %>
|
||||
</td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end if @comments.any? %>
|
||||
</div>
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag 'scm' %>
|
||||
<% end %>
|
||||
<% html_title @news.title -%>
|
||||
|
|
|
@ -338,3 +338,7 @@ a:hover.st_add{ color:#ff8e15;}
|
|||
padding-top: 2px;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
/*新闻*/
|
||||
.msg_box{ width:670px; height:173px; border-bottom:1px dashed #CCC; padding-top:10px;}
|
||||
.msg_box h4{ }
|
||||
.msg_box textarea{width:658px;height:90px;padding:5px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 0px; color:#666; font-size:12px; }
|
Loading…
Reference in New Issue