parent
34acb1aa2f
commit
c612104fab
@ -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="发布问题 ,请先输入标题"></div>
|
||||||
|
<div class="full-width-wrap mt15"><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="发布通知,请先输入标题"></div>
|
||||||
|
<div class="full-width-wrap mt15"><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="发布帖子,请先输入帖子标题"></div>
|
||||||
|
<div class="full-width-wrap mt15"><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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}] );
|
Loading…
Reference in new issue