Merge branch 'szzh' into develop
This commit is contained in:
commit
0d6c4a9984
|
@ -79,9 +79,7 @@ class AttachmentsController < ApplicationController
|
||||||
if candown || User.current.admin? || User.current.id == @attachment.author_id
|
if candown || User.current.admin? || User.current.id == @attachment.author_id
|
||||||
@attachment.increment_download
|
@attachment.increment_download
|
||||||
if stale?(:etag => @attachment.digest)
|
if stale?(:etag => @attachment.digest)
|
||||||
if params[:force] == 'true'
|
if params[:preview] == 'true'
|
||||||
direct_download
|
|
||||||
else
|
|
||||||
convered_file = @attachment.diskfile
|
convered_file = @attachment.diskfile
|
||||||
#如果本身不是pdf文件,则先寻找是不是已转换化,如果没有则转化
|
#如果本身不是pdf文件,则先寻找是不是已转换化,如果没有则转化
|
||||||
unless pdf?(convered_file)
|
unless pdf?(convered_file)
|
||||||
|
@ -96,6 +94,8 @@ class AttachmentsController < ApplicationController
|
||||||
else
|
else
|
||||||
direct_download
|
direct_download
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
direct_download
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -24,7 +24,7 @@ class TestController < ApplicationController
|
||||||
end
|
end
|
||||||
@paths = homeworks_attach_path
|
@paths = homeworks_attach_path
|
||||||
zipfile = ziping homeworks_attach_path
|
zipfile = ziping homeworks_attach_path
|
||||||
send_file zipfile, :filename => bid.name,
|
send_file zipfile, :filename => filename_for_content_disposition(bid.name),
|
||||||
:type => detect_content_type(zipfile)
|
:type => detect_content_type(zipfile)
|
||||||
rescue Errno::ENOENT => e
|
rescue Errno::ENOENT => e
|
||||||
logger.error "[Errno::ENOENT] ===> #{e}"
|
logger.error "[Errno::ENOENT] ===> #{e}"
|
||||||
|
|
|
@ -11,7 +11,7 @@ class ZipdownController < ApplicationController
|
||||||
def download
|
def download
|
||||||
if User.current.logged?
|
if User.current.logged?
|
||||||
begin
|
begin
|
||||||
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file])
|
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file])
|
||||||
rescue => e
|
rescue => e
|
||||||
render file: 'public/no_file_found.html'
|
render file: 'public/no_file_found.html'
|
||||||
end
|
end
|
||||||
|
@ -59,9 +59,10 @@ class ZipdownController < ApplicationController
|
||||||
if homework != nil
|
if homework != nil
|
||||||
unless homework.attachments.empty?
|
unless homework.attachments.empty?
|
||||||
zipfile = zip_homework_by_user homework
|
zipfile = zip_homework_by_user homework
|
||||||
send_file zipfile.file_path, :filename => ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
|
filename = ((homework.user.user_extensions.nil? || homework.user.user_extensions.student_id.nil?) ? "" : homework.user.user_extensions.student_id) +
|
||||||
"_" + homework.user.show_name +
|
"_" + homework.user.show_name +
|
||||||
"_" + homework.name + ".zip", :type => detect_content_type(zipfile.file_path) if(zipfile)
|
"_" + homework.name + ".zip"
|
||||||
|
send_file zipfile.file_path, :filename => filename_for_content_disposition(filename), :type => detect_content_type(zipfile.file_path) if(zipfile)
|
||||||
else
|
else
|
||||||
render file: 'public/no_file_found.html'
|
render file: 'public/no_file_found.html'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
module ActivityNotifysHelper
|
module ActivityNotifysHelper
|
||||||
def get_new_notify_count(container,type)
|
def get_new_notify_count(container,type)
|
||||||
logger.info('xxoo')
|
query = ActivityNotify.where('activity_container_id=? and activity_container_type=? and notify_to=? and is_read=0',container.id,type,User.current.id);
|
||||||
query = ActivityNotify.where('activity_container_id=? and activity_container_type=? and notify_to=?',container.id,type,User.current.id);
|
|
||||||
return query.count()
|
return query.count()
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -253,7 +253,7 @@
|
||||||
};
|
};
|
||||||
params.get_ref_str_call=function(btn){
|
params.get_ref_str_call=function(btn){
|
||||||
var div = btn.parent('div');
|
var div = btn.parent('div');
|
||||||
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'</blockquote>';
|
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'<div class="cl"></div></blockquote>';
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
nh_init_board(params);
|
nh_init_board(params);
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div nhname="quote_show" id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
<div nhname="quote_show" id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
||||||
|
<div class="cl"></div>
|
||||||
<% unless replying %>
|
<% unless replying %>
|
||||||
<label class="fl ml3" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
<label class="fl ml3" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -238,7 +238,7 @@
|
||||||
};
|
};
|
||||||
params.get_ref_str_call=function(btn){
|
params.get_ref_str_call=function(btn){
|
||||||
var div = btn.parent('div');
|
var div = btn.parent('div');
|
||||||
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'</blockquote>';
|
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'<div class="cl"></div></blockquote>';
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
nh_init_board(params);
|
nh_init_board(params);
|
||||||
|
|
|
@ -185,9 +185,17 @@ function nh_init_board(params){
|
||||||
if(params.quote_input!=undefined)params.quote_input.empty();
|
if(params.quote_input!=undefined)params.quote_input.empty();
|
||||||
}else{
|
}else{
|
||||||
if(params.type=='reply'){
|
if(params.type=='reply'){
|
||||||
params.jumphref.attr('href','#'+params.form.attr('id'));
|
params.textarea.show();
|
||||||
params.jumphref[0].click();
|
params.textarea.focus();
|
||||||
}else params.inputsubject.focus();
|
params.textarea.hide();
|
||||||
|
//params.jumphref.attr('href','#'+params.form.attr('id'));
|
||||||
|
//params.jumphref[0].click();
|
||||||
|
}else{
|
||||||
|
params.textarea.show();
|
||||||
|
params.textarea.focus();
|
||||||
|
params.textarea.hide();
|
||||||
|
// params.inputsubject.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
params.textarea.data('init','1');//标记为已经初始化
|
params.textarea.data('init','1');//标记为已经初始化
|
||||||
|
|
|
@ -168,8 +168,11 @@
|
||||||
params.cancel_btn.click();
|
params.cancel_btn.click();
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
if(!params.div_form.is(':hidden')){
|
if(!params.div_form.is(':hidden')){
|
||||||
$("#nhjump").attr('href','#'+params.div_form.attr('id'));
|
params.textarea.show();
|
||||||
$("#nhjump")[0].click();
|
params.textarea.focus();
|
||||||
|
params.textarea.hide();
|
||||||
|
// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
|
||||||
|
// $("#nhjump")[0].click();
|
||||||
}
|
}
|
||||||
},300);
|
},300);
|
||||||
params.textarea.data('init',1);
|
params.textarea.data('init',1);
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
<br />
|
<br />
|
||||||
<%= l :label_activity_time %> : <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %>
|
<%= l :label_activity_time %> : <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %>
|
||||||
</p>
|
</p>
|
||||||
<%= link_to_attachments_course(e) if e.is_a?(News) %>
|
<%= link_to_attachments_course(e) if e.class.to_s == "News" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div><!--课程动态 end-->
|
</div><!--课程动态 end-->
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<% if file.is_public? || User.current.member_of_course?(course) %>
|
<% if file.is_public? || User.current.member_of_course?(course) %>
|
||||||
<div class="re_con_box" id="container_files_<%= file.id %>">
|
<div class="re_con_box" id="container_files_<%= file.id %>">
|
||||||
<div class="">
|
<div class="">
|
||||||
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %>
|
<%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename, preview: true),: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 User.current.logged? %>
|
||||||
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||||
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= link_to '下载',download_named_attachment_path(file.id, file.filename, force: true),class: 'f_l re_open' %>
|
<%= link_to_attachment file, text: '下载', class: 'f_l re_open' %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<% project_attachments.each do |file| %>
|
<% project_attachments.each do |file| %>
|
||||||
<div class="re_con_box">
|
<div class="re_con_box">
|
||||||
<div class="">
|
<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" %>
|
<%= link_to truncate(file.filename,length: 35, omission: '...'), download_named_attachment_path(file.id, file.filename, preview: true),: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 User.current.logged? %>
|
||||||
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
|
<% 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) %>
|
<%= 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) %>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
<% else %>
|
<% 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) %>
|
<%= 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 %>
|
<% end %>
|
||||||
<%= link_to '下载',download_named_attachment_path(file.id, file.filename, force: true),class: 'f_l re_open' %>
|
<%= link_to_attachment file, text: '下载', class: 'f_l re_open' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:label_course_news) %>
|
<%= l(:label_course_news) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @course_news.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
<% @course_news.each do |course_new|%>
|
<% @course_news.each do |course_new|%>
|
||||||
<li style="clear: both; list-style: none;">
|
<li style="clear: both; list-style: none;">
|
||||||
|
@ -41,7 +40,6 @@
|
||||||
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;">
|
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;">
|
||||||
<%= l(:label_homework_overview) %>
|
<%= l(:label_homework_overview) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @bids.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
<% unless @bids.first.nil?%>
|
<% unless @bids.first.nil?%>
|
||||||
<% @bids.each do |bid| %>
|
<% @bids.each do |bid| %>
|
||||||
|
@ -76,7 +74,6 @@
|
||||||
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:view_course_journals_for_messages) %>
|
<%= l(:view_course_journals_for_messages) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @course_journal_messages.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<% @course_journal_messages.each do |course_journal_message|%>
|
<% @course_journal_messages.each do |course_journal_message|%>
|
||||||
|
@ -109,7 +106,6 @@
|
||||||
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:view_borad_course) %>
|
<%= l(:view_borad_course) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @course_messages.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
<% @course_messages.each do |course_message|%>
|
<% @course_messages.each do |course_message|%>
|
||||||
<li style="clear: both; list-style: none;">
|
<li style="clear: both; list-style: none;">
|
||||||
|
@ -137,7 +133,6 @@
|
||||||
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:label_course_attendingcontestwork_download) %>
|
<%= l(:label_course_attendingcontestwork_download) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @attachments.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
<% @attachments.each do |attachment|%>
|
<% @attachments.each do |attachment|%>
|
||||||
<li style="clear: both; list-style: none;">
|
<li style="clear: both; list-style: none;">
|
||||||
|
@ -174,7 +169,6 @@
|
||||||
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:label_issue_tracking) %>
|
<%= l(:label_issue_tracking) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @issues.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
<% @issues.each do |issue|%>
|
<% @issues.each do |issue|%>
|
||||||
<li style="clear: both; list-style: none;">
|
<li style="clear: both; list-style: none;">
|
||||||
|
@ -203,7 +197,6 @@
|
||||||
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:project_moule_boards_show) %>
|
<%= l(:project_moule_boards_show) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @project_messages.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
<% @project_messages.each do |project_message|%>
|
<% @project_messages.each do |project_message|%>
|
||||||
<li style="clear: both; list-style: none;">
|
<li style="clear: both; list-style: none;">
|
||||||
|
@ -236,7 +229,6 @@
|
||||||
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:label_wiki) %>
|
<%= l(:label_wiki) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @project_news.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
<% @wiki_contents.each do |wikicontent|%>
|
<% @wiki_contents.each do |wikicontent|%>
|
||||||
<li style="clear: both; list-style: none;">
|
<li style="clear: both; list-style: none;">
|
||||||
|
@ -268,7 +260,6 @@
|
||||||
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style=" list-style-type:none;clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:label_project_news) %>
|
<%= l(:label_project_news) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @project_news.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
<% @project_news.each do |project_new|%>
|
<% @project_news.each do |project_new|%>
|
||||||
<li style="clear: both; list-style: none;">
|
<li style="clear: both; list-style: none;">
|
||||||
|
@ -298,7 +289,6 @@
|
||||||
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="clear: both;margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:label_project_mail_feedback) %>
|
<%= l(:label_project_mail_feedback) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @course_journal_messages.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<% @project_journal_messages.each do |project_journal_message|%>
|
<% @project_journal_messages.each do |project_journal_message|%>
|
||||||
|
@ -336,7 +326,6 @@
|
||||||
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:label_user_message) %>
|
<%= l(:label_user_message) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @user_journal_messages.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<% @user_journal_messages.each do |user_journal_message|%>
|
<% @user_journal_messages.each do |user_journal_message|%>
|
||||||
|
@ -395,7 +384,6 @@
|
||||||
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
|
||||||
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
|
<span class="wmail_h4" style="color:#474646; font-size:14px; margin-bottom:5px;" >
|
||||||
<%= l(:label_user_message_forum) %>
|
<%= l(:label_user_message_forum) %>
|
||||||
<!--<span class="wmail_num" style="color:#fe3f0c; margin-left:5px; font-weight:normal;">(<%#= @memos.count %>)</span>-->
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<% @memos.each do |memo|%>
|
<% @memos.each do |memo|%>
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%>
|
<%= link_to truncate(course_new.course.name,length: 30,omission: '...'), course_url(course_new.course, :token => @token.value)%>
|
||||||
]
|
]
|
||||||
|
|
||||||
<%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value)
|
<%= link_to course_new.author, user_activities_url(course_new.author,:token => @token.value)
|
||||||
%>
|
%>
|
||||||
<%= l(:label_project_notice) %>
|
<%= l(:label_project_notice) %>
|
||||||
|
|
||||||
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value)
|
<%= link_to truncate(course_new.title,length: 30,omission: '...'), news_url(course_new,:token => @token.value)
|
||||||
|
|
||||||
|
|
||||||
%> <%= format_time(course_new.created_on) %>
|
%> <%= format_time(course_new.created_on) %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
[
|
[
|
||||||
|
|
||||||
<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value)
|
<%= link_to truncate(bid.course.name,length: 30,omission: '...'),course_url(bid.course, :token => @token.value)
|
||||||
|
|
||||||
%>
|
%>
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@
|
||||||
<%= l(:label_course_homework) %>
|
<%= l(:label_course_homework) %>
|
||||||
|
|
||||||
<%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
|
<%= link_to truncate(bid.name, length: 30,omission: '...'), student_work_index_path(:homework => bid.id,:token => @token.value)
|
||||||
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<%= format_time(bid.created_at) %>
|
<%= format_time(bid.created_at) %>
|
||||||
|
|
||||||
|
@ -66,17 +66,17 @@
|
||||||
[
|
[
|
||||||
|
|
||||||
<%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value)
|
<%= link_to truncate(course_journal_message.course.name,length: 30,omission: '...'), course_url(course_journal_message.course, :token => @token.value)
|
||||||
|
|
||||||
%>
|
%>
|
||||||
]
|
]
|
||||||
|
|
||||||
<%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value)
|
<%= link_to course_journal_message.user, user_activities_url(course_journal_message.user,:token => @token.value)
|
||||||
%>
|
%>
|
||||||
<%= l(:label_send_course_journals_for_messages) %>
|
<%= l(:label_send_course_journals_for_messages) %>
|
||||||
|
|
||||||
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value)
|
<%= link_to truncate(course_journal_message.notes,length: 30,omission: '...'), course_feedback_url(course_journal_message.course,:token => @token.value)
|
||||||
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<%= format_time(course_journal_message.created_on) %>
|
<%= format_time(course_journal_message.created_on) %>
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@
|
||||||
[
|
[
|
||||||
|
|
||||||
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)
|
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course, :token => @token.value)
|
||||||
|
|
||||||
%>
|
%>
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -106,8 +106,8 @@
|
||||||
<%= l(:label_send_course_messages) %>
|
<%= l(:label_send_course_messages) %>
|
||||||
|
|
||||||
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value)
|
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value)
|
||||||
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<%= format_time(course_message.created_on) %>
|
<%= format_time(course_message.created_on) %>
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
▪[
|
▪[
|
||||||
|
|
||||||
<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value)
|
<%= link_to truncate(attachment.course.name,length: 30,omission: '...'), course_url(attachment.course, :token => @token.value)
|
||||||
|
|
||||||
%>
|
%>
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -135,8 +135,8 @@
|
||||||
<%= l(:label_course_file_upload) %>
|
<%= l(:label_course_file_upload) %>
|
||||||
|
|
||||||
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value)
|
<%= link_to truncate(attachment.filename,length: 30,omission: '...'),course_files_url(attachment.course,:token => @token.value)
|
||||||
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<%= format_time(attachment.created_on) %>
|
<%= format_time(attachment.created_on) %>
|
||||||
</li>
|
</li>
|
||||||
|
@ -158,7 +158,7 @@
|
||||||
[
|
[
|
||||||
|
|
||||||
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value)
|
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value)
|
||||||
|
|
||||||
%>
|
%>
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -167,8 +167,8 @@
|
||||||
<%= l(:label_project_issue) %>
|
<%= l(:label_project_issue) %>
|
||||||
|
|
||||||
<%= link_to truncate(issue. subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value)
|
<%= link_to truncate(issue. subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value)
|
||||||
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<%= format_time(issue.created_on) %>
|
<%= format_time(issue.created_on) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
▪[
|
▪[
|
||||||
|
|
||||||
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value)
|
<%= link_to truncate(project_message.project.name,length: 30,omission: '...'), project_url(project_message.project, :token => @token.value)
|
||||||
|
|
||||||
%>
|
%>
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -194,8 +194,8 @@
|
||||||
<%= l(:label_send_course_messages) %>
|
<%= l(:label_send_course_messages) %>
|
||||||
|
|
||||||
<%= link_to truncate(project_message. subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value)
|
<%= link_to truncate(project_message. subject,length: 30,omission: '...'),board_message_url(project_message, :board_id => project_message.board_id,:token => @token.value)
|
||||||
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<%= format_time(project_message.created_on) %>
|
<%= format_time(project_message.created_on) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -277,13 +277,13 @@
|
||||||
▪
|
▪
|
||||||
|
|
||||||
<%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)
|
<%= link_to user_journal_message.user, user_activities_url(user_journal_message.user,:token => @token.value)
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<%= l(:label_show_your_message) %>
|
<%= l(:label_show_your_message) %>
|
||||||
|
|
||||||
<%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value)
|
<%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'), feedback_url(@user,:token => @token.value)
|
||||||
|
|
||||||
|
|
||||||
%>
|
%>
|
||||||
<%= format_time(user_journal_message.created_on) %>
|
<%= format_time(user_journal_message.created_on) %>
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if reply_allow %>
|
<% if reply_allow %>
|
||||||
<%= link_to l(:label_bid_respond_quote),'',
|
<%= link_to l(:label_bid_respond_quote),'',
|
||||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
{:focus => 'project_respond',:nhname=>"reply_btn", :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
<div class="msg_box" id='leave-message'>
|
<style type="text/css">
|
||||||
|
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||||
|
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||||
|
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||||
|
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||||
|
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||||
|
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||||
|
div.ke-toolbar .ke-outline{border:none;}
|
||||||
|
|
||||||
|
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;}
|
||||||
|
div.recall_con{width:600px;}
|
||||||
|
div.recall_con .reply_btn{margin-left:555px;margin-top:5px;}
|
||||||
|
</style>
|
||||||
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||||
|
<div class="msg_box" id='leave-message' nhname='new_message' style="height:auto;">
|
||||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||||
<h4><%= l(:label_user_response) %></h4>
|
<h4><%= l(:label_user_response) %></h4>
|
||||||
<% if !User.current.logged?%>
|
<% if !User.current.logged?%>
|
||||||
|
@ -12,8 +26,10 @@
|
||||||
<%= form_for('new_form', :method => :post,
|
<%= form_for('new_form', :method => :post,
|
||||||
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
|
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
|
||||||
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
|
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
|
||||||
:placeholder => "#{l(:label_welcome_my_respond)}" %>
|
:placeholder => "#{l(:label_welcome_my_respond)}",:nhname=>'new_message_textarea' %>
|
||||||
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr" %>
|
<p nhname="contentmsg"></p>
|
||||||
|
<div class="fl mt10" style="padding-top:5px;" nhname="toolbar_container"></div>
|
||||||
|
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -24,3 +40,158 @@
|
||||||
</div>
|
</div>
|
||||||
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
|
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
|
||||||
|
|
||||||
|
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
function init_editor(params){
|
||||||
|
var editor = params.kindutil.create(params.textarea, {
|
||||||
|
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
|
||||||
|
items:['emoticons'],
|
||||||
|
afterChange:function(){//按键事件
|
||||||
|
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||||
|
},
|
||||||
|
afterCreate:function(){
|
||||||
|
var toolbar = $("div[class='ke-toolbar']",params.div_form);
|
||||||
|
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||||
|
params.toolbar_container.append(toolbar);
|
||||||
|
}
|
||||||
|
}).loadPlugin('paste');
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
|
||||||
|
function nh_check_field(params){
|
||||||
|
var result=true;
|
||||||
|
if(params.content!=undefined){
|
||||||
|
if(params.content.isEmpty()){
|
||||||
|
result=false;
|
||||||
|
}
|
||||||
|
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||||
|
params.textarea.html(params.content.html());
|
||||||
|
params.content.sync();
|
||||||
|
if(params.content.isEmpty()){
|
||||||
|
params.contentmsg.html('内容不能为空');
|
||||||
|
params.contentmsg.css({color:'#ff0000'});
|
||||||
|
}else{
|
||||||
|
params.contentmsg.html('填写正确');
|
||||||
|
params.contentmsg.css({color:'#008000'});
|
||||||
|
}
|
||||||
|
params.contentmsg.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function init_form(params){
|
||||||
|
// var flag = false;
|
||||||
|
// if(params.form.attr('data-remote') != undefined ){
|
||||||
|
// flag = true
|
||||||
|
// }
|
||||||
|
// params.form[0].onsubmit = function(){
|
||||||
|
// if(flag){
|
||||||
|
// $(this).removeAttr('data-remote');//不这么搞return false没用 花擦花擦
|
||||||
|
// }
|
||||||
|
// var is_checked = nh_check_field({
|
||||||
|
// issubmit:true,
|
||||||
|
// content:params.editor,
|
||||||
|
// contentmsg:params.contentmsg,
|
||||||
|
// textarea:params.textarea
|
||||||
|
// });
|
||||||
|
// if(is_checked){
|
||||||
|
// if(flag){
|
||||||
|
// alert('add')
|
||||||
|
// $(this).attr('data-remote','true');
|
||||||
|
// }
|
||||||
|
// alert('ok')
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
params.form.submit(function(){
|
||||||
|
var flag = false;
|
||||||
|
if(params.form.attr('data-remote') != undefined ){
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
var is_checked = nh_check_field({
|
||||||
|
issubmit:true,
|
||||||
|
content:params.editor,
|
||||||
|
contentmsg:params.contentmsg,
|
||||||
|
textarea:params.textarea
|
||||||
|
});
|
||||||
|
if(is_checked){
|
||||||
|
if(flag){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
$(this)[0].submit();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// return true; //这个涛哥的firefox不能提交
|
||||||
|
//$(this).trigger('submit'); //这个虽然能提交 但是他是个死循环
|
||||||
|
//$(this)[0].submit(); //用这个form的data-remote='true'没效果了
|
||||||
|
//肿么破阿 我滴个神 实在不行就用$.ajax()算了
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function nh_reset_form(params){
|
||||||
|
params.form[0].reset();
|
||||||
|
params.textarea.empty();
|
||||||
|
if(params.editor != undefined){
|
||||||
|
params.editor.html(params.textarea.html());
|
||||||
|
}
|
||||||
|
params.contentmsg.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
KindEditor.ready(function(K){
|
||||||
|
$("a[nhname='reply_btn']").live('click',function(){
|
||||||
|
var params = {};
|
||||||
|
params.kindutil = K;
|
||||||
|
params.container = $(this).parent('div').parent('div');
|
||||||
|
params.div_form = $(">.respond-form",params.container);
|
||||||
|
params.form = $("form",params.div_form);
|
||||||
|
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||||
|
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||||
|
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||||
|
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
params.editor = init_editor(params);
|
||||||
|
init_form(params);
|
||||||
|
params.cancel_btn.click(function(){
|
||||||
|
nh_reset_form(params);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
params.cancel_btn.click();
|
||||||
|
setTimeout(function(){
|
||||||
|
if(!params.div_form.is(':hidden')){
|
||||||
|
params.textarea.show();
|
||||||
|
params.textarea.focus();
|
||||||
|
params.textarea.hide();
|
||||||
|
// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
|
||||||
|
// $("#nhjump")[0].click();
|
||||||
|
}
|
||||||
|
},300);
|
||||||
|
params.textarea.data('init',1);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("div[nhname='new_message']").each(function(){
|
||||||
|
var params = {};
|
||||||
|
params.kindutil = K;
|
||||||
|
params.div_form = $(this);
|
||||||
|
params.form = $("form",params.div_form);
|
||||||
|
if(params.form==undefined || params.form.length==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
|
||||||
|
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||||
|
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
params.editor = init_editor(params);
|
||||||
|
init_form(params);
|
||||||
|
// $("a[nhname='cancel_btn']",params.div_form).click(function(){
|
||||||
|
// nh_reset_form(params);
|
||||||
|
// });
|
||||||
|
params.textarea.data('init',1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -35,7 +35,7 @@
|
||||||
<%= c1.downloads %>
|
<%= c1.downloads %>
|
||||||
</div>
|
</div>
|
||||||
<div class="table_cell1 downicon1 filename download_icon" >
|
<div class="table_cell1 downicon1 filename download_icon" >
|
||||||
<%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%>
|
<%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%>c
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if reply_allow %>
|
<% if reply_allow %>
|
||||||
<%= link_to l(:label_bid_respond_quote),'',
|
<%= link_to l(:label_bid_respond_quote),'',
|
||||||
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
{:focus => 'project_respond',:nhname=>'reply_btn', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea')); $('##{ids} textarea') ;return false;"} %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
<style type="text/css">
|
||||||
|
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||||
|
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||||
|
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||||
|
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||||
|
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||||
|
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||||
|
div.ke-toolbar .ke-outline{border:none;}
|
||||||
|
|
||||||
|
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;}
|
||||||
|
div.recall_con{width:600px;}
|
||||||
|
div.recall_con .reply_btn{margin-left:555px;margin-top:5px;}
|
||||||
|
</style>
|
||||||
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||||
<div class="dis">
|
<div class="dis">
|
||||||
<div class="msg_box" id='leave-message'>
|
<div class="msg_box" id='leave-message'>
|
||||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||||
|
@ -49,3 +63,163 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
function init_editor(params){
|
||||||
|
var editor = params.kindutil.create(params.textarea, {
|
||||||
|
resizeType : 1,minWidth:"1px",width:"100%",height:"150px",
|
||||||
|
items:['emoticons'],
|
||||||
|
afterChange:function(){//按键事件
|
||||||
|
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||||
|
},
|
||||||
|
afterCreate:function(){
|
||||||
|
var toolbar = $("div[class='ke-toolbar']",params.div_form);
|
||||||
|
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||||
|
params.toolbar_container.append(toolbar);
|
||||||
|
}
|
||||||
|
}).loadPlugin('paste');
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
|
||||||
|
function nh_check_field(params){
|
||||||
|
var result=true;
|
||||||
|
if(params.content!=undefined){
|
||||||
|
if(params.content.isEmpty()){
|
||||||
|
result=false;
|
||||||
|
}
|
||||||
|
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||||
|
params.textarea.html(params.content.html());
|
||||||
|
params.content.sync();
|
||||||
|
if(params.content.isEmpty()){
|
||||||
|
params.contentmsg.html('内容不能为空');
|
||||||
|
params.contentmsg.css({color:'#ff0000'});
|
||||||
|
}else{
|
||||||
|
params.contentmsg.html('填写正确');
|
||||||
|
params.contentmsg.css({color:'#008000'});
|
||||||
|
}
|
||||||
|
params.contentmsg.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function init_form(params){
|
||||||
|
// var flag = false;
|
||||||
|
// if(params.form.attr('data-remote') != undefined ){
|
||||||
|
// flag = true
|
||||||
|
// }
|
||||||
|
// params.form[0].onsubmit = function(){
|
||||||
|
// if(flag){
|
||||||
|
// $(this).removeAttr('data-remote');//不这么搞return false没用 花擦花擦
|
||||||
|
// }
|
||||||
|
// var is_checked = nh_check_field({
|
||||||
|
// issubmit:true,
|
||||||
|
// content:params.editor,
|
||||||
|
// contentmsg:params.contentmsg,
|
||||||
|
// textarea:params.textarea
|
||||||
|
// });
|
||||||
|
// if(is_checked){
|
||||||
|
// if(flag){
|
||||||
|
// alert('add')
|
||||||
|
// $(this).attr('data-remote','true');
|
||||||
|
// }
|
||||||
|
// alert('ok')
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
params.form.submit(function(){
|
||||||
|
var flag = false;
|
||||||
|
if(params.form.attr('data-remote') != undefined ){
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
var is_checked = nh_check_field({
|
||||||
|
issubmit:true,
|
||||||
|
content:params.editor,
|
||||||
|
contentmsg:params.contentmsg,
|
||||||
|
textarea:params.textarea
|
||||||
|
});
|
||||||
|
if(is_checked){
|
||||||
|
if(flag){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
$(this)[0].submit();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// return true; //这个涛哥的firefox不能提交
|
||||||
|
//$(this).trigger('submit'); //这个虽然能提交 但是他是个死循环
|
||||||
|
//$(this)[0].submit(); //用这个form的data-remote='true'没效果了
|
||||||
|
//肿么破阿 我滴个神 实在不行就用$.ajax()算了
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function nh_reset_form(params){
|
||||||
|
params.form[0].reset();
|
||||||
|
params.textarea.empty();
|
||||||
|
if(params.editor != undefined){
|
||||||
|
params.editor.html(params.textarea.html());
|
||||||
|
}
|
||||||
|
params.contentmsg.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
KindEditor.ready(function(K){
|
||||||
|
$("a[nhname='reply_btn']").live('click',function(){
|
||||||
|
var params = {};
|
||||||
|
params.kindutil = K;
|
||||||
|
if($(this).parent('span')==undefined || $(this).parent('span').length==0){
|
||||||
|
params.container = $(this).parent('div').parent('div');
|
||||||
|
}else{
|
||||||
|
params.container = $(this).parent('span').parent('div').parent('div');
|
||||||
|
}
|
||||||
|
params.div_form = $(">.respond-form",params.container);
|
||||||
|
params.form = $("form",params.div_form);
|
||||||
|
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||||
|
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||||
|
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||||
|
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
params.editor = init_editor(params);
|
||||||
|
init_form(params);
|
||||||
|
params.cancel_btn.click(function(){
|
||||||
|
nh_reset_form(params);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
params.cancel_btn.click();
|
||||||
|
setTimeout(function(){
|
||||||
|
if(!params.div_form.is(':hidden')){
|
||||||
|
params.textarea.show();
|
||||||
|
params.textarea.focus();
|
||||||
|
params.textarea.hide();
|
||||||
|
// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
|
||||||
|
// $("#nhjump")[0].click();
|
||||||
|
}
|
||||||
|
},300);
|
||||||
|
params.textarea.data('init',1);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("div[nhname='new_message']").each(function(){
|
||||||
|
var params = {};
|
||||||
|
params.kindutil = K;
|
||||||
|
params.div_form = $(this);
|
||||||
|
params.form = $("form",params.div_form);
|
||||||
|
if(params.form==undefined || params.form.length==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
|
||||||
|
params.contentmsg = $("p[nhname='contentmsg']",params.div_form),
|
||||||
|
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||||
|
if(params.textarea.data('init') == undefined){
|
||||||
|
params.editor = init_editor(params);
|
||||||
|
init_form(params);
|
||||||
|
// $("a[nhname='cancel_btn']",params.div_form).click(function(){
|
||||||
|
// nh_reset_form(params);
|
||||||
|
// });
|
||||||
|
params.textarea.data('init',1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
border: #d5dee9 1px solid;
|
border: #d5dee9 1px solid;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div style="width: 80%; margin-left:10%;">
|
<div style="width: 80%; margin-left:10%;" nhname='new_message'>
|
||||||
<%= form_for('new_form', :remote => true, :method => :post,
|
<%= form_for('new_form', :remote => true, :method => :post,
|
||||||
:url => {:controller => 'words',
|
:url => {:controller => 'words',
|
||||||
:action => 'create',
|
:action => 'create',
|
||||||
|
@ -51,10 +51,12 @@
|
||||||
<%= f.text_area 'user_message', :rows => 3, :cols => 65,
|
<%= f.text_area 'user_message', :rows => 3, :cols => 65,
|
||||||
:placeholder => "#{l(:label_leave_a_message)}",
|
:placeholder => "#{l(:label_leave_a_message)}",
|
||||||
:style => "resize: none; width: 98%",
|
:style => "resize: none; width: 98%",
|
||||||
:class => 'noline'%>
|
:class => 'noline',:nhname=>'new_message_textarea'%>
|
||||||
<%# end %>
|
<%# end %>
|
||||||
<%= f.text_field :reference_user_id, :style=>"display:none"%>
|
<%= f.text_field :reference_user_id, :style=>"display:none"%>
|
||||||
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
|
<p nhname="contentmsg"></p>
|
||||||
|
<div style="padding-top:5px;float:left;" nhname="toolbar_container"></div>
|
||||||
|
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-top: 5px;"%>
|
||||||
<%else %>
|
<%else %>
|
||||||
<div style="font-size: 14px;margin:10px;">
|
<div style="font-size: 14px;margin:10px;">
|
||||||
<%= l(:label_user_login_tips) %>
|
<%= l(:label_user_login_tips) %>
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
<%= form_tag(words_create_reply_path, :remote => true) do %>
|
<%= form_tag(words_create_reply_path, :remote => true) do %>
|
||||||
<%= text_area_tag 'user_notes', "", :class => 'noline',
|
<%= text_area_tag 'user_notes', "", :class => 'noline',
|
||||||
:style => "resize: none;", :rows => 4,
|
:style => "resize: none;", :rows => 4,
|
||||||
:placeholder => l(:label_feedback_respond_content),
|
:placeholder => l(:label_feedback_respond_content)#,
|
||||||
:maxlength => 250 %>
|
#:maxlength => 250
|
||||||
|
%>
|
||||||
|
<p nhname="contentmsg"></p>
|
||||||
|
|
||||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
||||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
|
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
|
||||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
|
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
|
||||||
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
|
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
|
||||||
|
<div class="fl" style="padding-top:5px;float:left;" nhname="toolbar_container"></div>
|
||||||
<%= submit_tag l(:button_feedback_respond), :name => nil ,
|
<%= submit_tag l(:button_feedback_respond), :name => nil ,
|
||||||
:class => "enterprise",
|
:class => "enterprise",
|
||||||
:style => "float: right; margin-top: 1px; margin-right: 4px;margin-bottom: 5px;"%>
|
:style => "float: right; margin-top: 1px; margin-right: 4px;margin-bottom: 5px;"%>
|
||||||
|
<input nhname="cancel_btn" type="button" style="display:none;"/>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
|
@ -1,9 +1,10 @@
|
||||||
<%= form_tag(words_create_reply_path, :remote => true) do %>
|
<%= form_tag(words_create_reply_path, :remote => true) do %>
|
||||||
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
|
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
|
||||||
:style => "resize: none;overflow: hidden;",:rows => 4,
|
:style => "resize: none;overflow: hidden;",:rows => 4,
|
||||||
:placeholder => l(:label_feedback_respond_content),
|
:placeholder => l(:label_feedback_respond_content)#,
|
||||||
|
|
||||||
:maxlength => 250 %>
|
#:maxlength => 250
|
||||||
|
%>
|
||||||
<p nhname="contentmsg"></p>
|
<p nhname="contentmsg"></p>
|
||||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
||||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
|
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
<%= form_tag(words_create_reply_path, :remote => true) do %>
|
<%= form_tag(words_create_reply_path, :remote => true) do %>
|
||||||
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
|
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
|
||||||
:style => "resize: none;overflow: hidden;",:rows => 4,
|
:style => "resize: none;overflow: hidden;",:rows => 4,
|
||||||
:placeholder => l(:label_feedback_respond_content),
|
:placeholder => l(:label_feedback_respond_content)
|
||||||
|
#,:maxlength => 250
|
||||||
:maxlength => 250 %>
|
%>
|
||||||
|
<p nhname="contentmsg"></p>
|
||||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
|
||||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
|
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
|
||||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
|
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
|
||||||
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
|
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
|
||||||
|
|
||||||
|
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
|
||||||
<%= submit_tag l(:button_feedback_respond), :name => nil ,
|
<%= submit_tag l(:button_feedback_respond), :name => nil ,
|
||||||
:class => "reply_btn"%>
|
:class => "reply_btn"%>
|
||||||
|
<input nhname="cancel_btn" type="button" style="display:none;"/>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
|
@ -5620,7 +5620,8 @@ _plugin('core', function(K) {
|
||||||
afterUpload : function(data) {
|
afterUpload : function(data) {
|
||||||
if (data.error === 0) {
|
if (data.error === 0) {
|
||||||
var url = K.formatUrl(data.url, 'absolute');
|
var url = K.formatUrl(data.url, 'absolute');
|
||||||
self.exec('insertimage', url, 'image','','','1','left');
|
//self.exec('insertimage', url, 'image','','','1','left');
|
||||||
|
self.insertHtml('<img src="'+url+'"/>');
|
||||||
var asset_id = data.asset_id;
|
var asset_id = data.asset_id;
|
||||||
if ( asset_id != "" && parent.document.getElementById('asset_id') != null ) {
|
if ( asset_id != "" && parent.document.getElementById('asset_id') != null ) {
|
||||||
parent.document.getElementById('asset_id').value += asset_id.toString();
|
parent.document.getElementById('asset_id').value += asset_id.toString();
|
||||||
|
|
Loading…
Reference in New Issue