Examples of DBTopic


Examples of com.appspot.gaeforum309.db.DBTopic

    });
    addSection(DBTopic.tagName, new Template.ITemplateSection() {

      @Override
      public void head(StringBuilder response, Path path, IPathable object) {
        DBTopic topic = (DBTopic) object;
        // Affichage des pages
        /*
        response.append("<div " +
            "id=\"brd-pagepost-top\" class=\"main-pagepost gen-content\">"+
            "<p class=\"paging\"><span class=\"pages\">Pages</span> <strong class=\"first-item\">1</strong> <a href=\"http://punbb.informer.com/forums/forum/48/news/page/2/\">2</a> <a href=\"http://punbb.informer.com/forums/forum/48/news/page/3/\">3</a> <a href=\"http://punbb.informer.com/forums/forum/48/news/page/4/\">4</a> <a href=\"http://punbb.informer.com/forums/forum/48/news/page/2/\">Next</a></p>"+
            "<p class=\"posting\">You must <a href=\"http://punbb.informer.com/forums/login/\">login</a> or <a href=\"http://punbb.informer.com/forums/register/\">register</a> to post a new topic</p>"+
            "</div>"
            );
            */
       
       
        // TODO: Remplacer getChilds().size() par mieux
        // TODO: Paging doit influer les valeurs affichées
        response.append("<div class=\"main-head\">"+
            "<p class=\"options\"><span class=\"feed first-item\"><a class=\"feed\" href=\"/\">RSS forum feed</a></span></p>"+
            "<h2 class=\"hn\"><span><span class=\"item-info\">Topics: 1 to "+ topic.getChilds().size() +" of "+ topic.getChilds().size() +"</span></span></h2>"+
            "</div>");
       
        response.append("<div class=\"main-subhead\">" +
            "<p class=\"item-summary forum-views\"><span><strong class=\"subject-title\">Topics</strong> in this forum with details of <strong class=\"info-replies\">replies</strong>, <strong class=\"info-views\">views</strong>, <strong class=\"info-lastpost\">last post</strong>.</span></p>" +
            "</div>");
       
        response.append("<div id=\"forum48\" class=\"main-content main-forum forum-views\">");
      }

      @Override
      public void foot(StringBuilder response, Path path, IPathable object) {
        response.append("</div>");
       
        if(Action.actionAuthorized(object, Action.ActionType.createChild))
        {
          Action action = Action.buildAction(object, Action.ActionType.createChild);
         
          TemplatePunBB.writeActionAsForm(action, response);
        }
      }

      // TODO: Add a method on IPathable to count childs objects instead of getChilds().size()
      @Override
      public void body(StringBuilder response, Path path, IPathable object) {
        DBTopic topic = (DBTopic)object;
       
        response.append("<div id=\"forum48\" class=\"main-item odd main-first-item\">" +
            "<span class=\"icon \"><!-- --></span>" +
            "<div class=\"item-subject\">" +
            "<h3 class=\"hn\"><a href=\""+ ForumPages.Page.getUrl(topic) +"\"><span>"+ topic.getTitle() +"</span></a></h3>" +
            "<p>"+topic.getDescription()+"</p>" +
            "</div>" +
            "<ul class=\"item-info\">" +
            "<li class=\"info-topics\"><strong>"+ topic.getChilds().size() +"</strong> <span class=\"label\">topics</span></li>"+
            "<li class=\"info-posts\"><strong>X</strong> <span class=\"label\">posts</span></li>" +
            "<li class=\"info-lastpost\"><span class=\"label\">Last post:</span> <strong><a href=\"http://punbb.informer.com/forums/post/145563/#p145563\">2012-06-28 07:06</a></strong> <cite>by CReatiVe4w3</cite></li>" +
            "</ul>" +
            "</div>");
      }
View Full Code Here

Examples of com.appspot.gaeforum309.db.DBTopic

   
    addSection(DBTopic.tagName, new Template.ITemplateSection() {
     
      @Override
      public void head(StringBuilder response, Path path, IPathable object) {
        DBTopic topic = (DBTopic)object;
       
        response.append("<H2><a href='"+ ForumPages.Page.getUrl(topic)+"'>" + topic.getTitle() + "</a></H2>");
        response.append("<table border='1' width='100%'><tr><th width='10px'></th><th>Subject</th><th>Author</th><th>Last message</th></th>");
      }
     
      @Override
      public void foot(StringBuilder response, Path path, IPathable object) {
        DBTopic topic = (DBTopic)object;
       
        response.append("<H2><a href='"+ForumPages.Page.getUrl(topic)+"'>" + topic.getTitle() + "</a></H2>");
        response.append("</table>");
      }
     
      @Override
      public void body(StringBuilder response, Path path, IPathable object) {
        DBTopic topic = (DBTopic)object;
       
        response.append("<tr><td>X</td><td><b><a href='"+ ForumPages.Page.getUrl(topic) +"'>"+topic.getTitle()+"</a>:</b> "+topic.getDescription()+"</b></td></tr>");
      }
    });
   
    addSection(DBConversation.tagName, new Template.ITemplateSection() {
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.