improve reputation display and flash messages
This commit is contained in:
8
app/views/layouts/_flash.html.erb
Normal file
8
app/views/layouts/_flash.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="container-fluid">
|
||||
<% flash.each do |type, msg| %>
|
||||
<div class="alert <%= bootstrap_class_for_flash(type) %> alert-dismissible fade show" role="alert">
|
||||
<%= msg %>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -13,8 +13,7 @@
|
||||
|
||||
<body>
|
||||
<%= render 'layouts/navbar' %>
|
||||
<p class="notice"><%= notice %></p>
|
||||
<p class="alert"><%= alert %></p>
|
||||
<%= render partial: 'layouts/flash', flash: flash %>
|
||||
<div class="container-fluid">
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,25 @@
|
||||
<h3>Reputation</h3>
|
||||
<h3>Reputations</h3>
|
||||
|
||||
<% standings.each do |standing| %>
|
||||
<div>
|
||||
<h5><%= standing.wow_reputation.name %></h5>
|
||||
<%= render partial: 'wow_characters/standing', locals: { standing: standing, tier: standing.wow_reputation.wow_reputation_tier.wow_reputation_tier_levels[standing.tier] } %>
|
||||
<div class="accordion" id="wow_reputation_accordion">
|
||||
<% standings.each do |reputation_group| %>
|
||||
<div class="accordion-item">
|
||||
<h3 class="accordion-header" id="heading_<%= reputation_group[0] %>">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse_<%= reputation_group[0] %>" aria-expanded="true" aria-controls="collapse_<%= reputation_group[0] %>">
|
||||
<% if reputation_group[0] %>
|
||||
<%= meta_wow_reputations.find { |n| n.id == reputation_group[0] }.name %>
|
||||
<% else %>
|
||||
Other
|
||||
<% end %>
|
||||
</button>
|
||||
</h3>
|
||||
<div id="collapse_<%= reputation_group[0] %>" class="accordion-collapse collapse collapsed" aria-labelledby="heading_<%= reputation_group[0] %>" data-bs-parent="#wow_reputation_accordion">
|
||||
<% reputation_group[1].each do |standing| %>
|
||||
<div class="accordion-body">
|
||||
<h5><%= standing.wow_reputation.name %></h5>
|
||||
<%= render partial: 'wow_characters/standing', locals: { standing: standing, tier: standing.wow_reputation.wow_reputation_tier.wow_reputation_tier_levels[standing.tier] } %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="col-7">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<%= render partial: 'wow_characters/reputations', locals: { standings: @wow_character.wow_standings } %>
|
||||
<%= render partial: 'wow_characters/reputations', locals: { standings: @wow_character.wow_standings.group_by { |standing| standing.wow_reputation.meta_wow_reputation_id }, meta_wow_reputations: @meta_wow_reputations } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user