Merge branch 'develop' into dev_cs

This commit is contained in:
caishi 2017-09-30 10:05:22 +08:00
commit b900ad466d
9 changed files with 122 additions and 101 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

@ -1,8 +1,16 @@
<div class="homepageRightBanner user_bg_shadow bor-grey-e mb10" style="width:1003px;padding: 0px" >
<div class="clearfix bor-bottom-greyE padding10">
<div class="NewsBannerName">
<div class="clearfix padding10">
<div class="NewsBannerName" style="width: 100px">
<%= get_acts_list_type @type %>
</div>
<div class="fl mt3">
<%= link_to "全部", {:controller => "courses", :action => "show", :type => nil}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type.nil? ? 'active' : ''} fl"%>
<%= link_to "普通作业", {:controller => "courses", :action => "show", :type => "common_homework"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'common_homework' ? 'active' : ''} fl"%>
<%= link_to "实训作业", {:controller => "courses", :action => "show", :type => "shixun_homework"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'shixun_homework' ? 'active' : ''} fl"%>
<%= link_to "资源", {:controller => "courses", :action => "show", :type => "attachment"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'attachment' ? 'active' : ''} fl"%>
<%= link_to "讨论", {:controller => "courses", :action => "show", :type => "message"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'message' ? 'active' : ''} fl"%>
<%#= link_to "成员管理", {:controller => "courses", :action => "show", :type => "message"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'message' ? 'active' : ''} fl"%>
</div>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
<div class="fr activities_btn">
<% if false %>
@ -15,8 +23,8 @@
</li>
<% end %>
<div class="ml10 edu-dropdown">
<span class="mr10 color-orange03">+&nbsp;新建</span><i class="fa fa-sort-down fl fr mt3 color-orange03"></i>
<ul class="edu-dropdown-menu" id="all_status_list" style="top:29px;left: 4px">
<span class="mr10 color-orange03">新建</span><i class="fa fa-sort-down fl fr mt3 color-orange03"></i>
<ul class="edu-dropdown-menu" id="all_status_list" style="top:29px;left: -5px;width: 90px;">
<li>
<%= link_to '普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-grey" %>
</li>
@ -35,14 +43,7 @@
</div>
<% end %>
</div>
<div class="clearfix padding10">
<%= link_to "全部", {:controller => "courses", :action => "show", :type => nil}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type.nil? ? 'active' : ''} fl"%>
<%= link_to "普通作业", {:controller => "courses", :action => "show", :type => "common_homework"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'common_homework' ? 'active' : ''} fl"%>
<%= link_to "实训作业", {:controller => "courses", :action => "show", :type => "shixun_homework"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'shixun_homework' ? 'active' : ''} fl"%>
<%= link_to "资源", {:controller => "courses", :action => "show", :type => "attachment"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'attachment' ? 'active' : ''} fl"%>
<%= link_to "讨论", {:controller => "courses", :action => "show", :type => "message"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'message' ? 'active' : ''} fl"%>
<%#= link_to "成员管理", {:controller => "courses", :action => "show", :type => "message"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'message' ? 'active' : ''} fl"%>
</div>
</div>
<% if false %>
<!--TO成员管理-->

View File

