新闻界面修改,new页面bug修复
This commit is contained in:
parent
789acee429
commit
b9967074dc
|
@ -74,7 +74,7 @@ class NewsController < ApplicationController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@news = News.new(:project => @project, :author => User.current)
|
@news = News.new(:project => @project, :author => User.current)
|
||||||
@course_tag = @project.project_type
|
@course_tag = @project.project_type
|
||||||
if @course_tag
|
if @course_tag
|
||||||
render :layout => 'base_courses'
|
render :layout => 'base_courses'
|
||||||
end
|
end
|
||||||
|
@ -89,7 +89,8 @@ class NewsController < ApplicationController
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to project_news_index_path(@project)
|
redirect_to project_news_index_path(@project)
|
||||||
else
|
else
|
||||||
render :action => 'new'
|
layout_file = (@project.project_type == 1) ? 'base_courses' : 'base_projects'
|
||||||
|
render :action => 'new', :layout => layout_file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ end %>
|
||||||
|
|
||||||
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
|
<%= 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 />
|
<hr />
|
||||||
<div id="issue_tree">
|
<div id="issue_tree">
|
||||||
<div class="contextual">
|
<div class="contextual">
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<meta name="keywords" content="issue,bug,tracker" />
|
<meta name="keywords" content="issue,bug,tracker" />
|
||||||
<%= csrf_meta_tag %>
|
<%= csrf_meta_tag %>
|
||||||
<%= favicon %>
|
<%= 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' %>
|
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||||
<%= javascript_heads %>
|
<%= javascript_heads %>
|
||||||
<%= heads_for_theme %>
|
<%= heads_for_theme %>
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<%= error_messages_for @news %>
|
<%= 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">
|
<div class="box tabular">
|
||||||
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p>
|
<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 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>
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,34 @@
|
||||||
<!-- added by huang -->
|
<!-- 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">
|
<div class="content-title-top">
|
||||||
<% if @project.project_type == 1%>
|
<%= link_to(btn_tips,
|
||||||
<%= link_to(l(:label_news_notice),
|
|
||||||
new_project_news_path(@project),
|
new_project_news_path(@project),
|
||||||
:class => 'icon icon-add',
|
:class => 'icon icon-add',
|
||||||
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
|
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
|
||||||
<% 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 %>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="add-news" style="display:none;">
|
<div id="add-news" class="add_frame" style="display:none;">
|
||||||
<% if @project.project_type == 1 %>
|
|
||||||
<h3><%= l(:bale_news_notice)%></h3>
|
|
||||||
<% else %>
|
|
||||||
<h3><%= l(:label_news_new)%></h3>
|
|
||||||
<% end %>
|
|
||||||
<%= labelled_form_for @news, :url => project_news_index_path(@project),
|
<%= labelled_form_for @news, :url => project_news_index_path(@project),
|
||||||
: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 => 'button-submit', :name => nil %>
|
<%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit --> |
|
||||||
<%= preview_link preview_news_path(:project_id => @project), 'news-form' %> |
|
<%= preview_link preview_news_path(:project_id => @project), 'news-form' ,target='preview',{:class => 'whiteButton m3p10'}%> |
|
||||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %>
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' ,:class => 'whiteButton m3p10' %>
|
||||||
<% end if @project %>
|
<% end if @project %>
|
||||||
<div id="preview" class="wiki"></div>
|
<div id="preview" class="wiki"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<!--add by huang :list news-->
|
<!--add by huang :list news-->
|
||||||
|
<h3 style="font-weight:bold; border-bottom:1px solid #f0f0f0"><%=label_tips%></h3>
|
||||||
<div>
|
<div>
|
||||||
<% if @newss.empty? %>
|
<% if @newss.empty? %>
|
||||||
<p class="nodata">
|
<p class="nodata">
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<tr>
|
<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>
|
<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>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -85,3 +85,16 @@
|
||||||
|
|
||||||
<% html_title(l(:label_news_plural)) -%>
|
<% html_title(l(:label_news_plural)) -%>
|
||||||
</div>
|
</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>
|
||||||
|
|
|
@ -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),
|
<%= labelled_form_for @news, :url => project_news_index_path(@project),
|
||||||
: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 => "enterprise" %>
|
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
|
||||||
<%= preview_link preview_news_path(:project_id => @project), 'news-form' %>
|
<%= preview_link preview_news_path(:project_id => @project), 'news-form' ,target='preview',{:class => 'whiteButton m3p10'}%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div id="preview" class="wiki"></div>
|
<div id="preview" class="wiki"></div>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
|
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
|
||||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||||
<%= submit_tag l(:button_save) %>
|
<%= 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;' %>
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div id="preview" class="wiki"></div>
|
<div id="preview" class="wiki"></div>
|
||||||
|
|
|
@ -3,19 +3,17 @@
|
||||||
.text_center{
|
.text_center{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif;
|
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;
|
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
|
||||||
-webkit-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;
|
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:-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:-moz-linear-gradient(top, #ffffff 5%, #f6f6f6 100%);
|
||||||
background:-webkit-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:-ms-linear-gradient(top, #ffffff 5%, #f6f6f6 100%);
|
||||||
background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%);
|
background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%);
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0);
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0);
|
||||||
|
|
||||||
background-color:#ffffff;
|
background-color:#ffffff;
|
||||||
|
|
||||||
-moz-border-radius:6px;
|
-moz-border-radius:6px;
|
||||||
-webkit-border-radius:6px;
|
-webkit-border-radius:6px;
|
||||||
border-radius:6px;
|
border-radius:6px;
|
||||||
|
|
||||||
border:1px solid #dcdcdc;
|
border:1px solid #dcdcdc;
|
||||||
|
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
color:#666666;
|
color:#666666;
|
||||||
|
color: #116699;
|
||||||
font-family:arial;
|
font-family:arial;
|
||||||
font-size:15px;
|
font-size:15px;
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
padding:6px 24px;
|
padding:6px 24px;
|
||||||
|
/*padding:3px 10px;*/
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
|
|
||||||
text-shadow:0px 1px 0px #ffffff;
|
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:-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:-moz-linear-gradient(top, #f6f6f6 5%, #ffffff 100%);
|
||||||
background:-webkit-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:-ms-linear-gradient(top, #f6f6f6 5%, #ffffff 100%);
|
||||||
background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%);
|
background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%);
|
||||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff',GradientType=0);
|
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff',GradientType=0);
|
||||||
|
text-decoration: none;
|
||||||
background-color:#f6f6f6;
|
background-color:#f6f6f6;
|
||||||
}
|
}
|
||||||
|
input[class~='whiteButton']:active, .whiteButton:active {
|
||||||
|
|
||||||
input[class='whiteButton']:active, .whiteButton:active {
|
|
||||||
position:relative;
|
position:relative;
|
||||||
top:1px;
|
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
|
/* minimal
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
@ -313,3 +315,25 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
|
||||||
border-bottom-left-radius : 10px;
|
border-bottom-left-radius : 10px;
|
||||||
border-bottom-right-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%;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue