dev_aliyun
杨树明 5 years ago
commit bb84bb1080

@ -129,7 +129,8 @@ class Myshixun < ActiveRecord::Base
if current_game.blank?
current_game = Game.find_by_sql("SELECT g.* FROM games g, challenges c where g.myshixun_id=#{self.id} and g.challenge_id = c.id and g.status = 2 order by c.position desc").first
end
return current_game
return current_game.blank? ? games.first : current_game
#
# if self.status == 1
# current_game = Game.find_by_sql("SELECT g.* FROM games g, challenges c where g.myshixun_id=#{self.id} and g.challenge_id = c.id and g.status = 2 order by c.position desc").first

@ -9,12 +9,12 @@
<% if @is_teacher && @is_teacher == 1 %>
<li class="clearfix mb10 none">
<label class="panel-form-label fl">项目邀请码:</label>
<input type="text" style="width: 285px;" class="input-60-40 fl" name="invite_code" value="<%=@project.invite_code %>" placeholder="请输入六位项目邀请码">
<input type="text" style="width: 285px;" class="input-60-40 fl" name="invite_code" value="<%=@project.invite_code %>" placeholder="请输入六位项目邀请码" maxlength="6">
</li>
<% else %>
<li class="clearfix mb10">
<label class="panel-form-label fl">项目邀请码:</label>
<input type="text" style="width: 285px;" class="input-60-40 fl" name="invite_code" placeholder="请输入六位项目邀请码">
<input type="text" style="width: 285px;" class="input-60-40 fl" name="invite_code" placeholder="请输入六位项目邀请码" maxlength="6">
<div class="cl"></div>
</li>
<% end %>

