summaryrefslogtreecommitdiff
path: root/buildscripts/apigen/pradosoft/annotation-group.latte
blob: 39c49769cbf36e08a60f8477c430d9e68859b9c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{layout '@layout.latte'}
{var $active = 'annotation-group-' . $annotation}

{block title}{$annotation|firstUpper}{/block}

{block content}
<div id="content">
	<h1>{include title}</h1>

	{if $hasElements}
		<table class="summary" id="classes" n:if="$annotationClasses">
			<caption>Classes summary</caption>
			{include classes, items => $annotationClasses}
		</table>

		<table class="summary" id="interfaces" n:if="$annotationInterfaces">
			<caption>Interfaces summary</caption>
			{include classes, items => $annotationInterfaces}
		</table>

		<table class="summary" id="traits" n:if="$annotationTraits">
			<caption>Traits summary</caption>
			{include classes, items => $annotationTraits}
		</table>

		<table class="summary" id="exceptions" n:if="$annotationExceptions">
			<caption>Exceptions summary</caption>
			{include classes, items => $annotationExceptions}
		</table>

		<table class="summary" id="methods" n:if="$annotationMethods">
			<caption>Methods summary</caption>
			<tr n:foreach="$annotationMethods as $method">
				<td class="name"><a href="{$method->declaringClassName|classUrl}">{$method->declaringClassName}</a></td>
				<td class="name"><code><a href="{$method|methodUrl}">{$method->name}()</a></code></td>
				<td>
					{if $method->hasAnnotation($annotation)}
						{foreach $method->annotations[$annotation] as $description}
							{if $description}
								{$description|annotation:$annotation:$method|noescape}<br>
							{/if}
						{/foreach}
					{/if}
				</td>
			</tr>
		</table>

		<table class="summary" id="constants" n:if="$annotationConstants">
			<caption>Constants summary</caption>
			<tr n:foreach="$annotationConstants as $constant">
				{if $constant->declaringClassName}
					<td class="name"><a href="{$constant->declaringClassName|classUrl}">{$constant->declaringClassName}</a></td>
					<td class="name"><code><a href="{$constant|constantUrl}"><b>{$constant->name}</b></a></code></td>

				{else}
					<td class="name" n:if="$namespaces || $classes || $interfaces || $traits || $exceptions"><a n:if="$constant->namespaceName" href="{$constant->namespaceName|namespaceUrl}">{$constant->namespaceName}</a></td>
					<td n:class="name"><code><a href="{$constant|constantUrl}"><b>{$constant->shortName}</b></a></code></td>
				{/if}
				<td>
					{foreach $constant->annotations[$annotation] as $description}
						{if $description}
							{$description|annotation:$annotation:$constant|noescape}<br>
						{/if}
					{/foreach}
				</td>
			</tr>
		</table>

		<table class="summary" id="properties" n:if="$annotationProperties">
			<caption>Properties summary</caption>
			<tr n:foreach="$annotationProperties as $property">
				<td class="name"><a href="{$property->declaringClassName|classUrl}">{$property->declaringClassName}</a></td>
				<td class="name"><a href="{$property|propertyUrl}"><var>${$property->name}</var></a></td>
				<td>
					{foreach $property->annotations[$annotation] as $description}
						{if $description}
							{$description|annotation:$annotation:$property|noescape}<br>
						{/if}
					{/foreach}
				</td>
			</tr>
		</table>

		<table class="summary" id="functions" n:if="$annotationFunctions">
			<caption>Functions summary</caption>
			<tr n:foreach="$annotationFunctions as $function">
				<td class="name" n:if="$namespaces"><a n:if="$function->namespaceName" href="{$function->namespaceName|namespaceUrl}">{$function->namespaceName}</a></td>
				<td class="name"><code><a href="{$function|functionUrl}">{$function->shortName}</a></code></td>
				<td>
					{foreach $function->annotations[$annotation] as $description}
						{if $description}
							{$description|annotation:$annotation:$function|noescape}<br>
						{/if}
					{/foreach}
				</td>
			</tr>
		</table>

	{else}
		<p>No elements with <code>@{$annotation}</code> annotation found.</p>
	{/if}
</div>
{/block}


{define classes}
	<tr n:foreach="$items as $class">
		<td class="name"><a href="{$class|classUrl}">{$class->name}</a></td>
		<td>
			{foreach $class->annotations[$annotation] as $description}
				{if $description}
					{$description|annotation:$annotation:$class|noescape}<br>
				{/if}
			{/foreach}
		</td>
	</tr>
{/define}