新闻界面修改,new页面bug修复

This commit is contained in:
yanxd 2014-01-08 20:18:32 +08:00
parent 789acee429
commit b9967074dc
8 changed files with 86 additions and 45 deletions

View File

@ -74,7 +74,7 @@ class NewsController < ApplicationController
def new
@news = News.new(:project => @project, :author => User.current)
@course_tag = @project.project_type
@course_tag = @project.project_type
if @course_tag
render :layout => 'base_courses'
end
@ -89,7 +89,8 @@ class NewsController < ApplicationController
flash[:notice] = l(:notice_successful_create)
redirect_to project_news_index_path(@project)
else
render :action => 'new'
layout_file = (@project.project_type == 1) ? 'base_courses' : 'base_projects'
render :action => 'new', :layout => layout_file
end
end

View File

@ -101,7 +101,7 @@ end %>
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
<% if !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %>
<% if false # !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %>
<hr />
<div id="issue_tree">
<div class="contextual">

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>

View File

@ -1,9 +1,12 @@
<%= error_messages_for @news %>
<div class="add_frame_header" >
<% str = (@project.project_type == 1) ? l(:bale_news_notice) : l(:label_news_new) %>
<%= str %>
</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 => 15, :class => 'wiki-edit', :style => "width:490px;" %></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 => @news} %></p>
</div>

View File

@ -1,34 +1,34 @@
<!-- added by huang -->
<%
if @project.project_type == 1
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
else
btn_tips = l(:label_news_new)
label_tips = l(:label_news)
end
%>
<% if @project && User.current.allowed_to?(:manage_news, @project) %>
<div class="content-title-top">
<% if @project.project_type == 1%>
<%= link_to(l(:label_news_notice),
<%= link_to(btn_tips,
new_project_news_path(@project),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
<% else %>
<%= link_to(l(:label_news_new),
new_project_news_path(@project),
:class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
<% end %>
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
</div>
<div id="add-news" style="display:none;">
<% if @project.project_type == 1 %>
<h3><%= l(:bale_news_notice)%></h3>
<% else %>
<h3><%= l(:label_news_new)%></h3>
<% end %>
<div id="add-news" class="add_frame" style="display:none;">
<%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form', :multipart => true } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create), :class => 'button-submit', :name => nil %>
<%= preview_link preview_news_path(:project_id => @project), 'news-form' %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %>
<%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit --> |
<%= preview_link preview_news_path(:project_id => @project), 'news-form' ,target='preview',{:class => 'whiteButton m3p10'}%> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' ,:class => 'whiteButton m3p10' %>
<% end if @project %>
<div id="preview" class="wiki"></div>
</div>
<% end %>
<!--add by huang :list news-->
<h3 style="font-weight:bold; border-bottom:1px solid #f0f0f0"><%=label_tips%></h3>
<div>
<% if @newss.empty? %>
<p class="nodata">
@ -50,7 +50,7 @@
<% else %>
<tr>
<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>
<span style="float: right"> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span></td>
<span style="float: right" class='delete_icon'> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span></td>
</tr>
<% end %>
<tr>
@ -85,3 +85,16 @@
<% html_title(l(:label_news_plural)) -%>
</div>
<script type='text/javascript'>
$(document).ready(function($) {
$('.content-text-list').each(function(){
$(this).find('.delete_icon').hide();
$(this).mouseenter(function(event) {
$(this).find('.delete_icon').show();
});
$(this).mouseleave(function(event) {
$(this).find('.delete_icon').hide();
});
});
});
</script>

View File

@ -1,9 +1,9 @@
<h3><%=l(:label_news_new)%></h3>
<!-- <h3><%=l(:label_news_new)%></h3> -->
<%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form', :multipart => true } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create), :class => "enterprise" %>
<%= preview_link preview_news_path(:project_id => @project), 'news-form' %>
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
<%= preview_link preview_news_path(:project_id => @project), 'news-form' ,target='preview',{:class => 'whiteButton m3p10'}%>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -16,7 +16,7 @@
: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 => @project, :id => @news), 'news-form' %> |
<%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => ''} %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -3,19 +3,17 @@
.text_center{
text-align: center;
}
* {
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif;
}
/* 按钮
*******************************************************************************/
input[class='whiteButton'], .whiteButton {
input[class~='whiteButton'], .whiteButton {
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #f6f6f6));
background:-moz-linear-gradient(top, #ffffff 5%, #f6f6f6 100%);
background:-webkit-linear-gradient(top, #ffffff 5%, #f6f6f6 100%);
@ -23,28 +21,24 @@ input[class='whiteButton'], .whiteButton {
background:-ms-linear-gradient(top, #ffffff 5%, #f6f6f6 100%);
background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0);
background-color:#ffffff;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #dcdcdc;
display:inline-block;
color:#666666;
color: #116699;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
/*padding:3px 10px;*/
text-decoration:none;
text-shadow:0px 1px 0px #ffffff;
}
input[class='whiteButton']:hover, .whiteButton:hover {
input[class~='whiteButton']:hover, .whiteButton:hover {
color: #c61a1a;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f6f6f6), color-stop(1, #ffffff));
background:-moz-linear-gradient(top, #f6f6f6 5%, #ffffff 100%);
background:-webkit-linear-gradient(top, #f6f6f6 5%, #ffffff 100%);
@ -52,14 +46,22 @@ input[class='whiteButton']:hover, .whiteButton:hover {
background:-ms-linear-gradient(top, #f6f6f6 5%, #ffffff 100%);
background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff',GradientType=0);
text-decoration: none;
background-color:#f6f6f6;
}
input[class='whiteButton']:active, .whiteButton:active {
input[class~='whiteButton']:active, .whiteButton:active {
position:relative;
top:1px;
text-decoration: none;
}
input[class~='m3p10'], .m3p10 {
margin: 0;
padding: 3px 10px;
height: 20px;
display: inline-block;
}
input[class~='h30'], .h30{
height: 30px;
}
/* minimal
*******************************************************************************/
@ -313,3 +315,25 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
border-bottom-left-radius : 10px;
border-bottom-right-radius: 10px;
}
/* 项目新闻栏
*******************************************************************************/
.add_frame {
position:relative;
margin: 5px 10px 2px 0px;
padding: 10px 10px;
border-radius: 5px;
/*box-shadow: 1px 1px 6px rgb(241,241,241);*/
/*border: 1px solid #F1F1F1;*/
}
.add_frame_header{
background: linear-gradient(#fbfbfb, #f8f8f8) repeat scroll 0% 0% transparent;
border-bottom: 1px solid rgb(226,226,226);
box-shadow: 0px 1px 0px white, 0px, -1px 0px rgb(245,245,245);
height: 39px;
font-size: 15px;
line-height: 26px;
height: 30px;
font-size: 1.5em;
padding-left: 4%;
}