src/doc: IntroRedefList use new templates
authorAlexandre Terrasa <alexandre@moz-code.org>
Mon, 23 Feb 2015 23:53:04 +0000 (00:53 +0100)
committerAlexandre Terrasa <alexandre@moz-code.org>
Sat, 25 Apr 2015 01:46:51 +0000 (21:46 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/doc/doc_phases/doc_html.nit
src/doc/html_templates/html_templates.nit

index 2b92f96..e68e6d6 100644 (file)
@@ -723,16 +723,8 @@ end
 redef class IntrosRedefsListArticle
        redef fun render(v, doc, page, parent) do
                if mentities.is_empty then return
-               var title = list_title
-               # FIXME diff hack
-               var id = "intros"
-               if title == "Redefines" then id = "redefs"
-               var article = new TplArticle.with_title("{mentity.nitdoc_id}.{id}", title)
-               var list = new TplList.with_classes(["list-unstyled", "list-labeled"])
-               for mentity in mentities do
-                       list.add_li mentity.tpl_list_item
-               end
-               article.content = list
+               var article = new TplArticle.with_title(list_title.to_lower, list_title)
+               article.content = write_to_string
                parent.add_child article
        end
 end
index 3e9421e..0152a85 100644 (file)
@@ -19,6 +19,7 @@ import html_model
 import html::bootstrap
 import doc_phases::doc_structure
 import doc_phases::doc_hierarchies
+import doc_phases::doc_intros_redefs
 
 # Renders the page as HTML.
 redef class DocPage
@@ -315,3 +316,18 @@ redef class HierarchyListArticle
                addn lst
        end
 end
+
+redef class IntrosRedefsListArticle
+       redef var html_id is lazy do return "article_intros_redefs_{mentity.nitdoc_id}"
+       redef var html_title is lazy do return list_title
+       redef fun is_hidden do return mentities.is_empty
+
+       redef fun render_body do
+               var lst = new UnorderedList
+               lst.css_classes.add "list-unstyled list-labeled"
+               for mentity in mentities do
+                       lst.add_li mentity.html_list_item
+               end
+               add lst
+       end
+end