From e680ae1aa31b9a48fb6a94b3a728ff962102bd42 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 7 Nov 2015 13:37:08 +0000 Subject: [PATCH] Responsive layout for mobile devices (#19097). Patch by Felix Gliesche. git-svn-id: http://svn.redmine.org/redmine/trunk@14817 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 3 +- app/views/layouts/base.html.erb | 44 ++- public/javascripts/responsive.js | 83 +++++ public/stylesheets/responsive.css | 595 ++++++++++++++++++++++++++++++ 4 files changed, 723 insertions(+), 2 deletions(-) create mode 100644 public/javascripts/responsive.js create mode 100644 public/stylesheets/responsive.css diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c345083b7..fce5d6e22 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -340,6 +340,7 @@ module ApplicationHelper { :value => project_path(:id => p, :jump => current_menu_item) } end + content_tag( :span, nil, :class => 'jump-box-arrow') + select_tag('project_quick_jump_box', options, :onchange => 'if (this.value != \'\') { window.location = this.value; }') end end @@ -1267,7 +1268,7 @@ module ApplicationHelper # Returns the javascript tags that are included in the html layout head def javascript_heads - tags = javascript_include_tag('jquery-1.11.1-ui-1.11.0-ujs-3.1.4', 'application') + tags = javascript_include_tag('jquery-1.11.1-ui-1.11.0-ujs-3.1.4', 'application', 'responsive') unless User.current.pref.warn_on_leaving_unsaved == '0' tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });") end diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index b1ffcaf13..147749290 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -4,11 +4,12 @@ <%= html_title %> + <%= csrf_meta_tag %> <%= favicon %> -<%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', :media => 'all' %> +<%= stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', 'responsive', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= heads_for_theme %> @@ -18,6 +19,44 @@
+ +
+ + + <% if User.current.logged? || !Setting.login_required? %> + + <% end %> + + <% if User.current.logged? %> +
+ <% if Setting.gravatar_enabled? %> + <%= link_to(avatar(User.current, :size => "80"), user_path(User.current)) %> + <% end %> + <%= link_to_user(User.current, :format => :username) %> +
+ <% end %> + + <% if display_main_menu?(@project) %> +

<%= l(:label_project) %>

+ + <% end %> + +

<%= l(:label_general) %>

+ + + + +

<%= l(:label_profile) %>

+ + +
+
@@ -29,6 +68,9 @@