@ -33,7 +33,6 @@
<%= image_tag(url_to_avatar(memo.author), :width => 50, :height => 50,:alt=>'用户头像', :class=>"bor-radius-all mt3" ) %>
</a>
<div class="fl color-grey pr" style="flex: 1;">
<a href="<%= user_path(memo.author_id) %>" ><%= User.find(memo.author_id).try(:show_name) %></a>
<p class="font-16 clearfix">
<a href="<%= forum_memo_path(memo.forum, memo) %>" class="clearfix item_name fl" target="_blank">
<%= memo.subject %>
@ -42,14 +41,20 @@
<span class="btn-top btn-cir-red mt7 ml5 fl">顶</span>
<% end %>
</p>
<p style="width: 1103px;" class="overellipsis color-dark-grey"><%= memo.content %></p>
<p class="clearfix font-12 mt5">
<span class="mr20 fl" style="cursor: default;" data-tip-down="浏览数"><i class="fa fa-eye mr5"></i><%= memo.viewed_count %></span>
<span class="mr20 fl" style="cursor: default;" data-tip-down="点赞数"><i class="fa fa-thumbs-o-up mr5"></i><%= get_praise_num(memo) %></span>
<span class="mr50 fl" style="cursor: default;" data-tip-down="回复数"><i class="fa fa-comments-o mr5"></i><%= Memo.where(:root_id => memo.id).count %></span>
<!--<span class="fl">类别:分享</span>-->
<span class="fr mr5">最后更新:<%= time_from_now memo.updated_at %></span>
</p>
<p style="width: 1091px;" class="overellipsis color-dark-grey mb10"><%= memo.content.html_safe %></p>
<div class="clearfix">
<a href="<%= user_path(memo.author_id) %>" class="fl"><%= User.find(memo.author_id).try(:show_name) %></a>
<span class="fl ml30"><%= time_from_now memo.updated_at %></span>
<!--<span class="fl ml50">最后回复:</span>-->
<p class="font-12 mt5 fr">
<span class="mr20 fl" style="cursor: default;" data-tip-down="浏览数"><i class="fa fa-eye mr5"></i><%= memo.viewed_count %></span>
<span class="mr20 fl" style="cursor: default;" data-tip-down="点赞数"><i class="fa fa-thumbs-o-up mr5"></i><%= get_praise_num(memo) %></span>
<span class="mr10 fl" style="cursor: default;" data-tip-down="回复数"><i class="fa fa-comments-o mr5"></i><%= Memo.where(:root_id => memo.id).count %></span>
<!--<span class="fl">类别:分享</span>-->
</p>
</div>
<% if @user.admin? || @user == memo.author %>
<div class="edu-position-hidebox" style="position: absolute;right: 10px;top:0px;">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>

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 %>

View File

@ -23,7 +23,7 @@
<li class="clearfix">
<label class="fl panel-form-label" style="width: 12%;">&nbsp;</label>
<span class="fl mr20">
<input type="checkbox" name="memo[sticky]" <%= @memo.sticky == 1 ? 'checked' : '' %> value="1" id="to_top" class="ml-3 mr5 magic-checkbox">
<input type="checkbox" name="memo[sticky]" <%= @memo.sticky ? 'checked' : '' %> value="<%= @memo.sticky ? 1 : 0 %>" id="to_top" class="ml-3 mr5 magic-checkbox">
<label for="to_top">置顶</label>
</span>
</li>
@ -85,6 +85,28 @@
$("#memo-form").submit();
}
}
document.onkeydown = function(event) {
var target, code, tag;
if (!event) {
event = window.event; //针对ie浏览器
target = event.srcElement;
code = event.keyCode;
if (code == 13) {
tag = target.tagName;
if (tag == "INPUT") { return true; }
else { return false; }
}
}
else {
target = event.target; //针对遵循w3c标准的浏览器如Firefox
code = event.keyCode;
if (code == 13) {
tag = target.tagName;
if (tag == "INPUT") { return false; }
else { return true; }
}
}
};
</script>
@ -210,5 +232,7 @@
$("#memo_classify_tips").attr('style','color: #F00;');
}
}
</script>
<% end %>

View File

@ -51,7 +51,7 @@
</div>
<% end %>
</div>
<div class="panel-inner-info clearfix">
<div class="panel-inner-info clearfix memos_con">
<!--帖子内容-->
<%= @memo.content.html_safe %>
</div>

View File

@ -497,4 +497,10 @@ input::-ms-clear{display:none;}
.task-header-info .fork{font-weight:bold;font-size:14px;color:#666;}
.memos_con a{color: #3b94d6!important;}
.memos_con ul li{ list-style-type: disc!important; }
.memos_con ol li{ list-style-type: decimal!important; }
.memos_con li{ margin-bottom: 0!important; }