Merge branch 'dev_xucheng' into develop

This commit is contained in:
XuCheng642 2017-09-29 21:54:55 +08:00
commit 601ddd46f6
4 changed files with 63 additions and 78 deletions

View File

@ -554,28 +554,28 @@ end
end
def save_school
# uploaded_io = params[:logo]
uploaded_io = params[:logo]
sl = School.create(:name => params[:schoolname],:province => params[:province],:city => params[:city],:address => params[:address])
# unless uploaded_io.nil?
# File.new(Rails.root.join('public', 'images', 'school', sl.id.to_s+'.png'), 'wb').write(sl.id)
# File.new(Rails.root.join('public', 'images', 'school', sl.id.to_s+'.png'), 'wb') do |file|
# file.write(uploaded_io.read)
# end
# sl.logo_link = '/images/school/'+sl.id.to_s+'.png'
# end
unless uploaded_io.nil?
File.open(Rails.root.join('public', 'images', 'school', sl.id.to_s+'.png'), 'wb') do |file|
file.write(uploaded_io.read)
end
sl.logo_link = '/images/school/'+sl.id.to_s+'.png'
sl.save
end
@user = User.current
@se = @user.extensions
if @user.save && @se.save
diskfile1 = disk_filename('school', sl.id , 'id')
diskfileID = diskfile1 + 'temp'
begin
FileUtils.mv diskfileID, diskfile1, force: true if File.exist? diskfileID
ensure
File.delete(diskfileID) if File.exist?(diskfileID)
end
end
# if @user.save && @se.save
# diskfile1 = disk_filename('school', sl.id , 'id')
# diskfileID = diskfile1 + 'temp'
# begin
# FileUtils.mv diskfileID, diskfile1, force: true if File.exist? diskfileID
# ensure
# File.delete(diskfileID) if File.exist?(diskfileID)
# end
# end
redirect_to departments_part_managements_path
end

View File

@ -23,7 +23,7 @@
</td>
<td><%= format_time(jour.created_on) %></td>
<td class="edu-txt-left" style="white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">
<%= link_to jour.m_parent_id.nil? ? strip_html(jour.notes) : 'RE: ' + strip_html(jour.notes), student_work_index_path(:homework => jour.jour_id, :tab => 2) %>
<%= link_to jour.m_parent_id.nil? ? strip_html(jour.notes) : 'RE: ' + strip_html(jour.notes), student_work_index_path(:homework => jour.jour_id, :tab => 2),:target => '_blank' %>
</td>
<td>
<% replys = JournalsForMessage.where(:m_parent_id => jour.id) %>

View File

