Skip to content

Commit

Permalink
Merge pull request #1263 from scireum/feature/csc/serviceTags
Browse files Browse the repository at this point in the history
API Docs: shows method and content type in toc instead of generic icon
  • Loading branch information
sabieber authored Jul 28, 2023
2 parents 41ccf4f + c3a1aaf commit bee1586
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
27 changes: 7 additions & 20 deletions src/main/resources/default/templates/system/api.html.pasta
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
<i:block name="sidebar">
<t:navbox labelKey="template.html.tableOfContent.heading">
<i:for type="sirius.web.services.PublicServiceInfo" var="service" items="api.getServices()">
<t:navboxLink url="@apply('#%s', service.getUri())"
icon="fa fa-file-alt">
<t:navboxLink url="@apply('#%s', service.getUri())">
<i:invoke template="/templates/system/service-format-tag.html.pasta"
service="@service"/>
@service.getLabel()
</t:navboxLink>
</i:for>
Expand Down Expand Up @@ -64,25 +65,11 @@
</p>
</i:if>

<div>
<div class="p-2" style="border-radius: 4px; background-color: #EEEEEE">
<t:fullTag color="@service.determineHttpMethodColor(service.getHttpMethod())"
class="align-text-top">
@service.getHttpMethod().name()
</t:fullTag>
<div class="p-2" style="border-radius: 4px; background-color: #EEEEEE">
<i:invoke template="/templates/system/service-format-tag.html.pasta"
service="@service"/>

<i:if test="service.getFormat() == sirius.web.services.Format.JSON">
<t:fullTag color="blue-light" class="align-text-top">JSON</t:fullTag>
</i:if>
<i:if test="service.getFormat() == sirius.web.services.Format.XML">
<t:fullTag color="green-light" class="align-text-top">XML</t:fullTag>
</i:if>
<i:if test="service.getFormat() == sirius.web.services.Format.RAW">
<t:fullTag color="violet-light" class="align-text-top">RAW</t:fullTag>
</i:if>

<span class="text-monospace whitespace-pre-wrap">@service.getUri()</span>
</div>
<span class="text-monospace whitespace-pre-wrap">@service.getUri()</span>
</div>

<i:if test="!service.getParameters().isEmpty()">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<i:arg type="sirius.web.services.PublicServiceInfo" name="service"/>

<t:fullTag color="@service.determineHttpMethodColor(service.getHttpMethod())"
class="align-text-top">
@service.getHttpMethod().name()
</t:fullTag>

<i:if test="service.getFormat() == sirius.web.services.Format.JSON">
<t:fullTag color="blue-light" class="align-text-top">JSON</t:fullTag>
</i:if>
<i:if test="service.getFormat() == sirius.web.services.Format.XML">
<t:fullTag color="green-light" class="align-text-top">XML</t:fullTag>
</i:if>
<i:if test="service.getFormat() == sirius.web.services.Format.RAW">
<t:fullTag color="violet-light" class="align-text-top">RAW</t:fullTag>
</i:if>

0 comments on commit bee1586

Please sign in to comment.