Files
astuto/app/views/layouts/_header.html.erb

114 lines
5.7 KiB
Plaintext
Raw Normal View History

<nav class="header">
2019-08-19 16:43:32 +02:00
<div class="container">
2019-09-23 17:06:32 +02:00
<%=
2024-09-16 18:48:18 +02:00
link_to get_url_for_logo, class: "brand#{@tenant_setting.logo_links_to == 'nothing' ? ' brandDisabled' : ''}", tabindex: @tenant_setting.logo_links_to == 'nothing' ? -1 : 0 do
2022-07-18 10:47:54 +02:00
app_name = content_tag :span, @tenant.site_name
logo = image_tag(@tenant.site_logo ? @tenant.site_logo : "", class: 'logo', skip_pipeline: true)
2019-09-24 16:37:55 +02:00
if @tenant_setting.brand_display == "name_and_logo"
2022-07-18 10:47:54 +02:00
logo + app_name
elsif @tenant_setting.brand_display == "name_only"
2022-07-18 10:47:54 +02:00
app_name
elsif @tenant_setting.brand_display == "logo_only"
2022-07-18 10:47:54 +02:00
logo
end
2019-09-23 17:06:32 +02:00
end
%>
<button
class="navbarToggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
2019-08-19 16:43:32 +02:00
<span class="navbar-toggler-icon"></span>
</button>
2019-08-19 16:43:32 +02:00
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="boardsNav">
<% if @tenant_setting.show_roadmap_in_header %>
Bump yarn packages (webpacker, bootstrap, ...) (#222) * Specify exact versions in package.json * Bump @rails packages to 6.1.7-3 * Bump decode-uri-component from 0.2.0 to 0.2.2 (#176) Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump qs from 6.5.2 to 6.5.3 (#177) Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/ljharb/qs/releases) - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3) --- updated-dependencies: - dependency-name: qs dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump express from 4.17.1 to 4.18.2 (#178) Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump json5 from 1.0.1 to 1.0.2 (#182) Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump minimatch from 3.0.4 to 3.0.8 (#223) Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.0.8. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.0.8) --- updated-dependencies: - dependency-name: minimatch dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @rails/webpacker to 5.1.0 * Fix translations import in application.js * Bump @rails/webpacker to 5.4.4 * Set some babel plugins loose=true to suppress warnings * Bump boostrap to 4.6.2 and popper.js to 1.16.1 * Fix CSS after bootstrap bump --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-13 18:41:26 +02:00
<li class="nav-item<%= (current_page?(roadmap_path) or (@tenant_setting.root_board_id == 0 and current_page?(root_path))) ? ' active' : '' %>">
<%= link_to t('roadmap.title'), @header_full_urls ? get_url_for(method(:roadmap_url)) : roadmap_path, class: 'nav-link' %>
</li>
<% end %>
<%= render 'layouts/boards_nav_section', boards: @boards unless @boards.nil? %>
2019-08-22 17:09:13 +02:00
</ul>
<ul class="profileNav">
2019-08-19 16:43:32 +02:00
<% if user_signed_in? %>
<li class="nav-item dropdown">
<a class="profileToggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<%= image_tag(current_user.gravatar_url, class: 'gravatar', alt: current_user.full_name, size: 24) %>
<span class="fullname"><%= current_user.full_name.truncate(24) %></span>
2024-07-12 20:38:46 +02:00
<% if current_user.moderator? && Post.pending.length > 0 %>
<span class="notificationDot notificationDotTop"><%= Post.pending.length %></span>
<% end %>
2019-08-19 16:43:32 +02:00
</a>
<div class="dropdown-menu" onclick="event.stopPropagation()" aria-labelledby="navbarDropdown">
2023-01-18 21:11:27 +01:00
<% if current_user.moderator? %>
<h6 class="dropdown-header"><%= t('header.menu.administration_header') %></h6>
<% if current_user.admin? or current_user.owner? %>
<%=
link_to t('header.menu.site_settings'),
2024-07-12 20:38:46 +02:00
@header_full_urls ? get_url_for(method(:site_settings_general_url)) : site_settings_general_path,
class: 'dropdown-item siteSettingsDropdown'
%>
<% end %>
2024-07-12 20:38:46 +02:00
<%= link_to @header_full_urls ? get_url_for(method(:moderation_feedback_url)) : moderation_feedback_path, class: 'dropdown-item moderationDropdown' do %>
<%= t('header.menu.moderation') %>
<% if Post.pending.length > 0 %>
&nbsp;
<span class="notificationDot"><%= Post.pending.length %></span>
<% end %>
<% end %>
2024-05-03 18:11:07 +02:00
<% if current_user.owner? and Rails.application.multi_tenancy? %>
<%= link_to @header_full_urls ? get_url_for(method(:request_billing_page_url)) : request_billing_page_path, class: 'dropdown-item', data: {turbolinks: false} do %>
2024-05-03 18:11:07 +02:00
<%= t('billing.title') %>
<% if not Current.tenant.tenant_billing.has_active_subscription? %>
<span style="color: red; font-size: 18px;">⚠️</span>
<% end %>
<% end %>
<% end %>
2022-05-01 18:00:38 +02:00
<div class="dropdown-divider"></div>
<% end %>
<h6 class="dropdown-header"><%= t('header.menu.profile_header') %></h6>
<%= link_to t('header.menu.profile_settings'), @header_full_urls ? get_url_for(method(:edit_user_registration_url)) : edit_user_registration_path, class: 'dropdown-item' %>
2019-08-19 16:43:32 +02:00
<div class="dropdown-divider"></div>
<% if current_user.admin? %>
<h6 class="dropdown-header"><%= t('header.menu.help_header') %></h6>
<% unless @boards.empty? %>
<%= link_to t('header.menu.tour'), @header_full_urls ? get_url_for(method(:board_url), resource: @boards.first, options: { tour: true }) : board_path(@boards.first, tour: true), class: 'dropdown-item tourDropdown' %>
<% end %>
<%= link_to t('header.menu.docs'), 'https://github.com/astuto/astuto-docs', class: 'dropdown-item', target: '_blank' %>
<%= link_to t('header.menu.support'), Rails.application.multi_tenancy? ? 'mailto:info@astuto.io' : 'https://github.com/astuto/astuto/issues', class: 'dropdown-item', target: '_blank' %>
<div class="dropdown-divider"></div>
<% end %>
2024-05-03 18:11:07 +02:00
<% unless @disable_sign_out %>
<%= button_to t('header.menu.sign_out'), destroy_user_session_path, method: :delete, class: 'dropdown-item' %>
2024-05-03 18:11:07 +02:00
<% else %>
<small style="font-size: 12px; color: grey; padding: 0.25rem 1.5rem;">
Sign out disabled
</small>
<% end %>
2019-08-19 16:43:32 +02:00
</div>
</li>
<% else %>
<li class="nav-item">
<%= link_to t('header.log_in'), @header_full_urls ? get_url_for(method(:new_user_session_url)) : new_user_session_path, class: 'nav-link' %>
2019-08-19 16:43:32 +02:00
</li>
<% end %>
</ul>
</div>
</div>
</nav>