boardDetail.ejs 2.54 KB
<!DOCTYPE html>
<html>
<head>
    <title><%=title%></title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
<body>
<div class="main">
    <a href="/boards"><h2>게시판</h2></a>
    <div class="content_box">
        <!-- content box-->
        <div class="content_detail">

            <div class="content-pic"><img src='../images/<%=content.name%>.jpg' width="340" height="340" onError="this.src='../images/noImage.jpg';"></div>
            <div class="content-title"><%=content.name%></div>
            <div class="content-info">
                <%=content.company%> / <%=content.category%>
            </div>
            <div class="content-text">
                <%=content.price%>
            </div>
            <div class="addBtngroup" style="margin-left:450px;">
                <a href="/boards">확인</a>
            </div>
        </div>
        <!-- content box end -->

        <!-- 혁신의 끝을 달리는 옆에서 달아주는 댓글 창-->
        <div class="reply">
          <div class="reply_form">
              <form id="replyAction" action="/boards/reply" method="post">
                  <div class="reply_grade">
                    <SELECT size=1 class="replyGrade" id="replyGrade" name="replyGrade">
                      <OPTION VALUE=1>1</OPTION>
                      <OPTION VALUE=2>2</OPTION>
                      <OPTION VALUE=3>3</OPTION>
                      <OPTION VALUE=4>4</OPTION>
                      <OPTION VALUE=5>5</OPTION>
                    </SELECT></div>
                  <div class="reply_comment">
                      <textarea class="replyComment" id="replyComment" name="replyComment" rows="3" cols="30"></textarea>
                  </div>
                  <input type="hidden" name="replyId" id="replyId" value="<%=content._id%>">
                  <button type="submit">댓글 작성</button>
              </form>
            </div>
            <div class="reply_list">
                <%if(content.comments.length>0){%>
                <%var commentsList = content.comments;%>
                <%for(var i=0; i<commentsList.length; i++){%>
                %>
                <div class="reply_content">
                    <div class="reply_info"><%=commentsList[i].grade%> / <%=commentsList[i].memo%></div>
                </div>
                <%}%>
                <%} else {%>
                <div class="reply_content">
                    <div class="reply_info">댓글이 없습니다</div>
                </div>
                <%}%>
           </div>

        </div>
        <!-- end -->

</div>
</body>
</html>