versionDetails.html.twig 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {% import "PackagistWebBundle::macros.html.twig" as packagist %}
  2. {% if is_granted('ROLE_EDIT_PACKAGES') or version.package.maintainers.contains(app.user) %}
  3. <form class="action" action="{{ path("delete_version", {"versionId": version.id}) }}" method="post">
  4. <input type="hidden" name="_method" value="DELETE" />
  5. <input type="submit" value="Delete">
  6. </form>
  7. {% endif %}
  8. <p class="requireme">require: <input type="text" readonly="readonly" value="{{ "\"#{version.package.vendor}/#{version.package.packageName}\": \"#{version.hasVersionAlias() ? version.versionAlias : version.version}\"" }}" /></p>
  9. <h2 class="authors">Author{{ version.authors|length > 1 ? 's' : '' }}</h2>
  10. <ul>
  11. {% for author in version.authors %}
  12. <li>
  13. {%- if author.homepage -%}
  14. <a href="{{ author.homepage }}">{{ author.name }}</a>
  15. {%- else -%}
  16. {{ author.name }}
  17. {%- endif -%}
  18. {% if author.email %} &lt;<a href="mailto:{{ author.email }}">{{ author.email }}</a>&gt;{% endif -%}
  19. </li>
  20. {% endfor %}
  21. </ul>
  22. <div class="clearfix package-links">
  23. {% for type in ["require", "devRequire", "suggest", "provide", "conflict", "replace"] %}
  24. <div class="{{ type }}s">
  25. <h2>{{ ('link_type.' ~ type)|trans }}</h2>
  26. {% if attribute(version, type)|length %}
  27. <ul>
  28. {%- for link in attribute(version, type) -%}
  29. <li>{{ packagist.packageLink(link.packageName) }}: {{ link.packageVersion == 'self.version' ? version.version : link.packageVersion }}</li>
  30. {%- endfor -%}
  31. </ul>
  32. {% else %}
  33. None
  34. {% endif %}
  35. </div>
  36. {% endfor %}
  37. </div>