diff --git a/Gemfile b/Gemfile index 34f4efe..2d71810 100644 --- a/Gemfile +++ b/Gemfile @@ -37,18 +37,16 @@ gem 'web-console', '~> 4.0.1', group: :development # Use Codacy for coverage gem 'codacy-coverage', :require => false -gem 'bootstrap-sass', '~> 3.4.1' -gem 'autoprefixer-rails', '~> 9.6.1' - -gem 'bh', '~> 1.3.6' +gem 'bootstrap', '~> 4.4.1' +gem "bootstrap_form", "~> 4.0" +gem 'font-awesome-sass', '~> 5.12.0' # Use Diffy for showing translation diffs gem 'diffy' gem 'diff-lcs' gem 'will_paginate', '~> 3.1.8' -gem 'will-paginate-i18n', '~> 0.1.15' -gem 'will_paginate-bootstrap', '~> 1.0.2' +gem 'will_paginate-bootstrap4', '~> 0.2.2' gem 'devise', '~> 4.7.1' gem 'omniauth' diff --git a/Gemfile.lock b/Gemfile.lock index 55e912d..d842ac2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,18 +56,19 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2) - autoprefixer-rails (9.6.5) + autoprefixer-rails (9.7.3) execjs bcrypt (3.1.13) - bh (1.3.6) - actionpack - activesupport bindex (0.8.1) bootsnap (1.4.5) msgpack (~> 1.0) - bootstrap-sass (3.4.1) - autoprefixer-rails (>= 5.2.1) - sassc (>= 2.0.0) + bootstrap (4.4.1) + autoprefixer-rails (>= 9.1.0) + popper_js (>= 1.14.3, < 2) + sassc-rails (>= 2.0.0) + bootstrap_form (4.3.0) + actionpack (>= 5.0) + activemodel (>= 5.0) builder (3.2.3) codacy-coverage (2.1.5) simplecov @@ -94,6 +95,8 @@ GEM faraday (0.17.0) multipart-post (>= 1.2, < 3) ffi (1.11.2) + font-awesome-sass (5.12.0) + sassc (>= 1.11) globalid (0.4.2) activesupport (>= 4.2.0) hashie (3.6.0) @@ -143,6 +146,7 @@ GEM oauth2 (~> 1.1) omniauth (~> 1.9) orm_adapter (0.5.0) + popper_js (1.14.5) rack (2.0.8) rack-test (1.1.0) rack (>= 1.0, < 3) @@ -227,25 +231,24 @@ GEM websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) - will-paginate-i18n (0.1.15) will_paginate (3.1.8) - will_paginate-bootstrap (1.0.2) - will_paginate (>= 3.0.3) + will_paginate-bootstrap4 (0.2.2) + will_paginate (~> 3.0, >= 3.0.0) zeitwerk (2.2.1) PLATFORMS ruby DEPENDENCIES - autoprefixer-rails (~> 9.6.1) - bh (~> 1.3.6) bootsnap - bootstrap-sass (~> 3.4.1) + bootstrap (~> 4.4.1) + bootstrap_form (~> 4.0) codacy-coverage coffee-rails (~> 5.0.0) devise (~> 4.7.1) diff-lcs diffy + font-awesome-sass (~> 5.12.0) jbuilder (~> 2.9.1) jquery-rails (~> 4.3.5) mysql2 (~> 0.5.2) @@ -261,9 +264,8 @@ DEPENDENCIES tzinfo-data uglifier (~> 4.1.20) web-console (~> 4.0.1) - will-paginate-i18n (~> 0.1.15) will_paginate (~> 3.1.8) - will_paginate-bootstrap (~> 1.0.2) + will_paginate-bootstrap4 (~> 0.2.2) BUNDLED WITH 2.0.2 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 907c067..84f608f 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,9 +10,10 @@ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. // -//= require jquery -//= require jquery_ujs //= require turbolinks +//= require jquery3 +//= require rails-ujs +//= require popper //= require bootstrap-sprockets //= require codemirror/codemirror //= require codemirror/addon/display/placeholder diff --git a/app/assets/javascripts/init.coffee b/app/assets/javascripts/init.coffee index fbac815..cabf848 100644 --- a/app/assets/javascripts/init.coffee +++ b/app/assets/javascripts/init.coffee @@ -18,6 +18,6 @@ App.init = -> $(document).on "turbolinks:load", -> App.init() -$(document).on "click", '#translationNav a[href="#preview"]', -> +$(document).on "click", '#translationTab a[href="#preview"]', -> $('#preview .problem-content').html(cm.getValue()) MathJax.Hub.Queue(["Typeset",MathJax.Hub]); \ No newline at end of file diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index da8e9b4..4ee9c55 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -15,11 +15,13 @@ *= require_tree . */ -@import "bootstrap-sprockets"; @import "bootstrap"; +@import "rails_bootstrap_forms"; +@import "font-awesome-sprockets"; +@import "font-awesome"; .turbolinks-progress-bar { - background-color: $brand-primary; + background-color: $primary; } /* Sticky footer styles -------------------------------------------------- */ @@ -37,21 +39,36 @@ body { width: 100%; /* Set the fixed height of the footer here */ height: 40px; - background-color: $navbar-default-bg; + line-height: 40px; + background-color: $light; } -.container .text-muted { - margin: 10px 0; +/* Custom style for navbar toggler due to CSP problems */ +.navbar-toggler-icon { + background-image: none !important; +} + +/* Style for buttons in the corner of problems/translations */ +.problem-buttons { + position: relative; + display: block; +} + +.problem-buttons .problem-buttons-inner { + position: absolute; + right: 0; + top: 0; + z-index: 10; } /* Style for links to previous and next problem */ .problem-prev { - @extend .pull-left; + float: left; margin: 20px -30px 0; } .problem-next { - @extend .pull-right; + float: right; margin: 20px -30px 0; } diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ec958ef..66acd86 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -27,4 +27,12 @@ module ApplicationHelper page_title + ' - ' + base_title end end + + def nav_link_to(body, url) + nav_options = { class: current_page?(url) ? 'nav-item active': 'nav-item' } + content_tag(:li, nav_options) do + link_to body, url, class: 'nav-link' + end + end + end diff --git a/app/views/about/copyright.de.html.erb b/app/views/about/copyright.de.html.erb index ebac61c..0d30be1 100644 --- a/app/views/about/copyright.de.html.erb +++ b/app/views/about/copyright.de.html.erb @@ -1,7 +1,9 @@ <% provide(:title, 'Copyright') %> -
Ja! Es ist nicht nur erlaubt, sondern beherzt, das Material zu teilen und frei zu benutzen - für nichtkommerzielle Zwecke. Aber bitte lesen Sie weiter...
diff --git a/app/views/about/index.de.html.erb b/app/views/about/index.de.html.erb
index c0edcd1..f627490 100644
--- a/app/views/about/index.de.html.erb
+++ b/app/views/about/index.de.html.erb
@@ -1,12 +1,10 @@
Diese Seite ist eine Übersetzung der englischen Rätsel-Webseite projecteuler.net.
-- <%= link_to about_info_path, class: 'btn btn-primary btn-lg' do %> - Mehr erfahren » - <% end %> -
Diese Seite ist eine Übersetzung der englischen Rätsel-Webseite projecteuler.net.
++ <%= link_to about_info_path, class: 'btn btn-primary btn-lg' do %> + Mehr erfahren » + <% end %>
Sehen Sie sich die mathematischen Probleme in deutscher Sprache an.
- <%= link_to problems_path, class: 'btn btn-default' do %> + <%= link_to problems_path, class: 'btn btn-primary' do %> Zu den Problemen » <% end %>
@@ -28,7 +26,7 @@Vermissen Sie eine Funktion auf der Webseite, oder ist Ihnen ein Fehler aufgefallen? Dann helfen Sie beim Entwickeln der Webseite in Ruby on Rails!
- +Project Euler ist eine Serie von herausfordernden mathematischen bzw. Programmier-Problemen, die mehr als nur mathematische Einblicke zum Lösen erfordern. Obwohl die Mathematik Ihnen helfen wird, auf elegante und effiziente Lösungswege zu kommen, ist der Gebrauch von Computer- und Programmierkenntnissen nötig, um den Großteil der Probleme zu lösen.
Die Motivation für das Starten und die Instandhaltung von Project Euler ist die, dem Forschergeist eine Plattform bereitzustellen, die sich mit unbekannten Gebieten befasst, und neue Konzepte in einem spaßigen und freizeitlichen Kontext zu erlernen.
Aber wenn die Probleme nach einer Herausforderung klingen, dann können Sie sich die <%= link_to 'Probleme', problems_path %> ansehen, bevor Sie sich registrieren.
-\ No newline at end of file +"Project Euler existiert zum Begeistern, Herausfordern und Entwickeln der Fähigkeiten und des Genusses von jedem mit einem Interesse für die faszinierende Welt der Mathematik."
\ No newline at end of file diff --git a/app/views/about/legal.de.html.erb b/app/views/about/legal.de.html.erb index 0512c08..6ca2ad4 100644 --- a/app/views/about/legal.de.html.erb +++ b/app/views/about/legal.de.html.erb @@ -1,6 +1,8 @@ <% provide(:title, 'Impressum') %> -"Project Euler existiert zum Begeistern, Herausfordern und Entwickeln der Fähigkeiten und des Genusses von jedem mit einem Interesse für die faszinierende Welt der Mathematik."
Angaben gemäß § 5 TMG:
Philipp Fischbeck
Großbeerenstraße 48
diff --git a/app/views/about/privacy.de.html.erb b/app/views/about/privacy.de.html.erb
index da987bf..eaff58a 100644
--- a/app/views/about/privacy.de.html.erb
+++ b/app/views/about/privacy.de.html.erb
@@ -1,6 +1,8 @@
<% provide(:title, 'Datenschutz') %>
-
Diese Datenschutz-Information gilt für die Datenverarbeitung durch:
Philipp Fischbeck
diff --git a/app/views/about/roman_numerals.de.html.erb b/app/views/about/roman_numerals.de.html.erb
index c831cc3..567c611 100644
--- a/app/views/about/roman_numerals.de.html.erb
+++ b/app/views/about/roman_numerals.de.html.erb
@@ -1,6 +1,6 @@
<%= provide(:title, 'Über römische Zahlen') %>
-