-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from TreinaDev/feat/move-events-page-out-of-d…
…ashboard Fazer a home page de usuários logados não exibir mais os eventos
- Loading branch information
Showing
27 changed files
with
153 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,5 @@ | ||
<% if current_user.role == "event_manager"%> | ||
<div class="bg-white p-10 shadow-md rounded"> | ||
<div class="flex justify-between items-center"> | ||
<h1>Meus Eventos</h1> | ||
|
||
<%= link_to 'Criar Evento', new_event_path, class: 'form_button w-fit'%> | ||
</div> | ||
|
||
<div class="mt-4"> | ||
<% if @events.any? %> | ||
<table class="w-full text-left table-auto"> | ||
<thead> | ||
<tr> | ||
<th class="px-4 py-2 border-b border-blue-gray-500">Nome</th> | ||
<th class="px-4 py-2 border-b border-blue-gray-500">Status</th> | ||
<th class="px-4 py-2 border-b border-blue-gray-500">Limite de participantes</th> | ||
<th class="px-4 py-2 border-b border-blue-gray-500">Quando</th> | ||
<th class="px-4 py-2 border-b border-blue-gray-500"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @events.each do |e| %> | ||
<tr class="even:bg-gray-100"> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"><%= e.name %></td> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"> | ||
<p class="<%=e.status == 'published' ? "text-success font-medium" : "text-warning font-medium" %>"><%= Event.human_enum_name(:status, e.status) %></p> | ||
</td> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"><%= e.participants_limit%></td> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"><%= l(e.start_date.to_date)%></td> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"> | ||
<div class="flex gap-4 items-center justify-end"> | ||
<%= link_to 'Gerenciar', event_path(e), class: 'outline_button', test_id: "manage-#{e.id}" %> | ||
<%= button_to event_path(e), method: :delete, class: 'danger_button', data: { turbo_method: :delete, turbo_confirm: "Tem certeza que deseja deletar o evento:\n#{e.name}", test_id: "delete-#{e.id}" } do %> | ||
<img src="<%= asset_path('bin.svg')%>" class="h-6 w-6"/> | ||
<% end %> | ||
</div> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
|
||
<% else %> | ||
<p>Você não possui eventos cadastrados.</p> | ||
<% end %> | ||
</div> | ||
</div> | ||
<% if current_user.event_manager? %> | ||
<p>Dashboard Manager</p> | ||
<% elsif current_user.admin? %> | ||
<p>Dashboard Admin</p> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<div class="bg-white p-10 shadow-md rounded"> | ||
<div class="flex justify-between items-center"> | ||
<h1>Meus Eventos</h1> | ||
|
||
<%= link_to 'Criar Evento', new_event_path, class: 'form_button w-fit'%> | ||
</div> | ||
|
||
<div class="mt-4"> | ||
<% if @events.any? %> | ||
<table class="w-full text-left table-auto"> | ||
<thead> | ||
<tr> | ||
<th class="px-4 py-2 border-b border-blue-gray-500">Nome</th> | ||
<th class="px-4 py-2 border-b border-blue-gray-500">Status</th> | ||
<th class="px-4 py-2 border-b border-blue-gray-500">Limite de participantes</th> | ||
<th class="px-4 py-2 border-b border-blue-gray-500">Quando</th> | ||
<th class="px-4 py-2 border-b border-blue-gray-500"></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @events.each do |e| %> | ||
<tr class="even:bg-gray-100"> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"><%= e.name %></td> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"> | ||
<p class="<%=e.status == 'published' ? "text-success font-medium" : "text-warning font-medium" %>"><%= Event.human_enum_name(:status, e.status) %></p> | ||
</td> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"><%= e.participants_limit%></td> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"><%= l(e.start_date.to_date)%></td> | ||
<td class="px-4 py-2 border-b border-blue-gray-100"> | ||
<div class="flex gap-4 items-center justify-end"> | ||
<%= link_to 'Gerenciar', event_path(e), class: 'outline_button', test_id: "manage-#{e.id}" %> | ||
<%= button_to event_path(e), method: :delete, class: 'danger_button', data: { turbo_method: :delete, turbo_confirm: "Tem certeza que deseja deletar o evento:\n#{e.name}", test_id: "delete-#{e.id}" } do %> | ||
<img src="<%= asset_path('bin.svg')%>" class="h-6 w-6"/> | ||
<% end %> | ||
</div> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
<% else %> | ||
<p>Você não possui eventos cadastrados.</p> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.