Merge commit 'b6f76562e2c6999af16502d802bd523a8484e167' into ng_turn
This commit is contained in:
+7
-5
@@ -48,7 +48,8 @@ function submitArticle(){
|
||||
|
||||
function submitComment(){
|
||||
var $this = $(this);
|
||||
var $article = $this.parents('.article').eq(0);
|
||||
|
||||
var $article = $this.closest('.articleObj').eq(0);
|
||||
var articleNo = $article.data('no');
|
||||
var $text = $article.find('input.commentText');
|
||||
var text = $.trim($text.val());
|
||||
@@ -96,8 +97,8 @@ function drawArticle(idx, articleObj){
|
||||
.data('no', articleObj.no)
|
||||
.data('author', articleObj.general_no);
|
||||
|
||||
console.log(articleObj);
|
||||
|
||||
|
||||
$article.find('.articleNo').text(articleObj.no);
|
||||
$article.find('.authorName').text(articleObj.author);
|
||||
$article.find('.articleTitle').text(articleObj.title);
|
||||
$article.find('.date').text(articleObj.date);
|
||||
@@ -107,7 +108,7 @@ function drawArticle(idx, articleObj){
|
||||
|
||||
var $articleComment = $article.find('ul.commentList');
|
||||
|
||||
$.each(articleObj.comment, function(commentObj){
|
||||
$.each(articleObj.comment, function(_, commentObj){
|
||||
var $comment = $commentFrame.clone();
|
||||
$comment.find('.author').text(commentObj.author);
|
||||
//$comment.find('.text').text(commentObj.text);
|
||||
@@ -116,6 +117,8 @@ function drawArticle(idx, articleObj){
|
||||
$articleComment.append($comment);
|
||||
});
|
||||
|
||||
$article.find('.submitComment').click(submitComment);
|
||||
|
||||
var $board = $('#board');
|
||||
|
||||
$board.append($article);
|
||||
@@ -150,7 +153,6 @@ function loadArticles(){
|
||||
$(function(){
|
||||
|
||||
$('#submitArticle').click(submitArticle);
|
||||
$('.submitComment').click(submitComment);
|
||||
|
||||
loadArticles()
|
||||
.then(drawArticles, errUnknown)
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
function changePermission(isAmbassador, rawGeneralList){
|
||||
console.log(isAmbassador);
|
||||
console.log(rawGeneralList);
|
||||
|
||||
var generalList = [];
|
||||
$.each(rawGeneralList, function(idx, value){
|
||||
generalList.push(parseInt(value.id));
|
||||
})
|
||||
|
||||
$.post({
|
||||
url:'j_general_set_permission.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
isAmbassador:isAmbassador,
|
||||
genlist:generalList
|
||||
},
|
||||
}).then(function(data){
|
||||
if(!data){
|
||||
alert('변경하지 못했습니다.');
|
||||
return false;
|
||||
}
|
||||
if(!data.result){
|
||||
alert('변경하지 못했습니다. : '+data.reason);
|
||||
return false;
|
||||
}
|
||||
alert('변경했습니다.');
|
||||
location.reload();
|
||||
}, errUnknown);
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$('#selectAmbassador').select2({
|
||||
theme: 'bootstrap4',
|
||||
placeholder: "",
|
||||
allowClear: true,
|
||||
language: "ko",
|
||||
width:300,
|
||||
maximumSelectionLength: 2,
|
||||
containerCss: {
|
||||
display: "inline-block !important;",
|
||||
color: 'white !important'
|
||||
},
|
||||
data:candidateAmbassadors,
|
||||
//containerCssClass: 'simple-select2-align-center bg-secondary text-secondary',
|
||||
dropdownCssClass: 'simple-select2-align-center bg-secondary text-secondary',
|
||||
});
|
||||
|
||||
$('#selectAuditor').select2({
|
||||
theme: 'bootstrap4',
|
||||
placeholder: "",
|
||||
allowClear: true,
|
||||
language: "ko",
|
||||
width:300,
|
||||
maximumSelectionLength: 2,
|
||||
containerCss: {
|
||||
display: "inline-block !important;",
|
||||
color: 'white !important'
|
||||
},
|
||||
data:candidateAuditors,
|
||||
//containerCssClass: 'simple-select2-align-center bg-secondary text-secondary',
|
||||
dropdownCssClass: 'simple-select2-align-center bg-secondary text-secondary',
|
||||
});
|
||||
|
||||
$('#changeAmbassador').click(function(){
|
||||
if(!confirm('외교권자를 변경할까요?')){
|
||||
return false;
|
||||
}
|
||||
|
||||
changePermission(true, $('#selectAmbassador').select2('data'));
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#changeAuditor').click(function(){
|
||||
if(!confirm('조언자를 변경할까요?')){
|
||||
return false;
|
||||
}
|
||||
|
||||
changePermission(false, $('#selectAuditor').select2('data'));
|
||||
return false;
|
||||
})
|
||||
})
|
||||
+1
-1
@@ -523,7 +523,7 @@ function activateMessageForm(){
|
||||
jQuery(function($){
|
||||
|
||||
//tmp_template.html은 추후 msg.js에 통합될 수 있음
|
||||
var getTemplate = $.get('js/templates/message.html?9',function(obj){
|
||||
var getTemplate = $.get('js/templates/message.html?10',function(obj){
|
||||
messageTemplate = obj;
|
||||
});
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<div class="msg_body">
|
||||
<div class="msg_header">
|
||||
<%if(!this.option && !this.option.action && src.id == myGeneralID && now <= last5min && invalidType == 'msg_valid'){%>
|
||||
<%if(!this.option.action && src.id == myGeneralID && now <= last5min && invalidType == 'msg_valid'){%>
|
||||
<button type="button" data-erase_until="<%last5min%>" class="btn btn btn-outline-warning btn-sm btn-delete-msg" style='float:right'>❌</button>
|
||||
<%}%>
|
||||
<%if(msgType == 'private') {%>
|
||||
|
||||
Reference in New Issue
Block a user