Added has_many assoziations for creator and cashier to jobs, fixed all views according to that changes. Implemented allocation of roles infos when status changes in job model.
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
<div>
|
||||
<h1 class="text-4xl font-bold">Benutzer Details</h1>
|
||||
<h1 class="text-4xl font-bold text-hsrm-gray py-4">Benutzer Details</h1>
|
||||
<%= render partial: 'user', locals: { user: @user } %>
|
||||
</div>
|
||||
<p>Some Stats:
|
||||
<ul>
|
||||
<li>Druckaufträge insgesammt: <%= @user.jobs_as_costumer.size %></li>
|
||||
<li>davon abgebrochen: <%= @user.jobs_as_costumer.canceled.size %></li>
|
||||
<li>letzten 5 Druckaufträge</li>
|
||||
</ul>
|
||||
</p>
|
||||
<h1 class="py-4 text-4xl font-bold text-hsrm-gray">Die letzten 10 Druckaufträge</h1>
|
||||
<div class="min-w-full overflow-auto shadow-lg">
|
||||
<table class="w-full py-8 table-auto">
|
||||
<thead class="font-semibold tracking-wide bg-gray-200 border-b-2 border-gray-300 text text-hsrm-gray">
|
||||
@@ -27,7 +21,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id='jobs' class="divide-y divivde-gray-300">
|
||||
<%= render partial: "jobs/job_tr", collection: @user.jobs_as_costumer.limit(5), as: :job, locals: { no_actions: true } %>
|
||||
<%= render partial: "jobs/job_tr", collection: @user.created_jobs.order(created_at: :desc).limit(10), as: :job, locals: { no_actions: true } %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user