@ -53,71 +53,71 @@
</div>
</div>
</div>
<div class="fr edu-menu-panel" style="height:60px;">
<%= link_to (image_tag(url_to_avatar(User.current), :width =>"34", :height => "34", :class => "radius mt13", :nhname => "avatar_image", :alt=>"头像", :id => "nh_user_logo")), user_path(User.current),:class => "fl" %>
<ul class="edu-menu-list" style="top:60px;">
<span class="bor-bottom-greyE currentName task-hide"><%= User.current.show_name %></span>
<li><%= link_to '我的课堂', user_path(User.current) %></li>
<li><%= link_to '我的实训', user_path(User.current, :type => 'a_shixun') %></li>
<li><%= link_to '我的实践课程', user_path(User.current, :type => 'a_path') %></li>
<% if User.current.partner.present? %>
<li><%= link_to '客户管理', partner_list_cooperate_path(User.current.partner) %></li>
<% end %>
<li><%= link_to '我的项目', user_path(User.current, :type => 'a_project') %></li>
<li><%= link_to '我的众包', user_path(User.current, :type => 'a_package') %></li>
</div>
<% if User.current.department_members.count > 0 %>
<li><%= link_to '学院统计', statistics_college_path(User.current.department_members.first.try(:department)) %></li>
<% end %>
<li><%= link_to '账号管理', my_account_path %></li>
<li class="bor-top-greyE"><%= link_to '退出', signout_path %></li>
</ul>
</div>
<div class="fr head-right mr10">
<a href="javascript:void(0)" id="search-open" class="fl headIcon pointer">
<i class="iconfont icon-sousuo color-white"></i>
</a>
<div class="fl edu-menu-panel headIcon">
<i class="iconfont icon-tianjiafangda color-white"></i>
<div class="edu-menu-list" style="top:60px;width: 240px;">
<div class="overPart"></div>
<ul class="fl with50 edu-txt-center pr ul-leftline">
<% unless User.current.identity == "学生" %>
<li><%= link_to '新建课堂', new_course_path() %></li>
<% end %>
<li><%= link_to '新建实训', new_shixun_path() %></li>
<li><%= link_to '新建实践课程', new_subject_path() %></li>
<li><%= link_to '新建项目', new_project_path() %></li>
</ul>
<ul class="fl with50 edu-txt-center">
<li>
<% if User.current.profile_completed? %>
<%= link_to "加入课堂", join_private_courses_path, :remote => true %>
<% else %>
<%= link_to "加入课堂", 'javascript:void(0)', onclick: 'showUserProfileModal()' %>
<% end %>
</li>
<!-- <li><%#= link_to "加入项目", applied_join_project_path, :remote => true %></li>-->
</ul>
</div>
<div class="fr edu-menu-panel" style="height:60px;">
<%= link_to (image_tag(url_to_avatar(User.current), :width =>"34", :height => "34", :class => "radius mt13", :nhname => "avatar_image", :alt=>"头像", :id => "nh_user_logo")), user_path(User.current),:class => "fl" %>
<ul class="edu-menu-list" style="top:60px;">
<span class="bor-bottom-greyE currentName task-hide"><%= User.current.show_name %></span>
<li><%= link_to '我的课堂', user_path(User.current) %></li>
<li><%= link_to '我的实训', user_path(User.current, :type => 'a_shixun') %></li>
<li><%= link_to '我的实践课程', user_path(User.current, :type => 'a_path') %></li>
<% if User.current.partner.present? %>
<li><%= link_to '客户管理', partner_list_cooperate_path(User.current.partner) %></li>
<% end %>
<li><%= link_to '我的项目', user_path(User.current, :type => 'a_project') %></li>
<li><%= link_to '我的众包', user_path(User.current, :type => 'a_package') %></li>
<% if User.current.department_members.count > 0 %>
<li><%= link_to '学院统计', statistics_college_path(User.current.department_members.first.try(:department)) %></li>
<% end %>
<li><%= link_to '账号管理', my_account_path %></li>
<li class="bor-top-greyE"><%= link_to '退出', signout_path %></li>
</ul>
</div>
<div class="fr head-right mr10">
<a href="javascript:void(0)" id="search-open" class="fl headIcon pointer">
<i class="iconfont icon-sousuo color-white"></i>
</a>
<div class="fl edu-menu-panel headIcon">
<i class="iconfont icon-tianjiafangda color-white"></i>
<div class="edu-menu-list" style="top:60px;width: 240px;">
<div class="overPart"></div>
<ul class="fl with50 edu-txt-center pr ul-leftline">
<% unless User.current.identity == "学生" %>
<li><%= link_to '新建课堂', new_course_path() %></li>
<% end %>
<li><%= link_to '新建实训', new_shixun_path() %></li>
<li><%= link_to '新建实践课程', new_subject_path() %></li>
<li><%= link_to '新建项目', new_project_path() %></li>
</ul>
<ul class="fl with50 edu-txt-center">
<% if User.current.profile_completed? %>
<li><%= link_to "加入课堂", join_private_courses_path, :remote => true %></li>
<li><%= link_to "加入项目", applied_join_project_path, :remote => true %></li>
<% else %>
<li><%= link_to "加入课堂", 'javascript:void(0)', onclick: 'showUserProfileModal()' %></li>
<li><%= link_to "加入项目", 'javascript:void(0)', onclick: 'showUserProfileModal()' %></li>
<% end %>
</ul>
</div>
</div>
<div class="fl edu-menu-panel headIcon">
<a href="<%= user_tidings_user_path(User.current) %>">
<i class="iconfont icon-xiaoxilingdang color-white"></i>
</a>
<!--新消息提醒-->
<% new_tidings_count = User.current.tidings.where("created_at > '#{User.current.onclick_time.onclick_time}'").count %>
<% new_pri_message_count = User.current.private_messages.where("created_at > '#{User.current.onclick_time.onclick_time}'").count %>
<% count = new_tidings_count + new_pri_message_count %>
<% if count > 0 %>
<a href="<%= user_tidings_user_path(User.current) %>"><span class="newslight"><%= count > 99 ? "99+" : count %></span> </a>
<div class="edu-menu-list edu-txt-center" style="width:220px;top:60px">
<a class="font-14 padding10" style="line-height: 35px;" href="<%= user_tidings_user_path(User.current) %>">您有<span class="color-orange"><%= count %></span>条新消息,点击查看</a>
</div>
<% end %>
</div>
<div class="fl edu-menu-panel headIcon">
<a href="<%= user_tidings_user_path(User.current) %>">
<i class="iconfont icon-xiaoxilingdang color-white"></i>
</a>
<!--新消息提醒-->
<% new_tidings_count = User.current.tidings.where("created_at > '#{User.current.onclick_time.onclick_time}'").count %>
<% new_pri_message_count = User.current.private_messages.where("created_at > '#{User.current.onclick_time.onclick_time}'").count %>
<% count = new_tidings_count + new_pri_message_count %>
<% if count > 0 %>
<a href="<%= user_tidings_user_path(User.current) %>"><span class="newslight"><%= count > 99 ? "99+" : count %></span> </a>
<div class="edu-menu-list edu-txt-center" style="width:220px;top:60px">
<a class="font-14 padding10" style="line-height: 35px;" href="<%= user_tidings_user_path(User.current) %>">您有<span class="color-orange"><%= count %></span>条新消息,点击查看</a>
</div>
<% end %>
</div>
</div>

