OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/views/layouts/base.html.erb

207 lines
8.2 KiB

<%#-- copyright
OpenProject is a project management system.
Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2017 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See docs/COPYRIGHT.rdoc for more details.
++#%><!DOCTYPE html>
<% show_decoration = params["layout"].nil? %>
<html xmlns="http://www.w3.org/1999/xhtml"
lang="<%= I18n.locale.to_s %>"
xml:lang="<%= I18n.locale.to_s %>"
ng-csp="no-unsafe-eval"
class="<%= 'in_modal' unless show_decoration %>">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width">
<%= output_title_and_meta_tags %>
<% relative_url_root = OpenProject::Configuration['rails_relative_url_root'] || '' %>
<meta name="app_base_path" content="<%= relative_url_root %>"/>
<base href="<%= relative_url_root %>/" />
<% if @project %>
<meta name="current_project"
data-project-name="<%= h @project.name %>"
data-project-id="<%= @project.id %>"
data-project-identifier="<%= @project.identifier %>"/>
<% end %>
<meta name="openproject_initializer"
data-locale="<%= I18n.locale %>"
data-default-locale="<%= I18n.default_locale %>"
data-environment="<%= Rails.env %>"/>
<meta name="current_menu_item" content="<%= current_menu_item %>"/>
<meta name="accessibility-mode" content="<%= current_user.impaired? %>"/>
<%= csrf_meta_tags %>
<%= render 'common/favicons' %>
<%= stylesheet_link_tag 'openproject', media: "all" %>
<%# Include CLI assets (development) or prod build assets %>
<%= include_frontend_assets %>
<%= javascript_include_tag 'application' %>
<%= javascript_include_tag "locales/#{I18n.locale}" %>
<!-- Text formatting specific includes -->
<%= text_formatting_js_includes %>
<!-- project specific tags -->
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= content_for(:header_tags) if content_for?(:header_tags) %>
<% if EnterpriseToken.allows_to?(:define_custom_style) && CustomStyle.try(:current).present? %>
<% cache(CustomStyle.current) do %>
<%= render partial: "custom_styles/inline_css" %>
<% if CustomStyle.current.favicon.present? %>
<link rel="icon" type="image/png" href="<%= custom_style_favicon_path(digest: CustomStyle.current.digest, filename: CustomStyle.current.favicon_identifier) %>" sizes="32x32">
<% end %>
<% if CustomStyle.current.touch_icon.present? %>
<link rel="apple-touch-icon" sizes="180x180" href="<%= custom_style_touch_icon_path(digest: CustomStyle.current.digest, filename: CustomStyle.current.touch_icon_identifier) %>">
<% end %>
<% end %>
<% end %>
<%= crowdin_in_context_translation %>
</head>
<body class="<%= body_css_classes %>" data-relative_url_root="<%= root_path %>">
<noscript>
<div class="top-shelf icon icon-warning">
<h1><%= l(:noscript_heading) %></h1>
<p>
<%= l(:noscript_description) %>
</p>
<h2>
<a href="http://www.enable-javascript.com/" target="_blank"><%= l(:noscript_learn_more) %></a>
</h2>
</div>
</noscript>
[27828] Feature: Query menu in sidenav (#6429) * in main menu add gantt as extra work package child item * Satisfy spec and code climate * Add gantt chart icon behin default gantt query name. * WIP Query menu in left sidebar * Shift query dropdown in left sidenav * Reload menu or load query on click from every project location * WIP set correct label for default queries * Query menu listens on all changes of queries (delete, create, rename, toggle starred) and updates immediatly * WIP: Inline edit, field validation * Inline Edit validation and comfirm * Inline edit: validation of duplicate name * Set default columns and sorting for static queries * Codeclimate issues fixed * WIP Inline edit validation not working perfectly in all error states * Inline edit working * Autocompleter hover disabled and hovering over categories fixed * Category hover and toggle fixed; tested in Chrome, Firefox and Opera * Placeholder cut off fixed and text wrap added * English and german wording adjusted * Styles of inline edit and menu adjusted; matching wiki page styles * prevent menus to be displayed to often * application menu only displayed on work package * specify using no_menu layout more often * adapt tests to altered production implementation * Hamburger icon only in project; on global wp page: default queries shown correctly and summary removed * searching for undefined leads to error * Accessible click fixed (listen on escape) * Gantt in top menu deleted (gantt chart is part of default queries on wp page) * load menu on wp summary page * reduce times queries are loaded * lowercase on second word * remove menu from search and home * Styles fixed (category toggle and correct highlighting) * reflect static query in url * fix autocomplete handling in specs * Open all global menus on default and hide hamburger icon on global pages; Rebuild changes that have been ovrwritten after merge" * Correct highlighting of default queries after reload * Replace summary cuke with spec * WIP * Clear up selectors * Avoid actively setting promises and instead use $state.go to load links [ci skip] * Make editable title component a little simpler We can reuse the component I built for the wiki, that wasn't present in the frontend beforehand. * Fix moving through the menu and selecting items [ci skip] * Add save button to query title when query changed * Improve static names lookup by comparing query_props * Adapt and fix specs * Allow inner scrolling of wp query results Also, style the webkit scrollbar to make it pretty where supported * Allow renaming the query through setting menu, but simply focus on field [ci skip]
6 years ago
<% main_menu = render_main_menu(local_assigns.fetch(:menu_name, :module_menu), @project) %>
<% side_displayed = content_for?(:sidebar) || content_for?(:main_menu) || !main_menu.blank? %>
<% initial_classes = initial_menu_classes(side_displayed, show_decoration) %>
<div id="wrapper" style="<%= initial_menu_styles %>" class="<%= initial_classes %>">
<% if show_decoration %>
<div id="top-menu">
<div id="header">
<div id="top-menu-items">
<h1 class="hidden-for-sighted">
<%= l(:label_top_menu) %>
</h1>
<main-menu-toggle></main-menu-toggle>
<a href="" class="hidden-for-sighted skip-navigation-link"
aria-label="<%= I18n.t('js.work_packages.jump_marks.label_content') %>">
<%= I18n.t('js.work_packages.jump_marks.content') %>
</a>
<%= render_top_menu_left %>
<div id="logo" class="hidden-for-mobile">
<%= link_to(I18n.t('label_home'), home_url, class: 'home-link') %>
</div>
<%= call_hook :view_layouts_base_top_menu %>
<div class="top-menu-items-right">
<%= render partial: 'search/mini_form' %>
<%= render_top_menu_right %>
</div>
</div>
</div>
</div>
<% end %>
<div id="main"
class="<%= initial_classes %>">
<% if (side_displayed && show_decoration) %>
<div id="main-menu" class="main-menu">
<h1 class="hidden-for-sighted"><%= l(:label_main_menu) %></h1>
<main-menu-resizer></main-menu-resizer>
<div id="menu-sidebar">
<%= main_menu %>
<%= content_for :main_menu %>
<!-- Sidebar -->
<div id="sidebar">
<%= content_for :sidebar %>
<%= call_hook :view_layouts_base_sidebar %>
</div>
</div>
</div>
<% end %>
<div id="content-wrapper" class="<%= initial_classes %>">
<% if show_decoration %>
<div id="breadcrumb" class="<%= initial_classes %><%= show_breadcrumb ? ' -show' : '' %>">
<%= you_are_here_info %>
<%= full_breadcrumb %>
<%= call_hook :view_layouts_base_breadcrumb %>
</div>
<% end %>
<%= render_flash_messages %>
<notifications-container></notifications-container>
<% if show_onboarding_modal? %>
<section data-augmented-model-wrapper
data-modal-initialize-now="true"
data-modal-class-name="onboarding-modal -highlight">
<%= render partial: '/onboarding/configuration_modal' %>
</section>
<% end %>
<div id="content" class="<%= initial_classes %>">
<h1 class="hidden-for-sighted"><%= l(:label_content) %></h1>
<%= content_for :content_body %>
<% unless local_assigns[:no_action_menu] %>
<!-- Action menu -->
<%= render partial: 'layouts/action_menu' %>
<%= yield %>
<% end %>
<%= call_hook :view_layouts_base_content %>
<% unless local_assigns[:no_action_menu] %>
<div style="clear:both;">&nbsp;</div>
<% end %>
</div>
<% unless local_assigns[:no_action_menu] %>
<div style="clear:both;">&nbsp;</div>
<% end %>
</div>
</div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
</div>
<%# Properly decides main menu expanded state and width before its drawn. Fixes flickering side menu
where menu is first expanded, then being collapsed in angular. %>
<%= nonced_javascript_tag do %>
// execute these lines to prevent flickering when page loads:
(function($) {
var wrapper = $('#wrapper');
var savedMainMenuWidth = window.OpenProject.guardedLocalStorage("openProject-mainMenuWidth");
if (window.innerWidth < 680) {
// force hide on load for mobile
$('.can-hide-navigation').addClass('hidden-navigation');
}
if (savedMainMenuWidth) {
document.documentElement.style.setProperty("--main-menu-width", savedMainMenuWidth + 'px');
}
wrapper.show();
// Wrapper for page-specific JS from deprecated inline functions
// no longer available with CSP.
<%= content_for :additional_js_dom_ready %>
}(jQuery));
<% end %>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>