Skip to content

Commit

Permalink
Fix broken software form
Browse files Browse the repository at this point in the history
Form was included twice resulting in a rendering error.
  • Loading branch information
melegiul committed Jan 17, 2025
1 parent 97914fb commit 2b6ce5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 49 deletions.
8 changes: 5 additions & 3 deletions templates/software/__config.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{% trans_default_domain 'software' %}
<div class="mb-5">
<a href="{{ path('software_config_new',{'id':software.id}) }}" class="btn">
{% trans %}config.create{% endtrans %}
</a>
{% if isEditable %}
<a href="{{ path('software_config_new',{'id':software.id}) }}" class="btn">
{% trans %}config.create{% endtrans %}
</a>
{% endif %}
<button class="btn" type="button" data-type="dialogs" data-target="#modal-software-config-info">
{% trans from 'general' %}info{% endtrans %}
</button>
Expand Down
49 changes: 3 additions & 46 deletions templates/software/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,59 +23,16 @@
{% block body %}
{{ include('base/__approvedBy.html.twig', {'data':software}) }}

<div class="grid grid-cols-12">
<div class="col-span-4">
<div class="grid grid-cols-5 gap-4">
<div class="col-span-3">
<h3>{% trans %}software.baseData{% endtrans %}</h3>
{{ include('software/__form.html.twig') }}
<p class="created-by">{% trans from 'general' %}createdBy{% endtrans %}: {{ software.user.email }}</p>
</div>
<div class="col-span-8">
<div class="col-span-2">
<h3>{% trans %}config.attached{% endtrans %}</h3>
{{ include('software/__config.html.twig') }}
</div>
<div class="col-span-12">
{% set inherited = softwareInherited(software) %}
{% set used = teamUsesSoftware(currentTeam, software) %}
{% include 'base/__inheritanceInfo.html.twig' with {team:software.team, currentTeam:currentTeam, used:used, inherited:inherited} %}
</div>
</div>

<div class="accordion" id="accordionExample">
<div class="card z-depth-0 bordered">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link collapsed" type="button" data-toggle="collapse"
data-target="#collapseOne"
aria-expanded="false" aria-controls="collapseOne">
<h4 class="h4-responsive">{% trans %}software.baseData{% endtrans %}</h4>
</button>
</h5>
</div>
<div id="collapseOne" class="collapse{% if not isEditable %} show{% endif %}" aria-labelledby="headingOne"
data-parent="#accordionExample">
<div class="card-body {% if not activ or software.approved %}disabled{% endif %}">
{{ include('software/__form.html.twig') }}
<p>{% trans from 'general' %}createdBy{% endtrans %}: {{ software.user.email }}</p>
</div>
</div>
</div>
{% if isEditable %}
<div class="card z-depth-0 bordered">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="btn btn-link " type="button" data-toggle="collapse"
data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
<h4 class="h4-responsive">{% trans %}config.attached{% endtrans %}</h4>
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordionExample">
<div class="card-body {% if not activ or software.approved %}disabled{% endif %}">
{{ include('software/__config.html.twig') }}
</div>
</div>
</div>
{% endif %}
</div>

{% if software.previous %}
Expand Down

0 comments on commit 2b6ce5f

Please sign in to comment.