| ... |
... |
@@ -31,45 +31,26 @@ |
| 31 |
31 |
})) |
| 32 |
32 |
#end |
| 33 |
33 |
|
| 34 |
|
-#macro (getTemplateExample $inputCard $outputCard) |
| 35 |
|
- #set ($templateReference = $services.model.resolveDocument($inputCard.templateReference)) |
| 36 |
|
- #if ($xwiki.getDocument($templateReference).isNew()) |
| 37 |
|
- #set ($outputCard = { |
| 38 |
|
- 'title': $inputCard.title, |
| 39 |
|
- 'description': $inputCard.description, |
| 40 |
|
- 'documentation': 'http://extensions.xwiki.org/xwiki/bin/view/Extension/Templates+Application/', |
| 41 |
|
- 'thumbnail': $inputCard.thumbnail |
| 42 |
|
- }) |
| 43 |
|
- #else |
| 44 |
|
- #set ($outputCard = { |
| 45 |
|
- 'title': $inputCard.title, |
| 46 |
|
- 'description': $inputCard.description, |
| 47 |
|
- 'examples': $inputCard.templateReference, |
| 48 |
|
- 'thumbnail': $inputCard.thumbnail |
| 49 |
|
- }) |
| 50 |
|
- #end |
| 51 |
|
-#end |
| 52 |
|
- |
| 53 |
53 |
#set ($exampleCards = [{ |
| 54 |
54 |
'title': 'Article', |
| 55 |
55 |
'description': 'Article page', |
| 56 |
|
- 'templateReference': 'Templates.Article.Template.WebHome', |
| 57 |
|
- 'thumbnail': 'Help.Templates.WebHome@article.png' |
|
37 |
+ 'examples': 'Help.Templates.Article.WebHome', |
|
38 |
+ 'thumbnail': 'Help.Templates.Article.WebHome@article.png' |
| 58 |
58 |
}, { |
| 59 |
59 |
'title': 'Encyclopedia', |
| 60 |
60 |
'description': 'Encyclopedia page', |
| 61 |
|
- 'templateReference': 'Templates.Encyclopedia.Template.WebHome', |
| 62 |
|
- 'thumbnail': 'Help.Templates.WebHome@encyclopedia.png' |
|
42 |
+ 'examples': 'Help.Templates.Encyclopedia.WebHome', |
|
43 |
+ 'thumbnail': 'Help.Templates.Encyclopedia.WebHome@encyclopedia.png' |
| 63 |
63 |
}, { |
| 64 |
64 |
'title': 'Meeting Report', |
| 65 |
65 |
'description': 'Agenda and notes', |
| 66 |
|
- 'templateReference': 'Templates.Meeting.Template.WebHome', |
| 67 |
|
- 'thumbnail': 'Help.Templates.WebHome@meeting.png' |
|
47 |
+ 'examples': 'Help.Templates.Meeting.WebHome', |
|
48 |
+ 'thumbnail': 'Help.Templates.Meeting.WebHome@meeting.png' |
| 68 |
68 |
}, { |
| 69 |
69 |
'title': 'Simple Page', |
| 70 |
70 |
'description': 'With table of contents', |
| 71 |
|
- 'templateReference': 'Templates.SimplePage.Template.WebHome', |
| 72 |
|
- 'thumbnail': 'Help.Templates.WebHome@simple.png' |
|
52 |
+ 'examples': 'Help.Templates.Simple.WebHome', |
|
53 |
+ 'thumbnail': 'Help.Templates.Simple.WebHome@simple.png' |
| 73 |
73 |
}]) |
| 74 |
74 |
{{/velocity}} |
| 75 |
75 |
|
| ... |
... |
@@ -101,9 +101,7 @@ |
| 101 |
101 |
<div class="clearfix visible-lg-block"></div> |
| 102 |
102 |
#end |
| 103 |
103 |
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3"> |
| 104 |
|
- #set ($outputCard = {}) |
| 105 |
|
- #getTemplateExample($card $outputCard) |
| 106 |
|
- #helpExampleCard($outputCard) |
|
85 |
+ #helpExampleCard($card) |
| 107 |
107 |
</div> |
| 108 |
108 |
#end |
| 109 |
109 |
</div> |