diff --git a/src/fr/devinsy/statoolinfos/core/Category.java b/src/fr/devinsy/statoolinfos/core/Category.java index c290a84..ec6711f 100644 --- a/src/fr/devinsy/statoolinfos/core/Category.java +++ b/src/fr/devinsy/statoolinfos/core/Category.java @@ -28,6 +28,7 @@ public class Category private String name; private String description; private StringList softwares; + private String logoPath; /** * Instantiates a new category. @@ -37,6 +38,7 @@ public class Category this.name = name; this.description = description; this.softwares = new StringList(); + this.logoPath = "categories/default.png"; } /** @@ -54,6 +56,7 @@ public class Category this.name = name; this.description = description; this.softwares = new StringList(softwares); + this.logoPath = "categories/default.png"; } public String getDescription() @@ -61,6 +64,11 @@ public class Category return this.description; } + public String getLogoPath() + { + return this.logoPath; + } + public String getName() { return this.name; @@ -115,6 +123,11 @@ public class Category this.description = description; } + public void setLogoPath(final String logoPath) + { + this.logoPath = logoPath; + } + public void setName(final String name) { this.name = name; diff --git a/src/fr/devinsy/statoolinfos/htmlize/CategoriesPage.java b/src/fr/devinsy/statoolinfos/htmlize/CategoriesPage.java index 7f6da06..85f7451 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/CategoriesPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/CategoriesPage.java @@ -59,9 +59,10 @@ public class CategoriesPage int index = 0; for (CategoryStat stat : stats) { - data.setEscapedContent("categoryListLine", index, "categoryListLineNameLink", stat.getCategory().getName()); + data.setEscapedContent("categoryListLine", index, "categoryListLineNameValue", stat.getCategory().getName()); data.setAttribute("categoryListLine", index, "categoryListLineNameLink", "href", "category-" + stat.getCategory().getTechnicalName() + ".xhtml"); data.setAttribute("categoryListLine", index, "categoryListLineNameLink", "title", stat.getCategory().getDescription()); + data.setAttribute("categoryListLine", index, "categoryListLineNameLogo", "src", stat.getCategory().getLogoPath()); data.setEscapedContent("categoryListLine", index, "categoryListLineSoftwares", stat.getCategory().getSoftwares().sort().toStringWithFrenchCommas()); data.setContent("categoryListLine", index, "categoryListLineOrganizationCount", stat.getOrganizationCount()); diff --git a/src/fr/devinsy/statoolinfos/htmlize/CategoryPage.java b/src/fr/devinsy/statoolinfos/htmlize/CategoryPage.java index beb274d..ed363d5 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/CategoryPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/CategoryPage.java @@ -56,8 +56,9 @@ public class CategoryPage TagDataManager data = new TagDataManager(); - data.setContent("categoryName", category.getName()); - data.setContent("categoryDescription", category.getDescription()); + data.setAttribute("categoryLogo", "src", category.getLogoPath()); + data.setEscapedContent("categoryName", category.getName()); + data.setEscapedContent("categoryDescription", category.getDescription()); data.setContent("categorySoftwares", category.getSoftwares().sort().toStringWithFrenchCommas()); data.setContent("serviceCount", services.size()); data.setContent("serviceListView", ServiceListView.build(services.sortByName())); diff --git a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java index cc5c8b9..fc50974 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java +++ b/src/fr/devinsy/statoolinfos/htmlize/Htmlizer.java @@ -195,6 +195,12 @@ public class Htmlizer StatoolInfosUtils.copyRessource(source + "circle-icons/color/tools.png", color); StatoolInfosUtils.copyRessource(source + "circle-icons/mono/tools.png", mono); + + // + File categories = new File(targetDirectory, "categories"); + categories.mkdirs(); + StatoolInfosUtils.copyRessource(source + "categories/default.png", categories); + } } diff --git a/src/fr/devinsy/statoolinfos/htmlize/SoftwaresPage.java b/src/fr/devinsy/statoolinfos/htmlize/SoftwaresPage.java index 8770459..868875f 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/SoftwaresPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/SoftwaresPage.java @@ -62,9 +62,10 @@ public class SoftwaresPage data.setEscapedContent("softwareListLine", index, "softwareListLineNameLink", stat.getName()); data.setAttribute("softwareListLine", index, "softwareListLineNameLink", "href", "software-" + stat.getTechnicalName() + ".xhtml"); - data.setEscapedContent("softwareListLine", index, "softwareListLineCategoryLink", stat.getCategory().getName()); + data.setEscapedContent("softwareListLine", index, "softwareListLineCategoryName", stat.getCategory().getName()); data.setAttribute("softwareListLine", index, "softwareListLineCategoryLink", "href", "category-" + stat.getCategory().getTechnicalName() + ".xhtml"); data.setAttribute("softwareListLine", index, "softwareListLineCategoryLink", "title", stat.getCategory().getDescription()); + data.setAttribute("softwareListLine", index, "softwareListLineCategoryLogo", "src", stat.getCategory().getLogoPath()); data.setEscapedContent("softwareListLine", index, "softwareListLineSoftwares", stat.getCategory().getName()); data.setContent("softwareListLine", index, "softwareListLineOrganizationCount", stat.getOrganizationCount()); diff --git a/src/fr/devinsy/statoolinfos/htmlize/categories.xhtml b/src/fr/devinsy/statoolinfos/htmlize/categories.xhtml index b257a6d..dab523c 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/categories.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/categories.xhtml @@ -11,7 +11,7 @@
-Nom de la catégorie | +Nom de la catégorie | Logiciels | Services | Organisations | @@ -30,7 +30,10 @@|
---|---|---|---|---|---|
- n/a + + + n/a + | n/a | n/a | diff --git a/src/fr/devinsy/statoolinfos/htmlize/category.xhtml b/src/fr/devinsy/statoolinfos/htmlize/category.xhtml index 99bc951..d4039e6 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/category.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/category.xhtml @@ -12,10 +12,14 @@- n/a + + + n/a + | n/a | n/a | diff --git a/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.png b/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.png new file mode 100644 index 0000000..ee06df2 Binary files /dev/null and b/src/fr/devinsy/statoolinfos/htmlize/stuff/categories/default.png differ