@ -52,7 +52,9 @@
</div>
</div>
</div>
</div>
<div>
<span class="font-15 fr mt15">
<a href="/login" class="mr5 color-white">登录</a>
<em class="vertical-line"></em>
@ -75,7 +77,7 @@
</ul>
<ul class="fl with50 edu-txt-center">
<li><%= link_to "加入课堂", signin_path %></li>
<!-- <li><%#= link_to "加入项目", applied_join_project_path, :remote => true %></li>-->
<li><%= link_to "加入项目", signin_path %></li>
</ul>
</div>
</div>

@ -351,10 +351,21 @@ class NewHeader extends Component {
</div>
</div>
</Modal>
<a href="/" className={" fl ml25 mr30"}>
<a href="/" className={" fl ml25 mr25"}>
{ImageUrlType===true?<img alt="高校智能化教学与实训平台" className="fl" src={getImageUrl(ImageUrl)} style={{height:'60px'}} />:<img alt="高校智能化教学与实训平台" className="logoimg" src={getImageUrl(ImageUrl)}/>}
</a>
<div className="educontent">
<style>
{
`
.educontents{
margin: 0px auto;
box-sizing: border-box;
}
`
}
</style>
<div className="educontents fl">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<div className="head-nav pr">
@ -477,7 +488,7 @@ class NewHeader extends Component {
`
}
</style>
<div style={{display:isLogin===false?'block':'none'}} className={"fr mtf4 mr25"} >
<div style={{display:isLogin===false?'block':'none'}} className={"fr mt15 mr25"} >
<span className="font-15 fr" >
<a href="/login" className="mr5 color-white">登录</a>
<em className="vertical-line"></em>
@ -486,7 +497,7 @@ class NewHeader extends Component {
</div>
<div className="fr head-right mr10 mtf20" >
<div className="fr head-right mr10" >
<a href="javascript:void(0)" id="search-open" className="fl mr30 headIcon">
{/*"/images/educoder/icon/search.svg"
<img src={getImageUrl(`images/educoder/icon/search.svg`)} /> */}
@ -515,9 +526,9 @@ class NewHeader extends Component {
}
</li>
<li>
{/* <li>
<a href="/applied_project/applied_join" data-remote="true">加入项目</a>
</li>
</li> */}
</ul>
</div>
</div>

@ -6,7 +6,7 @@
float: left;
width: 97px;
}
.head-nav{float: left;width: 820px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;}
.head-nav{float: left;width: 810px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;}
.head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;}
.head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px}
.head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff}

Loading…
Cancel
Save