From fbf3d3f7473e205383bd6a805eb653d8f98b29c8 Mon Sep 17 00:00:00 2001
From: XuCheng642 <287102909@qq.com>
Date: Fri, 29 Sep 2017 21:53:08 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=9B=9E=E5=A4=8D?=
=?UTF-8?q?=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/managements_controller.rb | 34 +++---
.../managements/_leave_message_list.html.erb | 2 +-
.../managements/add_departments_part.html.erb | 103 ++++++++----------
.../managements/departments_part.html.erb | 2 +-
4 files changed, 63 insertions(+), 78 deletions(-)
diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index 29e087a28..ca8c7f1a3 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -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
diff --git a/app/views/managements/_leave_message_list.html.erb b/app/views/managements/_leave_message_list.html.erb
index 5f0aa0fba..7bbbcc9b8 100644
--- a/app/views/managements/_leave_message_list.html.erb
+++ b/app/views/managements/_leave_message_list.html.erb
@@ -23,7 +23,7 @@
<%= format_time(jour.created_on) %> |
- <%= 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' %>
|
<% replys = JournalsForMessage.where(:m_parent_id => jour.id) %>
diff --git a/app/views/managements/add_departments_part.html.erb b/app/views/managements/add_departments_part.html.erb
index 8bfe79c6c..d94e166a9 100644
--- a/app/views/managements/add_departments_part.html.erb
+++ b/app/views/managements/add_departments_part.html.erb
@@ -1,66 +1,51 @@
<%= form_tag save_school_managements_path(),method: "post",:id => "save_school" do %>
-
-
-
-
-
-
-
-
-
- <%= 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
+
+
+ <%= image_tag('/images/school/default.png', id: "avatar_image", :class=>"school_avatar ml25", width:60,height:60) %>
+ 上传图片
+ <%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%>
+ 删除图片
+
+
+
+ <%#= 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
} %>
-
- +选择文件
-
-
-
-
- <%= image_tag(url_to_auth_img(0, 'ID'), :width => 200, :height => 150, :id => 'nh_source_id') %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<% end %>
From 4ee161c7205d08f4d4b9801fc8ecdf4e119459b3 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 29 Sep 2017 21:53:20 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=9D=E9=A2=98?=
=?UTF-8?q?=E5=9B=9E=E8=BD=A6=E4=BA=8B=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/memos/_form.html.erb | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/app/views/memos/_form.html.erb b/app/views/memos/_form.html.erb
index 5ce666b75..0fa5ec1ae 100644
--- a/app/views/memos/_form.html.erb
+++ b/app/views/memos/_form.html.erb
@@ -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; }
+ }
+ }
+ };
@@ -210,5 +232,7 @@
$("#memo_classify_tips").attr('style','color: #F00;');
}
}
+
+
<% end %>
\ No newline at end of file
From ca2ddbb90ce9b2ed8b4650c3250ab896a9a7f1fc Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 29 Sep 2017 22:01:56 +0800
Subject: [PATCH 4/6] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=96=B0=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/_course_activity_content.html.erb | 23 ++++++++++---------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/app/views/courses/_course_activity_content.html.erb b/app/views/courses/_course_activity_content.html.erb
index 6d9cf19eb..fa14009d0 100644
--- a/app/views/courses/_course_activity_content.html.erb
+++ b/app/views/courses/_course_activity_content.html.erb
@@ -1,8 +1,16 @@
-
-
+
+
<%= get_acts_list_type @type %>
+
+ <%= 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"%>
+
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
<% if false %>
@@ -15,7 +23,7 @@
<% end %>
- + 新建
+ 新建
<% end %>
-
- <%= 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"%>
-
+
<% if false %>
From 2266ff1eae8db94eac2c051c27c6f93569f7c71a Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 29 Sep 2017 22:04:47 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=96=B0=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/_course_activity_content.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/courses/_course_activity_content.html.erb b/app/views/courses/_course_activity_content.html.erb
index fa14009d0..9bf55b04b 100644
--- a/app/views/courses/_course_activity_content.html.erb
+++ b/app/views/courses/_course_activity_content.html.erb
@@ -24,7 +24,7 @@
<% end %>
新建
-
-
+
<%= @memo.content.html_safe %>
diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css
index 90e504b93..4bf7c1872 100644
--- a/public/stylesheets/css/edu-common.css
+++ b/public/stylesheets/css/edu-common.css
@@ -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; }
+
+
|