add user profile check to join course btn

dev_aliyun
p31729568 5 years ago
parent 4314222b12
commit 3275a3fff0

@ -161,7 +161,7 @@
var htmlvalue = '<div class="task-popup" style="width:480px;"><div class="task-popup-title clearfix">提示</div>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">您需要去完善您的个人资料,才能使用此功能</p></div>' +
'<div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl">取消</a>'+
'<a href="/my/account?need_profile_completed=true" class="task-btn task-btn-orange fr" target="_blank" onclick="hideModal();">立即完善</a></div></div>';
'<a href="/my/account?need_profile_completed=true" class="task-btn task-btn-orange fr" onclick="hideModal();">立即完善</a></div></div>';
pop_box_new(htmlvalue, 480, 205);
}

@ -85,7 +85,13 @@
<li><%= link_to '新建项目', new_project_path() %></li>
</ul>
<ul class="fl with50 edu-txt-center">
<li><%= link_to "加入课堂", join_private_courses_path, :remote => true %></li>
<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>
@ -154,4 +160,12 @@
<% end %>
});
function showUserProfileModal() {
var htmlvalue = '<div class="task-popup" style="width:480px;"><div class="task-popup-title clearfix">提示</div>'+
'<div class="task-popup-content"><p class="task-popup-text-center font-16">您需要去完善您的个人资料,才能使用此功能</p></div>' +
'<div class="task-popup-submit clearfix"><a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl">取消</a>'+
'<a href="/my/account?need_profile_completed=true" class="task-btn task-btn-orange fr" onclick="hideModal();">立即完善</a></div></div>';
pop_box_new(htmlvalue, 480, 205);
}
</script>
Loading…
Cancel
Save