Merge branch 'szzh' into develop
This commit is contained in:
commit
d7b17b455d
|
@ -52,10 +52,14 @@ class BlogCommentsController < ApplicationController
|
|||
render_attachment_warning_if_needed(@article)
|
||||
else
|
||||
end
|
||||
if params[:is_homepage]
|
||||
redirect_to user_blogs_path(params[:user_id])
|
||||
if params[:in_act]
|
||||
redirect_to user_path(params[:user_id])
|
||||
else
|
||||
redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
|
||||
if params[:is_homepage]
|
||||
redirect_to user_blogs_path(params[:user_id])
|
||||
else
|
||||
redirect_to user_blog_blog_comment_path(:user_id=>params[:user_id],:blog_id=>params[:blog_id],:id=>params[:id])
|
||||
end
|
||||
end
|
||||
end
|
||||
def destroy
|
||||
|
|
|
@ -2,7 +2,7 @@ class BlogsController < ApplicationController
|
|||
before_filter :find_blog,:except => [:index,:create,:new,:set_homepage, :cancel_homepage]
|
||||
before_filter :find_user
|
||||
def index
|
||||
@articls = @user.blog.articles
|
||||
@articls = @user.blog.articles.order("updated on desc")
|
||||
@article = BlogComment.new
|
||||
respond_to do |format|
|
||||
format.html {render :layout=>'new_base_user'}
|
||||
|
|
|
@ -1791,13 +1791,24 @@ class UsersController < ApplicationController
|
|||
def share_news_to_project
|
||||
news = News.find(params[:send_id])
|
||||
project_ids = params[:project_ids]
|
||||
# project_ids.each do |project_id|
|
||||
# if Project.find(project_id).news.map(&:id).exclude?(news.id)
|
||||
# project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now)
|
||||
# news.attachments.each do |attach|
|
||||
# project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
|
||||
# :downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
|
||||
# :is_public => attach.is_public, :quotes => 0)
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
project_ids.each do |project_id|
|
||||
if Project.find(project_id).news.map(&:id).exclude?(news.id)
|
||||
project_news = News.create(:project_id => project_id.to_i, :title => news.title, :summary => news.summary, :description => news.description,:author_id => User.current.id, :created_on => Time.now)
|
||||
project = Project.find(project_id)
|
||||
if project.news.map(&:id).exclude?(news.id)
|
||||
message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id)
|
||||
news.attachments.each do |attach|
|
||||
project_news.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
|
||||
:downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
|
||||
:is_public => attach.is_public, :quotes => 0)
|
||||
message.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
|
||||
:downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
|
||||
:is_public => attach.is_public, :quotes => 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% if User.current.logged? && User.current.id == @user.id %>
|
||||
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage]},:method=>'PUT',
|
||||
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage],:in_act => params[:in_act]},:method=>'PUT',
|
||||
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
|
||||
<% end %>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<li>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => @article.id},
|
||||
{:action => 'edit', :id => @article.id,:in_act => params[:in_act]},
|
||||
:class => 'postOptionLink'
|
||||
) if User.current && User.current.id == @article.author.id %>
|
||||
</li>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<div class="homepageRight mt0 ml10">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">
|
||||
项目通知
|
||||
新闻
|
||||
</div>
|
||||
</div>
|
||||
<% if @project && User.current.allowed_to?(:manage_news, @project) %>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div id="new_course_news">
|
||||
<div class="homepagePostBrief c_grey">
|
||||
<div>
|
||||
<input type="text" name="news[title]" id="news_title" class="InputBox w713" maxlength="60" onfocus="$('#news_editor').show()" onkeyup="regexTitle();" placeholder="发布通知,请先输入通知标题" value="<%= news.title%>" >
|
||||
<input type="text" name="news[title]" id="news_title" class="InputBox w713" maxlength="60" onfocus="$('#news_editor').show()" onkeyup="regexTitle();" placeholder="发布新闻,请先输入新闻标题" value="<%= news.title%>" >
|
||||
<p id="title_notice_span"></p>
|
||||
</div>
|
||||
<div id="news_editor" style="display: none;">
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
</div>
|
||||
<%end%>
|
||||
<div class="postDetailTitle fl">
|
||||
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">通知: <%= @news.title%></a>
|
||||
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">新闻: <%= @news.title%></a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div class="homepageRight mt0 ml10">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">
|
||||
编辑通知
|
||||
编辑<%= @news.project_id != -1 ? '新闻':'通知' %>
|
||||
</div>
|
||||
</div>
|
||||
<%= labelled_form_for :news, @news, :url => news_path(@news),
|
||||
|
|
|
@ -35,7 +35,21 @@
|
|||
<li class="homepagePostSettingIcon">
|
||||
<% if User.current.logged? %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}','#{User.current.id}','news')") %></li>
|
||||
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => activity},
|
||||
:class => 'postOptionLink'
|
||||
) if activity.author == User.current %>
|
||||
</li>
|
||||
<li>
|
||||
<%= delete_link(
|
||||
news_path(activity),
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if activity.author == User.current %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</li>
|
||||
|
|
|
@ -40,7 +40,21 @@
|
|||
<li class="homepagePostSettingIcon">
|
||||
<% if User.current.logged? %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
|
||||
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => activity},
|
||||
:class => 'postOptionLink'
|
||||
) if User.current.allowed_to?(:manage_news, activity.course) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= delete_link(
|
||||
news_path(activity),
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if User.current.allowed_to?(:manage_news, activity.course) %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</li>
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %> TO <!--+"(课程名称)"-->
|
||||
<%= link_to activity.project.name.to_s+" | 项目通知", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
||||
<% end %> TO <!--+"(名称)"-->
|
||||
<%= link_to activity.project.name.to_s+" | 新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
|
||||
|
@ -37,7 +37,21 @@
|
|||
<li class="homepagePostSettingIcon">
|
||||
<% if User.current.logged? %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}','#{User.current.id}','news')") %></li>
|
||||
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
{:action => 'edit', :id => activity},
|
||||
:class => 'postOptionLink'
|
||||
) if activity.author == User.current %>
|
||||
</li>
|
||||
<li>
|
||||
<%= delete_link(
|
||||
news_path(activity),
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if activity.author == User.current %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</li>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</div>
|
||||
<div class="homepagePostTitle break_word"> <!--+"(通知标题)"-->
|
||||
<div class="fl">
|
||||
<%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id), :class => "postGrey" %>
|
||||
<%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %>
|
||||
</div>
|
||||
<% if activity.sticky == 1%>
|
||||
<span class="sticky_btn_cir ml10">置顶</span>
|
||||
|
|
|
@ -82,6 +82,10 @@ RedmineApp::Application.routes.draw do
|
|||
get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'}
|
||||
get '/', to: 'organizations#show', defaults: { id: 1 }, constraints: {subdomain: 'team'}
|
||||
|
||||
get '/', to: 'users#show', defaults: {id: 7}, constraints: {subdomain: 'whm'}
|
||||
get '/', to: 'users#show', defaults: {id: 5}, constraints: {subdomain: 'yg'}
|
||||
get '/', to: 'users#show', defaults: {id:11}, constraints: {subdomain: 'wt'}
|
||||
|
||||
resources :org_member do
|
||||
member do
|
||||
|
||||
|
|
|
@ -693,7 +693,7 @@ a.postReplyCancel:hover {color:#ffffff;}
|
|||
.homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;}
|
||||
.homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;}
|
||||
.homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;}
|
||||
a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;}
|
||||
a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;text-align:center;}
|
||||
a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
|
||||
.homepagePostReplyPortrait {float:left; width:33px;}
|
||||
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
|
||||
|
|
Loading…
Reference in New Issue