Conflicts: app/views/layouts/new_base_user.html.erbcxt_course
commit
3c5afb2b4f
@ -1,11 +1,11 @@
|
||||
[
|
||||
<% @users && @users.each_with_index do |person,index| %>
|
||||
<% if index == 0 %>
|
||||
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "", "searchKey": ""}
|
||||
<%= index != @users.size-1 ? ',' : '' %>
|
||||
<% else %>
|
||||
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
|
||||
<%= index != @users.size-1 ? ',' : '' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% @users && @users.each_with_index do |person,index| %>
|
||||
<% if index == 0 %>
|
||||
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
|
||||
<%= index != @users.size-1 ? ',' : '' %>
|
||||
<% else %>
|
||||
{"id":<%=index%>, "userid": "<%=person.id%>", "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
|
||||
<%= index != @users.size-1 ? ',' : '' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
]
|
||||
|
@ -0,0 +1,43 @@
|
||||
<div id="Footer" class="f12">
|
||||
<div class="footerAboutContainer">
|
||||
<ul class="footerAbout">
|
||||
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
|
||||
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank">服务协议</a>|</li>
|
||||
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
|
||||
<li class="fl"><%= link_to l(:label_surpport_group), "javascript:void(0);", :class => "f_grey mw20", :target=>"_blank" %>|</li>
|
||||
<li class="fl"><a href="javascript:void(0);" disabled="true" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<ul class="departments">
|
||||
<!--li class="fl mr10">
|
||||
<strong><%#= l(:label_hosted_organization)%></strong><a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=47" class=" ml10 f_grey" target="_blank"><%#= l(:label_hosted_by)%></a>
|
||||
</li>
|
||||
<li class="fl">
|
||||
<a href="http://www.nudt.edu.cn/ArticleShow.asp?ID=41" class="mr45 f_grey" target="_blank"><%#= l(:label_sponsor)%></a>
|
||||
</li-->
|
||||
<li class="fl mr10">
|
||||
<strong><%= l(:label_partners)%></strong>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<a href="http://eecs.pku.edu.cn" class="f_grey" target="_blank"><%#= l(:label_co_organizer_EECS)%><img src="/images/footer_logo/PekingUniversity.png" width="121" height="40" style="display: inline-block;" alt="北京大学" /></a>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<a href="http://scse.buaa.edu.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_BHU)%><img src="/images/footer_logo/BeiHang_university.png" width="173" height="40" style="display: inline-block;" alt="北京航空航天大学" /></a>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<a href="http://www.iscas.ac.cn/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_CAS)%><img src="/images/footer_logo/ISCAS_logo.png" width="91" height="40" style="display: inline-block;" alt="ISCAS" /></a>
|
||||
</li>
|
||||
<li class="fl mr20">
|
||||
<a href="http://www.inforbus.com/" class="f_grey" target="_blank"><%#= l(:label_co_organizer_InforS)%><img src="/images/footer_logo/CVICSE.png" width="165" height="40" style="display: inline-block;" alt="中创软件" /></a>
|
||||
</li>
|
||||
<li class="fl"><a href="http://www.webxmf.com/" target="_blank"><img src="/images/footer_logo/bee_logo.png" width="167" height="40" style="display: inline-block;" alt="web小蜜蜂" /></a></li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<ul class="copyright">
|
||||
<li class="fl mr30"><%= l(:label_rights_reserved)%></li>
|
||||
<li class="fl"><a href="http://www.miibeian.gov.cn/" class="fl f_grey" target="_blank"><%= l(:label_license)%></a></li>
|
||||
</ul>
|
||||
</div><!--Footer end-->
|
@ -0,0 +1,111 @@
|
||||
<div class="navHomepage">
|
||||
<div class="navHomepageLogo fl">
|
||||
<a href ="javascript:void(0);" disabled="true" class="mt3"><%= image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3")%></a>
|
||||
</div>
|
||||
<div class="fl">
|
||||
<ul>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">首页</a>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">资源库</a>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl">
|
||||
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">题库</a>
|
||||
</li>
|
||||
<li class="navHomepageMenu fl mr30">
|
||||
<a href ="javascript:void(0);" disabled="true" class="c_white f16 db p10">帮助中心</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="fl" id="navHomepageSearch">
|
||||
<!--<form class="navHomepageSearchBox">-->
|
||||
<% name = name%>
|
||||
<a href ="javascript:void(0);" disabled="true"><%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
||||
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的班级、项目、用户、资源以及帖子"/>
|
||||
<input type="hidden" name="search_type" id="type" value="all"/>
|
||||
<input type="text" style="display: none;"/>
|
||||
<a href="javascript:void(0);" class="homepageSearchIcon" disabled="true"></a>
|
||||
<% end %></a>
|
||||
</div>
|
||||
|
||||
<div class="navHomepageProfile" id="navHomepageProfile">
|
||||
<ul>
|
||||
<li class="homepageProfileMenuIcon" id="homepageProfileMenuIcon">
|
||||
<div class="mt5 mb8" id="user_avatar"></div>
|
||||
<a href ="javascript:void(0);" disabled="true"><%= image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo", :class => "portraitRadius") %></a>
|
||||
<ul class="topnav_login_list none" id="topnav_login_list">
|
||||
<li>
|
||||
<a href ="javascript:void(0);" class="menuGrey" disabled="true">修改资料</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href ="javascript:void(0);" class="menuGrey" disabled="true">我的组织</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href ="javascript:void(0);" class="menuGrey" disabled="true">新建组织</a>
|
||||
</li>
|
||||
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
||||
<li>
|
||||
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="navHomepageNews" id="user_messages">
|
||||
<a href ="javascript:void(0);" class="homepageNewsIcon" disabled="true" title = "您的所有消息" ></a>
|
||||
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var onUserMessages = false;
|
||||
var onNotice = false;
|
||||
//搜索相关
|
||||
$("#navHomepageSearch").mouseover(function(){
|
||||
$("#navHomepageSearchType").show();
|
||||
}).mouseout(function(){
|
||||
$("#navHomepageSearchType").hide();
|
||||
});
|
||||
|
||||
$("#user_messages").mouseenter(function(){
|
||||
onNotice = true;
|
||||
$("#user_messages_list").show();
|
||||
if($("#message_list_detail").length == 0){
|
||||
$.get('<%=user_messages_unviewed_users_path %>');
|
||||
$("#ajax-indicator").hide();
|
||||
}
|
||||
var obj = $("#user_messages_list");
|
||||
clearTimeout(obj.timer);
|
||||
}).mouseleave(function(){
|
||||
onNotice = false;
|
||||
var obj = $("#user_messages_list");
|
||||
setTimeout(function(){
|
||||
if(!onNotice && !onUserMessages) {
|
||||
obj.hide();
|
||||
obj.html("<%=escape_javascript(render :partial => 'layouts/message_loading') %>");
|
||||
} }, 500);
|
||||
});
|
||||
$("#message_list_detail").mouseenter(function(event){
|
||||
event.stopPropagation();
|
||||
onUserMessages = true;
|
||||
}).mouseleave(function(){
|
||||
onUserMessages = false;
|
||||
});
|
||||
|
||||
$("#navHomepageProfile").mouseenter(function(){
|
||||
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
||||
$("#topnav_login_list").show();
|
||||
});
|
||||
$("#navHomepageProfile").mouseleave(function(){
|
||||
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
||||
$("#topnav_login_list").hide();
|
||||
});
|
||||
|
||||
function signout(){
|
||||
$.post(
|
||||
'<%= signout_path%>',
|
||||
{}
|
||||
);
|
||||
}
|
||||
</script>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,14 @@
|
||||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
|
||||
<div class="blue-title">{{current_course.name}}</div>
|
||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">标题</span><input class="new-class-input ml25" ng-model="issuetitle" placeholder="发起讨论,请先输入标题(限128字符)" maxlength="128"></div>
|
||||
<div class="full-width-wrap mt15 mb50"><textarea class="full-width-textarea" ng-model="issue" placeholder="请输入您的讨论内容~"></textarea></div>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
|
||||
<a ng-click="publishIssue()" class="weixin-tab link-blue2 border-top">确定</a>
|
||||
</div>
|
||||
|
||||
<!--<div ng-show="!current_course" class="blue-title">{{tip_1}}</div>-->
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
</div>
|
@ -0,0 +1,14 @@
|
||||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
|
||||
<div class="blue-title">{{current_course.name}}</div>
|
||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">标题</span><input class="new-class-input ml25" ng-model="noticetitle" placeholder="发布通知,请先输入标题(限64字符)" maxlength="64"></div>
|
||||
<div class="full-width-wrap mt15 mb50"><textarea class="full-width-textarea" ng-model="notice" placeholder="请输入您的通知内容~"></textarea></div>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
|
||||
<a ng-click="publishNotice()" class="weixin-tab link-blue2 border-top">确定</a>
|
||||
</div>
|
||||
|
||||
<!--<div ng-show="!current_course" class="blue-title">{{tip_1}}</div>-->
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
</div>
|
@ -0,0 +1,14 @@
|
||||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
|
||||
<div class="blue-title">{{current_project.name}}</div>
|
||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">标题</span><input class="new-class-input ml25" ng-model="notetitle" placeholder="发布帖子,请先输入帖子标题(限128字符)" maxlength="128"></div>
|
||||
<div class="full-width-wrap mt15 mb50"><textarea class="full-width-textarea" ng-model="note" placeholder="请输入您的帖子内容~"></textarea></div>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
|
||||
<a ng-click="publishNote()" class="weixin-tab link-blue2 border-top">确定</a>
|
||||
</div>
|
||||
|
||||
<!--<div ng-show="!current_course" class="blue-title">{{tip_1}}</div>-->
|
||||
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>
|
||||
</div>
|
@ -0,0 +1,73 @@
|
||||
app.controller('ClassPublishIssueController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
|
||||
// common.checkLogin();
|
||||
|
||||
var vm = $scope;
|
||||
vm.current_course = rms.get('current_course');
|
||||
|
||||
vm.issuetitle = "";
|
||||
vm.issue = "";
|
||||
var course_id = $routeParams.id;
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
|
||||
if(!vm.current_course){
|
||||
$http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
if (response.data.status == 0){
|
||||
vm.current_course = response.data.data;
|
||||
console.log("courses");
|
||||
console.log(response.data.data);
|
||||
}
|
||||
else{
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
}
|
||||
if(!vm.current_course){
|
||||
vm.tip_1 = "该班级不存在或已被删除";
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
vm.cancel = function(){
|
||||
window.history.back();
|
||||
};
|
||||
|
||||
//发布问题 即项目讨论区
|
||||
vm.publishIssue = function(){
|
||||
if(vm.issuetitle.length == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '标题不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
if(vm.issue.length == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '内容不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
var text = vm.issue.replace(/\n/g,'<br/>');
|
||||
|
||||
$http.post(config.apiUrl + "courses/"+course_id+"/publishissue",
|
||||
{token: auth.token(),title: vm.issuetitle, text: text}
|
||||
).then(function(response){
|
||||
if(response.data.status == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '您已成功发布问题',function(){
|
||||
rms.save('course_activities_page',0);
|
||||
rms.save("course_activities",[]);
|
||||
rms.save("course_has_more",false);
|
||||
$location.path("/class").search({id: course_id});
|
||||
});
|
||||
}
|
||||
else{
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}] );
|
@ -0,0 +1,72 @@
|
||||
app.controller('ClassPublishNoticeController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
|
||||
// common.checkLogin();
|
||||
|
||||
var vm = $scope;
|
||||
vm.current_course = rms.get('current_course');
|
||||
|
||||
var course_id = $routeParams.id;
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
|
||||
vm.noticetitle = "";
|
||||
vm.notice = "";
|
||||
|
||||
if(!vm.current_course){
|
||||
$http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
if (response.data.status == 0){
|
||||
vm.current_course = response.data.data;
|
||||
console.log("courses");
|
||||
console.log(response.data.data);
|
||||
}
|
||||
else{
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
}
|
||||
if(!vm.current_course){
|
||||
vm.tip_1 = "该班级不存在或已被删除";
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
vm.cancel = function(){
|
||||
window.history.back();
|
||||
};
|
||||
|
||||
//发布通知 只有老师能发布
|
||||
vm.publishNotice = function(){
|
||||
if(vm.noticetitle.length == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '标题不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
if(vm.notice.length == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '内容不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
var text = vm.notice.replace(/\n/g,'<br/>');
|
||||
|
||||
$http.post(config.apiUrl + "courses/"+course_id+"/publishnotice",
|
||||
{token: auth.token(),title: vm.noticetitle, text: text}
|
||||
).then(function(response){
|
||||
if(response.data.status == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '您已成功发布通知',function(){
|
||||
rms.save('course_activities_page',0);
|
||||
rms.save("course_activities",[]);
|
||||
rms.save("course_has_more",false);
|
||||
$location.path("/class").search({id: course_id});
|
||||
});
|
||||
}
|
||||
else{
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}] );
|
@ -0,0 +1,74 @@
|
||||
app.controller('ProjectPublishNoteController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
|
||||
// common.checkLogin();
|
||||
|
||||
var vm = $scope;
|
||||
vm.current_project = rms.get('current_project');
|
||||
|
||||
var project_id = $routeParams.id;
|
||||
|
||||
vm.alertService = alertService.create();
|
||||
|
||||
vm.notetitle = "";
|
||||
vm.note = "";
|
||||
|
||||
if(!vm.current_project){
|
||||
$http.get(config.apiUrl+ 'projects/'+project_id+"?token="+auth.token()).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
if (response.data.status == 0){
|
||||
vm.current_project = response.data.data;
|
||||
console.log("projects");
|
||||
console.log(response.data.data);
|
||||
}
|
||||
else{
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
}
|
||||
|
||||
if(!vm.current_project){
|
||||
vm.tip_1 = "该项目不存在或已被删除";
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
vm.cancel = function(){
|
||||
window.history.back();
|
||||
};
|
||||
|
||||
//发布通知 只有老师能发布
|
||||
vm.publishNote = function(){
|
||||
if(vm.notetitle.length == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '标题不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
if(vm.note.length == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '内容不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
var text = vm.note.replace(/\n/g,'<br/>');
|
||||
|
||||
$http.post(config.apiUrl + "projects/"+project_id+"/publishnote",
|
||||
{token: auth.token(),title: vm.notetitle, text: text}
|
||||
).then(function(response){
|
||||
if(response.data.status == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '您已成功发布帖子',function(){
|
||||
rms.save('project_activities_page',0);
|
||||
rms.save("project_activities",[]);
|
||||
rms.save("project_has_more",false);
|
||||
rms.save('tab_num',null);
|
||||
$location.path("/project").search({id: project_id});
|
||||
});
|
||||
}
|
||||
else{
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
}] );
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue