From 878bcc8cf13008e9638379db127e4bd1c84665f2 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 9 May 2016 14:43:28 +0800 Subject: [PATCH 01/79] =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=B7=BB=E5=8A=A0=E8=80=81=E5=B8=88=E3=80=81?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 6 ++++++ .../_org_left_subfield_list.html.erb | 1 - app/views/organizations/setting.html.erb | 20 +++++++++++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 917ccc01c..4b6139a6a 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -148,4 +148,10 @@ module OrganizationsHelper org_acts end + def org_subfield_had_created?(org, type) + sub_field = org.org_subfields.select{|subfield| subfield.field_type == type} + result = sub_field.length > 0 ? true : false + result + end + end diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 39837df88..77a2a014b 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -118,7 +118,6 @@ <% end %> - <% else %>
<% if !field.subfield_subdomain_dir.nil? %> diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index c989b259c..4c9a9e92e 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -152,10 +152,22 @@ - - - - +
  • + + +
  • + <% unless org_subfield_had_created?(@organization, "Comptec") %> +
  • + + +
  • + <% end %> + <% unless org_subfield_had_created?(@organization, "Compstu") %> +
  • + + +
  • + <% end %>
  • 新增
  • From a98678e001ab0d61b0effd06d81ec3d164775611 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 9 May 2016 15:00:50 +0800 Subject: [PATCH 02/79] =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=98=BE=E7=A4=BA=E6=96=B9=E6=B3=95=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 15 +++++++++++++++ .../_org_left_subfield_list.html.erb | 2 +- app/views/organizations/_subfield_list.html.erb | 13 +++++-------- app/views/organizations/setting.html.erb | 6 +++--- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4b6139a6a..981921d0b 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -154,4 +154,19 @@ module OrganizationsHelper result end + def org_subfield_type(field) + case field.field_type + when "Post" + result = "帖子" + when "Resource" + result = "资源" + when "Compstu" + result = "学生" + when "Comptec" + result = "教师" + when "Complex" + result = "综合" + end + end + end diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 77a2a014b..6e01e9c50 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -91,7 +91,7 @@ <% end %> <% else %>
    - <% if field.field_type == "Post" %> + <% if field.field_type == ("Post" || "Complex" || "Compstu" || "Comptec") %>
    <% if !field.subfield_subdomain_dir.nil? %> diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index 4619ed337..0d6b5aac2 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -8,7 +8,6 @@
  • 操作
  • - <% subfields.each do |field| %> <% if is_default_field?(field) %> <% name = get_default_name(field) %> @@ -32,10 +31,9 @@
    <%= select( :name,:group_id, subfield_status_option_default, { :include_blank => false,:selected => field.status}, - { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> + { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> <% end %> <% end %> -
  • 默认
  • <%= field.hide==0?"隐藏":"可见" %> @@ -60,20 +58,19 @@
  • 新增
  • <% if field.field_type == "Resource" %> - 列表 + 默认 <% else %> <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %>
    <%= select( :name,:group_id, subfield_status_option, - { :include_blank => false,:selected => field.status}, - {:onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> + { :include_blank => false,:selected => field.status}, + { :onchange=>"update_status('#update_status_form_#{field.id}');", :id =>"field_status_id", :name => "status",:class=>"undis class-edit fl", :style => "width:56px;"}) %> <% end %> - <% end %>
  • -
  • <%= field.field_type == "Post" ? "帖子" : "资源" %>
  • +
  • <%= org_subfield_type field %>
  • - +
  • <% unless org_subfield_had_created?(@organization, "Comptec") %>
  • - +
  • <% end %> <% unless org_subfield_had_created?(@organization, "Compstu") %>
  • - +
  • <% end %>
  • 新增
  • From fc36e4c01eb12f52154561cec393ea209dda912d Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 9 May 2016 18:10:22 +0800 Subject: [PATCH 03/79] =?UTF-8?q?=E6=95=99=E5=B8=88=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 10 +- .../_org_left_subfield_list.html.erb | 2 +- .../organizations/_show_students.html.erb | 36 +++++ .../organizations/_show_teachers.html.erb | 45 +++++++ app/views/organizations/show.html.erb | 126 ++++++++++-------- public/stylesheets/new_user.css | 1 + public/stylesheets/org.css | 20 ++- 7 files changed, 177 insertions(+), 63 deletions(-) create mode 100644 app/views/organizations/_show_students.html.erb create mode 100644 app/views/organizations/_show_teachers.html.erb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 3709dd24b..561ebf8a8 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -98,10 +98,16 @@ class OrganizationsController < ApplicationController else if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) + # params[:org_subfield_id] 存在即对应的栏目,否则进入组织动态 if params[:org_subfield_id] @org_subfield = OrgSubfield.find(params[:org_subfield_id]) - @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0 - @org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10) + if @org_subfield.field_type == "Comptec" || @org_subfield.field_type == "Compstu" + #@org_students = User.find_by_sql("SELECT * FROM users u, user_extensions ue where u.id = ue.user_id and ue.identity =1;") + @org_teachers = User.find_by_sql("SELECT * FROM users u, user_extensions ue where u.id = ue.user_id and ue.identity =0;") + else + @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0 + @org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10) + end else shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id) diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 6e01e9c50..90019354c 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -91,7 +91,7 @@ <% end %> <% else %>
    - <% if field.field_type == ("Post" || "Complex" || "Compstu" || "Comptec") %> + <% if field.field_type == "Post" || field.field_type == "Complex" || field.field_type == "Compstu" || field.field_type == "Comptec" %>
    <% if !field.subfield_subdomain_dir.nil? %> diff --git a/app/views/organizations/_show_students.html.erb b/app/views/organizations/_show_students.html.erb new file mode 100644 index 000000000..7f8d90203 --- /dev/null +++ b/app/views/organizations/_show_students.html.erb @@ -0,0 +1,36 @@ +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    尹刚国防科学技术大学教授
    +
    +
    6000
    +
    课程数
    +
    +
    +
    +
    500
    +
    学生数
    +
    +
    +
    +
    8000
    +
    资源数
    +
    +
    + 添加 +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/organizations/_show_teachers.html.erb b/app/views/organizations/_show_teachers.html.erb new file mode 100644 index 000000000..a95efbfa9 --- /dev/null +++ b/app/views/organizations/_show_teachers.html.erb @@ -0,0 +1,45 @@ +
    +
    + + + +
    +
    + <% @org_teachers.each do |org_teacher| %> + <% school = School.where("id =?", org_teacher.school_id).first %> +
    +
    +
    +
    +
    <%= org_teacher.try(:realname).nil? ? org_teacher.try(:login) : org_teacher.try(:realname) %> + <% unless school.nil? %> + <%= school.name %> + <% end %> + <% unless org_teacher.nil? %> + <%= org_teacher.technical_title %>
    + <% end %> +
    +
    <%= User.current.courses.count %>
    +
    课程数
    +
    +
    +
    +
    500
    +
    学生数
    +
    +
    +
    +
    8000
    +
    资源数
    +
    +
    + 添加 +
    +
    +
    + <% end %> +
    \ No newline at end of file diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb index f217f006e..24c1ab791 100644 --- a/app/views/organizations/show.html.erb +++ b/app/views/organizations/show.html.erb @@ -1,69 +1,77 @@ -<%= javascript_include_tag "jquery.infinitescroll.js" %> +<% if !params[:org_subfield_id].nil? && @org_subfield.field_type == "Compstu" %> + <%= render 'organizations/show_students', :field => @org_subfield %> +<% elsif !params[:org_subfield_id].nil? && @org_subfield.field_type == "Comptec" %> + <%= render 'organizations/show_teachers', :field => @org_subfield %> +<% else %> + <%= javascript_include_tag "jquery.infinitescroll.js" %> -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> -<% end %> + <%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <% end %> -<% if params[:show_homepage].nil? and User.current.logged? %> -
    -
    <%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %>
    - <% if params[:org_subfield_id].nil? %> -
      -
    • -
        -
      • -
          -
        • 课程动态
        • -
        • <%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%> -
        • -
        • <%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%> - -
        • <%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%> -
        • <%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%> - - -
        -
      • -
      • -
          -
        • 项目动态
        • -
        • <%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%> -
        • <%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%> - -
        -
      • -
      • -
          -
        • 更多
        • -
        • <%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%> -
        • <%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%> + <% if params[:show_homepage].nil? and User.current.logged? %> +
          +
          <%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %>
          + <% if params[:org_subfield_id].nil? %> +
            +
          • +
              +
            • +
                +
              • 课程动态
              • +
              • <%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%> +
              • +
              • <%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%> + +
              • <%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%> +
              • <%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%> + + +
              +
            • +
            • +
                +
              • 项目动态
              • +
              • <%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%> +
              • <%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%> + +
              +
            • +
            • +
                +
              • 更多
              • +
              • <%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%> +
              • <%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%> +
              +
            • +
            +
          -
        • -
        -
      • -
      - <% end %> -
    -<% end %> -<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %> - - <% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %> + <% end %> +
    + <% end %> + <% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %> + + <% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %> <%= render :partial => 'show_home_page', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %> -<% end %> -<% if @org_activities %> - <%= render :partial => 'organizations/org_activities', - :locals => {:org_activities => @org_activities, - :page=> @page, - :org => @organization, - :org_act_count=> @org_activities.count} %> + <% end %> + <% if @org_activities %> + <%= render :partial => 'organizations/org_activities', + :locals => {:org_activities => @org_activities, + :page=> @page, + :org => @organization, + :org_act_count=> @org_activities.count} %> + <% end %> <% end %> + + diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 986e4183d..0d0602788 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -76,6 +76,7 @@ a.linkGrey6:hover {color:#ffffff !important;} .ml15{ margin-left:15px;} .ml20{ margin-left:20px;} .ml24{margin-left:24px;} +.ml25{margin-left:25px;} .ml36{ margin-left:36px; } .ml40{ margin-left:40px;} .ml45{ margin-left:45px;} diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index d05c94bbe..76309217d 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -159,4 +159,22 @@ a.blue-btn { background-color: #269ac9; cursor: pointer; text-align: center; -} \ No newline at end of file +} + +/*名师榜20160505*/ +.function-row {border-bottom:1px dashed #b2b2b2; padding-bottom:16px;} +.teacher-list-search {width:310px; height:23px; border:1px solid #ccc; border-right:none; outline:none;} +.teacher-search-icon {background:url(../images/search.png) 0 3px no-repeat; width:25px; height:23px; border:1px solid #ccc; border-left:none;} +.teacher-search-type {width:84px; height:23px; border:1px solid #ccc; outline:none;} +.teacher-list-row {border-bottom:1px dashed #b2b2b2; padding:18px 0;} +.teacher-avatar {float:left;} +.teacher-name {font-size:18px; color:#333; margin-right:15px;} +.teacher-social-block {width:90px; float:left; text-align:center;} +.block-num {font-size:16px; color:#000;} +.block-title {font-size:12px; color:#999;} +.block-slice {width:1px; height:40px; background-color:#e0e0e0; float:left; margin-top:3px;} +.teacher-intro {font-size:13px; color:#999; line-height:24px; height:72px; overflow:hidden;} +a.teacher-select {font-size:13px; color:#fff; padding:3px 18px; background-color:#269ac9;} +a.teacher-select:hover {background-color:#297fb8;} +a.follow-button {font-size:13px; color:#272727; padding:3px 5px; background-color:#f2efef;} +a.follow-button:hover {background-color:#c1c1c1;} From cf1cf58babb1f98869b99623513273aec077c6b7 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 9 May 2016 18:44:20 +0800 Subject: [PATCH 04/79] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=97=A8=E6=88=B7?= =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=9B=AE=E5=BD=95=E6=B7=BB=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E6=A0=8F"|"=E4=BB=A5=E5=8F=8A=E7=99=BB=E5=BD=95=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BD=8D=E7=BD=AE=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org2.html.erb | 6 +- app/views/layouts/base_sub_domain.html.erb | 378 +- db/schema.rb | 4379 +++++++++-------- .../javascripts/code_review.js | 706 +-- .../stylesheets/activity.css | 6 +- .../stylesheets/code_review.css | 192 +- .../stylesheets/window_js/MIT-LICENSE | 38 +- .../stylesheets/window_js/alert.css | 238 +- .../stylesheets/window_js/alert_lite.css | 176 +- .../stylesheets/window_js/alphacube.css | 300 +- .../stylesheets/window_js/behavior.htc | 100 +- .../stylesheets/window_js/darkX.css | 242 +- .../stylesheets/window_js/debug.css | 50 +- .../stylesheets/window_js/default.css | 310 +- .../stylesheets/window_js/iefix/iepngfix.css | 6 +- .../stylesheets/window_js/iefix/iepngfix.htc | 106 +- .../stylesheets/window_js/lighting.css | 1920 ++++---- .../window_js/lighting/pngbehavior.htc | 134 +- .../stylesheets/window_js/mac_os_x.css | 666 +-- .../stylesheets/window_js/mac_os_x_dialog.css | 320 +- .../stylesheets/window_js/nuncio.css | 328 +- .../stylesheets/window_js/spread.css | 216 +- public/stylesheets/org2.css | 5 +- 23 files changed, 5428 insertions(+), 5394 deletions(-) diff --git a/app/views/layouts/base_org2.html.erb b/app/views/layouts/base_org2.html.erb index 0052cf077..4c76056d6 100644 --- a/app/views/layouts/base_org2.html.erb +++ b/app/views/layouts/base_org2.html.erb @@ -101,10 +101,11 @@ <%= field.name %> - <% else activity.container_type == 'OrgSubfield' %> @@ -39,6 +40,7 @@ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %> <% end %>

    <%=link_to message.content.to_s.html_safe, board_message_url_in_org(message.board.id, message.id), :target => "_blank" %>

    +
    <% else %> @@ -51,6 +53,7 @@ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %> <% end %>

    <%=link_to message.content.to_s.html_safe, board_message_path(message.board, activity), :target => "_blank" %>

    +
    <% end %> @@ -66,6 +69,7 @@ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %> <% end %>

    <%=link_to news.description.to_s.html_safe, news_path(news), :target => "_blank" %>

    +
    <% end %> @@ -96,3 +100,12 @@ <% end %> <% end %> + + diff --git a/public/stylesheets/org2.css b/public/stylesheets/org2.css index 6e2954bf4..f7be08e71 100644 --- a/public/stylesheets/org2.css +++ b/public/stylesheets/org2.css @@ -52,6 +52,7 @@ a.sn-link-select {color:#809df9;} .sn-ml15 {margin-left:15px;} .sn-ml55 {margin-left:55px;} .sn-mr0 {margin-right:0px !important;} +.sn-mr20 {margin-right:20px;} .sn-mr50 {margin-right:50px;} .sn-w229 {width:229px;} /*头部样式*/ From e8424d9b971f53413cc6371668dfcaac0d12e4e2 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 10 May 2016 10:57:55 +0800 Subject: [PATCH 10/79] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_boardlist.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_project_boardlist.html.erb b/app/views/users/_project_boardlist.html.erb index 5f61d26ef..55f576db1 100644 --- a/app/views/users/_project_boardlist.html.erb +++ b/app/views/users/_project_boardlist.html.erb @@ -44,7 +44,7 @@ <% end %>

    <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>100} %>

    -
    +
    发帖时间:<%= format_time(activity.created_on) %> 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> <% count=0 %> From 99d9a288285b59d70b1a635a494d832a11540477 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 10 May 2016 11:33:02 +0800 Subject: [PATCH 11/79] =?UTF-8?q?=E5=90=8D=E5=B8=88=E6=A6=9Csql=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- app/helpers/organizations_helper.rb | 6 +++++- app/models/school.rb | 1 + app/views/organizations/_show_teachers.html.erb | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 561ebf8a8..07bd55321 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -103,7 +103,7 @@ class OrganizationsController < ApplicationController @org_subfield = OrgSubfield.find(params[:org_subfield_id]) if @org_subfield.field_type == "Comptec" || @org_subfield.field_type == "Compstu" #@org_students = User.find_by_sql("SELECT * FROM users u, user_extensions ue where u.id = ue.user_id and ue.identity =1;") - @org_teachers = User.find_by_sql("SELECT * FROM users u, user_extensions ue where u.id = ue.user_id and ue.identity =0;") + @org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 order by course_count desc") else @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0 @org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index f84c71a59..d2974baae 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -170,7 +170,11 @@ module OrganizationsHelper end def org_teacher_resource_count user - results = Attachment.find_by_sql("SELECT * FROM `attachments` where author_id = #{user.user_id};") + results = Attachment.find_by_sql("SELECT count(*) FROM attachments where author_id = #{user.id};").count + end + + def org_teacher_course_count user + results = Course.find_by_sql("select count(*) from courses where courses.tea_id = #{user.id}").count end end diff --git a/app/models/school.rb b/app/models/school.rb index 6cafb0473..b9a1d88cb 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -5,4 +5,5 @@ class School < ActiveRecord::Base def to_s self.name.to_s end + end diff --git a/app/views/organizations/_show_teachers.html.erb b/app/views/organizations/_show_teachers.html.erb index 28e308b49..9418b861f 100644 --- a/app/views/organizations/_show_teachers.html.erb +++ b/app/views/organizations/_show_teachers.html.erb @@ -23,7 +23,7 @@ <%= org_teacher.technical_title %>
    <% end %>
    -
    <%= User.current.courses.count %>
    +
    <%= org_teacher.courses.count %>
    课程数
    @@ -33,7 +33,7 @@
    -
    <%= org_teacher_resource_count(org_teacher) %>8000
    +
    <%= org_teacher_resource_count(org_teacher) %>
    资源数
    From e502aa7c439558fcd7f96d5b23c95213e0aeb67d Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Tue, 10 May 2016 12:51:42 +0800 Subject: [PATCH 12/79] =?UTF-8?q?KE=E8=A1=A8=E6=A0=BC=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E8=87=AA=E5=8A=A8=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=81=9A=E4=BA=86=E4=B8=80=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 12 ++-- app/views/users/_user_course_list.html.erb | 2 +- app/views/users/_user_project_list.html.erb | 2 +- .../kindeditor/assets_controller.rb | 12 ++++ lib/rails_kindeditor/config/routes.rb | 1 + public/assets/kindeditor/kindeditor.js | 16 ++--- public/assets/kindeditor/pasteimg.js | 66 +++++++++++++++++++ .../kindeditor/plugins/code/previewcode.css | 10 ++- .../assets/kindeditor/plugins/paste/paste.js | 1 + .../assets/kindeditor/plugins/table/table.js | 2 +- public/stylesheets/courses.css | 6 ++ public/stylesheets/new_user.css | 11 +++- public/stylesheets/project.css | 4 ++ public/stylesheets/public.css | 6 +- 14 files changed, 127 insertions(+), 24 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 54970add6..ce54496a0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2855,11 +2855,11 @@ class UsersController < ApplicationController @c_sort = 2 end - sort_name = "updated_at" + sort_name = "updated_on" sort_type = @c_sort == 1 ? "asc" : "desc" - @courses = @user.courses.visible.where("is_delete =?", 0).order("#{sort_name} #{sort_type}") - # @courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a #{sort_type}") + # @courses = @user.courses.visible.where("is_delete =?", 0).order("#{sort_name} #{sort_type}") + @courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}") #根据 作业+资源数排序 if @order.to_i == 2 @@ -2900,11 +2900,11 @@ class UsersController < ApplicationController @c_sort = 2 end - sort_name = "updated_on" + sort_name = "updated_at" sort_type = @c_sort == 1 ? "asc" : "desc" - @projects = @user.projects.visible.order("#{sort_name} #{sort_type}") - # @projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a #{sort_type}") + #@projects = @user.projects.visible.order("#{sort_name} #{sort_type}") + @projects = @user.projects.visible.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS #{sort_name} ").order("#{sort_name} #{sort_type}") #根据 问题+资源数排序 @project.project_score.issue_num @project.project_score.attach_num if @order.to_i == 2 diff --git a/app/views/users/_user_course_list.html.erb b/app/views/users/_user_course_list.html.erb index 212798eb1..8ef0faa9e 100644 --- a/app/views/users/_user_course_list.html.erb +++ b/app/views/users/_user_course_list.html.erb @@ -31,7 +31,7 @@ 创建时间:<%= format_time(course.created_at) %> - 更新时间:<%= format_time(course.updated_at) %> + 更新时间:<%= format_time(course.updated_on) %> 开课学期:  <%= current_time_and_term course %> diff --git a/app/views/users/_user_project_list.html.erb b/app/views/users/_user_project_list.html.erb index b7b4948e4..1526da58f 100644 --- a/app/views/users/_user_project_list.html.erb +++ b/app/views/users/_user_project_list.html.erb @@ -28,7 +28,7 @@
  • 创建时间:<%= format_time(project.created_on) %> - 更新时间:<%= format_time(project.updated_on) %> + 更新时间:<%= format_time(project.updated_at) %>

    <%= project.project_score.issue_num %>问题| <%= project.project_score.attach_num %>资源

  • diff --git a/lib/rails_kindeditor/app/controllers/kindeditor/assets_controller.rb b/lib/rails_kindeditor/app/controllers/kindeditor/assets_controller.rb index 0e1177563..c94a3944e 100644 --- a/lib/rails_kindeditor/app/controllers/kindeditor/assets_controller.rb +++ b/lib/rails_kindeditor/app/controllers/kindeditor/assets_controller.rb @@ -118,6 +118,18 @@ class Kindeditor::AssetsController < ApplicationController @result[:file_list] = @file_list render :text => @result.to_json end + + def uploadpic + picstr = params["pic"]; + + picArry = picstr.split("|") + + picArry.each do |picurl| + puts picurl + end + + + end private def show_error(msg) diff --git a/lib/rails_kindeditor/config/routes.rb b/lib/rails_kindeditor/config/routes.rb index 7ebb0b748..86b888ad3 100644 --- a/lib/rails_kindeditor/config/routes.rb +++ b/lib/rails_kindeditor/config/routes.rb @@ -2,5 +2,6 @@ Rails.application.routes.draw do namespace :kindeditor do post "/upload" => "assets#create" get "/filemanager" => "assets#list" + get "/uploadpic" => "assets#uploadpic" end end \ No newline at end of file diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 74013be54..579da5d0c 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -3,8 +3,7 @@ // for (var property in myObject) { // s = s + "\n "+property +": " + myObject[property] ; // } -// alert(s); -//} +// alert(s) /******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2013 kindsoft.net @@ -3788,17 +3787,17 @@ _extend(KEdit, KWidget, { } else { val = body.innerHTML; } - if (self.beforeGetHtml) { - val = self.beforeGetHtml(val); - } +// if (self.beforeGetHtml) { +// val = self.beforeGetHtml(val); +// } if (_GECKO && val == '
    ') { val = ''; } return val; } - if (self.beforeSetHtml) { - val = self.beforeSetHtml(val); - } +// if (self.beforeSetHtml) { +// val = self.beforeSetHtml(val); +// } if (_IE && _V >= 9) { val = val.replace(/(<.*?checked=")checked(".*>)/ig, '$1$2'); } @@ -4690,6 +4689,7 @@ function _bindNewlineEvent() { }); K(doc).keyup(function(e) { if (e.which != 13 || e.shiftKey || e.ctrlKey || e.altKey) { + df(); return; } if (newlineTag == 'br') { diff --git a/public/assets/kindeditor/pasteimg.js b/public/assets/kindeditor/pasteimg.js index f08a768aa..5f62eac17 100644 --- a/public/assets/kindeditor/pasteimg.js +++ b/public/assets/kindeditor/pasteimg.js @@ -352,3 +352,69 @@ function enablePasteImg(_editor) { }); return; }; + +function df() { + var haspicContainer = document.getElementById("has_pic"); + if (haspicContainer == null) { + haspicContainer = document.createElement("div"); + haspicContainer.id = "has_pic"; + haspicContainer.innerHTML = "
    您有图片需要上传到服务器  上传
    "; + $(".ke-toolbar").after(haspicContainer); + } + + var img = $(".ke-edit-iframe").contents().find("img"); + + var piccount = 0; + var sstr = ""; + $(img).each(function (i) { + var that = $(this); + if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) { + piccount++; + if (i == $(img).length - 1) + sstr += that.attr("src"); + else + sstr += that.attr("src") + "|"; + } + }); + + $("#piclist").val(sstr); + document.getElementById("has_pic").style.display = (piccount > 0) ? "block" : "none"; +} + +function closeupload() { + $("#has_pic").hide(); + $("#upload").show(); +} + +function uploadpic() { + var piclist = encodeURI($("#piclist").val()); + if (piclist.length == 0) return false; + $.ajax({ + url: "/kindeditor/uploadpic", + data: "pic=" + piclist, + type: "GET", + beforeSend: function () { + $("#upload").hide(); + $("#confirm").text("正在上传中..."); + }, + success: function (msg) { + if (msg !== "") { + var str = new Array(); + str = msg.split('|'); + var img = $(".ke-edit-iframe").contents().find("img"); + + $(img).each(function (i) { + var that = $(this); + if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) { + that.attr("src", "/uploads/image/" + str[i]); + that.attr("data-ke-src", "/uploads/image/" + str[i]); + } + }); + + $("#confirm").html(img.length + "张图片已经上传成功!  关闭"); + } + else $("#confirm").text("上传失败!"); + } + }); +} + diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index c2adf3a35..b9c8252e8 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -1,7 +1,7 @@ .ke-content { font-size: 12px; - font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢ź, ; - font-family:Tahoma; + font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family: ΢���ź�, ����; + font-family:Tahoma; } .ke-content pre { font-size:9pt; @@ -48,4 +48,8 @@ .ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;} span.at {color:#269ac9;} -span.at a{color:#269ac9;text-decoration: none;} \ No newline at end of file +span.at a{color:#269ac9;text-decoration: none;} + +/*yk*/ +.ke-content ol li{list-style-type: decimal;margin-left: 20px;} +.ke-content ul li{list-style-type: disc;margin-left: 20px;} \ No newline at end of file diff --git a/public/assets/kindeditor/plugins/paste/paste.js b/public/assets/kindeditor/plugins/paste/paste.js index 767cefb09..abf777398 100644 --- a/public/assets/kindeditor/plugins/paste/paste.js +++ b/public/assets/kindeditor/plugins/paste/paste.js @@ -353,3 +353,4 @@ KindEditor.plugin('paste', function(K) { return; }); + diff --git a/public/assets/kindeditor/plugins/table/table.js b/public/assets/kindeditor/plugins/table/table.js index 9eb29fb30..be386f7cc 100644 --- a/public/assets/kindeditor/plugins/table/table.js +++ b/public/assets/kindeditor/plugins/table/table.js @@ -283,7 +283,7 @@ KindEditor.plugin('table', function(K) { for (var i = 0; i < rows; i++) { html += ''; for (var j = 0; j < cols; j++) { - html += '' + (K.IE ? ' ' : '
    ') + ''; + html += '' + (K.IE ? ' ' : '
    ') + ''; } html += ''; } diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index f83a180d3..6e55146a6 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -124,12 +124,14 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostDes {float:left; width:655px; margin-left:15px;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} +.homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} .homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} @@ -172,6 +174,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} @@ -1111,6 +1114,9 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 8e62f6d3f..67176c761 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -7,7 +7,8 @@ div,img,tr,td,table{ border:0;} table,tr,td{border:0;cellspacing:0; cellpadding:0;} ol,ul,li{ list-style-type:none} a:link,a:visited{color:#7f7f7f;text-decoration:none;} -a:hover,a:active{color:#000;} +a:hover,a:active{color:#000;}tr,td,table{ border:0;} +table,tr,td{border:0;cellspacing:0; cellpadding:0;} .pInline {margin:0px; padding:0px; display:inline-block;} /*常用*/ @@ -667,6 +668,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostDes {float:left; width:655px; margin-left:15px; overflow:hidden;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:5px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:5px; font-weight:bold;} +.homepagePostTitle td,.homepagePostTitle tr {border: 1px solid; border-color: inherit;} .homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;} .homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} @@ -676,6 +678,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} .borderBottomNone {border-bottom:none !important;} .topBorder {border-top: 1px solid #e4e4e4;} @@ -712,6 +715,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent {font-size:12px; color:#484848; margin:3px 5px 12px 5px;font: 14px/1.5 "sans serif",tahoma,verdana,helvetica;font-family:"微软雅黑","宋体";} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} @@ -853,6 +857,9 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re .postDetailTitle {width:570px; max-width:570px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} @@ -1551,4 +1558,4 @@ ul.wlist li{float: left;} ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3px;} ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;} /*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}*/ -.wlist_select a{background-color: #64bdd9;cursor: default;} +.wlist_select a{background-color: #64bdd9;cursor: default;} \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 79f06769e..1ef99e66b 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -973,6 +973,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} } .homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .topBorder { border-top: 1px solid #E4E4E4; } @@ -1110,6 +1111,9 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;} .postDetailTitle {width:580px; max-width:580px; margin-bottom:5px;} .postDetailDes {width:580px; max-width:580px; margin-bottom:6px; color:#888888;display:block;overflow:hidden;word-break:keep-all;text-overflow:ellipsis;} .postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;} +.postDetailDes ol li{list-style-type: decimal;margin-left: 20px;} +.postDetailDes ul li{list-style-type: disc;margin-left: 20px;} +.postDetailDes td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; line-height: 18px !important;} .postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;} .postDetailDate {color:#888888; font-size:12px; float:left;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d016fee4a..253aaf46b 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -601,6 +601,7 @@ a.postTypeGrey:hover {color:#269ac9;} .homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;} .homepagePostIntro ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostIntro ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;} .homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;} .homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} @@ -636,6 +637,7 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} .homepagePostReplyContent ol li{list-style-type: decimal;margin-left: 20px;} .homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;} +.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#15bccf;} @@ -972,8 +974,8 @@ a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-r .AgreementTxt{text-indent:2em; margin-bottom:15px;} .AgreementImg{ margin:0px auto;} -.list_style ol li{list-style-type: decimal;margin-left: 20px;} -.list_style ul li{list-style-type: disc;margin-left: 20px;} +.list_style ol li{list-style-type:decimal; margin-left:20px;} +.list_style ul li{list-style-type:disc; margin-left:20px;} /* @功能 定义 */ span.at {color:#269ac9;} From cabac5914c29e18c2a27c3660a6cc4a8f10db200 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 10 May 2016 13:41:21 +0800 Subject: [PATCH 13/79] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 8 ++++++-- app/views/organizations/_show_teachers.html.erb | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index d2974baae..3db2345ce 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -170,11 +170,15 @@ module OrganizationsHelper end def org_teacher_resource_count user - results = Attachment.find_by_sql("SELECT count(*) FROM attachments where author_id = #{user.id};").count + results = Attachment.find_by_sql("SELECT * FROM attachments where author_id = #{user.id};").count end def org_teacher_course_count user - results = Course.find_by_sql("select count(*) from courses where courses.tea_id = #{user.id}").count + results = Course.find_by_sql("select * from courses where courses.tea_id = #{user.id}").count end + def org_student_course_count user + course_ids = user.courses.map { |c| c.is_delete == 0 && c.id} + results = Member.find_by_sql("select id from courses where courses.tea_id = #{user.id}").count + end end diff --git a/app/views/organizations/_show_teachers.html.erb b/app/views/organizations/_show_teachers.html.erb index 9418b861f..cbaed9f74 100644 --- a/app/views/organizations/_show_teachers.html.erb +++ b/app/views/organizations/_show_teachers.html.erb @@ -23,12 +23,12 @@ <%= org_teacher.technical_title %> <% end %>
    -
    <%= org_teacher.courses.count %>
    +
    <%= org_teacher_course_count(org_teacher) %>
    课程数
    -
    500
    +
    <%= org_student_course_count(org_teacher) %>500
    学生数
    From d7add63f560689b9882086758551c0ffab59b82e Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 10 May 2016 16:03:50 +0800 Subject: [PATCH 14/79] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E6=A0=8F=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E5=9B=9E=E5=A4=8D=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=82=B9=E5=87=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sub_document_comments/_show_sub_document_newstyle.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb b/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb index 0af0bb698..a82e24ad4 100644 --- a/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb +++ b/app/views/sub_document_comments/_show_sub_document_newstyle.html.erb @@ -14,7 +14,7 @@
  • <%=link_to document.title, org_subfield_sub_domain_sub_document_comment_path(document, :org_subfield_id => @org_subfield, :sub_domain_id => @subdomain), :class => "sn-newslist-titile fl", :target => "_blank" %> <%= format_date(document.created_at) %> - 回复(<%= document.children.count %>) + 回复(<%= document.children.count %>)
  • From f4b10d45d2479046d9454cf2b4ee3656f5f42621 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 10 May 2016 16:26:05 +0800 Subject: [PATCH 15/79] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E7=BB=8F=E8=BF=87=E7=9A=84=E6=97=B6=E5=80=99=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=85=B7=E4=BD=93=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/_dir_list_content.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb index 60c4aa3bf..4dee108ee 100644 --- a/app/views/repositories/_dir_list_content.html.erb +++ b/app/views/repositories/_dir_list_content.html.erb @@ -43,7 +43,7 @@ - - 添加 + <% if User.current.admin? %> + <%= org_teacher.excellent_teacher==0?"设为名师":"取消设置" %> + + <% else %> + <%= render :partial => 'layouts/user_watch_btn', :locals => {:target => org_teacher} %> + 关注 + <% end %>
    -<% end %> \ No newline at end of file +<% end %> + + \ No newline at end of file diff --git a/app/views/organizations/reset_excellent_teacher.js.erb b/app/views/organizations/reset_excellent_teacher.js.erb new file mode 100644 index 000000000..fdf160bc4 --- /dev/null +++ b/app/views/organizations/reset_excellent_teacher.js.erb @@ -0,0 +1 @@ +$("#hide_<%= @ex_teacher.id %>").text("设为名师"); \ No newline at end of file diff --git a/app/views/organizations/set_excellent_teacher.js.erb b/app/views/organizations/set_excellent_teacher.js.erb new file mode 100644 index 000000000..32dc53689 --- /dev/null +++ b/app/views/organizations/set_excellent_teacher.js.erb @@ -0,0 +1 @@ +$("#hide_<%= @ex_teacher.id %>").text("取消设置"); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 0df73ea68..44eca36ee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -93,6 +93,8 @@ RedmineApp::Application.routes.draw do get 'autocomplete_search' post 'hide_org_subfield' post 'show_org_subfield' + post 'set_excellent_teacher' + post 'reset_excellent_teacher' post 'agree_apply_subdomain' end end diff --git a/db/migrate/20160513012705_add_excellent_teacher_to_user.rb b/db/migrate/20160513012705_add_excellent_teacher_to_user.rb new file mode 100644 index 000000000..88a79ec26 --- /dev/null +++ b/db/migrate/20160513012705_add_excellent_teacher_to_user.rb @@ -0,0 +1,5 @@ +class AddExcellentTeacherToUser < ActiveRecord::Migration + def change + add_column :users, :excellent_teacher, :integer, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index 9a13f24da..d8ddb7e0d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160506104128) do +ActiveRecord::Schema.define(:version => 20160513012705) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -52,6 +52,28 @@ ActiveRecord::Schema.define(:version => 20160506104128) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + create_table "application_settings", :force => true do |t| + t.integer "default_projects_limit" + t.boolean "signup_enabled" + t.boolean "signin_enabled" + t.boolean "gravatar_enabled" + t.text "sign_in_text" + t.datetime "created_at" + t.datetime "updated_at" + t.string "home_page_url" + t.integer "default_branch_protection", :default => 2 + t.boolean "twitter_sharing_enabled", :default => true + t.text "restricted_visibility_levels" + t.boolean "version_check_enabled", :default => true + t.integer "max_attachment_size", :default => 10, :null => false + t.integer "default_project_visibility" + t.integer "default_snippet_visibility" + t.text "restricted_signup_domains" + t.boolean "user_oauth_applications", :default => true + t.string "after_sign_out_path" + t.integer "session_expire_delay", :default => 10080, :null => false + end + create_table "applied_projects", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false @@ -144,6 +166,20 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.string "typeName", :limit => 50 end + create_table "audit_events", :force => true do |t| + t.integer "author_id", :null => false + t.string "type", :null => false + t.integer "entity_id", :null => false + t.string "entity_type", :null => false + t.text "details" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id" + add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type" + add_index "audit_events", ["type"], :name => "index_audit_events_on_type" + create_table "auth_sources", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 60, :default => "", :null => false @@ -241,6 +277,17 @@ ActiveRecord::Schema.define(:version => 20160506104128) do add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["project_id"], :name => "boards_project_id" + create_table "broadcast_messages", :force => true do |t| + t.text "message", :null => false + t.datetime "starts_at" + t.datetime "ends_at" + t.integer "alert_type" + t.datetime "created_at" + t.datetime "updated_at" + t.string "color" + t.string "font" + end + create_table "bug_to_osps", :force => true do |t| t.integer "osp_id" t.integer "relative_memo_id" @@ -540,6 +587,10 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.integer "visits", :default => 0 end + add_index "courses", ["id"], :name => "id", :unique => true + add_index "courses", ["tea_id"], :name => "tea_id" + add_index "courses", ["visits"], :name => "visits" + create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false @@ -601,6 +652,15 @@ ActiveRecord::Schema.define(:version => 20160506104128) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "deploy_keys_projects", :force => true do |t| + t.integer "deploy_key_id", :null => false + t.integer "project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id" + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -650,6 +710,16 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.datetime "created_at" end + create_table "emails", :force => true do |t| + t.integer "user_id", :null => false + t.string "email", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true + add_index "emails", ["user_id"], :name => "index_emails_on_user_id" + create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -672,6 +742,25 @@ ActiveRecord::Schema.define(:version => 20160506104128) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + create_table "events", :force => true do |t| + t.string "target_type" + t.integer "target_id" + t.string "title" + t.text "data" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "action" + t.integer "author_id" + end + + add_index "events", ["action"], :name => "index_events_on_action" + add_index "events", ["author_id"], :name => "index_events_on_author_id" + add_index "events", ["created_at"], :name => "index_events_on_created_at" + add_index "events", ["project_id"], :name => "index_events_on_project_id" + add_index "events", ["target_id"], :name => "index_events_on_target_id" + add_index "events", ["target_type"], :name => "index_events_on_target_type" + create_table "exercise_answers", :force => true do |t| t.integer "user_id" t.integer "exercise_question_id" @@ -774,6 +863,15 @@ ActiveRecord::Schema.define(:version => 20160506104128) do add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" + create_table "forked_project_links", :force => true do |t| + t.integer "forked_to_project_id", :null => false + t.integer "forked_from_project_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true + create_table "forums", :force => true do |t| t.string "name", :null => false t.text "description" @@ -903,6 +1001,17 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.datetime "updated_at", :null => false end + create_table "identities", :force => true do |t| + t.string "extern_uid" + t.string "provider" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id" + add_index "identities", ["user_id"], :name => "index_identities_on_user_id" + create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1046,6 +1155,20 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.integer "private", :default => 0 end + create_table "keys", :force => true do |t| + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.text "key" + t.string "title" + t.string "type" + t.string "fingerprint" + t.boolean "public", :default => false, :null => false + end + + add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id" + add_index "keys", ["user_id"], :name => "index_keys_on_user_id" + create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -1057,6 +1180,27 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.integer "owner_type", :default => 0 end + create_table "label_links", :force => true do |t| + t.integer "label_id" + t.integer "target_id" + t.string "target_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id" + add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type" + + create_table "labels", :force => true do |t| + t.string "title" + t.string "color" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "labels", ["project_id"], :name => "index_labels_on_project_id" + create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1107,6 +1251,47 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.integer "viewed_count", :default => 0 end + create_table "merge_request_diffs", :force => true do |t| + t.string "state" + t.text "st_commits", :limit => 2147483647 + t.text "st_diffs", :limit => 2147483647 + t.integer "merge_request_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true + + create_table "merge_requests", :force => true do |t| + t.string "target_branch", :null => false + t.string "source_branch", :null => false + t.integer "source_project_id", :null => false + t.integer "author_id" + t.integer "assignee_id" + t.string "title" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "milestone_id" + t.string "state" + t.string "merge_status" + t.integer "target_project_id", :null => false + t.integer "iid" + t.text "description" + t.integer "position", :default => 0 + t.datetime "locked_at" + end + + add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" + add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id" + add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id" + add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at" + add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id" + add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch" + add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id" + add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch" + add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true + add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title" + create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1141,6 +1326,39 @@ ActiveRecord::Schema.define(:version => 20160506104128) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" + create_table "milestones", :force => true do |t| + t.string "title", :null => false + t.integer "project_id", :null => false + t.text "description" + t.date "due_date" + t.datetime "created_at" + t.datetime "updated_at" + t.string "state" + t.integer "iid" + end + + add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id" + add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date" + add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true + add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" + + create_table "namespaces", :force => true do |t| + t.string "name", :null => false + t.string "path", :null => false + t.integer "owner_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type" + t.string "description", :default => "", :null => false + t.string "avatar" + end + + add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id" + add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true + add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id" + add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true + add_index "namespaces", ["type"], :name => "index_namespaces_on_type" + create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1166,6 +1384,31 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.datetime "updated_at", :null => false end + create_table "notes", :force => true do |t| + t.text "note" + t.string "noteable_type" + t.integer "author_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "project_id" + t.string "attachment" + t.string "line_code" + t.string "commit_id" + t.integer "noteable_id" + t.boolean "system", :default => false, :null => false + t.text "st_diff", :limit => 2147483647 + end + + add_index "notes", ["author_id"], :name => "index_notes_on_author_id" + add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id" + add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id" + add_index "notes", ["created_at"], :name => "index_notes_on_created_at" + add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type" + add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type" + add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type" + add_index "notes", ["project_id"], :name => "index_notes_on_project_id" + add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at" + create_table "notificationcomments", :force => true do |t| t.string "notificationcommented_type" t.integer "notificationcommented_id" @@ -1175,6 +1418,49 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.datetime "updated_at", :null => false end + create_table "oauth_access_grants", :force => true do |t| + t.integer "resource_owner_id", :null => false + t.integer "application_id", :null => false + t.string "token", :null => false + t.integer "expires_in", :null => false + t.text "redirect_uri", :null => false + t.datetime "created_at", :null => false + t.datetime "revoked_at" + t.string "scopes" + end + + add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true + + create_table "oauth_access_tokens", :force => true do |t| + t.integer "resource_owner_id" + t.integer "application_id" + t.string "token", :null => false + t.string "refresh_token" + t.integer "expires_in" + t.datetime "revoked_at" + t.datetime "created_at", :null => false + t.string "scopes" + end + + add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true + add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id" + add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true + + create_table "oauth_applications", :force => true do |t| + t.string "name", :null => false + t.string "uid", :null => false + t.string "secret", :null => false + t.text "redirect_uri", :null => false + t.string "scopes", :default => "", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "owner_id" + t.string "owner_type" + end + + add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type" + add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true + create_table "onclick_times", :force => true do |t| t.integer "user_id" t.datetime "onclick_time" @@ -1330,6 +1616,23 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.integer "show_mode", :default => 0 end + create_table "permissions", :force => true do |t| + t.string "controller", :limit => 30, :default => "", :null => false + t.string "action", :limit => 30, :default => "", :null => false + t.string "description", :limit => 60, :default => "", :null => false + t.boolean "is_public", :default => false, :null => false + t.integer "sort", :default => 0, :null => false + t.boolean "mail_option", :default => false, :null => false + t.boolean "mail_enabled", :default => false, :null => false + end + + create_table "permissions_roles", :id => false, :force => true do |t| + t.integer "permission_id", :default => 0, :null => false + t.integer "role_id", :default => 0, :null => false + end + + add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" + create_table "phone_app_versions", :force => true do |t| t.string "version" t.text "description" @@ -1412,6 +1715,11 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.datetime "updated_at", :null => false end + create_table "project_import_data", :force => true do |t| + t.integer "project_id" + t.text "data" + end + create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1501,6 +1809,16 @@ ActiveRecord::Schema.define(:version => 20160506104128) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" + create_table "protected_branches", :force => true do |t| + t.integer "project_id", :null => false + t.string "name", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "developers_can_push", :default => false, :null => false + end + + add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id" + create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1635,6 +1953,25 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.integer "is_teacher_score", :default => 0 end + create_table "services", :force => true do |t| + t.string "type" + t.string "title" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "active", :default => false, :null => false + t.text "properties" + t.boolean "template", :default => false + t.boolean "push_events", :default => true + t.boolean "issues_events", :default => true + t.boolean "merge_requests_events", :default => true + t.boolean "tag_push_events", :default => true + t.boolean "note_events", :default => true, :null => false + end + + add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id" + add_index "services", ["project_id"], :name => "index_services_on_project_id" + create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -1673,6 +2010,26 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.datetime "updated_at", :null => false end + create_table "snippets", :force => true do |t| + t.string "title" + t.text "content", :limit => 2147483647 + t.integer "author_id", :null => false + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "file_name" + t.datetime "expires_at" + t.string "type" + t.integer "visibility_level", :default => 0, :null => false + end + + add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id" + add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id" + add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at" + add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at" + add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id" + add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level" + create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -1745,9 +2102,9 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.integer "absence_penalty", :default => 0 t.float "system_score", :default => 0.0 t.boolean "is_test", :default => false + t.float "work_score" t.integer "simi_id" t.integer "simi_value" - t.float "work_score" end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" @@ -1795,13 +2152,13 @@ ActiveRecord::Schema.define(:version => 20160506104128) do create_table "sub_domains", :force => true do |t| t.integer "org_subfield_id" - t.integer "priority", :default => 0 + t.integer "priority" t.string "name" t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "hide" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "subfield_subdomain_dirs", :force => true do |t| @@ -1811,6 +2168,17 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.datetime "updated_at", :null => false end + create_table "subscriptions", :force => true do |t| + t.integer "user_id" + t.integer "subscribable_id" + t.string "subscribable_type" + t.boolean "subscribed" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true + create_table "system_messages", :force => true do |t| t.integer "user_id" t.string "content" @@ -2043,12 +2411,24 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.string "salt", :limit => 64 t.integer "gid" t.integer "visits", :default => 0 + t.integer "excellent_teacher", :default => 0 end add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" add_index "users", ["type"], :name => "index_users_on_type" + create_table "users_star_projects", :force => true do |t| + t.integer "project_id", :null => false + t.integer "user_id", :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id" + add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true + add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id" + create_table "versions", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "name", :default => "", :null => false @@ -2100,6 +2480,23 @@ ActiveRecord::Schema.define(:version => 20160506104128) do t.datetime "updated_at", :null => false end + create_table "web_hooks", :force => true do |t| + t.string "url" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "type", :default => "ProjectHook" + t.integer "service_id" + t.boolean "push_events", :default => true, :null => false + t.boolean "issues_events", :default => false, :null => false + t.boolean "merge_requests_events", :default => false, :null => false + t.boolean "tag_push_events", :default => false + t.boolean "note_events", :default => false, :null => false + end + + add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id" + add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id" + create_table "wechat_logs", :force => true do |t| t.string "openid", :null => false t.text "request_raw" From 83ac35cc94f64f1646754c8912488aa32c6356ef Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 10:29:22 +0800 Subject: [PATCH 28/79] =?UTF-8?q?=E4=B8=8D=E5=90=8C=E7=9A=84=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=AE=9A=E5=88=B6=E6=98=AF=E5=90=A6=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=90=8D=E5=B8=88=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 1 + app/views/organizations/setting.html.erb | 5 +++++ .../20160513021204_add_allow_teacher_to_organization.rb | 5 +++++ db/schema.rb | 3 ++- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160513021204_add_allow_teacher_to_organization.rb diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 922e9cb66..98483bb64 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -279,6 +279,7 @@ class OrganizationsController < ApplicationController # @organization.domain = params[:organization][:domain] @organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0 @organization.allow_guest_download = params[:organization][:allow_guest_download] == 'on' ? 1 : 0 + @organization.allow_teacher = params[:organization][:allow_teacher] == 'on' ? 1 : 0 @organization.show_mode = params[:show_mode] #@organization.name = params[:organization][:name] @organization.save diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index c841b68b5..7b82f3a6e 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -87,6 +87,11 @@  允许游客下载 <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %> + <% if User.current.admin? %> +
    允许设置名师榜 : + class="ml3" /> +
    + <% end %> 保存 <% end %> diff --git a/db/migrate/20160513021204_add_allow_teacher_to_organization.rb b/db/migrate/20160513021204_add_allow_teacher_to_organization.rb new file mode 100644 index 000000000..07b39c9a0 --- /dev/null +++ b/db/migrate/20160513021204_add_allow_teacher_to_organization.rb @@ -0,0 +1,5 @@ +class AddAllowTeacherToOrganization < ActiveRecord::Migration + def change + add_column :organizations, :allow_teacher, :integer, :default => false + end +end diff --git a/db/schema.rb b/db/schema.rb index d8ddb7e0d..ac18f108b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160513012705) do +ActiveRecord::Schema.define(:version => 20160513021204) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1614,6 +1614,7 @@ ActiveRecord::Schema.define(:version => 20160513012705) do t.boolean "allow_guest_download", :default => true t.integer "visits", :default => 0 t.integer "show_mode", :default => 0 + t.integer "allow_teacher", :default => 0 end create_table "permissions", :force => true do |t| From a2418396dd644e05647ee0e77863ea3852633a9f Mon Sep 17 00:00:00 2001 From: Linda <2294690300@qq.com> Date: Fri, 13 May 2016 10:30:38 +0800 Subject: [PATCH 29/79] =?UTF-8?q?=E9=82=A6=E6=9C=AC=E5=BA=93zip=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=A0=B7=E5=BC=8F=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/show.html.erb | 2 ++ public/stylesheets/repository.css | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 82e6f871f..6fed85acf 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -1,6 +1,8 @@ <%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>

    <%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>

    + ZIP下载 +
    <% if @entries.nil? %> diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index 9e0e07a77..89dc34d7a 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -287,4 +287,7 @@ li.commit .commit-row-info .committed_ago { .rep_history_grey{ color: #7F7F7F; } -.rep_mail_name{max-width: 150px; overflow: hidden; text-overflow: ellipsis;} \ No newline at end of file +.rep_mail_name{max-width: 150px; overflow: hidden; text-overflow: ellipsis;} +a.btn_zipdown{ display:block; height:25px; width:80px; text-align: center; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE); + color: #7f7f7f; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-top: 7px; margin-right: 5px;} +a:hover.btn_zipdown{color:#269ac9;} \ No newline at end of file From 1673ae451b7d39e39fe4670c06b568ffe573b50e Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 10:50:34 +0800 Subject: [PATCH 30/79] =?UTF-8?q?=E5=90=8D=E5=B8=88=E6=A6=9C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=B8=80=E4=B8=AA=E5=90=8E=E5=B0=B1=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=86=8D=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/organization.rb | 4 ++++ app/views/org_subfields/create.js.erb | 1 + .../_setting_excellent_teachers.html.erb | 6 ++++++ app/views/organizations/setting.html.erb | 19 +++---------------- 4 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 app/views/organizations/_setting_excellent_teachers.html.erb diff --git a/app/models/organization.rb b/app/models/organization.rb index 8f9d290eb..311a37bf8 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -26,4 +26,8 @@ class Organization < ActiveRecord::Base def switch_type self.show_mode.to_i == 1 ? true : false end + + def allow_set_teachers + self.allow_teacher.to_i == 1 ? true : false + end end diff --git a/app/views/org_subfields/create.js.erb b/app/views/org_subfields/create.js.erb index 3e08d9f9e..5cc6d5c91 100644 --- a/app/views/org_subfields/create.js.erb +++ b/app/views/org_subfields/create.js.erb @@ -4,6 +4,7 @@ :locals => {:subfields => @organization.org_subfields.order("priority") }) %>"); $("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); + $("#org_excellent_teachers").html("<%= escape_javascript(render :partial => 'organizations/setting_excellent_teachers') %>"); <% end %> $("#subfield_name").val(""); $("#sub_dir").val(""); \ No newline at end of file diff --git a/app/views/organizations/_setting_excellent_teachers.html.erb b/app/views/organizations/_setting_excellent_teachers.html.erb new file mode 100644 index 000000000..ea6c1c9a6 --- /dev/null +++ b/app/views/organizations/_setting_excellent_teachers.html.erb @@ -0,0 +1,6 @@ +<% if @organization.allow_set_teachers && !org_subfield_had_created?(@organization, "Comptec") %> +
  • + + +
  • +<% end %> \ No newline at end of file diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb index 7b82f3a6e..2caeee726 100644 --- a/app/views/organizations/setting.html.erb +++ b/app/views/organizations/setting.html.erb @@ -157,22 +157,9 @@ -
  • - - -
  • - <% unless org_subfield_had_created?(@organization, "Comptec") %> -
  • - - -
  • - <% end %> - <% unless org_subfield_had_created?(@organization, "Compstu") %> -
  • - - -
  • - <% end %> +
    + <%= render :partial => 'organizations/setting_excellent_teachers' %> +
  • 新增
  • From 61803aa6966e36352bd6ed4c03b29a5417c01b61 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 10:54:33 +0800 Subject: [PATCH 31/79] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=90=8D=E5=B8=88?= =?UTF-8?q?=E6=A6=9C=E7=9A=84=E6=97=B6=E5=80=99=E5=B1=80=E9=83=A8=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_subfields/destroy.js.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/org_subfields/destroy.js.erb b/app/views/org_subfields/destroy.js.erb index d069b1cd8..c14eeae8f 100644 --- a/app/views/org_subfields/destroy.js.erb +++ b/app/views/org_subfields/destroy.js.erb @@ -2,4 +2,5 @@ $("#org_subfield_list").html(""); $("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority") }) %>"); $("#sub_field_left_lists").html(""); -$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); \ No newline at end of file +$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); +$("#org_excellent_teachers").html("<%= escape_javascript(render :partial => 'organizations/setting_excellent_teachers') %>"); \ No newline at end of file From f7a888ac3dce4bc1a67215d1b6861f8df1ddc5ba Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 11:11:09 +0800 Subject: [PATCH 32/79] =?UTF-8?q?=E5=90=8D=E5=B8=88=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/org_subfields_controller.rb | 6 ++++++ app/views/organizations/_subfield_list.html.erb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 661073cdc..c628b25fc 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -15,6 +15,12 @@ class OrgSubfieldsController < ApplicationController end end @subfield.update_attributes(:field_type => params[:field_type]) + # 如果栏目是教师,不参入类型的配置,定义为右三模式 + # 新增模块命名规则,左边1开头,右边2开头,以前的不变 + # eg:23 右三 + if params[:field_type] == "Comptec" + @subfield.update_attributes(:status => 23) + end else @res = false end diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index 0d6b5aac2..3cdb2991c 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -57,7 +57,7 @@
  • 新增
  • - <% if field.field_type == "Resource" %> + <% if field.field_type == "Resource" || field.field_type == "Comptec" %> 默认 <% else %> <%= form_tag({:controller => 'org_subfields', :action => 'update_status', :id => field.id,},:remote=>'true', :method => 'post', :id=>"update_status_form_#{field.id}", :class => 'query_form') do %> From 7bd047f7e4bbc5ef3a4d0f86e3c2b99949fae842 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 11:25:05 +0800 Subject: [PATCH 33/79] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=BA=8C=E4=B8=AD=E5=90=8D=E5=B8=88=E6=A6=9C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org2.html.erb | 2 ++ .../_org_subfield_rightM2.html.erb | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 app/views/organizations/_org_subfield_rightM2.html.erb diff --git a/app/views/layouts/base_org2.html.erb b/app/views/layouts/base_org2.html.erb index 6a641d0f2..9b481fac5 100644 --- a/app/views/layouts/base_org2.html.erb +++ b/app/views/layouts/base_org2.html.erb @@ -157,6 +157,8 @@ <%= render :partial => 'organizations/org_subfield_rightM', :locals => {:field => field} %> <% elsif field.status.to_i == 8 %> <%= render :partial => 'organizations/org_subfield_rightD', :locals => {:field => field} %> + <% elsif field.status.to_i == 23 %> + <%= render :partial => 'organizations/org_subfield_rightM2', :locals => {:field => field} %> <% end %> <% end %>
  • diff --git a/app/views/organizations/_org_subfield_rightM2.html.erb b/app/views/organizations/_org_subfield_rightM2.html.erb new file mode 100644 index 000000000..1f954b66a --- /dev/null +++ b/app/views/organizations/_org_subfield_rightM2.html.erb @@ -0,0 +1,24 @@ +
    +

    名师风采更多

    +
    +
    张晓华国防科学技术大学
    +
    博客 8课程 2学生 218
    +
    +
    +
    +
    张晓华国防科学技术大学
    博客 8课程 2学生 218
    +
    +
    +
    +
    张晓华国防科学技术大学
    博客 8课程 2学生 218
    +
    +
    +
    +
    张晓华国防科学技术大学
    博客 8课程 2学生 218
    +
    +
    +
    +
    张晓华国防科学技术大学
    博客 8课程 2学生 218
    +
    +
    +
    \ No newline at end of file From 61470c9bd40aa3601017c733363240077ed30d67 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 13 May 2016 11:29:45 +0800 Subject: [PATCH 34/79] =?UTF-8?q?=E5=90=8D=E5=B8=88=E6=A6=9Ccss=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/org2.css | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/org2.css b/public/stylesheets/org2.css index f7be08e71..c26d9498b 100644 --- a/public/stylesheets/org2.css +++ b/public/stylesheets/org2.css @@ -50,6 +50,7 @@ a.sn-link-select {color:#809df9;} .sn-mt28 {margin-top:28px;} .sn-mb40 {margin-bottom:40px;} .sn-ml15 {margin-left:15px;} +.sn-ml20 {margin-left:20px;} .sn-ml55 {margin-left:55px;} .sn-mr0 {margin-right:0px !important;} .sn-mr20 {margin-right:20px;} @@ -152,7 +153,7 @@ a.more-btn{ display:block; width:185px; height:30px; text-align:center; backgrou .partner-btn{ width:35px; height:22px; background-color:#999; line-height:1.0; font-size:18px; color:#fff; text-align: center; margin-right:5px; cursor:pointer;} .partner-btn:hover{ background-color:#172b65;} /* index-active */ -.sn-index-activebox{ margin-bottom:20px; background:#fff; padding-bottom:10px;} +.sn-index-activebox, .sn-teacher-wrap{ margin-bottom:20px; background:#fff; padding-bottom:10px;} .active-title{width:330px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;} .sn-index-active{ margin:0px 20px 5px 20px;} .sn-index-active a.sn-activeimg{width:330px; height:210px;} @@ -237,6 +238,18 @@ ul.sn-inner-pages li a:hover{ background-color:#24366e; color:#fff; text-decorat .sn-inner-pages_select { background-color:#24366e; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;} .sn-inner-pages_select a{background-color: #24366e; color: #fff;cursor: default;} +/*名师榜*/ +.sn-teacher-list {margin:0 20px; padding:15px 0; border-bottom:1px solid #e9e9e9;} +a.sn-teacher-name {width:75px; font-size:18px; color:#777; float:left;} +.sn-teacher-unit {width:154px; font-size:14px; color:#999; float:left; margin-left:15px; margin-top:3px;} +.sn-teacher-info {height:30px; line-height:30px; vertical-align:middle; float:left; margin-left:15px;} +.sn-teacher-social {height:30px; line-height:30px; vertical-align:middle; float:left; color:#999; font-size:12px; margin-left:15px;} +.sn-border-none {border:none;} +.sn-teacher-block {width:163px; height:222px; border-right:1px solid #e5e7ec; margin:40px 0 24px 0; float:left;} +.sn-teacher-avatar2 {margin:0 18px; padding:18px 0;} +.sn-teacher-info2 {color:#666; text-align:center; font-size:16px;} +.sn-info2-hidden {width:153px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0 auto;} + /*弹框*/ .upload_con h2 { display: block; From 457bac0b9d63160c4ee63b691fe6ddf441acb278 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 11:30:49 +0800 Subject: [PATCH 35/79] 0 --- app/views/organizations/teachers.html.erb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb index 211641fcb..a7417fa1b 100644 --- a/app/views/organizations/teachers.html.erb +++ b/app/views/organizations/teachers.html.erb @@ -9,11 +9,12 @@ - + + + + + +
    名师列表
    From 343e9d9434fd2f97badb6d16ca0a8b478452dc3d Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 11:32:50 +0800 Subject: [PATCH 36/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=88=86=E5=89=B2=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/environments/production.rb | 2 +- config/initializers/logger.rb | 66 +++++++++++++++---------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 63931fa33..b3c783be8 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -17,7 +17,7 @@ RedmineApp::Application.configure do # config.logger.level = Logger::INFO # Full error reports are disabled and caching is turned on - config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly + # config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly config.action_controller.perform_caching = true # to additional_environment.rb diff --git a/config/initializers/logger.rb b/config/initializers/logger.rb index e9b61ce06..2f707182a 100644 --- a/config/initializers/logger.rb +++ b/config/initializers/logger.rb @@ -194,36 +194,36 @@ require 'fileutils' # end # # e.g. "Thu Sep 22 08:51:08 GMT+9:00 2005: hello world" # -class Logger - #具体内容请看https://bugs.ruby-lang.org/issues/7303 - # Device used for logging messages. - class LogDevice - def shift_log_period(period_end) - postfix = period_end.strftime("%Y%m%d") # YYYYMMDD - age_file = "#{@filename}.#{postfix}" - if FileTest.exist?(age_file) - # try to avoid filename crash caused by Timestamp change. - idx = 0 - # .99 can be overridden; avoid too much file search with 'loop do' - while idx < 100 - idx += 1 - age_file = "#{@filename}.#{postfix}.#{idx}" - break unless FileTest.exist?(age_file) - end - end - # @dev.close rescue nil - # File.rename("#{@filename}", age_file) - # @dev = create_logfile(@filename) - #覆盖原来lib库的方法,将上边三行删除,增加下边两行 - FileUtils.cp(@filename, age_file) - reset_logfile(@dev) # see below for this new method return true - return true - end - #打开原来lib库,新增一个方法 - def reset_logfile(logdev) - logdev.truncate( 0 ) - logdev.sync = true - add_log_header(logdev) - end - end -end +# class Logger +# #具体内容请看https://bugs.ruby-lang.org/issues/7303 +# # Device used for logging messages. +# class LogDevice +# def shift_log_period(period_end) +# postfix = period_end.strftime("%Y%m%d") # YYYYMMDD +# age_file = "#{@filename}.#{postfix}" +# if FileTest.exist?(age_file) +# # try to avoid filename crash caused by Timestamp change. +# idx = 0 +# # .99 can be overridden; avoid too much file search with 'loop do' +# while idx < 100 +# idx += 1 +# age_file = "#{@filename}.#{postfix}.#{idx}" +# break unless FileTest.exist?(age_file) +# end +# end +# # @dev.close rescue nil +# # File.rename("#{@filename}", age_file) +# # @dev = create_logfile(@filename) +# #覆盖原来lib库的方法,将上边三行删除,增加下边两行 +# FileUtils.cp(@filename, age_file) +# reset_logfile(@dev) # see below for this new method return true +# return true +# end +# #打开原来lib库,新增一个方法 +# def reset_logfile(logdev) +# logdev.truncate( 0 ) +# logdev.sync = true +# add_log_header(logdev) +# end +# end +# end From a1323e3d76bf364c93a75a4f2470fe63c93920c0 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 13 May 2016 11:32:52 +0800 Subject: [PATCH 37/79] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 13 ++++++----- public/assets/kindeditor/pasteimg.js | 32 ++++++++++++++++---------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 755f1427a..f96216658 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -3787,17 +3787,18 @@ _extend(KEdit, KWidget, { } else { val = body.innerHTML; } -// if (self.beforeGetHtml) { -// val = self.beforeGetHtml(val); -// } + //yk + if (self.beforeGetHtml) { + val = self.beforeGetHtml(val); + } if (_GECKO && val == '
    ') { val = ''; } return val; } -// if (self.beforeSetHtml) { -// val = self.beforeSetHtml(val); -// } + if (self.beforeSetHtml) { + val = self.beforeSetHtml(val); + } if (_IE && _V >= 9) { val = val.replace(/(<.*?checked=")checked(".*>)/ig, '$1$2'); } diff --git a/public/assets/kindeditor/pasteimg.js b/public/assets/kindeditor/pasteimg.js index 41474d013..385e02ac2 100644 --- a/public/assets/kindeditor/pasteimg.js +++ b/public/assets/kindeditor/pasteimg.js @@ -362,12 +362,14 @@ function df(myself) { var sstr = ""; $(img).each(function (i) { var that = $(this); - if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) { - piccount++; - if (i == $(img).length - 1) - sstr += that.attr("src"); - else - sstr += that.attr("src") + "|"; + if(that.attr("src")) { + if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) { + piccount++; + if (i == $(img).length - 1) + sstr += that.attr("src"); + else + sstr += that.attr("src") + "|"; + } } }); uploadpic(sstr,myself); @@ -409,12 +411,18 @@ function uploadpic(piclist,myself) { var tIndex = 0; $(img).each(function (i) { var that = $(this); - if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) { - that.attr("src", str[tIndex]); - that.attr("data-ke-src", str[tIndex]); - that.parent().attr("href", str[tIndex]); - that.parent().attr("data-ke-src", str[tIndex]); - tIndex = tIndex + 1; + if(that.attr("src")){ + if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) { + that.attr("src", str[tIndex]); + that.attr("data-ke-src", str[tIndex]); + + //非视频 + if(!(that.parent().attr("class") && that.parent().attr("class") == "mediaIcobox" )) { + that.parent().attr("href", str[tIndex]); + that.parent().attr("data-ke-src", str[tIndex]); + } + tIndex = tIndex + 1; + } } }); } From 3853d5b7ad8981f6ab7eabd260df9dac74943a10 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 13:39:44 +0800 Subject: [PATCH 38/79] =?UTF-8?q?=E5=8F=B3=E4=B8=89=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=AE=9A=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 5 +++ app/models/user.rb | 14 +++++++ .../_org_subfield_rightM2.html.erb | 42 +++++++++---------- 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 3db2345ce..6463bf854 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -181,4 +181,9 @@ module OrganizationsHelper course_ids = user.courses.map { |c| c.is_delete == 0 && c.id} results = Member.find_by_sql("select id from courses where courses.tea_id = #{user.id}").count end + + def excellent_teachers + User.where("excellent_teacher =?",true) + end + end diff --git a/app/models/user.rb b/app/models/user.rb index 2030adfdf..c3a4f8c25 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -308,6 +308,20 @@ class User < Principal end # ====================================================================== + def my_workplace + self.user_extensions.try(:occupation).to_s + end + + def my_blogs_count + self.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count + end + + def my_students + my_students=StudentsForCourse.find_by_sql("SELECT SUM(student_count) as students_count, c.tea_id FROM courses c, (SELECT course_id , COUNT(id) AS student_count FROM students_for_courses GROUP BY course_id) AS ct + WHERE c.id= ct.course_id and c.tea_id = #{self.id} GROUP BY c.tea_id").first + results = my_students.blank? ? 0 : my_students.students_count + results + end # 查询用户未读过的记录 # 用户留言记录 diff --git a/app/views/organizations/_org_subfield_rightM2.html.erb b/app/views/organizations/_org_subfield_rightM2.html.erb index 1f954b66a..567df26d9 100644 --- a/app/views/organizations/_org_subfield_rightM2.html.erb +++ b/app/views/organizations/_org_subfield_rightM2.html.erb @@ -1,24 +1,24 @@

    名师风采更多

    -
    -
    张晓华国防科学技术大学
    -
    博客 8课程 2学生 218
    -
    -
    -
    -
    张晓华国防科学技术大学
    博客 8课程 2学生 218
    -
    -
    -
    -
    张晓华国防科学技术大学
    博客 8课程 2学生 218
    -
    -
    -
    -
    张晓华国防科学技术大学
    博客 8课程 2学生 218
    -
    -
    -
    -
    张晓华国防科学技术大学
    博客 8课程 2学生 218
    -
    -
    + <% excellent_teachers.each do |teacher| %> +
    + <%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sn-fl", :style => "display:block;"), user_path(teacher), :alt => "用户头像", :target => '_blank' %> + +
    + <%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "sn-teacher-name sn-hidden", :title => '', :target => '_blank' %> + <%= teacher.my_workplace %>
    +
    + <% unless teacher.my_blogs_count == 0 %> + 博客 <%= teacher.my_blogs_count %> + <% end %> + <% unless teacher.courses.count == 0 %> + 课程 <%= teacher.courses.count %> + <% end %> + <% unless teacher.my_students == 0 %> + 学生 <%= teacher.my_students %> + <% end %> +
    +
    +
    + <% end %>
    \ No newline at end of file From e90da9d812d98f1f62dcc9ab7c6b6704fd3a5e6e Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 14:00:05 +0800 Subject: [PATCH 39/79] =?UTF-8?q?teachers=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_left_subfield_list.html.erb | 2 +- app/views/organizations/_org_teachers_list.html.erb | 6 +++--- app/views/organizations/teachers.html.erb | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 681cd90c8..3fe57d223 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -107,7 +107,7 @@ <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> <% end %> <% end %> - <% if User.current.logged? and User.current.admin_of_org?(organization) %> + <% if User.current.logged? and User.current.admin_of_org?(organization) && field.field_type != "Comptec" %> <%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %> <% end %>
    diff --git a/app/views/organizations/_org_teachers_list.html.erb b/app/views/organizations/_org_teachers_list.html.erb index 79634425d..3f8f5af8e 100644 --- a/app/views/organizations/_org_teachers_list.html.erb +++ b/app/views/organizations/_org_teachers_list.html.erb @@ -14,17 +14,17 @@ <%= org_teacher.technical_title %> <% end %>
    -
    <%= @org_count %>
    +
    <%= org_teacher.courses.count %>
    课程数
    -
    <%#= org_student_course_count(org_teacher) %>500
    +
    <%= org_teacher.my_students %>500
    学生数
    -
    <%#= org_teacher_resource_count(org_teacher) %>
    +
    <%= org_teacher_resource_count(org_teacher) %>
    资源数
    diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb index a7417fa1b..35ba9c8fd 100644 --- a/app/views/organizations/teachers.html.erb +++ b/app/views/organizations/teachers.html.erb @@ -14,7 +14,9 @@ -
    名师列表
    +
    + <%= link_to "名师列表", teachers_organization_path(@organization), :class => "fontGrey" %> +
    From dc92e821a3f63acce61077d8a5869b1329b2e50a Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 13 May 2016 14:08:34 +0800 Subject: [PATCH 40/79] =?UTF-8?q?=E5=90=8D=E5=B8=88=E6=A6=9C=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_org_subfield_rightD.html.erb | 6 +- .../_org_subfield_rightM2.html.erb | 12 +- app/views/organizations/teachers.html.erb | 2 +- db/schema.rb | 408 +----------------- public/stylesheets/org.css | 2 +- public/stylesheets/org2.css | 1 + 6 files changed, 20 insertions(+), 411 deletions(-) diff --git a/app/views/organizations/_org_subfield_rightD.html.erb b/app/views/organizations/_org_subfield_rightD.html.erb index 398f679e1..2953d1a0a 100644 --- a/app/views/organizations/_org_subfield_rightD.html.erb +++ b/app/views/organizations/_org_subfield_rightD.html.erb @@ -10,7 +10,7 @@ <% org_acts = get_subfield_acts field %> <% unless org_acts.blank? %> <% activity = org_acts.first %> -
    +
    <% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %> <% document = activity.org_act %> <% org_subfield_id = params[:org_subfield_id] %> @@ -52,13 +52,13 @@ <% end %>
    <% else %> -
    +
    <% end %> <% elsif field.field_type == "Resource" %> <% org_attachs = get_attach_org2(field) %> -
    +
    <% if !field.subfield_subdomain_dir.nil? %> <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> <%= link_to image_tag("/images/default_blank/right-03.jpg", :width => "369", :height => "169"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %> diff --git a/app/views/organizations/_org_subfield_rightM2.html.erb b/app/views/organizations/_org_subfield_rightM2.html.erb index 567df26d9..5c82e52dc 100644 --- a/app/views/organizations/_org_subfield_rightM2.html.erb +++ b/app/views/organizations/_org_subfield_rightM2.html.erb @@ -9,16 +9,20 @@ <%= teacher.my_workplace %>
    <% unless teacher.my_blogs_count == 0 %> - 博客 <%= teacher.my_blogs_count %> + 博客 <%= teacher.my_blogs_count %> <% end %> <% unless teacher.courses.count == 0 %> - 课程 <%= teacher.courses.count %> + 课程 <%= teacher.courses.count %> <% end %> <% unless teacher.my_students == 0 %> - 学生 <%= teacher.my_students %> + 学生 <%= teacher.my_students %> <% end %>
    <% end %> -
    \ No newline at end of file +
    + + \ No newline at end of file diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb index a7417fa1b..ea9923287 100644 --- a/app/views/organizations/teachers.html.erb +++ b/app/views/organizations/teachers.html.erb @@ -3,7 +3,7 @@ <%= form_tag( url_for(:controller => 'organizations', :action => 'teachers'), :remote => true , :method => 'get', :id => 'resource_search_form') do %> - <%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :style => 'border-style:none', :class => "teacher-search-icon fl" %> + <%= submit_tag '', :class => 'homepageSearchIcon', :onfocus => 'this.blur();', :class => "teacher-search-icon fl" %> <% end %> diff --git a/db/schema.rb b/db/schema.rb index ac18f108b..700d7cb4c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -52,28 +52,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" - create_table "application_settings", :force => true do |t| - t.integer "default_projects_limit" - t.boolean "signup_enabled" - t.boolean "signin_enabled" - t.boolean "gravatar_enabled" - t.text "sign_in_text" - t.datetime "created_at" - t.datetime "updated_at" - t.string "home_page_url" - t.integer "default_branch_protection", :default => 2 - t.boolean "twitter_sharing_enabled", :default => true - t.text "restricted_visibility_levels" - t.boolean "version_check_enabled", :default => true - t.integer "max_attachment_size", :default => 10, :null => false - t.integer "default_project_visibility" - t.integer "default_snippet_visibility" - t.text "restricted_signup_domains" - t.boolean "user_oauth_applications", :default => true - t.string "after_sign_out_path" - t.integer "session_expire_delay", :default => 10080, :null => false - end - create_table "applied_projects", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false @@ -166,20 +144,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.string "typeName", :limit => 50 end - create_table "audit_events", :force => true do |t| - t.integer "author_id", :null => false - t.string "type", :null => false - t.integer "entity_id", :null => false - t.string "entity_type", :null => false - t.text "details" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id" - add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type" - add_index "audit_events", ["type"], :name => "index_audit_events_on_type" - create_table "auth_sources", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 60, :default => "", :null => false @@ -277,17 +241,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["project_id"], :name => "boards_project_id" - create_table "broadcast_messages", :force => true do |t| - t.text "message", :null => false - t.datetime "starts_at" - t.datetime "ends_at" - t.integer "alert_type" - t.datetime "created_at" - t.datetime "updated_at" - t.string "color" - t.string "font" - end - create_table "bug_to_osps", :force => true do |t| t.integer "osp_id" t.integer "relative_memo_id" @@ -587,10 +540,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.integer "visits", :default => 0 end - add_index "courses", ["id"], :name => "id", :unique => true - add_index "courses", ["tea_id"], :name => "tea_id" - add_index "courses", ["visits"], :name => "visits" - create_table "custom_fields", :force => true do |t| t.string "type", :limit => 30, :default => "", :null => false t.string "name", :limit => 30, :default => "", :null => false @@ -652,15 +601,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "deploy_keys_projects", :force => true do |t| - t.integer "deploy_key_id", :null => false - t.integer "project_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id" - create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -710,16 +650,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.datetime "created_at" end - create_table "emails", :force => true do |t| - t.integer "user_id", :null => false - t.string "email", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true - add_index "emails", ["user_id"], :name => "index_emails_on_user_id" - create_table "enabled_modules", :force => true do |t| t.integer "project_id" t.string "name", :null => false @@ -742,25 +672,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" - create_table "events", :force => true do |t| - t.string "target_type" - t.integer "target_id" - t.string "title" - t.text "data" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "action" - t.integer "author_id" - end - - add_index "events", ["action"], :name => "index_events_on_action" - add_index "events", ["author_id"], :name => "index_events_on_author_id" - add_index "events", ["created_at"], :name => "index_events_on_created_at" - add_index "events", ["project_id"], :name => "index_events_on_project_id" - add_index "events", ["target_id"], :name => "index_events_on_target_id" - add_index "events", ["target_type"], :name => "index_events_on_target_type" - create_table "exercise_answers", :force => true do |t| t.integer "user_id" t.integer "exercise_question_id" @@ -863,15 +774,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" - create_table "forked_project_links", :force => true do |t| - t.integer "forked_to_project_id", :null => false - t.integer "forked_from_project_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true - create_table "forums", :force => true do |t| t.string "name", :null => false t.text "description" @@ -1001,17 +903,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.datetime "updated_at", :null => false end - create_table "identities", :force => true do |t| - t.string "extern_uid" - t.string "provider" - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id" - add_index "identities", ["user_id"], :name => "index_identities_on_user_id" - create_table "invite_lists", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1155,20 +1046,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.integer "private", :default => 0 end - create_table "keys", :force => true do |t| - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.text "key" - t.string "title" - t.string "type" - t.string "fingerprint" - t.boolean "public", :default => false, :null => false - end - - add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id" - add_index "keys", ["user_id"], :name => "index_keys_on_user_id" - create_table "kindeditor_assets", :force => true do |t| t.string "asset" t.integer "file_size" @@ -1180,27 +1057,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.integer "owner_type", :default => 0 end - create_table "label_links", :force => true do |t| - t.integer "label_id" - t.integer "target_id" - t.string "target_type" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id" - add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type" - - create_table "labels", :force => true do |t| - t.string "title" - t.string "color" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "labels", ["project_id"], :name => "index_labels_on_project_id" - create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1251,47 +1107,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.integer "viewed_count", :default => 0 end - create_table "merge_request_diffs", :force => true do |t| - t.string "state" - t.text "st_commits", :limit => 2147483647 - t.text "st_diffs", :limit => 2147483647 - t.integer "merge_request_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true - - create_table "merge_requests", :force => true do |t| - t.string "target_branch", :null => false - t.string "source_branch", :null => false - t.integer "source_project_id", :null => false - t.integer "author_id" - t.integer "assignee_id" - t.string "title" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "milestone_id" - t.string "state" - t.string "merge_status" - t.integer "target_project_id", :null => false - t.integer "iid" - t.text "description" - t.integer "position", :default => 0 - t.datetime "locked_at" - end - - add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" - add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id" - add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id" - add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at" - add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id" - add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch" - add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id" - add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch" - add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true - add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title" - create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1326,39 +1141,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["parent_id"], :name => "messages_parent_id" - create_table "milestones", :force => true do |t| - t.string "title", :null => false - t.integer "project_id", :null => false - t.text "description" - t.date "due_date" - t.datetime "created_at" - t.datetime "updated_at" - t.string "state" - t.integer "iid" - end - - add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id" - add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date" - add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true - add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id" - - create_table "namespaces", :force => true do |t| - t.string "name", :null => false - t.string "path", :null => false - t.integer "owner_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "type" - t.string "description", :default => "", :null => false - t.string "avatar" - end - - add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id" - add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true - add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id" - add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true - add_index "namespaces", ["type"], :name => "index_namespaces_on_type" - create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1384,31 +1166,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.datetime "updated_at", :null => false end - create_table "notes", :force => true do |t| - t.text "note" - t.string "noteable_type" - t.integer "author_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "project_id" - t.string "attachment" - t.string "line_code" - t.string "commit_id" - t.integer "noteable_id" - t.boolean "system", :default => false, :null => false - t.text "st_diff", :limit => 2147483647 - end - - add_index "notes", ["author_id"], :name => "index_notes_on_author_id" - add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id" - add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id" - add_index "notes", ["created_at"], :name => "index_notes_on_created_at" - add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type" - add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type" - add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type" - add_index "notes", ["project_id"], :name => "index_notes_on_project_id" - add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at" - create_table "notificationcomments", :force => true do |t| t.string "notificationcommented_type" t.integer "notificationcommented_id" @@ -1418,49 +1175,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.datetime "updated_at", :null => false end - create_table "oauth_access_grants", :force => true do |t| - t.integer "resource_owner_id", :null => false - t.integer "application_id", :null => false - t.string "token", :null => false - t.integer "expires_in", :null => false - t.text "redirect_uri", :null => false - t.datetime "created_at", :null => false - t.datetime "revoked_at" - t.string "scopes" - end - - add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true - - create_table "oauth_access_tokens", :force => true do |t| - t.integer "resource_owner_id" - t.integer "application_id" - t.string "token", :null => false - t.string "refresh_token" - t.integer "expires_in" - t.datetime "revoked_at" - t.datetime "created_at", :null => false - t.string "scopes" - end - - add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true - add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id" - add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true - - create_table "oauth_applications", :force => true do |t| - t.string "name", :null => false - t.string "uid", :null => false - t.string "secret", :null => false - t.text "redirect_uri", :null => false - t.string "scopes", :default => "", :null => false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "owner_id" - t.string "owner_type" - end - - add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type" - add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true - create_table "onclick_times", :force => true do |t| t.integer "user_id" t.datetime "onclick_time" @@ -1617,23 +1331,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.integer "allow_teacher", :default => 0 end - create_table "permissions", :force => true do |t| - t.string "controller", :limit => 30, :default => "", :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "description", :limit => 60, :default => "", :null => false - t.boolean "is_public", :default => false, :null => false - t.integer "sort", :default => 0, :null => false - t.boolean "mail_option", :default => false, :null => false - t.boolean "mail_enabled", :default => false, :null => false - end - - create_table "permissions_roles", :id => false, :force => true do |t| - t.integer "permission_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - end - - add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id" - create_table "phone_app_versions", :force => true do |t| t.string "version" t.text "description" @@ -1716,11 +1413,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.datetime "updated_at", :null => false end - create_table "project_import_data", :force => true do |t| - t.integer "project_id" - t.text "data" - end - create_table "project_infos", :force => true do |t| t.integer "project_id" t.integer "user_id" @@ -1810,16 +1502,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - create_table "protected_branches", :force => true do |t| - t.integer "project_id", :null => false - t.string "name", :null => false - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "developers_can_push", :default => false, :null => false - end - - add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id" - create_table "queries", :force => true do |t| t.integer "project_id" t.string "name", :default => "", :null => false @@ -1954,25 +1636,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.integer "is_teacher_score", :default => 0 end - create_table "services", :force => true do |t| - t.string "type" - t.string "title" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "active", :default => false, :null => false - t.text "properties" - t.boolean "template", :default => false - t.boolean "push_events", :default => true - t.boolean "issues_events", :default => true - t.boolean "merge_requests_events", :default => true - t.boolean "tag_push_events", :default => true - t.boolean "note_events", :default => true, :null => false - end - - add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id" - add_index "services", ["project_id"], :name => "index_services_on_project_id" - create_table "settings", :force => true do |t| t.string "name", :default => "", :null => false t.text "value" @@ -2011,26 +1674,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.datetime "updated_at", :null => false end - create_table "snippets", :force => true do |t| - t.string "title" - t.text "content", :limit => 2147483647 - t.integer "author_id", :null => false - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "file_name" - t.datetime "expires_at" - t.string "type" - t.integer "visibility_level", :default => 0, :null => false - end - - add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id" - add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id" - add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at" - add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at" - add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id" - add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level" - create_table "softapplications", :force => true do |t| t.string "name" t.text "description" @@ -2103,9 +1746,9 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.integer "absence_penalty", :default => 0 t.float "system_score", :default => 0.0 t.boolean "is_test", :default => false - t.float "work_score" t.integer "simi_id" t.integer "simi_value" + t.float "work_score" end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" @@ -2153,13 +1796,13 @@ ActiveRecord::Schema.define(:version => 20160513021204) do create_table "sub_domains", :force => true do |t| t.integer "org_subfield_id" - t.integer "priority" + t.integer "priority", :default => 0 t.string "name" t.string "field_type" - t.integer "hide" - t.integer "status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.integer "hide", :default => 0 + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "subfield_subdomain_dirs", :force => true do |t| @@ -2169,17 +1812,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.datetime "updated_at", :null => false end - create_table "subscriptions", :force => true do |t| - t.integer "user_id" - t.integer "subscribable_id" - t.string "subscribable_type" - t.boolean "subscribed" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true - create_table "system_messages", :force => true do |t| t.integer "user_id" t.string "content" @@ -2419,17 +2051,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" add_index "users", ["type"], :name => "index_users_on_type" - create_table "users_star_projects", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id" - add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true - add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id" - create_table "versions", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.string "name", :default => "", :null => false @@ -2481,23 +2102,6 @@ ActiveRecord::Schema.define(:version => 20160513021204) do t.datetime "updated_at", :null => false end - create_table "web_hooks", :force => true do |t| - t.string "url" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "type", :default => "ProjectHook" - t.integer "service_id" - t.boolean "push_events", :default => true, :null => false - t.boolean "issues_events", :default => false, :null => false - t.boolean "merge_requests_events", :default => false, :null => false - t.boolean "tag_push_events", :default => false - t.boolean "note_events", :default => false, :null => false - end - - add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id" - add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id" - create_table "wechat_logs", :force => true do |t| t.string "openid", :null => false t.text "request_raw" diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 76309217d..abfeaef85 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -164,7 +164,7 @@ a.blue-btn { /*名师榜20160505*/ .function-row {border-bottom:1px dashed #b2b2b2; padding-bottom:16px;} .teacher-list-search {width:310px; height:23px; border:1px solid #ccc; border-right:none; outline:none;} -.teacher-search-icon {background:url(../images/search.png) 0 3px no-repeat; width:25px; height:23px; border:1px solid #ccc; border-left:none;} +.teacher-search-icon {background:url(../images/search.png) 0 3px no-repeat; width:25px; height:25px; border:1px solid #ccc; border-left:none; cursor:pointer;} .teacher-search-type {width:84px; height:23px; border:1px solid #ccc; outline:none;} .teacher-list-row {border-bottom:1px dashed #b2b2b2; padding:18px 0;} .teacher-avatar {float:left;} diff --git a/public/stylesheets/org2.css b/public/stylesheets/org2.css index c26d9498b..0ea602976 100644 --- a/public/stylesheets/org2.css +++ b/public/stylesheets/org2.css @@ -48,6 +48,7 @@ a.sn-link-select {color:#809df9;} .sn-mt13 {margin-top:13px;} .sn-mt15 {margin-top:15px;} .sn-mt28 {margin-top:28px;} +.sn-mb20 {margin-bottom:20px;} .sn-mb40 {margin-bottom:40px;} .sn-ml15 {margin-left:15px;} .sn-ml20 {margin-left:20px;} From 80c6edd2d33ff6a4f0a1e8fe1526afa37e523967 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 13 May 2016 14:22:10 +0800 Subject: [PATCH 41/79] =?UTF-8?q?KE=E8=BF=87=E6=BB=A4html=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=9A=84=E6=97=B6=E5=80=99=E8=A1=A8=E6=A0=BC=E7=9A=84?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E7=AD=89=E6=A0=B7=E5=BC=8F=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E8=A2=AB=E8=BF=87=E6=BB=A4=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index f96216658..9ae1300e7 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -290,14 +290,14 @@ K.options = { ], table: [ 'id', 'class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor', - '.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color', + '.padding', '.margin', '.border','.border-color', 'bgcolor', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background', - '.width', '.height', '.border-collapse' + '.width', '.height', '.border-collapse','.table-layout' ], 'td,th': [ 'id', 'class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight', - '.font-style', '.text-decoration', '.vertical-align', '.background', '.border' + '.font-style', '.text-decoration', '.vertical-align', '.background', '.border', '.text-overflow','.overflow','.white-space' ], a : ['id', 'class', 'href', 'target', 'name'], embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'], @@ -736,6 +736,8 @@ function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) { html = html.replace(/\u200B/g, ''); html = html.replace(/\u00A9/g, '©'); html = html.replace(/\u00AE/g, '®'); + html = html.replace(/\u2003/g, ' '); + html = html.replace(/\u3000/g, ' '); html = html.replace(/<[^>]+/g, function($0) { return $0.replace(/\s+/g, ' '); }); From 0feb1280fd0f2dcf1a0e866c4784f171390ec8f2 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 14:23:36 +0800 Subject: [PATCH 42/79] =?UTF-8?q?=E5=90=8D=E5=B8=88=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E5=88=97=E8=A1=A8=20=E5=8F=8A=E7=9B=B8=E5=85=B3=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 7 +++++++ app/views/organizations/_org_subfield_rightM2.html.erb | 4 +++- app/views/organizations/_org_teachers_list.html.erb | 2 +- app/views/organizations/teachers.html.erb | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 98483bb64..4747469cf 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -159,6 +159,10 @@ class OrganizationsController < ApplicationController end def teachers + unless @organization.allow_set_teachers + render_403 + return + end q = params[:search].nil? ? "" : "#{params[:search].strip}" if params[:type] == "courses" || params[:type].nil? @org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count @@ -169,6 +173,9 @@ class OrganizationsController < ApplicationController elsif params[:type] == "resources" @org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from attachments where attachments.author_id = u.id) as course_count from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc") + elsif params[:type] == "famous" + @org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count + from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and u.excellent_teacher =1 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc") end limit = 10 # @is_remote = true diff --git a/app/views/organizations/_org_subfield_rightM2.html.erb b/app/views/organizations/_org_subfield_rightM2.html.erb index 567df26d9..17a485583 100644 --- a/app/views/organizations/_org_subfield_rightM2.html.erb +++ b/app/views/organizations/_org_subfield_rightM2.html.erb @@ -1,5 +1,7 @@
    -

    名师风采更多

    +

    <%= field.name %> + <%= link_to "更多", teachers_organization_path(@organization, :type => "famous"), :target => "_blank", :class => "more" %> +

    <% excellent_teachers.each do |teacher| %>
    <%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sn-fl", :style => "display:block;"), user_path(teacher), :alt => "用户头像", :target => '_blank' %> diff --git a/app/views/organizations/_org_teachers_list.html.erb b/app/views/organizations/_org_teachers_list.html.erb index 3f8f5af8e..e24f53862 100644 --- a/app/views/organizations/_org_teachers_list.html.erb +++ b/app/views/organizations/_org_teachers_list.html.erb @@ -19,7 +19,7 @@
    -
    <%= org_teacher.my_students %>500
    +
    <%= org_teacher.my_students %>
    学生数
    diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb index 35ba9c8fd..54a869221 100644 --- a/app/views/organizations/teachers.html.erb +++ b/app/views/organizations/teachers.html.erb @@ -15,7 +15,7 @@
    - <%= link_to "名师列表", teachers_organization_path(@organization), :class => "fontGrey" %> + <%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous"), :class => "fontGrey" %>
    From 402976cf4064ca50d09b0fa403248e98d7dc32e8 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 May 2016 14:33:06 +0800 Subject: [PATCH 43/79] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80?= =?UTF-8?q?=E7=9A=84=E5=9B=9E=E5=A4=8D=E9=98=B2=E6=AD=A2=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_courses_jours.html.erb | 9 +++++---- app/views/words/_new_respond_course.html.erb | 3 ++- public/javascripts/init_KindEditor.js | 9 +++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index c7e4a7428..4a9b07ec7 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -36,7 +36,7 @@

    取消 - 留言 + 留言 <% end %>
    <% end %> @@ -55,9 +55,6 @@ +<% end %> - From 8d338cff9ee73788149d560c1d1bd23a1ed60d93 Mon Sep 17 00:00:00 2001 From: txz Date: Fri, 13 May 2016 15:48:31 +0800 Subject: [PATCH 53/79] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E9=94=81=E5=AE=9A?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E5=85=B3=E9=97=AD=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/wechat/course_discussion.html | 4 ++-- public/assets/wechat/project_discussion.html | 4 ++-- public/stylesheets/weui/weixin.css | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html index 3f095ab62..e36fb3e27 100644 --- a/public/assets/wechat/course_discussion.html +++ b/public/assets/wechat/course_discussion.html @@ -3,7 +3,7 @@
    -
    {{discussion.subject}}
    +
    {{discussion.subject}}      
    @@ -38,7 +38,7 @@ -
    +
    diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html index 890b47a73..24ed8c9fc 100644 --- a/public/assets/wechat/project_discussion.html +++ b/public/assets/wechat/project_discussion.html @@ -3,7 +3,7 @@
    -
    {{discussion.subject}}
    +
    {{discussion.subject}}      
    发布者: {{discussion.user.realname}}
    @@ -38,7 +38,7 @@ -
    +
    diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index fffa7a214..daa66d6bb 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -77,3 +77,6 @@ a.underline {text-decoration:underline;} .loading-box {position:absolute; top:50%; background:white; width:160px; height:72px; left:50%; margin-top:-36px; margin-left:-80px; text-align:center;} .loading-box img {margin-top: 3px; text-align: center;} .loading-box span {display: block; font-size:12px;} + +/*帖子锁定样式*/ +.locked_btn_cir {background: url("/images/locked.png") 0 0 no-repeat; cursor: default;} \ No newline at end of file From be97675aede746391a589df4e6498b9253ec0226 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 13 May 2016 16:09:26 +0800 Subject: [PATCH 54/79] =?UTF-8?q?=E6=B2=A1=E5=B8=A6=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=9B=BE=E7=89=87=E4=B8=8D=E8=AE=A9?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=94=BE=E5=A4=A7=E7=9C=8B!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/application.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index aa445f817..c43e0a6a2 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1013,15 +1013,18 @@ function showNormalImage(id) { var image=$(description_images[i]); var _path = getRootPath(); //如果图片是视频图片,不处理。 + if($(image).hasClass("mediaIco")){ var _src = _path+"/"+$(image).attr('src'); $(image).attr('src',_src); return; } - - var element=$("").attr("href",image.attr('src')); - image.wrap(element); - $(image).parent().colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); + var tmpsrc = image.attr('src'); + if (tmpsrc.indexOf('.gif') >= 0 || tmpsrc.indexOf('.jpg') >= 0 || tmpsrc.indexOf('.jpeg') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.bmp') >= 0 || tmpsrc.indexOf('.png') >= 0 || tmpsrc.indexOf('.BMP') >= 0 || tmpsrc.indexOf('.JPEG') >= 0 || tmpsrc.indexOf('.JPG') >= 0 || tmpsrc.indexOf('.PNG') >= 0 || tmpsrc.indexOf('.GIF') >= 0) { + var element = $("").attr("href", image.attr('src')); + image.wrap(element); + $(image).parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false}); + } } //$('#'+id+' a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false}); //有图片才将链接变为弹出框 } From a88ab5948959574d8fe8fe9ff1bf2d3774d857c6 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 13 May 2016 16:11:10 +0800 Subject: [PATCH 55/79] =?UTF-8?q?=E5=90=8D=E5=B8=88=E6=A6=9C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8F=B3=E4=BE=A7banner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/teachers.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb index cca83aa4d..062130336 100644 --- a/app/views/organizations/teachers.html.erb +++ b/app/views/organizations/teachers.html.erb @@ -1,3 +1,6 @@ +
    +
    名师榜
    +
    <%= form_tag( url_for(:controller => 'organizations', :action => 'teachers'), From d384d1e2b46c7e269b208a51be65379846c48362 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 13 May 2016 16:28:16 +0800 Subject: [PATCH 56/79] =?UTF-8?q?=E5=90=8D=E5=B8=88=E6=A6=9C=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_subfield_rightM2.html.erb | 2 +- public/stylesheets/org2.css | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/organizations/_org_subfield_rightM2.html.erb b/app/views/organizations/_org_subfield_rightM2.html.erb index 86b69ac05..aff570b8b 100644 --- a/app/views/organizations/_org_subfield_rightM2.html.erb +++ b/app/views/organizations/_org_subfield_rightM2.html.erb @@ -4,7 +4,7 @@ <% excellent_teachers.each do |teacher| %>
    - <%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sn-fl", :style => "display:block;"), user_path(teacher), :alt => "用户头像", :target => '_blank' %> + <%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sn-fl sn-avatar-circle", :style => "display:block;"), user_path(teacher), :alt => "用户头像", :target => '_blank' %>
    <%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "sn-teacher-name sn-hidden", :title => '', :target => '_blank' %> diff --git a/public/stylesheets/org2.css b/public/stylesheets/org2.css index 0ea602976..c2cf0a478 100644 --- a/public/stylesheets/org2.css +++ b/public/stylesheets/org2.css @@ -241,8 +241,8 @@ ul.sn-inner-pages li a:hover{ background-color:#24366e; color:#fff; text-decorat /*名师榜*/ .sn-teacher-list {margin:0 20px; padding:15px 0; border-bottom:1px solid #e9e9e9;} -a.sn-teacher-name {width:75px; font-size:18px; color:#777; float:left;} -.sn-teacher-unit {width:154px; font-size:14px; color:#999; float:left; margin-left:15px; margin-top:3px;} +a.sn-teacher-name {width:60px; font-size:18px; color:#777; float:left;} +.sn-teacher-unit {width:169px; font-size:14px; color:#999; float:left; margin-left:15px; margin-top:3px;} .sn-teacher-info {height:30px; line-height:30px; vertical-align:middle; float:left; margin-left:15px;} .sn-teacher-social {height:30px; line-height:30px; vertical-align:middle; float:left; color:#999; font-size:12px; margin-left:15px;} .sn-border-none {border:none;} @@ -250,6 +250,7 @@ a.sn-teacher-name {width:75px; font-size:18px; color:#777; float:left;} .sn-teacher-avatar2 {margin:0 18px; padding:18px 0;} .sn-teacher-info2 {color:#666; text-align:center; font-size:16px;} .sn-info2-hidden {width:153px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:0 auto;} +.sn-avatar-circle {border-radius:50%;} /*弹框*/ .upload_con h2 { From 39d014355b026d6b3adb317f329833987b331f53 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 16:30:45 +0800 Subject: [PATCH 57/79] =?UTF-8?q?=E7=A7=91=E5=A4=A7=E5=90=8D=E5=B8=88?= =?UTF-8?q?=EF=BC=8C=E5=92=8C=E5=90=8D=E5=B8=88=E5=88=97=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 1 + .../organizations/_org_left_subfield_list.html.erb | 2 +- app/views/organizations/teachers.html.erb | 10 ++++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index b48488fb8..c94f734e1 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -164,6 +164,7 @@ class OrganizationsController < ApplicationController return end q = params[:search].nil? ? "" : "#{params[:search].strip}" + @field = OrgSubfield.find(params[:org_subfield_id]) @type = params[:type] if @type == "courses" || @type.nil? @org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 3fe57d223..4340213a4 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -102,7 +102,7 @@ <% end %> <% else %> <% if field.field_type == "Comptec" %> - <%= link_to "#{field.name}", teachers_organization_path(organization), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> + <%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> <% else %> <%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %> <% end %> diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb index 4b50a2a81..6e06124a4 100644 --- a/app/views/organizations/teachers.html.erb +++ b/app/views/organizations/teachers.html.erb @@ -1,5 +1,11 @@
    -
    名师榜
    +
    + <% if @type == "famous" %> + 名师列表 + <% else %> + <%= @field.name %> + <% end %> +
    From 6ccb79a210cfc47c752070259db5350aab225c86 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 13 May 2016 16:47:56 +0800 Subject: [PATCH 58/79] =?UTF-8?q?=E6=95=99=E5=B8=88=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/teachers.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/teachers.html.erb b/app/views/organizations/teachers.html.erb index 6e06124a4..c368adef7 100644 --- a/app/views/organizations/teachers.html.erb +++ b/app/views/organizations/teachers.html.erb @@ -24,7 +24,7 @@
    - <%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey" %> + <%= link_to "名师列表", teachers_organization_path(@organization, :type => "famous", :org_subfield_id => @field.id), :class => "fontGrey2" %>
    From bc39b68bb2180b5e55296611627b206c39e99c9f Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 13 May 2016 16:50:41 +0800 Subject: [PATCH 59/79] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E6=B5=8B=E9=AA=8C?= =?UTF-8?q?=E9=A2=98=E7=9B=AE=E3=80=81=E9=97=AE=E5=8D=B7=E9=A2=98=E7=9B=AE?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=A4=9A=E6=AC=A1=E6=8F=90=E4=BA=A4=E8=A1=A8?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/_exercise_form.html.erb | 9 ++++ app/views/exercise/_new_MC.html.erb | 11 +++- app/views/exercise/_new_MCQ.html.erb | 11 +++- app/views/exercise/_new_single.html.erb | 11 +++- app/views/exercise/_show_MC.html.erb | 5 +- app/views/exercise/_show_MCQ.html.erb | 5 +- app/views/exercise/_show_single.html.erb | 5 +- app/views/poll/_new_MC.html.erb | 13 +++-- app/views/poll/_new_MCQ.html.erb | 13 +++-- app/views/poll/_new_mulit.html.erb | 13 +++-- app/views/poll/_new_single.html.erb | 13 +++-- app/views/poll/_poll_form.html.erb | 60 +++++++++++++++++----- app/views/poll/create_poll_question.js.erb | 2 +- 13 files changed, 135 insertions(+), 36 deletions(-) diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb index ec099cb09..f8fe7896c 100644 --- a/app/views/exercise/_exercise_form.html.erb +++ b/app/views/exercise/_exercise_form.html.erb @@ -87,10 +87,19 @@ var standard_ans = $.trim($("#question_standard_ans").val()); if(title.length == 0 || score.length == 0){ alert("题目标题/分数不能为空"); + doc.one('click', function(){ + add_poll_question($(this),quest_type); + }); }else if(!/^[1-9][0-9]*$/.test(score)) { alert("分数必须是非零开头的数字"); + doc.one('click', function(){ + add_poll_question($(this),quest_type); + }); }else if(quest_type !=3 && standard_ans.length == 0) { alert("标准答案不能为空"); + doc.one('click', function(){ + add_poll_question($(this),quest_type); + }); }else{ doc.parent().parent().parent().submit();} } diff --git a/app/views/exercise/_new_MC.html.erb b/app/views/exercise/_new_MC.html.erb index 6fd6c201e..43628f104 100644 --- a/app/views/exercise/_new_MC.html.erb +++ b/app/views/exercise/_new_MC.html.erb @@ -54,9 +54,16 @@
    -<% end %> \ No newline at end of file +<% end %> + \ No newline at end of file diff --git a/app/views/exercise/_new_MCQ.html.erb b/app/views/exercise/_new_MCQ.html.erb index a24835fc1..875b9ec4c 100644 --- a/app/views/exercise/_new_MCQ.html.erb +++ b/app/views/exercise/_new_MCQ.html.erb @@ -54,9 +54,16 @@
    -<% end %> \ No newline at end of file +<% end %> + \ No newline at end of file diff --git a/app/views/exercise/_new_single.html.erb b/app/views/exercise/_new_single.html.erb index 6180dac8e..24a0ad047 100644 --- a/app/views/exercise/_new_single.html.erb +++ b/app/views/exercise/_new_single.html.erb @@ -42,9 +42,16 @@
    -<% end %> \ No newline at end of file +<% end %> + \ No newline at end of file diff --git a/app/views/exercise/_show_MC.html.erb b/app/views/exercise/_show_MC.html.erb index eef7546e5..99c48a3ab 100644 --- a/app/views/exercise/_show_MC.html.erb +++ b/app/views/exercise/_show_MC.html.erb @@ -90,7 +90,7 @@ ''+ '
    '+ ''+ ''+ ' -<% end%> \ No newline at end of file +<% end%> + \ No newline at end of file diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb index 43b41f95d..0fbb588c5 100644 --- a/app/views/poll/_new_MCQ.html.erb +++ b/app/views/poll/_new_MCQ.html.erb @@ -3,7 +3,7 @@
    - +
    @@ -33,7 +33,7 @@
    -<% end%> \ No newline at end of file +<% end%> + \ No newline at end of file diff --git a/app/views/poll/_new_mulit.html.erb b/app/views/poll/_new_mulit.html.erb index 8a2205760..d25d34542 100644 --- a/app/views/poll/_new_mulit.html.erb +++ b/app/views/poll/_new_mulit.html.erb @@ -3,7 +3,7 @@
    - +
    @@ -13,7 +13,7 @@
    -<% end%> \ No newline at end of file +<% end%> + \ No newline at end of file diff --git a/app/views/poll/_new_single.html.erb b/app/views/poll/_new_single.html.erb index 7588bf3b4..fe8e7b604 100644 --- a/app/views/poll/_new_single.html.erb +++ b/app/views/poll/_new_single.html.erb @@ -3,12 +3,12 @@
    - +
    -<% end%> \ No newline at end of file +<% end%> + \ No newline at end of file diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index e08b13033..73c783794 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -51,8 +51,8 @@ function chooseQuestionType(quest_type,quest_id){ } function add_MC(){ - $("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>"); - $("#poll_questions_title").focus(); + $("#new_poll_question_new").html("<%= escape_javascript(render :partial => 'new_MC') %>"); + $("#poll_questions_title_new").focus(); } function insert_MC(quest_type,quest_num,quest_id){ @@ -94,7 +94,7 @@ function add_MC(){ ''+ ''+ ''+ ''+ '
    发布者: {{discussion.user.realname}}