templates/Doc/access.html.twig line 1

Open in your IDE?
  1. {% extends 'Layouts/Doc/default.html.twig' %}
  2. {% block title %}Documentation
  3. {% endblock %}
  4. {% block headerPageTitle %}
  5.     {{ 'app.documentation.page.title.index'|trans |upper}}
  6. {% endblock %}
  7. {% block body %}
  8.     <div class="card mb-12">
  9.         <div class="card-body flex-column p-5">
  10.             <div class="d-flex align-items-center h-lg-300px p-5 p-lg-15">
  11.                 <div class="row">
  12.                     <div class="col-md-8 pt-5 scroll-y">
  13.                         <h1 class="fw-bold fs-4 fs-lg-1 text-gray-800 mb-3">API Access per scope</h1>
  14.                         <div class="position-relative w-100 text-gray-800">
  15.                             <p>Foxorder's API contains diffrents roles. Each endpoint is restricted for one or multiple roles depending on its need.</p>
  16.                             <p>If you would like to test these endpoints
  17.                                 <a href="{{ path('foxorders_api_doc') }}" target="_blank">in our Swagger UI docs</a>, you need to retrieve a JWT token first.</p>
  18.                             <p>Here are the roles available in our API:</p>
  19.                             <div class="list-group text-active-gray-800">
  20.                                 <span class="list-group-item list-group-item-action flex-column align-items-start">
  21.                                     <div class="d-flex w-100 justify-content-between">
  22.                                         <span class="fw-bold">SCOPE MANAGER</span>The manager of the franchise
  23.                                     </div>
  24.                                 </span>
  25.                                 <span class="list-group-item list-group-item-action flex-column align-items-start">
  26.                                     <div class="d-flex w-100 justify-content-between">
  27.                                         <span class="fw-bold">SCOPE SHOP_OWNER</span>The manager of the shop
  28.                                     </div>
  29.                                 </span>
  30.                                 <span class="list-group-item list-group-item-action flex-column align-items-start">
  31.                                     <div class="d-flex w-100 justify-content-between">
  32.                                         <span class="fw-bold">SCOPE FRONT</span>Franchise's online shop
  33.                                     </div>
  34.                                 </span>
  35.                                 <span class="list-group-item list-group-item-action flex-column align-items-start">
  36.                                     <div class="d-flex w-100 justify-content-between">
  37.                                         <span class="fw-bold">SCOPE CUSTOMER</span>The customer
  38.                                     </div>
  39.                                 </span>
  40.                             </div>
  41.                         </div>
  42.                     </div>
  43.                     <div class="col-md-4 text-center">
  44.                         <img alt="Logo" src="{{ asset( foxorders_doc ~ 'api-photo-page.jpg') }}" style="width:300px; height:auto">
  45.                     </div>
  46.                 </div>
  47.             </div>
  48.         </div>
  49.     </div>
  50.     <div class="card">
  51.         <div class="card-body">
  52.             <div class="table-responsive">
  53.                 <table class="table table-row-bordered table-row-dashed gy-4 align-middle fw-bold">
  54.                     <thead class="fs-7 text-gray-400 text-uppercase">
  55.                         <tr>
  56.                             <th class="min-w-250px">Endpoint</th>
  57.                             <th class="min-w-90px text-center">Method</th>
  58.                             <th class="min-w-250px">Description</th>
  59.                             <th class="min-w-90px text-center">FRONT</th>
  60.                             <th class="min-w-90px text-center">MANAGER</th>
  61.                             <th class="min-w-90px text-center">SHOP_OWNER</th>
  62.                             <th class="min-w-90px text-center">CUSTOMER</th>
  63.                         </tr>
  64.                     </thead>
  65.                     <tbody class="fs-6 text-gray-800">
  66.                         {% for group in apis %}
  67.                             {% if section is null %}
  68.                                 <tr>
  69.                                     <td colspan="8" class="text-center bg-light-dark">
  70.                                         {{ group.group|upper }}
  71.                                     </td>
  72.                                 </tr>
  73.                             {% endif %}
  74.                             {% set authorized = 'app.documentation.badge.authorized'|trans|badge('light-success', false) %}
  75.                             {% set unauthorized = 'app.documentation.badge.unauthorized'|trans|badge('light-danger', false) %}
  76.                             {% for value in group.list %}
  77.                                 <tr>
  78.                                     <td>
  79.                                         <span class="mb-1 text-hover-primary">{{ value.api }}</span>
  80.                                     </td>
  81.                                     <td class="text-center">
  82.                                         {% if 'POST' == value.type %}
  83.                                             {% set typeClass = 'warning' %}
  84.                                         {% elseif 'PUT' == value.type %}
  85.                                             {% set typeClass = 'primary' %}
  86.                                         {% elseif 'PATCH' == value.type %}
  87.                                             {% set typeClass = 'info' %}
  88.                                         {% elseif 'DELETE' == value.type %}
  89.                                             {% set typeClass = 'danger' %}
  90.                                         {% else %}
  91.                                             {% set typeClass = 'success' %}
  92.                                         {% endif %}
  93.                                         {{ value.type|upper|badge('light-' ~ typeClass, false) }}
  94.                                     </td>
  95.                                     <td>
  96.                                         <span class="mb-1 text-hover-primary">{{ value.description|raw }}</span>
  97.                                     </td>
  98.                                     <td class="text-center">
  99.                                         {{ (value.api_role  ? authorized : unauthorized)|raw }}
  100.                                     </td>
  101.                                     <td class="text-center">
  102.                                         {{ (value.manager  ? authorized : unauthorized)|raw }}
  103.                                     </td>
  104.                                     <td class="text-center">
  105.                                         {{ (value.shop_owner  ? authorized : unauthorized)|raw }}
  106.                                     </td>
  107.                                     <td class="text-center">
  108.                                         {{ (value.customer  ? authorized : unauthorized)|raw }}
  109.                                     </td>
  110.                                 </tr>
  111.                             {% else %}
  112.                                 <tr>
  113.                                     <td colspan="8" style='color:orange'>{{ 'app.global.detail.no_record_found'|trans }}</td>
  114.                                 </tr>
  115.                             {% endfor %}
  116.                         {% else %}
  117.                             <tr>
  118.                                 <td colspan="8" style='color:orange'>{{ 'app.global.detail.no_record_found'|trans }}</td>
  119.                             </tr>
  120.                         {% endfor %}
  121.                     </tbody>
  122.                 </table>
  123.             </div>
  124.         </div>
  125.     </div>
  126. {% endblock %}