diff --git a/app/assets/javascripts/application.coffee.erb b/app/assets/javascripts/application.coffee.erb index 10e0bb33..ca169258 100644 --- a/app/assets/javascripts/application.coffee.erb +++ b/app/assets/javascripts/application.coffee.erb @@ -123,10 +123,17 @@ $ -> $(document).on 'turbolinks:load', () -> $('#textsizer a').textresizer({ target: '#main-content' }) - $(document).on 'click', '.check-all', () -> - checked = $(@).is(':checked') - $('.' + $(@).data('type')).each () -> - $(@).prop('checked', checked) + $(document).on 'click', 'body ul.nav a:not(.dropdown-toggle)', () -> + if $(this)[0].dataset and $(this)[0].dataset['bsToggle'] and $('.static-overlay').is(':visible') + $('.static-overlay').hide() + $('body ul.nav a').removeClass 'active' + $(this).addClass 'active' + $(this).parents('.dropdown').find('.dropdown-toggle').addClass 'active' + + $(document).on 'click', '.check-all', () -> + checked = $(@).is(':checked') + $('.' + $(@).data('type')).each () -> + $(@).prop('checked', checked) $(document).on 'click', '.sidebar-toggler', () -> width = $('.sidebar').width() diff --git a/app/assets/stylesheets/application.sass b/app/assets/stylesheets/application.sass index 25fe5c27..832fa0d8 100644 --- a/app/assets/stylesheets/application.sass +++ b/app/assets/stylesheets/application.sass @@ -206,6 +206,7 @@ header margin: 5px 0 #logo2 + height: 80px float: right margin: 5px 0 @@ -354,8 +355,13 @@ header .hidden-page display: none +.recent-request + background-color: #d9edf7 + border: 1px solid #bce8f1 + margin-bottom: 1.5em + .statistic-box - width: 90% + width: 100% text-align: center .statistic-box-figure @@ -468,5 +474,13 @@ body.mobile .statistic-overlay display: none +.nav.nav-pills + margin-top: -25px + +.nav-pills .nav-link + background-color: #669cca + color: #fff + margin-right: 0.5em + .dropdown-menu z-index: 1700 diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 0f84bf3e..96f71918 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -40,12 +40,12 @@ def index @requests.sort_by!(&:requested_datetime).reverse! @pages = (@requests.count / @per_page.to_f).ceil path = Rails.root.join(Settings::Client.resources_overview_path) - FileUtils.rm_rf path FileUtils.mkdir_p path + FileUtils.rm_rf Dir.glob(path.join('*.html')) all_requests = @requests all_requests.each_slice(@per_page) do |requests| @requests = requests - File.write path.join("#{@page}.html"), render_to_string(layout: !Settings::Client.resources_overview_remote) + File.write path.join("#{@page}.html"), render_to_string(layout: false) @page += 1 end return head :ok diff --git a/app/controllers/starts_controller.rb b/app/controllers/starts_controller.rb index ea43bfd7..99861d73 100644 --- a/app/controllers/starts_controller.rb +++ b/app/controllers/starts_controller.rb @@ -3,9 +3,8 @@ class StartsController < ApplicationController def show @request_id = params[:request] - return redirect_to "#{Settings::Url.ks_server_url}#{map_path request: @request_id, mobile: true}" if login_required? - return redirect_to "#{Settings::Url.ks_server_url}#{map_path}" if Settings::Client.skip_extra_homepage && !@mobile - + return redirect_to map_url(request: @request_id, mobile: true) if login_required? + return redirect_to map_url unless @mobile recent_requests end diff --git a/app/controllers/statics_controller.rb b/app/controllers/statics_controller.rb index 0847c5d1..a04808ce 100644 --- a/app/controllers/statics_controller.rb +++ b/app/controllers/statics_controller.rb @@ -21,6 +21,7 @@ def privacy end def promotion + return head(:not_found) unless Settings::StaticPage.promotion @file_name = 'werbung' render :api end @@ -35,21 +36,19 @@ def requests end def contact + return head(:not_found) unless Settings::StaticPage.contact @file_name = 'contact' render :api end def news + return head(:not_found) unless Settings::StaticPage.news @file_name = 'news' render :api end - def finance - @file_name = 'finance' - render :api - end - def participation + return head(:not_found) unless Settings::StaticPage.participation @file_name = 'participation' render :api end diff --git a/app/views/application/_menue_bottom.html.erb b/app/views/application/_menue_bottom.html.erb index 4cec8a88..4d4e299c 100644 --- a/app/views/application/_menue_bottom.html.erb +++ b/app/views/application/_menue_bottom.html.erb @@ -1,7 +1,6 @@ <%= link_to t(:mobile), [:start, { mobile: true }], data: { turbolinks: false } %> | -<%= link_to t(:api), api_static_path %> | +<%= link_to t(:api), api_static_path, remote: true %> | <% if Settings::Url.ks_demo_url.present? -%> <%= link_to t(:demo), Settings::Url.ks_demo_url, data: { turbolinks: false }, target: '_blank', rel: 'noopener' %> | <% end -%> <%= link_to t(:github), Settings::Url.ks_github_url, data: { turbolinks: false }, target: '_blank', rel: 'noopener' %> | -<%= link_to t(:promotion), %i[promotion static] %> diff --git a/app/views/application/_menue_top_left.html.erb b/app/views/application/_menue_top_left.html.erb index 2bd956fe..e364bb9d 100644 --- a/app/views/application/_menue_top_left.html.erb +++ b/app/views/application/_menue_top_left.html.erb @@ -1,8 +1,44 @@
diff --git a/app/views/application/_menue_top_right.html.erb b/app/views/application/_menue_top_right.html.erb index b960e6bd..882d5ae5 100644 --- a/app/views/application/_menue_top_right.html.erb +++ b/app/views/application/_menue_top_right.html.erb @@ -1,10 +1,8 @@ -<%= link_to t(:list), %i[requests static] %> | -<%= link_to t(:statistic), [:statistics], data: { turbolinks: false } %> | -<%= link_to t(:help), help_static_path %> | +<%= link_to t(:help), help_static_path, remote: true %> | <% if Settings::Url.respond_to?(:external_privacy_url) -%> <%= link_to t(:privacy), Settings::Url.external_privacy_url, target: '_blank', rel: 'noopener' %> | <% else -%> - <%= link_to t(:privacy), privacy_static_path %> | + <%= link_to t(:privacy), privacy_static_path, remote: true %> | <% end -%> -<%= link_to t(:imprint), imprint_static_path %> | -<%= link_to t(:usage), usage_static_path %> +<%= link_to t(:imprint), imprint_static_path, remote: true %> | +<%= link_to t(:usage), usage_static_path, remote: true %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 5a9fcaaa..a89da272 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -150,7 +150,7 @@