Conflicts: app/controllers/files_controller.rb db/schema.rb 处理冲突dev_hjq
commit
165d5f50c8
@ -0,0 +1,3 @@
|
|||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the shield_activities controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,43 @@
|
|||||||
|
class ShieldActivitiesController < ApplicationController
|
||||||
|
def create
|
||||||
|
if params[:org_id]
|
||||||
|
if params[:project_id]
|
||||||
|
ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||||
|
elsif params[:course_id]
|
||||||
|
ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Course', :shield_id => params[:course_id].to_i)
|
||||||
|
end
|
||||||
|
elsif params[:user_id]
|
||||||
|
if params[:project_id]
|
||||||
|
ShieldActivity.create(:container_type => 'User', :container_id => params[:user_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||||
|
elsif params[:course_id]
|
||||||
|
ShieldActivity.create(:container_type => 'User', :container_id => params[:user_id].to_i, :shield_type => 'Course', :shield_id => params[:course_id].to_i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show_acts
|
||||||
|
if params[:org_id]
|
||||||
|
if params[:project_id]
|
||||||
|
ShieldActivity.where("container_type='Organization' and container_id=#{params[:org_id].to_i} and shield_type='Project' and shield_id=#{params[:project_id]}").each do |act|
|
||||||
|
act.destroy
|
||||||
|
end
|
||||||
|
# ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||||
|
elsif params[:course_id]
|
||||||
|
ShieldActivity.where("container_type='Organization' and container_id=#{params[:org_id].to_i} and shield_type='Course' and shield_id=#{params[:course_id]}").each do |act|
|
||||||
|
act.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elsif params[:user_id]
|
||||||
|
if params[:project_id]
|
||||||
|
ShieldActivity.where("container_type='User' and container_id=#{params[:user_id].to_i} and shield_type='Project' and shield_id=#{params[:project_id]}").each do |act|
|
||||||
|
act.destroy
|
||||||
|
end
|
||||||
|
# ShieldActivity.create(:container_type => 'Organization', :container_id => params[:org_id].to_i, :shield_type => 'Project', :shield_id => params[:project_id].to_i)
|
||||||
|
elsif params[:course_id]
|
||||||
|
ShieldActivity.where("container_type='User' and container_id=#{params[:user_id].to_i} and shield_type='Course' and shield_id=#{params[:course_id]}").each do |act|
|
||||||
|
act.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,2 @@
|
|||||||
|
module ShieldActivitiesHelper
|
||||||
|
end
|
@ -0,0 +1,15 @@
|
|||||||
|
class OrgMessage < ActiveRecord::Base
|
||||||
|
belongs_to :user
|
||||||
|
belongs_to :organization
|
||||||
|
has_many :message_alls, :as => :message, :dependent => :destroy
|
||||||
|
validates :message_type, :presence => true
|
||||||
|
validates :message_id, :presence => true
|
||||||
|
validates :organization_id, :presence => true
|
||||||
|
after_create :add_user_message
|
||||||
|
|
||||||
|
def add_user_message
|
||||||
|
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
|
||||||
|
self.message_alls << MessageAll.new(:user_id => self.user_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,3 @@
|
|||||||
|
class ShieldActivity < ActiveRecord::Base
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,19 @@
|
|||||||
|
<% if activity.attachments.any? %>
|
||||||
|
<% activity.attachments.each do |attachment| %>
|
||||||
|
<div class="break_word">
|
||||||
|
<span class="fl">
|
||||||
|
<span title="<%= attachment.filename %>" id="attachment_<%=attachment.id %>">
|
||||||
|
<%= link_to_short_attachment attachment,:length=> 58, :class => 'mw400 hidden link_file_a fl newsBlue', :download => true -%>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span class="postAttSize">(
|
||||||
|
<%= number_to_human_size attachment.filesize %>)
|
||||||
|
</span>
|
||||||
|
<span class="author" title="<%= attachment.author%>">
|
||||||
|
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||||
|
<%= format_time(attachment.created_on) %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
@ -1,5 +1,5 @@
|
|||||||
<% if User.current.logged? && User.current.id == @user.id %>
|
<% 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},:method=>'PUT',
|
<%= form_for @article, :url =>{:controller=>'blog_comments',:action => 'update',:user_id=>@user.id , :blog_id => @article.id, :is_homepage => params[:is_homepage]},:method=>'PUT',
|
||||||
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
: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} %>
|
<%= render :partial => 'blog_comments/edit', :locals => {:f => f, :article => @article, :edit_mode => true, :user => @user} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -0,0 +1,50 @@
|
|||||||
|
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" >
|
||||||
|
<div class="homepagePostBrief" onmouseover="$('#homepage_message_setting_<%=activity.id%>').show();" onmouseout="$('#homepage_message_setting_<%= activity.id%>').hide();">
|
||||||
|
<div class="homepagePostDes">
|
||||||
|
<% if activity.author.id == User.current.id%>
|
||||||
|
<div class="homepagePostSetting" id="homepage_message_setting_<%= activity.id%>" style="display: none">
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
|
<ul class="homepagePostSettiongText">
|
||||||
|
<li>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_edit_homepage),
|
||||||
|
{:controller => 'blog_comments',:action => 'edit',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id, :is_homepage => 1},
|
||||||
|
:class => 'postOptionLink'
|
||||||
|
) if User.current && User.current.id == activity.author.id %>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_delete_homepage),
|
||||||
|
{:controller => 'blog_comments',:action => 'destroy',:user_id=>activity.author_id,:blog_id=>activity.blog_id, :id => activity.id},
|
||||||
|
:method => :delete,
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:class => 'postOptionLink'
|
||||||
|
) if User.current && User.current.id == activity.author.id %>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_cancel_homepage),
|
||||||
|
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
|
||||||
|
:method => :post,
|
||||||
|
:class => 'postOptionLink'
|
||||||
|
) if User.current && User.current.id == activity.blog.author_id %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<%end%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="homepagePostTitle hidden m_w530 fl">
|
||||||
|
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id,
|
||||||
|
:blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey", :style => 'text-align:center;' %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" >
|
||||||
|
<%= activity.content.to_s.html_safe %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,13 @@
|
|||||||
|
if(document.getElementById("popbox02")) {
|
||||||
|
hideModal("#popbox02");
|
||||||
|
}
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'copy_course') %>');
|
||||||
|
showModal('ajax-modal', '730px');
|
||||||
|
$('#ajax-modal').css('height','530px').css('width','730px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<div class='resourcePopupClose mt5 mr-5'>" +
|
||||||
|
"<a href='javascript:void(0)' class='resourceClose' onclick='hideResource();'></a></div>");
|
||||||
|
$('#ajax-modal').parent().css("top","30%").css("left","").css("position","fixed");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox").addClass("copyCoursePopup");
|
||||||
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
|||||||
|
<span class="add_attachment" data-containerid="<%= container.id %>">
|
||||||
|
<button name="button" class="sub_btn" onclick="_file<%=container.id %>.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>" type="button" ><%= l(:label_browse) %></button>
|
||||||
|
<%= file_field_tag 'attachments[dummy][file]',
|
||||||
|
:id => "_file#{container.id}",
|
||||||
|
:class => ie8? ? '':'file_selector',
|
||||||
|
:multiple => true,
|
||||||
|
:onchange => "addInputFiles_board(this, '#{container.id}','"+"submit_resource"+"');",
|
||||||
|
:style => ie8? ? '': 'display:none',
|
||||||
|
:data => {
|
||||||
|
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||||
|
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||||
|
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||||
|
:upload_path => uploads_path(:format => 'js'),
|
||||||
|
:description_placeholder => l(:label_optional_description),
|
||||||
|
:field_is_public => l(:field_is_public),
|
||||||
|
:are_you_sure => l(:text_are_you_sure),
|
||||||
|
:file_count => l(:label_file_count),
|
||||||
|
:delete_all_files => l(:text_are_you_sure_all),
|
||||||
|
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||||
|
:containerid => "#{container.id}"
|
||||||
|
} %>
|
||||||
|
</span>
|
||||||
|
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
|
||||||
|
|
||||||
|
<span id="upload_file_count<%=container.id %>">
|
||||||
|
<%= l(:label_no_file_uploaded)%>
|
||||||
|
</span>
|
||||||
|
(<%= l(:label_max_size) %>:
|
||||||
|
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div>
|
||||||
|
<span id="attachments_fields<%= container.id %>" data-containerid="<%= container.id %>" xmlns="http://www.w3.org/1999/html">
|
||||||
|
</span>
|
||||||
|
</div>
|
@ -0,0 +1,15 @@
|
|||||||
|
<% if @project %>
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_project_files',:locals => {:project => @project,:project_attachment_type => 1}) %>');
|
||||||
|
showModal('ajax-modal', '513px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||||
|
<% elsif @course %>
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_course_files',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||||
|
showModal('ajax-modal', '513px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","40%").css("left","36%");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||||
|
<% end %>
|
@ -0,0 +1 @@
|
|||||||
|
$("#agree_apply_subdomain_<%= params[:act_id] %>").text("已同意申请");
|
@ -0,0 +1 @@
|
|||||||
|
location.reload();
|
@ -0,0 +1 @@
|
|||||||
|
location.reload();
|
@ -0,0 +1,45 @@
|
|||||||
|
<div class="userCard boxShadow" style="<%= User.current == user ? 'top:-153px;':'' %>">
|
||||||
|
<div class="userAvatarWrap fl">
|
||||||
|
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像", :target => '_blank' %>
|
||||||
|
<%#= image_tag(url_to_avatar(user), :width => "50", :height => "50") %>
|
||||||
|
<!--<img src="images/homepageImage.jpg" width="50" height="50" alt="个人头像" />-->
|
||||||
|
</div>
|
||||||
|
<div class="fl">
|
||||||
|
<p class="homepageImageName mb5" style="max-width:88px;font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;"><%= user %></p>
|
||||||
|
<span class="homepageImageSex"></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p class="mb8 c_dark f14">
|
||||||
|
<span class="mr15 hidden fl ml15" style="max-width:90px;"><%= user.show_name %></span>
|
||||||
|
<%= user.user_extensions.technical_title %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div>
|
||||||
|
<div class="homepageImageBlock mb10">
|
||||||
|
<div><%= link_to User.watched_by(user.id).count, {:controller=>"users", :action=>"user_watchlist",:id=>user.id}, :class => 'homepageImageNumber',:target => "_blank" %></div>
|
||||||
|
<div class="homepageImageText"><%= link_to '关注',{:controller=>"users", :action=>"user_watchlist",:id=>user.id},:target => "_blank" %></div>
|
||||||
|
</div>
|
||||||
|
<div class="homepageVerDiv"></div>
|
||||||
|
<div class="homepageImageBlock">
|
||||||
|
<div><%= link_to user.watcher_users.count,{:controller=>"users", :action=>"user_fanslist",:id=>user.id}, :class => "homepageImageNumber fans_count_#{user.id}",:target => "_blank" %></div>
|
||||||
|
<div class="homepageImageText"><%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>user.id},:target => "_blank" %></div>
|
||||||
|
</div>
|
||||||
|
<div class="homepageVerDiv"></div>
|
||||||
|
<div class="homepageImageBlock">
|
||||||
|
<div><%= link_to user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count, user_blogs_path(user), :class => 'homepageImageNumber',:target => "_blank" %></div>
|
||||||
|
<div class="homepageImageText"><%= link_to '博客', user_blogs_path(user),:target => "_blank" %></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% if User.current != user %>
|
||||||
|
<div class="add_cancel_watch_<%= user.id %>">
|
||||||
|
<%= render :partial => 'users/watch_btn_for_picture', :locals => {:user => user} %>
|
||||||
|
</div>
|
||||||
|
<!--<a href="javascript:void(0);" class="userFollow mr27 fl">添加关注</a> <a href="javascript:void(0);" class="userCancel mr27 fl" style="display:none;">取消关注</a>-->
|
||||||
|
<%= link_to "留言", feedback_path(user), :class => 'greyBtn fr', :target => "_blank" %>
|
||||||
|
<%= link_to "私信", feedback_path(user), :class => 'greyBtn fr', :style => 'margin-right:20px;', :target => "_blank" %>
|
||||||
|
<!--<a href="javascript:void(0);" class="greyBtn fl">私信</a><a href="javascript:void(0);" class="greyBtn fr">留言</a> -->
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<em></em>
|
||||||
|
<font></font>
|
||||||
|
</div>
|
@ -0,0 +1,40 @@
|
|||||||
|
<% if ma.class == OrgMessage %>
|
||||||
|
<% if ma.message_type == 'ApplySubdomain'%>
|
||||||
|
<ul class="homepageNewsList fl">
|
||||||
|
<li class="homepageNewsPortrait fl">
|
||||||
|
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.organization), :width => "30", :height => "30"), organization_path(ma.organization_id) %></a>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsPubType fl">
|
||||||
|
<%=link_to ma.organization.name, organization_path(ma.organization_id), :class => "newsBlue homepageNewsPublisher" %>
|
||||||
|
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>申请子域名:</span>
|
||||||
|
</li>
|
||||||
|
<li class="homepageHomeworkContent fl">
|
||||||
|
<%= ma.content %>
|
||||||
|
</li>
|
||||||
|
<li class="homepageHomeworkContentWarn fl">
|
||||||
|
<%=link_to (ma.organization.domain.nil? || (ma.organization.domain && ma.organization.domain != ma.content)) ? "同意申请":"已同意申请",
|
||||||
|
agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ),
|
||||||
|
:id => "agree_apply_subdomain_#{ma.id}",
|
||||||
|
:method => 'post',
|
||||||
|
:remote => true,
|
||||||
|
:class => "green_btn_cir ml10",
|
||||||
|
:style => "color:#fff" %>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
<% if ma.message_type == 'AgreeApplySubdomain'%>
|
||||||
|
<ul class="homepageNewsList fl">
|
||||||
|
<li class="homepageNewsPortrait fl">
|
||||||
|
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsPubType fl">
|
||||||
|
<span class='<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl' : 'homepageNewsType fl' %>'>管理员同意了您的子域名申请:</span>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsContent fl">
|
||||||
|
<%= ma.content %>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
@ -0,0 +1,9 @@
|
|||||||
|
<% if User.current == user %>
|
||||||
|
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") %>
|
||||||
|
<% else %>
|
||||||
|
<%if(user.watched_by?(User.current))%>
|
||||||
|
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id),:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id),:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue