From 81d7582317926f239f080a4930cfca7dca70f815 Mon Sep 17 00:00:00 2001 From: Felix Gliesche Date: Fri, 22 May 2015 19:17:18 +0200 Subject: [PATCH] Responsive layout --- 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 3f607b8..34e51cb 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -337,6 +337,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 @@ -1256,7 +1257,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.3', 'application') + tags = javascript_include_tag('jquery-1.11.1-ui-1.11.0-ujs-3.1.3', '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 434f46c..b8cafa1 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -3,11 +3,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 %> @@ -17,6 +18,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) %>

+ + +
+
@@ -28,6 +67,9 @@