diff --git a/app/assets/stylesheets/wow_reputations.scss b/app/assets/stylesheets/wow_reputations.scss
new file mode 100644
index 0000000..e8f8968
--- /dev/null
+++ b/app/assets/stylesheets/wow_reputations.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the WowReputation controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: https://sass-lang.com/
diff --git a/app/controllers/wow_reputations_controller.rb b/app/controllers/wow_reputations_controller.rb
new file mode 100644
index 0000000..ef2e11e
--- /dev/null
+++ b/app/controllers/wow_reputations_controller.rb
@@ -0,0 +1,9 @@
+class WowReputationsController < ProtectedController
+ def index
+ @pagy, @wow_reputations = pagy(WowReputation.non_meta_reputations, items: 20)
+ end
+
+ def show
+ @wow_reputation = WowReputation.find(params[:id])
+ end
+end
diff --git a/app/helpers/wow_reputations_helper.rb b/app/helpers/wow_reputations_helper.rb
new file mode 100644
index 0000000..3e532b6
--- /dev/null
+++ b/app/helpers/wow_reputations_helper.rb
@@ -0,0 +1,2 @@
+module WowReputationsHelper
+end
diff --git a/app/models/wow_reputation.rb b/app/models/wow_reputation.rb
index 16ee3d6..e561e8a 100644
--- a/app/models/wow_reputation.rb
+++ b/app/models/wow_reputation.rb
@@ -11,5 +11,6 @@ class WowReputation < ApplicationRecord
validates :name, presence: true
validates :reputation_id, presence: true, uniqueness: true
- scope :meta_reputations, -> { where(meta_wow_reputation: nil) }
+ scope :meta_reputations, -> { where(description: nil) }
+ scope :non_meta_reputations, -> { where.not(description: nil) }
end
diff --git a/app/views/layouts/_navbar.html.erb b/app/views/layouts/_navbar.html.erb
index 35740f8..a13854b 100644
--- a/app/views/layouts/_navbar.html.erb
+++ b/app/views/layouts/_navbar.html.erb
@@ -5,13 +5,16 @@
<% if user_signed_in? %>
diff --git a/app/views/wow_reputations/_standing.html.erb b/app/views/wow_reputations/_standing.html.erb
new file mode 100644
index 0000000..a1ced73
--- /dev/null
+++ b/app/views/wow_reputations/_standing.html.erb
@@ -0,0 +1,5 @@
+<% if standing %>
+ <%= link_to standing.wow_character.name, standing.wow_character %> - <%= standing.wow_reputation.wow_reputation_tier.wow_reputation_tier_levels.find_by(order: standing.tier)&.name %>
+<% else %>
+ <%= t('wow_reputations.reputation_list.not_discovered') %>
+<% end %>
diff --git a/app/views/wow_reputations/index.html.erb b/app/views/wow_reputations/index.html.erb
new file mode 100644
index 0000000..77f29f4
--- /dev/null
+++ b/app/views/wow_reputations/index.html.erb
@@ -0,0 +1,22 @@
+Reputations list
+
+
+
+
+ | <%= t('wow_reputations.reputation_list.name') %> |
+ <%= t('wow_reputations.reputation_list.description') %> |
+ <%= t('wow_reputations.reputation_list.highest_reputation_character') %> |
+
+
+
+ <% @wow_reputations.each do |reputation| %>
+
+ | <%= reputation.name %> |
+ <%= reputation.description %> |
+ <%= render partial: 'wow_reputations/standing', locals: { standing: reputation.wow_standings.joins(:wow_character).where(wow_character: { user: current_user }).order(raw: :desc).first } %> |
+
+ <% end %>
+
+
+
+<%== pagy_bootstrap_nav(@pagy) %>
diff --git a/config/locales/layouts/de-de.yml b/config/locales/layouts/de-de.yml
index 6498438..2353b93 100644
--- a/config/locales/layouts/de-de.yml
+++ b/config/locales/layouts/de-de.yml
@@ -4,3 +4,4 @@ de-de:
characters: "Zeichen"
mounts: "Anschlüsse"
pets: "Maskottchen"
+ reputations: "Reputationen"
diff --git a/config/locales/layouts/en-gb.yml b/config/locales/layouts/en-gb.yml
index bea2866..9fa5654 100644
--- a/config/locales/layouts/en-gb.yml
+++ b/config/locales/layouts/en-gb.yml
@@ -4,3 +4,4 @@ en-gb:
characters: "Characters"
mounts: "Mounts"
pets: "Pets"
+ reputations: "Reputations"
diff --git a/config/locales/layouts/en-us.yml b/config/locales/layouts/en-us.yml
index 5df5470..ead98ca 100644
--- a/config/locales/layouts/en-us.yml
+++ b/config/locales/layouts/en-us.yml
@@ -4,3 +4,4 @@ en-us:
characters: "Characters"
mounts: "Mounts"
pets: "Pets"
+ reputations: "Reputations"
diff --git a/config/locales/layouts/es-es.yml b/config/locales/layouts/es-es.yml
index ebb3c13..9f16f18 100644
--- a/config/locales/layouts/es-es.yml
+++ b/config/locales/layouts/es-es.yml
@@ -4,3 +4,4 @@ es-es:
characters: "Caracteres"
mounts: "Montajes"
pets: "Mascotas"
+ reputations: "Reputaciones"
diff --git a/config/locales/layouts/es-mx.yml b/config/locales/layouts/es-mx.yml
index 247fcb6..8ad6fec 100644
--- a/config/locales/layouts/es-mx.yml
+++ b/config/locales/layouts/es-mx.yml
@@ -4,3 +4,4 @@ es-mx:
characters: "Caracteres"
mounts: "Montajes"
pets: "Mascotas"
+ reputations: "Reputaciones"
diff --git a/config/locales/layouts/fr-fr.yml b/config/locales/layouts/fr-fr.yml
index c601d5b..942307a 100644
--- a/config/locales/layouts/fr-fr.yml
+++ b/config/locales/layouts/fr-fr.yml
@@ -3,4 +3,5 @@ fr-fr:
navbar:
characters: "Personnages"
mounts: "Montures"
- pets: "Mascotte"
+ pets: "Mascottes"
+ reputations: "Réputations"
diff --git a/config/locales/layouts/it.yml b/config/locales/layouts/it.yml
index dc99d99..32ade89 100644
--- a/config/locales/layouts/it.yml
+++ b/config/locales/layouts/it.yml
@@ -3,4 +3,5 @@ it:
navbar:
characters: "Personaggi"
mounts: "Monti"
- pets: "Mascotte"
+ pets: "Mascotti"
+ reputations: "Reputazioni"
diff --git a/config/locales/layouts/ko.yml b/config/locales/layouts/ko.yml
index 3d04b83..74ace13 100644
--- a/config/locales/layouts/ko.yml
+++ b/config/locales/layouts/ko.yml
@@ -4,3 +4,4 @@ ko:
characters: "캐릭터"
mounts: "마운트"
pets: "마스코트"
+ reputations: "평판"
diff --git a/config/locales/layouts/pt-br.yml b/config/locales/layouts/pt-br.yml
index 026859f..4689f87 100644
--- a/config/locales/layouts/pt-br.yml
+++ b/config/locales/layouts/pt-br.yml
@@ -4,3 +4,4 @@ pt-br:
characters: "Personagens"
mounts: "Montagens"
pets: "Mascote"
+ reputations: "Reputações"
diff --git a/config/locales/layouts/ru-ru.yml b/config/locales/layouts/ru-ru.yml
index 2ecae18..e392ed2 100644
--- a/config/locales/layouts/ru-ru.yml
+++ b/config/locales/layouts/ru-ru.yml
@@ -4,3 +4,4 @@ ru-ru:
characters: "Символы"
mounts: "Крепления"
pets: "Талисман"
+ reputations: "Репутации"
diff --git a/config/locales/layouts/zh-cn.yml b/config/locales/layouts/zh-cn.yml
index 8bf1d1b..5eb413a 100644
--- a/config/locales/layouts/zh-cn.yml
+++ b/config/locales/layouts/zh-cn.yml
@@ -4,3 +4,4 @@ zh-cn:
characters: "人物"
mounts: "坐骑"
pets: "吉祥物"
+ reputations: "名声"
diff --git a/config/locales/layouts/zh-tw.yml b/config/locales/layouts/zh-tw.yml
index b330030..40a4845 100644
--- a/config/locales/layouts/zh-tw.yml
+++ b/config/locales/layouts/zh-tw.yml
@@ -4,3 +4,4 @@ zh-tw:
characters: "人物"
mounts: "坐骑"
pets: "吉祥物"
+ reputations: "名声"
diff --git a/config/locales/wow_reputations/de-de.yml b/config/locales/wow_reputations/de-de.yml
new file mode 100644
index 0000000..48c158f
--- /dev/null
+++ b/config/locales/wow_reputations/de-de.yml
@@ -0,0 +1,7 @@
+de-de:
+ wow_reputations:
+ reputation_list:
+ name: "Name"
+ description: "Beschreibung"
+ highest_reputation_character: "Charakter mit dem höchsten Ruf"
+ not_discovered: "Nicht entdeckt
diff --git a/config/locales/wow_reputations/en-gb.yml b/config/locales/wow_reputations/en-gb.yml
new file mode 100644
index 0000000..2ab963d
--- /dev/null
+++ b/config/locales/wow_reputations/en-gb.yml
@@ -0,0 +1,7 @@
+en-gb:
+ wow_reputations:
+ reputation_list:
+ name: "Name"
+ description: "Description"
+ highest_reputation_character: "Character with the highest reputation"
+ not_discovered: "Not discovered"
diff --git a/config/locales/wow_reputations/en-us.yml b/config/locales/wow_reputations/en-us.yml
new file mode 100644
index 0000000..bc86209
--- /dev/null
+++ b/config/locales/wow_reputations/en-us.yml
@@ -0,0 +1,7 @@
+en-us:
+ wow_reputations:
+ reputation_list:
+ name: "Name"
+ description: "Description"
+ highest_reputation_character: "Character with the highest reputation"
+ not_discovered: "Not discovered"
diff --git a/config/locales/wow_reputations/es-es.yml b/config/locales/wow_reputations/es-es.yml
new file mode 100644
index 0000000..b35c395
--- /dev/null
+++ b/config/locales/wow_reputations/es-es.yml
@@ -0,0 +1,7 @@
+es-es:
+ wow_reputations:
+ reputation_list:
+ name: "Nombre"
+ description: "Descripción"
+ highest_reputation_character: "Personaje con la más alta reputación"
+ not_discovered: "No descubierto"
diff --git a/config/locales/wow_reputations/es-mx.yml b/config/locales/wow_reputations/es-mx.yml
new file mode 100644
index 0000000..9331fd8
--- /dev/null
+++ b/config/locales/wow_reputations/es-mx.yml
@@ -0,0 +1,7 @@
+es-mx:
+ wow_reputations:
+ reputation_list:
+ name: "Nombre"
+ description: "Descripción"
+ highest_reputation_character: "Personaje con la más alta reputación"
+ not_discovered: "No descubierto"
diff --git a/config/locales/wow_reputations/fr-fr.yml b/config/locales/wow_reputations/fr-fr.yml
new file mode 100644
index 0000000..cc27f31
--- /dev/null
+++ b/config/locales/wow_reputations/fr-fr.yml
@@ -0,0 +1,7 @@
+en-gb:
+ wow_reputations:
+ reputation_list:
+ name: "Nom"
+ description: "Description"
+ highest_reputation_character: "Personnage avec la plus haute réputation"
+ not_discovered: "Pas découverte"
diff --git a/config/locales/wow_reputations/it.yml b/config/locales/wow_reputations/it.yml
new file mode 100644
index 0000000..920a260
--- /dev/null
+++ b/config/locales/wow_reputations/it.yml
@@ -0,0 +1,7 @@
+it:
+ wow_reputations:
+ reputation_list:
+ name: "Nome"
+ description: "Descrizione"
+ highest_reputation_character: "Personaggio con la più alta reputazione"
+ not_discovered: "Non scoperto"
diff --git a/config/locales/wow_reputations/ko.yml b/config/locales/wow_reputations/ko.yml
new file mode 100644
index 0000000..31d0332
--- /dev/null
+++ b/config/locales/wow_reputations/ko.yml
@@ -0,0 +1,7 @@
+ko:
+ wow_reputations:
+ reputation_list:
+ name: "이름"
+ description: "기술"
+ highest_reputation_character: "평판이 가장 높은 캐릭터"
+ not_discovered: "발견되지 않음"
diff --git a/config/locales/wow_reputations/pt-br.yml b/config/locales/wow_reputations/pt-br.yml
new file mode 100644
index 0000000..e902682
--- /dev/null
+++ b/config/locales/wow_reputations/pt-br.yml
@@ -0,0 +1,7 @@
+pt-br:
+ wow_reputations:
+ reputation_list:
+ name: "Sobrenome"
+ description: "Descrição"
+ highest_reputation_character: "Personagem com a maior reputação"
+ not_discovered: "Não descoberto"
diff --git a/config/locales/wow_reputations/ru-ru.yml b/config/locales/wow_reputations/ru-ru.yml
new file mode 100644
index 0000000..5a445ce
--- /dev/null
+++ b/config/locales/wow_reputations/ru-ru.yml
@@ -0,0 +1,7 @@
+ru-ru:
+ wow_reputations:
+ reputation_list:
+ name: "Фамилия"
+ description: "Описание"
+ highest_reputation_character: "Персонаж с самой высокой репутацией"
+ not_discovered: "Не обнаружено"
diff --git a/config/locales/wow_reputations/zh-cn.yml b/config/locales/wow_reputations/zh-cn.yml
new file mode 100644
index 0000000..e57f648
--- /dev/null
+++ b/config/locales/wow_reputations/zh-cn.yml
@@ -0,0 +1,7 @@
+zh-cn:
+ wow_reputations:
+ reputation_list:
+ name: "姓"
+ description: "描述"
+ highest_reputation_character: "声誉最高的人物"
+ not_discovered: "未发现"
diff --git a/config/locales/wow_reputations/zh-tw.yml b/config/locales/wow_reputations/zh-tw.yml
new file mode 100644
index 0000000..49de946
--- /dev/null
+++ b/config/locales/wow_reputations/zh-tw.yml
@@ -0,0 +1,7 @@
+zh-tw:
+ wow_reputations:
+ reputation_list:
+ name: "姓"
+ description: "描述"
+ highest_reputation_character: "声誉最高的人物"
+ not_discovered: "未发现"
diff --git a/config/routes.rb b/config/routes.rb
index ae7f403..9741e98 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -13,5 +13,6 @@ Rails.application.routes.draw do
resources :wow_characters, only: [:index, :show]
resources :wow_mounts, only: [:index, :show]
resources :wow_pets, only: [:index, :show]
+ resources :wow_reputations, only: [:index, :show]
end
end
diff --git a/spec/helpers/wow_reputations_helper_spec.rb b/spec/helpers/wow_reputations_helper_spec.rb
new file mode 100644
index 0000000..f0dc3cb
--- /dev/null
+++ b/spec/helpers/wow_reputations_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+# Specs in this file have access to a helper object that includes
+# the WowReputationHelper. For example:
+#
+# describe WowReputationHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# expect(helper.concat_strings("this","that")).to eq("this that")
+# end
+# end
+# end
+RSpec.describe WowReputationsHelper, type: :helper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/requests/wow_reputations_spec.rb b/spec/requests/wow_reputations_spec.rb
new file mode 100644
index 0000000..bacc52b
--- /dev/null
+++ b/spec/requests/wow_reputations_spec.rb
@@ -0,0 +1,7 @@
+require 'rails_helper'
+
+RSpec.describe "WowReputations", type: :request do
+ describe "GET /index" do
+ pending "add some examples (or delete) #{__FILE__}"
+ end
+end