@ -1,66 +1,51 @@
<div class="col-width-10 mt20" style="padding:20px 0 0 300px">
<%= form_tag save_school_managements_path(),method: "post",:id => "save_school" do %>
<!--<div class="clearfix ml30">-->
<!--<input type="hidden" value="<%#= @school_name%>" name="school_name" class="w150">-->
<!--<%##= image_tag('', id: "avatar_image", :class=>"school_avatar ml25") %>-->
<!--<a type="button" onclick="$('#file').click();" style="margin: 90px 0 0 0px;padding: 2px 5px;cursor: pointer;text-decoration: none;width: 70px;" class="fl color-grey">上传图片</a>-->
<!--<%#= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%>-->
<!--<a type="button"style="margin: 90px 0 0 0px;padding: 2px 5px;cursor: pointer;text-decoration: none;width: 70px;" class="fl color-grey" >删除图片</a>-->
<!--<div class="cl"></div>-->
<!--</div>-->
<div class="clearfix ml30">
<%= file_field_tag 'account/avatar[image]',
:id => "upload_img_id",
:style => 'display:none;',
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.authentication_img_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_user_auth_too_big, :max_size => number_to_human_size(Setting.authentication_img_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => 'school',
:source_id => @user.id.to_s,
:is_direct => 1
<div class="clearfix ml30">
<input type="hidden" value="<%= @school_name%>" name="school_name" class="w150">
<%= image_tag('/images/school/default.png', id: "avatar_image", :class=>"school_avatar ml25", width:60,height:60) %>
<a type="button" onclick="$('#file').click();" style="margin: 90px 0 0 0px;padding: 2px 5px;cursor: pointer;text-decoration: none;width: 70px;" class="fl color-grey">上传图片</a>
<%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%>
<a type="button"style="margin: 90px 0 0 0px;padding: 2px 5px;cursor: pointer;text-decoration: none;width: 70px;" class="fl color-grey" >删除图片</a>
<div class="cl"></div>
</div>
<!--<div class="clearfix ml30">-->
<%#= file_field_tag 'avatar[image]',
# :id => "upload_img_id",
# :style => 'display:none;',
# :size => "1",
# :multiple => false,
# :onchange => 'addInputAvatar(this);',
# :data => {
# :max_file_size => Setting.authentication_img_max_size.to_i.kilobytes,
# :max_file_size_message => l(:error_user_auth_too_big, :max_size => number_to_human_size(Setting.authentication_img_max_size.to_i.kilobytes)),
# :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
# :file_type => Redmine::Configuration['pic_types'].to_s,
# :type_support_message => l(:error_pic_type),
# :upload_path => upload_avatar_path(:format => 'js'),
# :description_placeholder => nil ,# l(:label_optional_description)
# :source_type => 'school',
# :source_id => @user.id.to_s,
# :is_direct => 1
} %>
<input type="hidden" value="0" id="upload_img_id_sign" />
<a href="javascript:void(0);" onclick="$('#upload_img_id').click();" class="course-bth-blue mt5">+选择文件</a>
</div>
<div class="clearfix ml30">
<label class="rz-label fl">&nbsp;</label>
<div class="color-grey fl font-12 pr" id="shili_image">
<%= image_tag(url_to_auth_img(0, 'ID'), :width => 200, :height => 150, :id => 'nh_source_id') %>
<br/>
</div>
</div>
<script>
$(function(){
var image = $("#nh_source_id");
var element = $("<a></a>").attr("href", image.attr('src')+".png");
image.wrap(element);
$("#nh_source_id").parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false});
});
</script>
<!--<input type="hidden" value="0" id="upload_img_id_sign" />-->
<!--<a href="javascript:void(0);" onclick="$('#upload_img_id').click();" class="course-bth-blue mt5">+选择文件</a>-->
<!--</div>-->
<!--<div class="clearfix ml30">-->
<!--<label class="rz-label fl">&nbsp;</label>-->
<!--<div class="color-grey fl font-12 pr" id="shili_image">-->
<!--<%#= image_tag(url_to_auth_img(0, 'ID'), :width => 200, :height => 150, :id => 'nh_source_id') %>-->
<!--<br/>-->
<!--</div>-->
<!--</div>-->
<!--<script>-->
<!--$(function(){-->
<!--var image = $("#nh_source_id");-->
<!--var element = $("<a></a>").attr("href", image.attr('src')+".png");-->
<!--image.wrap(element);-->
<!--$("#nh_source_id").parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false});-->
<!--});-->
<!--</script>-->
<div class="">
<div class="panel-form mr15">

View File

@ -3,7 +3,7 @@
<input class="fl task-form-20 task-height-30 ml35" id="shixun_Look_name" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;">
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt2" onclick="$('#department_part_search').submit();">搜索</a>
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2" id="clear_contents">清除</a>
<%#= link_to "新建单位",add_departments_part_managements_path(),:class => "task-btn task-btn-green fr mt6 mr30" %>
<%= link_to "新建单位",add_departments_part_managements_path(),:class => "task-btn task-btn-green fr mt6 mr30" %>
<input name="sx_order" type="hidden">
</div>
<% end %>