1.修复 项目--新闻、课程--课程通知 列表显示问题

2.优化页面代码
This commit is contained in:
sw 2014-10-10 14:09:43 +08:00
parent 0f492047a5
commit 5180c959a8
3 changed files with 45 additions and 15 deletions

View File

@ -74,7 +74,6 @@
<%= labelled_form_for @news, :url => course_news_index_path(@course), <%= labelled_form_for @news, :url => course_news_index_path(@course),
:html => {:id => 'news-form', :multipart => true} do |f| %> :html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %> <%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
<%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit -->
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>| <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>|
<%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> <%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
| |
@ -90,26 +89,48 @@
</p> </p>
<% else %> <% else %>
<% @newss.each do |news| %> <% @newss.each do |news| %>
<table class="content-text-list"> <table class="content-text-list">
<tr> <tr>
<td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td> <td colspan="2" valign="top" width="50">
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %>
</td>
<td> <td>
<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(news.author) if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span><span><%= link_to h(news.title), news_path(news) %></span> <strong>
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @couese) %> </span> <%= link_to_user(news.author) if news.respond_to?(:author) %>
</strong>
<span style="margin-left: 4px;" class="font_lighter">
<%= l(:label_project_notice) %>
</span>
<span>
<%= link_to h(news.title), news_path(news) %>
</span>
<span style="float: right">
<%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @couese) %>
</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px"> <td colspan="2" width="580px">
<span class="font_description"><%= textilizable(news, :description) %></span></td> <span class="font_description">
<%= textilizable(news, :description) %>
</span>
</td>
</tr> </tr>
<tr> <tr>
<td align="left"><span class="font_lighter"> <%= l :label_update_time %> <td align="left">
&nbsp;<%= format_time(news.created_on) %></span></td> <span class="font_lighter">
<td width="350" align="right" class="a"><%= link_to l(:label_project_newother), news_path(news) %><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %></td> <%= l :label_update_time %>
&nbsp;
<%= format_time(news.created_on) %>
</span>
</td>
<td width="350" align="right" class="a">
<%= link_to l(:label_project_newother), news_path(news) %>
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count >= 0 %>
</td>
</tr> </tr>
</table> </table>
</td> </td>

View File

@ -101,21 +101,29 @@
<table class="content-text-list"> <table class="content-text-list">
<tr> <tr>
<td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td> <td colspan="2" valign="top" width="50">
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %>
</td>
<td> <td>
<table width="580px" border="0"> <table width="580px" border="0">
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span><span><%= link_to h(news.title), news_path(news) %></span> <strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong>
<span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_notice) %></span>
<span><%= link_to h(news.title), news_path(news) %></span>
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span> <span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span>
</td> </td>
</tr> </tr>
<% else %> <% else %>
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong><span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_newshare) %></span><span> <%= link_to h(news.title), news_path(news) %></span> <strong><%= link_to_user(news.author) if news.respond_to?(:author) %></strong>
<span style="float: right" class='delete_icon'> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span> <span style="margin-left: 4px;" class="font_lighter"><%= l(:label_project_newshare) %></span>
<span> <%= link_to h(news.title), news_path(news) %></span>
<span style="float: right" class='delete_icon'>
<%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>
</span>
</td> </td>
</tr> </tr>
<% end %> <% end %>

View File

@ -750,7 +750,8 @@ ul.user_course_sort li{list-style-type:none;
.font_description{ .font_description{
font-size:14px; font-size:14px;
line-height: 1.5em; line-height: 1.5em;
word-break:break-all;
word-wrap: break-word;
} }
.font_description2{ .font_description2{
font-size:13px; font-size:13px;