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

164 lines
6.4 KiB

<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2021 the OpenProject GmbH
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-2013 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 COPYRIGHT and LICENSE files 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 %>"
class="<%= 'in_modal' unless show_decoration %>">
<head>
<%= render partial: 'layouts/common_head' %>
<!-- project specific tags -->
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= content_for(:header_tags) if content_for?(:header_tags) %>
<meta name="current_menu_item" content="<%= current_menu_item %>"/>
</head>
<body class="<%= body_css_classes %> __overflowing_element_container __overflowing_body" data-relative_url_root="<%= root_path %>" data-overflowing-identifier=".__overflowing_body">
<%= render partial: 'warning_bar/warning_bar' %>
<noscript>
<div class="top-shelf">
<p>
<span>
<%= op_icon 'icon3 icon-warning' %>
<strong><%= t(:noscript_heading) %></strong>
</span>
<%= t(:noscript_description) %>
<a href="http://www.enable-javascript.com/" target="_blank"><%= t(:noscript_learn_more) %></a>
</p>
</div>
</noscript>
<notifications-container></notifications-container>
<% main_menu = render_main_menu(local_assigns.fetch(:menu_name, nil), @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 %>
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
<header class="op-app-header">
<div class="op-app-header--start">
<h1 class="hidden-for-sighted">
<%= t(: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>
<div class="op-app-header--center op-logo">
<%= link_to(I18n.t('label_home'), fixed_home_url, class: 'op-logo--link') %>
</div>
<%= call_hook :view_layouts_base_top_menu %>
<div class="op-app-header--end">
<%= render partial: 'search/mini_form' %>
<%= render_top_menu_right %>
</div>
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
</header>
<% end %>
<div id="main"
class="<%= initial_classes %>">
<% if (side_displayed && show_decoration) %>
<div id="main-menu" class="main-menu">
<h1 class="hidden-for-sighted"><%= t(:label_main_menu) %></h1>
<main-menu-resizer></main-menu-resizer>
<div id="menu-sidebar">
<%= main_menu %>
<%= content_for :main_menu %>
<%= call_hook :view_layouts_base_main_menu %>
<!-- Sidebar -->
<div id="sidebar">
<%= content_for :sidebar %>
<%= call_hook :view_layouts_base_sidebar %>
</div>
</div>
</div>
<% end %>
<div class="content-overlay"></div>
Fix/update wysiwyg styles (#8844) This is a refactoring of the CSS classes in the WYSIWYG editor. The classes now use proper BEM and are almost completely independent of other CSS. It also includes small style refactorings, like a reduction of heading size in attribute fields, and an increase in heading size in all other instances. * Initial class definitions * Added more classes * Added Table of Contents basics * CkEditor applying custom CSS classes to p, h1, h2, h3, h4, h5, h6, li and blockquote * CKEditorInspector removed * op css class for headings * op css class for paragraphs * op css class for code/code block * adapt specs to altered markdown/html generation * adapt grid/budget representers to altered signature * op css class for lists * op css class for toc * op css class for links * Start working on typography css * op css class for tables * Fixing more typography, trying out larger headers * Applying custom classes to li, a, blockquote, figure, table, tr, td, th, image, codeblock, figcaption and macros * adapt specs to altered link classes * op css class for images * apply user content container class throughout application * CSS alignment custom classes applied to table * op css class for task list checkbox * Added task checkbox class * amend list checkbox class in backend * op css class for table thead element * adapt specs on image html generation * Updated table and typography styles * Update typography and figure styles * Figure overflow handling * Table alignment styles + ckEditor styles removed * rename wiki-anchor to op-uc-link_permalink * wrap table in div as well as figure * Updated code-block * Update permalinks * Fixed a lot about tables * Removed Description header from work-packages page * Fix frontend styles * Add placeholder styling, fix toc * Fixed figure print * working with table aligns * Custom class add to task lists * Custom classes applied to theads * op-uc-container custom class added to container * Codeblocks inside pre elements * Fix: single <code> and <a> tags * explicitly require overwritten gem class Apparently, the gem is not loaded yet when it is registered as a filter when in eager loading mode * adapt spec expectation to altered toc rendering * CkInspector removed * Latest ckeditor changes * remove highlight css class from wiki content * allow html pipleline to handle macros with additional classes * Fixed a lot of print css for tables * Add general print css back in * Update Table of Contents styling * Custom classes on ul, ol, li and task-lists * Revert "Custom classes on ul, ol, li and task-lists" This reverts commit 0d27d281378b324330ea2f25632de898269e2122. * Custom classes on ul, ol, li and task-lists * Custom classes on column's th * remove placeholder class when rendering * WOrking on task lists * Changing task-list classes, changed tests * Updated list styles * Remove unused todo list styles * remove checked in binstubs * Fix table of contents * adapt todo list handing in backend pipeline * adapt specs to altered css classes * Add numbers to table of contents * Better comments in table of contents * Fix: wrap single <table> with a <figure> * Fixes to todo list design * Updated todo list scss to fix nested lists * adapt selectors in table spec * Update table styles * Improve table borders more * Custom classes specs * Fix: no need to remove regular list classes when its type changes * Add modifier for inline headings * Update table editing styles * Remove break-word tests * wrap images just like tables * Update figure content styles * Fix: All tests passing (ul.op-uc-list_task-list) * div.op-uc-figure--content wrapping tables * Specs for figures wrappers div.op-uc-figure--content * Fix: add custom classes to links and codes again * Table wrapper div reverted + specs * Fix inline palceholders * Custom macro type classes * Add basic macro placeholder changes * Move heading permalink after text * Fix word-break spec * Sending figure styles to the backend (width) * extend test to take ckeditor placeholder into account * avoid adding bem classes multiple times * attempt to fix flickering spec * Removing image spinner when uploading finishes * adapt spec expectations Co-authored-by: Aleix Suau <info@macrofonoestudio.es> Co-authored-by: ulferts <jens.ulferts@googlemail.com>
4 years ago
<main 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 %>
<% if show_onboarding_modal? %>
<section data-augmented-model-wrapper
data-modal-initialize-now="true"
data-modal-class-name="onboarding-modal op-modal_autoheight -highlight">
<%= render partial: '/onboarding/configuration_modal' %>
</section>
<% end %>
<div id="content" class="<%= initial_classes %>">
<h1 class="hidden-for-sighted"><%= t(:label_content) %></h1>
<%= content_for :content_body %>
<% unless local_assigns[:no_action_menu] %>
<%= yield %>
<% end %>
<%= call_hook :view_layouts_base_content %>
</div>
Fix/update wysiwyg styles (#8844) This is a refactoring of the CSS classes in the WYSIWYG editor. The classes now use proper BEM and are almost completely independent of other CSS. It also includes small style refactorings, like a reduction of heading size in attribute fields, and an increase in heading size in all other instances. * Initial class definitions * Added more classes * Added Table of Contents basics * CkEditor applying custom CSS classes to p, h1, h2, h3, h4, h5, h6, li and blockquote * CKEditorInspector removed * op css class for headings * op css class for paragraphs * op css class for code/code block * adapt specs to altered markdown/html generation * adapt grid/budget representers to altered signature * op css class for lists * op css class for toc * op css class for links * Start working on typography css * op css class for tables * Fixing more typography, trying out larger headers * Applying custom classes to li, a, blockquote, figure, table, tr, td, th, image, codeblock, figcaption and macros * adapt specs to altered link classes * op css class for images * apply user content container class throughout application * CSS alignment custom classes applied to table * op css class for task list checkbox * Added task checkbox class * amend list checkbox class in backend * op css class for table thead element * adapt specs on image html generation * Updated table and typography styles * Update typography and figure styles * Figure overflow handling * Table alignment styles + ckEditor styles removed * rename wiki-anchor to op-uc-link_permalink * wrap table in div as well as figure * Updated code-block * Update permalinks * Fixed a lot about tables * Removed Description header from work-packages page * Fix frontend styles * Add placeholder styling, fix toc * Fixed figure print * working with table aligns * Custom class add to task lists * Custom classes applied to theads * op-uc-container custom class added to container * Codeblocks inside pre elements * Fix: single <code> and <a> tags * explicitly require overwritten gem class Apparently, the gem is not loaded yet when it is registered as a filter when in eager loading mode * adapt spec expectation to altered toc rendering * CkInspector removed * Latest ckeditor changes * remove highlight css class from wiki content * allow html pipleline to handle macros with additional classes * Fixed a lot of print css for tables * Add general print css back in * Update Table of Contents styling * Custom classes on ul, ol, li and task-lists * Revert "Custom classes on ul, ol, li and task-lists" This reverts commit 0d27d281378b324330ea2f25632de898269e2122. * Custom classes on ul, ol, li and task-lists * Custom classes on column's th * remove placeholder class when rendering * WOrking on task lists * Changing task-list classes, changed tests * Updated list styles * Remove unused todo list styles * remove checked in binstubs * Fix table of contents * adapt todo list handing in backend pipeline * adapt specs to altered css classes * Add numbers to table of contents * Better comments in table of contents * Fix: wrap single <table> with a <figure> * Fixes to todo list design * Updated todo list scss to fix nested lists * adapt selectors in table spec * Update table styles * Improve table borders more * Custom classes specs * Fix: no need to remove regular list classes when its type changes * Add modifier for inline headings * Update table editing styles * Remove break-word tests * wrap images just like tables * Update figure content styles * Fix: All tests passing (ul.op-uc-list_task-list) * div.op-uc-figure--content wrapping tables * Specs for figures wrappers div.op-uc-figure--content * Fix: add custom classes to links and codes again * Table wrapper div reverted + specs * Fix inline palceholders * Custom macro type classes * Add basic macro placeholder changes * Move heading permalink after text * Fix word-break spec * Sending figure styles to the backend (width) * extend test to take ckeditor placeholder into account * avoid adding bem classes multiple times * attempt to fix flickering spec * Removing image spinner when uploading finishes * adapt spec expectations Co-authored-by: Aleix Suau <info@macrofonoestudio.es> Co-authored-by: ulferts <jens.ulferts@googlemail.com>
4 years ago
</main>
</div>
<div id="ajax-indicator" style="display:none;"><span><%= t(: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");
var mainMenuCollapsed = window.OpenProject.guardedLocalStorage("openProject-mainMenuCollapsed");
if (window.innerWidth < 680) {
// force hide on load for mobile
$('.can-hide-navigation').addClass('hidden-navigation');
}
if (mainMenuCollapsed === 'true') {
savedMainMenuWidth = 0;
}
if (savedMainMenuWidth || savedMainMenuWidth === 0) {
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>