Skip to content

Commit

Permalink
Style some edit pages (audit_tom, tom)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayvented committed Nov 21, 2023
1 parent e3e209b commit 1df008f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 39 deletions.
3 changes: 2 additions & 1 deletion src/Controller/AuditTomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ public function editAuditTom(
'activ' => $audit->getActiv(),
'activNummer' => false,
'nextAudit' => $nextAudit,
'snack' => $request->get('snack')
'snack' => $request->get('snack'),
'urlBack' => $this->generateUrl('audit_tom'),
]
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Controller/TomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ public function editTom(
'activ' => $tom->getActiv(),
'activTitel' => false,
'snack' => $request->get('snack'),
'currentTeam' => $team
'currentTeam' => $team,
'urlBack' => $this->generateUrl('tom'),
]);
}

Expand Down
33 changes: 12 additions & 21 deletions templates/audit_tom/edit.html.twig
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
{% extends 'base.html.twig' %}
{% trans_default_domain 'audit_tom' %}

{% block title %}
{{ title }} ({% trans from 'general' %}number{% endtrans %}: {{ audit.nummer }})
{% endblock %}

{% block CTA %}
{% if audit.activ %}
<a href="{{ path('bericht_audit', {'id':audit.id}) }}">
<span>{% trans %}pdf.create{% endtrans %}</span>
<a href="{{ path('bericht_audit', {'id':audit.id}) }}" class="btn">
{% trans %}pdf.create{% endtrans %}
</a>
<a href="{{ path('bericht_audit', {'id':audit.id, 'all':1}) }}">
<span>{% trans %}pdf.createWithHistory{% endtrans %}</span>
<a href="{{ path('bericht_audit', {'id':audit.id, 'all':1}) }}" class="btn">
{% trans %}pdf.createWithHistory{% endtrans %}
</a>
{% endif %}
{% endblock %}

{% block body %}
<div>
<div>
<h2>{{ title }} ({% trans from 'general' %}number{% endtrans %}: {{ audit.nummer }})</h2>
</div>
<div>
{{ include('assign/__assign.html.twig',{'data':audit,'path':'assign_audit'}) }}
</div>
</div>

<div>
{{ include('audit_tom/__form.html.twig') }}
</div>
<p>{% trans %}createdBy{% endtrans %}: {{ audit.user.email }}</p>
{{ include('assign/__assign.html.twig',{'data':audit,'path':'assign_audit'}) }}
{{ include('audit_tom/__form.html.twig') }}
<p class="text-muted mt-5 text-sm">{% trans %}createdBy{% endtrans %}: {{ audit.user.email }}</p>
{% if audit.previous %}
<div>
<h2>{% trans %}history{% endtrans %}</h2>
{{ include('audit_tom/__history.html.twig', {'p':audit.previous}) }}
</div>
{% endif %}
{{ include('base/__snack.html.twig') }}
{% endblock %}

{% block javascript %}
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion templates/base/__approveBtn.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% if data.team in app.user.adminRoles and not data.activ == 0 %}
<a onClick="return confirm('{% trans %}confirmAction{% endtrans %}')"
href='{{ path(dataLink,{'id':data.id}) }}' type='button'
class='btn btn-success ml-1 btn-sm'>
class='btn btn-create'>
{% if data.approved %}
{% trans %}rescindApproval{% endtrans %}
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion templates/base/__disableBtn.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% if data.team in app.user.adminRoles and not data.approved and not data.activ == 0 %}
<a onClick="return confirm('{% trans %}confirmAction{% endtrans %}')"
href='{{ path(dataLink,{'id':data.id}) }}' type='button'
class='btn btn-danger ml-1 btn-sm'>
class='btn btn-danger'>
{% if data.activ == 1 %}
{% trans %}delete{% endtrans %}
{% else %}
Expand Down
23 changes: 9 additions & 14 deletions templates/tom/edit.html.twig
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
{% extends 'base.html.twig' %}
{% trans_default_domain 'tom' %}

{% block title %}
{{ tom.titel }} - {{ title }}
{% endblock %}

{% block CTA %}
{% if tom.activ %}
<a href="{{ path('bericht_tom', {'id':tom.id}) }}">
<span>{% trans from 'general' %}pdf.create{% endtrans %}</span>
<a href="{{ path('bericht_tom', {'id':tom.id}) }}" class="btn">
{% trans from 'general' %}pdf.create{% endtrans %}
</a>
{{ include('base/__approveBtn.html.twig',{'data':tom,'dataLink':'tom_approve'}) }}
{{ include('base/__disableBtn.html.twig',{'data':tom,'dataLink':'tom_disable'}) }}
{% endif %}
{% endblock %}

{% block body %}

<h2>{{ tom.titel }} - {{ title }}</h2>
{{ include('base/__approvedBy.html.twig', {'data':tom}) }}

<div>
{{ include('tom/__form.html.twig') }}
</div>
<p>{% trans from 'general' %}createdBy{% endtrans %}: {{ tom.user.email }}</p>
{{ include('tom/__form.html.twig') }}
<p class="text-muted mt-5 text-sm">{% trans from 'general' %}createdBy{% endtrans %}: {{ tom.user.email }}</p>
{% if tom.previous %}
<div>
<h2>{% trans from 'general' %}history{% endtrans %}</h2>
{{ include('tom/__history.html.twig', {'p':tom.previous}) }}
</div>
{% endif %}
{{ include('base/__snack.html.twig') }}
{% endblock %}

{% block javascript %}
{% endblock %}
{% endblock %}

0 comments on commit 1df008f

Please sign in to comment.