게시판 기능만 동작

This commit is contained in:
2019-01-25 02:11:54 +09:00
parent 4f6dd046ec
commit 27c7a85a21
4 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ $text = Util::getReq('text');
increaseRefresh("회의실", 1);
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
$me = $db->queryFirstRow('SELECT no, nation, name, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
$con = checkLimit($me['con']);
if ($con >= 2) {
+1 -1
View File
@@ -62,7 +62,7 @@ foreach(
) as $comment
){
//TODO:아이콘 받아오기?
$articles[$article['no']]['comment'] = $comment;
$articles[$comment['document_no']]['comment'][] = $comment;
}
Json::die([
+7 -5
View File
@@ -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)
+2 -3
View File
@@ -77,18 +77,17 @@ var isSecretBoard = <?=($isSecretBoard?'true':'false')?>; //
<!-- 설계미스. template와 shadowdom으로 변경 -->
<div id='articleTemplate' style='display:none;'>
<div class='articleFrame'>
<div><span class='articleTitle'></span></div>
<div>#<span class='articleNo'></span> <span class='articleTitle'></span></div>
<div class='authorPlate'><span class='authorIcon'></span><span class='authorName'></span><span class='date'></span></div>
<div class='text'>
</div>
</div>
<div class='commentFrame'>
<ul class='commentList'>
</ul>
<div>
<input class='commentText' type='text' maxlength='250'></input>
<input class='commentText' type='text' maxlength='250'>
<button type='button' class='submitComment'>등록</button>
</div>
</div>