Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/views/boards/_project_show.html.erb public/javascripts/course.js 处理冲突 修改项目动态分页 项目到航天中添加“新建项目”dev_repository_hjq
commit
12eaac5683
@ -1,42 +0,0 @@
|
||||
class DiscussDemosController < ApplicationController
|
||||
def index
|
||||
|
||||
@discuss_demo_list = DiscussDemo.where("body is not null").order("created_at desc").page(params[:page] || 1).per(10)
|
||||
end
|
||||
|
||||
def new
|
||||
@discuss_demo = DiscussDemo.create
|
||||
@discuss_demo.save!
|
||||
@discuss_demo
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
@discuss_demo = DiscussDemo.find(params[:id])
|
||||
@discuss_demo.update_attributes(:title => params[:discuss_demo][:title],:body => params[:discuss_demo][:body])
|
||||
redirect_to :controller=> 'discuss_demos',:action => 'show',:id => params[:id]
|
||||
end
|
||||
|
||||
def delete
|
||||
|
||||
end
|
||||
|
||||
def destroy
|
||||
asset = Kindeditor::Asset.find_by_owner_id(params[:id])
|
||||
if !asset.nil?
|
||||
filepath = File.join(Rails.root,"public","files","uploads",
|
||||
asset[:created_at].to_s.gsub("+0800","").to_datetime.strftime("%Y%m").to_s,
|
||||
asset[:asset].to_s)
|
||||
File.delete(filepath) if File.exist?filepath
|
||||
end
|
||||
DiscussDemo.destroy(params[:id])
|
||||
redirect_to :controller=> 'discuss_demos',:action => 'index'
|
||||
end
|
||||
|
||||
def show
|
||||
@discuss_demo = DiscussDemo.find(params[:id])
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
module OwnerTypeHelper
|
||||
MEMO = 1
|
||||
FORUM = 2
|
||||
MESSAGE = 3
|
||||
NEWS = 4
|
||||
COMMENT = 5
|
||||
BID = 6
|
||||
JOURNALSFORMESSAGE = 7
|
||||
end
|
@ -1,27 +0,0 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class CommentObserver < ActiveRecord::Observer
|
||||
def after_create(comment)
|
||||
if comment.commented.is_a?(News) && Setting.notified_events.include?('news_comment_added')
|
||||
##by senluo
|
||||
thread3=Thread.new do
|
||||
Mailer.news_comment_added(comment).deliver
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,4 +0,0 @@
|
||||
class DiscussDemo < ActiveRecord::Base
|
||||
attr_accessible :title, :body
|
||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
end
|
@ -1,25 +0,0 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class DocumentObserver < ActiveRecord::Observer
|
||||
def after_create(document)
|
||||
##by senluo
|
||||
thread2=Thread.new do
|
||||
Mailer.document_added(document).deliver if Setting.notified_events.include?('document_added')
|
||||
end
|
||||
end
|
||||
end
|
@ -1,8 +0,0 @@
|
||||
class ForumObserver < ActiveRecord::Observer
|
||||
# def after_create(forum)
|
||||
# Thread.start do
|
||||
# Mailer.forum_add(forum).deliver if Setting.notified_events.include?('forum_add')
|
||||
# end
|
||||
#
|
||||
# end
|
||||
end
|
@ -1,9 +1,7 @@
|
||||
# Added by young
|
||||
class JournalsForMessageObserver < ActiveRecord::Observer
|
||||
def after_create(journals_for_message)
|
||||
thread1 = Thread.start do
|
||||
Mailer.journals_for_message_add(User.current, journals_for_message).deliver
|
||||
end
|
||||
Mailer.run.journals_for_message_add(User.current, journals_for_message)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
class MemoObserver < ActiveRecord::Observer
|
||||
def after_create(memo)
|
||||
|
||||
thread1=Thread.new do
|
||||
Mailer.forum_message_added(memo).deliver if Setting.notified_events.include?('forum_message_added')
|
||||
end
|
||||
end
|
||||
end
|
@ -1,25 +0,0 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class MessageObserver < ActiveRecord::Observer
|
||||
def after_create(message)
|
||||
##by senluo
|
||||
thread5=Thread.new do
|
||||
Mailer.message_posted(message).deliver if Setting.notified_events.include?('message_posted')
|
||||
end
|
||||
end
|
||||
end
|
@ -1,25 +0,0 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class NewsObserver < ActiveRecord::Observer
|
||||
def after_create(news)
|
||||
##by senluo
|
||||
thread6=Thread.new do
|
||||
Mailer.news_added(news).deliver if Setting.notified_events.include?('news_added')
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,18 @@
|
||||
class ZipPack < ActiveRecord::Base
|
||||
# attr_accessible :title, :body
|
||||
|
||||
def self.packed?(bid_id, user_id, digests)
|
||||
zip_pack = ZipPack.where(homework_id: bid_id, user_id: user_id).first
|
||||
return false unless zip_pack && zip_pack.digests == digests
|
||||
zip_pack
|
||||
end
|
||||
|
||||
def file_valid?
|
||||
return false unless File.exist?(self.file_path)
|
||||
Trustie::Utils.digest(self.file_path) == self.file_digest
|
||||
end
|
||||
|
||||
def digests
|
||||
self.file_digests.split(',').sort
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
<% if !@save_flag && @save_message %>
|
||||
$("#error_show").html("<%= @save_message.join(', ') %>");
|
||||
<% elsif @message && @message != "" %>
|
||||
$("#error_show").html("<%= @message.html_safe %>");
|
||||
<% else %>
|
||||
closeModal();
|
||||
<% end %>
|
@ -1,3 +1,4 @@
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= labelled_form_for @bid do |f| %>
|
||||
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}"} %>
|
||||
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %>
|
||||
<% end %>
|
@ -1,3 +1,4 @@
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
|
||||
<%= render :partial => 'bids/new_homework_form', :locals => { :bid => @homework,:bid_id => "new_bid" } %>
|
||||
<%= render :partial => 'bids/new_homework_form', :locals => { :bid => @homework,:bid_id => "new_bid",:f => f,:edit_mode => false } %>
|
||||
<% end %>
|
@ -1,25 +0,0 @@
|
||||
<h1 style="">文章列表</h1>
|
||||
<div>
|
||||
<table border="1px solid !important" >
|
||||
<% @discuss_demo_list.each do |e| %>
|
||||
|
||||
<tr align="left" height="20">
|
||||
<td width="30%" ><%= truncate(e.title,:length => 50) %></td>
|
||||
<td align="center" width="60%">
|
||||
<%= truncate(e.body,:length => 50) %>
|
||||
</td>
|
||||
<td style=" margin-right: 1" width="10%">
|
||||
<%= link_to '查看文章',{:controller => 'discuss_demos',:action => 'show',:id=>e.id} %>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<%= link_to '删除文章',discuss_demo_path(e.id), :method => :delete,:confirm => l(:text_are_you_sure) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height="20"></tr>
|
||||
<tr height="20"></tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% paginate @discuss_demo_list %>
|
||||
<%= link_to '新建文章',new_discuss_demo_path %>
|
||||
</div>
|
@ -1,7 +0,0 @@
|
||||
<%= javascript_include_tag src='/assets/kindeditor/kindeditor' %>
|
||||
<h1>新建文章</h1>
|
||||
<%= form_for @discuss_demo,:url => {:controller => 'discuss_demos',:action => "show",:id =>@discuss_demo.id, :method => :put} do |f| %>
|
||||
<%= f.text_field :title %>
|
||||
<%= f.kindeditor :body ,:owner_id => @discuss_demo.id%>
|
||||
<%= f.submit :value=> '提交' %>
|
||||
<% end %>
|
@ -1,3 +0,0 @@
|
||||
<h1><%= @discuss_demo.title %></h1>
|
||||
<%= textAreailizable @discuss_demo.body %>
|
||||
<%=link_to "返回首页",discuss_demos_path %>
|
@ -0,0 +1,58 @@
|
||||
|
||||
<div class="re_con_top">
|
||||
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
||||
<p class="f_r" style="color: #808080">
|
||||
<% if order == "asc" %>
|
||||
按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
||||
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
||||
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
||||
<% else %>
|
||||
按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
||||
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
||||
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="for_img_thumbnails">
|
||||
<% project_attachments.each do |file| %>
|
||||
<div class="re_con_box">
|
||||
<div class="">
|
||||
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
||||
<% if User.current.logged? %>
|
||||
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
|
||||
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
||||
|
||||
<% if manage_allowed && file.container_id == project.id && file.container_type == "Project" %>
|
||||
<span id="is_public_<%= file.id %>">
|
||||
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
|
||||
</span>
|
||||
<% else %>
|
||||
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="">
|
||||
<p class="f_l c_grey02 font">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||
<%= link_to( l(:button_delete), attachment_path(file),
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if manage_allowed && file.container_id == project.id && file.container_type == "Project"%>
|
||||
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="tag_h">
|
||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "10"} %>
|
||||
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "10"} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!---re_con_box end-->
|
||||
<% end %>
|
||||
</div>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
@ -0,0 +1,65 @@
|
||||
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:lable_file_sharingarea) %></h2>
|
||||
</div>
|
||||
|
||||
<!--<%#= stylesheet_link_tag 'resource', :media => 'all' %> -->
|
||||
<script>
|
||||
function show_upload()
|
||||
{
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show_project',:locals => {:project => project}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>")
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||
}
|
||||
|
||||
function closeModal()
|
||||
{
|
||||
hideModal($("#popbox_upload"));
|
||||
}
|
||||
|
||||
function presscss(id)
|
||||
{
|
||||
if(id == "incourse")
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_dblue");
|
||||
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_lblue");
|
||||
$('#insite').attr("class", "re_schbtn b_dblue");
|
||||
}
|
||||
}
|
||||
function buttoncss()
|
||||
{
|
||||
$('#incourse').attr("class", "re_schbtn b_lblue");
|
||||
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<div class="resource"><!--资源库内容开始--->
|
||||
<div class="re_top">
|
||||
<%= form_tag( search_project_project_files_path(@project), method: 'get',:class => "re_search f_l",:remote=>true) do %>
|
||||
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
|
||||
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %>
|
||||
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||
<% end %>
|
||||
<% manage_allowed = User.current.allowed_to?(:manage_files, @project) %>
|
||||
<% if manage_allowed %> <!-- show_window('light','fade','20%','35%')-->
|
||||
<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>
|
||||
<% end %>
|
||||
</div><!---re_top end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="re_con" id="course_list">
|
||||
<%= render :partial => 'project_file_list',:locals => {project: @project,all_attachments: @all_attachments,sort:@sort,order:@order,project_attachments:@obj_attachments,:manage_allowed => manage_allowed} %>
|
||||
</div><!---re_con end-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<% html_title(l(:label_attachment_plural)) -%>
|
@ -0,0 +1,31 @@
|
||||
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
|
||||
<div class="upload_con">
|
||||
<h2>将此课件引入我的资源库</h2>
|
||||
<% if error == '403' %>
|
||||
<div class="upload_box">
|
||||
<div style="color: red;">您没有权限引用此资源</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="upload_box">
|
||||
<div id="error_show" style="color: red;"></div>
|
||||
<%= form_tag attach_relations_path,
|
||||
method: :post,
|
||||
remote: true,
|
||||
id: "relation_file_form" do %>
|
||||
<%= hidden_field_tag(:file_id, file.id) %>
|
||||
<%= content_tag('div', projects_check_box_tags('projects[project][]', User.current.projects,project,file), :id => 'projects')%>
|
||||
<a id="submit_quote" href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_quote();">引 用</a><a href="javascript:void(0)" class="blue_btn grey_btn fl c_white" onclick="closeModal();">取 消</a>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submit_quote()
|
||||
{
|
||||
$('#submit_quote').parent().submit();
|
||||
}
|
||||
</script>
|
@ -0,0 +1,29 @@
|
||||
|
||||
<div id="popbox_upload" class="box_h3 mb10" style="margin-top: -30px">
|
||||
<div class="upload_con">
|
||||
<h2><%= l(:label_upload_files)%></h2>
|
||||
<div class="upload_box">
|
||||
<%= error_messages_for 'attachment' %>
|
||||
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
|
||||
|
||||
<%= form_tag(project_files_path(project), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
|
||||
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
|
||||
<%= render :partial => 'attachement_list',:locals => {:project => project} %>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%= l(:button_cancel)%></a>
|
||||
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submit_resource()
|
||||
{
|
||||
$('#submit_resource').parent().submit();
|
||||
}
|
||||
</script>
|
@ -1,35 +1,33 @@
|
||||
<%if @addTag%>
|
||||
<% if @obj_flag == '3'%>
|
||||
|
||||
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
|
||||
<% if @addTag%>
|
||||
<% if @obj_flag == '3'%>
|
||||
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
//$('#put-tag-form-issue').hide();
|
||||
$('#name-issue').val("");
|
||||
<% elsif @obj_flag == '6'%>
|
||||
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
|
||||
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name',
|
||||
//$('#put-tag-form-issue').hide();
|
||||
$('#name-issue').val("");
|
||||
<% elsif @obj_flag == '6'%>
|
||||
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
|
||||
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
$("#put-tag-form- <%=@obj.class%>- <%=@obj.id%>").hide();
|
||||
$("#put-tag-form-<%=@obj.class%>-<%=@obj.id%> #name").val("");
|
||||
<% else %>
|
||||
|
||||
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
|
||||
$("#put-tag-form- <%=@obj.class%>- <%=@obj.id%>").hide();
|
||||
$("#put-tag-form-<%=@obj.class%>-<%=@obj.id%> #name").val("");
|
||||
<% else %>
|
||||
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
$('#tags_show').html('<%=render_attachments_tag_save(@project, nil)%>');
|
||||
$('#put-tag-form #name').val("");
|
||||
//$('#put-tag-form').hide();
|
||||
<% end %>
|
||||
<%else%>
|
||||
$('#tags_show').html('<%=render_attachments_tag_save(@project, nil)%>');
|
||||
$('#put-tag-form #name').val("");
|
||||
//$('#put-tag-form').hide();
|
||||
<% end %>
|
||||
<% else %>
|
||||
$("#attachments_fields").children().remove();
|
||||
$("#upload_file_count").text("未上传文件");
|
||||
$('#upload_file_div').slideToggle('slow');
|
||||
<%if @project%>
|
||||
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
|
||||
<%elsif @course%>
|
||||
$("#all_browse_div").html('<%= j(render partial: "course_show_all_attachment")%>');
|
||||
closeModal();
|
||||
$("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
|
||||
<%end%>
|
||||
<% if @project%>
|
||||
closeModal();
|
||||
$("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>');
|
||||
<%elsif @course%>
|
||||
closeModal();
|
||||
$("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
|
||||
<% end %>
|
||||
<% end %>
|
||||
$(document).ready(img_thumbnails);
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
<% if @can_quote %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_project',:locals => {:project => @project,:file => @file,:error => ''}) %>');
|
||||
<% else %>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show_quote_resource_project',:locals => {:project => @project,:file => @file,:error => '403'}) %>');
|
||||
<% end %>
|
||||
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'><a href='javascript:void(0)' onclick='closeModal()'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
@ -0,0 +1 @@
|
||||
$("#course_list").html("<%= escape_javascript(render :partial => 'project_file_list',:locals => {project: @project,all_attachments: @result,sort:@sort,order:@order,project_attachments:@searched_attach,:manage_allowed => User.current.allowed_to?(:manage_files, @project)})%>");
|
@ -1,27 +1,15 @@
|
||||
#!/usr/bin/env ruby
|
||||
#coding=utf-8
|
||||
|
||||
require 'rubygems'
|
||||
require 'rufus-scheduler'
|
||||
|
||||
#users = User.where("mail_notification = 'week' or mail_notification = 'day'")
|
||||
|
||||
scheduler = Rufus::Scheduler.new
|
||||
scheduler.cron('0 0 * * 1') do
|
||||
users = User.where("mail_notification = 'week'")
|
||||
users.each do |user|
|
||||
#Rails.logger.info "send mail to #{user.show_name}(#{user.mail}) at #{Time.now}"
|
||||
Thread.start do
|
||||
Mailer.send_for_user_activities(user, Date.today, 7).deliver
|
||||
end
|
||||
end
|
||||
end
|
||||
scheduler.cron('0 0 * * *') do
|
||||
users = User.where("mail_notification = 'day'")
|
||||
users.each do |user|
|
||||
#Rails.logger.info "send mail to #{user.show_name}(#{user.mail}) at #{Time.now}"
|
||||
Thread.start do
|
||||
Mailer.send_for_user_activities(user, Date.today, 1).deliver
|
||||
end
|
||||
end
|
||||
end
|
||||
## 移入crontab
|
||||
|
||||
# scheduler = Rufus::Scheduler.new
|
||||
#
|
||||
# #每天18:00发送当天的邮件汇总
|
||||
# scheduler.cron('0 18 * * *') do
|
||||
# users = User.where(mail_notification: 'day')
|
||||
# users.each do |user|
|
||||
# mailer = Mailer.send_for_user_activities(user, Date.today, 1)
|
||||
# mailer.deliver if mailer
|
||||
# end
|
||||
# end
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue