nitdoc: fix concerns list display
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 8 May 2014 05:00:28 +0000 (01:00 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 8 May 2014 05:00:28 +0000 (01:00 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

share/nitdoc/css/main.css
src/doc_template.nit
src/nitdoc.nit

index 1d9ddcf..4659036 100644 (file)
@@ -374,14 +374,14 @@ article .info .code {
 }\r
 \r
 .content section.concerns li {\r
-    margin-top: 20px;\r
+    margin-top: 10px;\r
 }\r
 \r
 .content section.concerns ul ul {\r
     padding-left: 20px;\r
 }\r
 \r
-.content section.concerns li li {\r
+.content section.concerns ul ul li {\r
     margin-top: 0;\r
 }\r
 \r
index 3424bef..11eec41 100644 (file)
@@ -643,6 +643,7 @@ class TplConcernList
        var elts = new Array[TplConcernElt]
 
        redef fun rendering do
+               if elts.is_empty then return
                add "<ul>"
                for elt in elts do
                        add elt
index 799c59c..3f98c30 100644 (file)
@@ -984,22 +984,23 @@ class NitdocClass
                        var stpl = new TplConcernList
                        for mmodule in mmodules do
                                # concerns list
-                               var mctpl = new TplConcernListElt
-                               mctpl.anchor = "#{mmodule.nitdoc_anchor}"
-                               mctpl.name = mmodule.nitdoc_name
-                               if mmodule.mdoc != null then
-                                       mctpl.comment = mmodule.mdoc.short_comment
+                               if mmodule != owner then
+                                       var mctpl = new TplConcernListElt
+                                       mctpl.anchor = "#{mmodule.nitdoc_anchor}"
+                                       mctpl.name = mmodule.nitdoc_name
+                                       if mmodule.mdoc != null then
+                                               mctpl.comment = mmodule.mdoc.short_comment
+                                       end
+                                       stpl.elts.add mctpl
+                                       # concern section
+                                       var cctpl = new TplConcern
+                                       cctpl.anchor = mmodule.nitdoc_anchor
+                                       cctpl.concern = mmodule.tpl_link
+                                       if mmodule.mdoc != null then
+                                               cctpl.comment = mmodule.mdoc.short_comment
+                                       end
+                                       mtpl.add cctpl
                                end
-                               stpl.elts.add mctpl
-                               # concern sectionm
-                               var cctpl = new TplConcern
-                               cctpl.anchor = mmodule.nitdoc_anchor
-                               cctpl.concern = mmodule.tpl_link
-                               if mmodule.mdoc != null then
-                                       cctpl.comment = mmodule.mdoc.short_comment
-                               end
-                               mtpl.add cctpl
-
                                var mprops = module_map[mmodule].to_a
                                prop_sorter.sort mprops
                                for mprop in mprops do mtpl.add tpl_mpropdef_article(mprop)