diff --git a/app/api/mobile/api.rb b/app/api/mobile/api.rb index c631d56f..6e9daea1 100644 --- a/app/api/mobile/api.rb +++ b/app/api/mobile/api.rb @@ -140,7 +140,6 @@ module Mobile # Rails.logger.info("########### host is #{request.host}") if (Rails.env.development? && session[:user_id].blank?) || - (session[:user_id].blank? && request.host.include?("testbdweb")) || params[:action] == "privateGit" session[:user_id] = 12 #116 end diff --git a/app/controllers/ecs_controller.rb b/app/controllers/ecs_controller.rb index 5d391a5d..f31bea88 100644 --- a/app/controllers/ecs_controller.rb +++ b/app/controllers/ecs_controller.rb @@ -1,5 +1,5 @@ class EcsController < ApplicationController - before_filter :require_login + before_filter :require_login, :except => [:get_navigation_url] before_filter :find_school, :except => [:get_navigation_url] before_filter :school_manager, :except => [:department, :get_navigation_url] layout 'base_ec' diff --git a/app/services/discusses_service.rb b/app/services/discusses_service.rb index a43ccfa8..9c242554 100644 --- a/app/services/discusses_service.rb +++ b/app/services/discusses_service.rb @@ -30,14 +30,15 @@ class DiscussesService memo_count = memos.count memos = memos.offset(offset).limit(15) #实训标签使用最多的9个 - hot_tags = TagRepertoire.find_by_sql("select a.name, sum(a.cnt) cnt, a.id from - (select tr.id, tr.name, count(d.dis_id) cnt, d.root_id, s.status, s.hidden - from tag_repertoires tr join (shixun_tag_repertoires str - left join (shixuns s join discusses d on d.dis_id = s.id and d.root_id is null and s.status =2 and s.hidden=false) - on s.id = str.shixun_id) on tr.id = str.tag_repertoire_id - group by d.dis_id order by cnt desc) a group by a.name - order by cnt desc limit 9").map{|ht| ht.attributes.dup} - + # hot_tags = TagRepertoire.find_by_sql("select a.name, sum(a.cnt) cnt, a.id from + # (select tr.id, tr.name, count(d.dis_id) cnt, d.root_id, s.status, s.hidden + # from tag_repertoires tr join (shixun_tag_repertoires str + # left join (shixuns s join discusses d on d.dis_id = s.id and d.root_id is null and s.status =2 and s.hidden=false) + # on s.id = str.shixun_id) on tr.id = str.tag_repertoire_id + # group by d.dis_id order by cnt desc) a group by a.name + # order by cnt desc limit 9").map{|ht| ht.attributes.dup} + tag_id = ShixunTagRepertoire.joins(:shixun).order("myshixuns_count desc").pluck(:tag_repertoire_id).uniq.first(9) + hot_tags = TagRepertoire.select([:id, :name]).where(:id => tag_id).order("FIELD(id, #{tag_id.join(",")})").map{|ht| ht.attributes.dup} if tag_id memos = memo_list memos user_info = format_for_current_user current_user hot_memos = Memo.field_for_recommend.posts.hot.limit(4) diff --git a/app/views/competitions/competitionsName.html.erb.html b/app/views/competitions/competitionsName.html.erb.html new file mode 100644 index 00000000..0ae6e2e6 --- /dev/null +++ b/app/views/competitions/competitionsName.html.erb.html @@ -0,0 +1,34 @@ + +
+
+ +
+
+ + diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index 6628a3ea..c67a8b57 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -76,7 +76,7 @@ -

请上传封面

+
@@ -168,12 +168,13 @@ $("#author_school_name_notice").addClass("none"); } var coverId = $("input[name='library[cover_id]']").val(); - if ((!coverId || coverId.length == 0) && (!cover_file || cover_file.length == 0)) { - $("#cover_file_notice").removeClass("none"); - return - }else{ - $("#cover_file_notice").addClass("none"); - } + + // if ((!coverId || coverId.length == 0) && (!cover_file || cover_file.length == 0)) { + // $("#cover_file_notice").removeClass("none"); + // return + // }else{ + // $("#cover_file_notice").addClass("none"); + // } if($('.attachments_fields .attachment').length == 0){ $("#file_notice").removeClass("none"); diff --git a/public/images/educoder/applys.png b/public/images/educoder/applys.png new file mode 100755 index 00000000..3f4e3018 Binary files /dev/null and b/public/images/educoder/applys.png differ diff --git a/public/images/educoder/competitionslog.png b/public/images/educoder/competitionslog.png new file mode 100755 index 00000000..97ce6c77 Binary files /dev/null and b/public/images/educoder/competitionslog.png differ diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index 81ce5b90..0df8d6e8 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -1234,10 +1234,15 @@ html>body #ajax-indicator { position: fixed; } } -.edu-menu-lists currentName{ +.edu-menu-lists .currentName{ text-align: left; } .edu-menu-lists li{ text-align: left; +} + +.login_regs{ + margin-right: 35%; + width: 558px; } \ No newline at end of file