<article ng-controller="topicCtrlr" ng-init="getTopic()">
    <section ng-show="!error" class="item border">
        <table>
            <tr>
                <th colspan="2">{{topic.topicSubject}}</th>
            </tr>
            <tr ng-show="first.show">
                <td colspan="2">                
                    <p>{{first.text}}</p>
                </td>
            </tr>
            <tr ng-repeat="post in topic.posts">
                <td ng-show="state.user.userNo != post.user.userNo">{{post.postContent}}</td>
                <td ng-show="state.user.userNo == post.user.userNo" ng-init="showEditor = false">{{post.postContent}} <span class="link right"
                        ng-click="deletePost(post.postNo)">[delete]</span> <span class="link right"
                        ng-click="showEditor = !showEditor">[edit]</span>
                    <div ng-show="showEditor">
                        <br />
                        <form name="editForm" id="editForm" ng-submit="editPost(post.postNo, edit.editContent)">
                            <textarea name="editContent" ng-model="edit.editContent" placeholder="{{post.postContent}}" required></textarea>
                            <br />
                            <input type="submit" name="editSubmit" ng-model="edit.submit" value="Edit" />
                        </form>
                    </div>
                </td>
                <td>{{post.user.userName}}<br />{{post.postDate}}</td>
            </tr>
            <tr>
                <td colspan="2" ng-show="state.user.userNo == null">{{logged.text1}} <span class="link"
                        ng-click="setLogin()">{{logged.link1}}</span> {{logged.text2}} <span class="link"
                        ng-click="setSignup()">{{logged.link2}}</span> {{logged.text3}}</td>
                <td colspan="2" ng-show="state.user.userNo != null">
                    <form name="replyForm" id="replyForm" ng-submit="makeReply(topic.topicNo)">
                        <label for="replyCotnent">Reply:</label>
                        <textarea name="replyContent" ng-model="reply.postContent" required></textarea>
                        <input type="submit" name="replySubmit" ng-model="reply.submit" value="Reply" />
                    </form>
                    <p class="status" ng-show="status.show">{{status.text}}</p>
                </td>
            </tr>
        </table>
    </section>
    <section ng-show="error" class="item border">
        <p>{{message.start}} <span class="link" ng-click="setForum()">{{message.link}}</span></p>
    </section>
</article>