diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 6ff3a50..fdce93e 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -15,3 +15,35 @@ */ @import "bootstrap"; + +$nord0: #2e3440; +$nord1: #3b4252; +$nord2: #434c5e; +$nord3: #4c566a; + +// Snow Storm +$nord4: #D8DEE9; + +$nord9: #5e81ac; + +a, a:visited { + color: $nord0; + text-decoration: none; +} + +a:hover { + color: $nord3; + text-decoration: underline; +} + +.dictionary-index-links { + font-size: 40px; + //color: #000; + font-weight: bold; +} + +.selected-letter { + color: $nord9; + display: inline; +} + diff --git a/app/helpers/dictionary_helper.rb b/app/helpers/dictionary_helper.rb index f958701..db9f749 100644 --- a/app/helpers/dictionary_helper.rb +++ b/app/helpers/dictionary_helper.rb @@ -1,10 +1,14 @@ module DictionaryHelper LETTERS = ['i', 'u', 'e', 'o', 'a', 'm', 'n', 'p', 't', 'k', 's', 'w', 'l', 'j'].sort - def alphabetical_links + def alphabetical_links(letter = nil) LETTERS.map do |l| - link_to l.to_s, dictionary_path(l) + if l == letter then + "

#{l.to_s}

" + else + link_to l.to_s, dictionary_path(l)#, class: "dictionary_index_links text-center" + end end.join("\n") end end diff --git a/app/views/application/_alphabetical_links.html.erb b/app/views/application/_alphabetical_links.html.erb new file mode 100644 index 0000000..ead009a --- /dev/null +++ b/app/views/application/_alphabetical_links.html.erb @@ -0,0 +1,11 @@ +
+ +
diff --git a/app/views/dictionary/index.html.erb b/app/views/dictionary/index.html.erb index 72ff185..b0ba57f 100644 --- a/app/views/dictionary/index.html.erb +++ b/app/views/dictionary/index.html.erb @@ -1,6 +1,11 @@ -<%= sanitize alphabetical_links, tags: ["a"] %> +

Index

+<%= render "alphabetical_links" %> -

<%= @parts_of_speech.count %> parts of speech entries in database

-

<%= @words.count %> word entries in database

+
+

<%= @parts_of_speech.count %> parts of speech entries in database

+

<%= @words.count %> word entries in database

+
-<%= render "partsofspeech", parts_of_speech: @parts_of_speech %> +
+ <%= render "partsofspeech", parts_of_speech: @parts_of_speech %> +
diff --git a/app/views/dictionary/show.html.erb b/app/views/dictionary/show.html.erb index 857e17a..cf4eee7 100644 --- a/app/views/dictionary/show.html.erb +++ b/app/views/dictionary/show.html.erb @@ -1,9 +1,11 @@
-

<%= @letter.to_s %>

+

<%= @letter.to_s %>

+<%= render "alphabetical_links", letter: @letter %> + <% @words.each do |word| %> -
+

<%= word.word %>

<%= render "definitions", word: word %>