This repository has been archived on 2021-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
greenlight/app/views/shared/_header.html.erb

58 lines
2.6 KiB
Plaintext

<div class="header py-4">
<div class="container">
<div class="d-flex">
<%= link_to (current_user ? current_user.main_room : root_path), class: "header-brand" do %>
<%= image_tag(Rails.configuration.branding_image.blank? ? "logo_with_text.png" : Rails.configuration.branding_image,
class: "header-brand-img") %>
<% end %>
<div class="d-flex ml-auto">
<% if current_user %>
<a class="px-5 ml-2 mt-1" href="" data-toggle="modal" data-target="#createRoomModal">
<i class="fas fa-plus"></i>&nbsp; <%= t("header.create_room") %>
</a>
<div class="dropdown">
<a href="#" class="nav-link pr-0" data-toggle="dropdown">
<% if current_user.image.blank? %>
<span class="avatar"><%= current_user.name.first %></span>
<% else %>
<span class="avatar" style="background-image: url(<%= current_user.image %>)"></span>
<% end %>
<span class="ml-2 d-none d-lg-block">
<span class="text-default username"><%= current_user.name %></span>
</span>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow" x-placement="bottom-end">
<%= link_to current_user.main_room, class: "dropdown-item" do %>
<i class="dropdown-icon fas fa-home"></i> <%= t("header.dropdown.home") %>
<% end %>
<%= link_to edit_user_path(current_user), class: "dropdown-item" do %>
<i class="dropdown-icon fas fa-cog"></i> <%= t("header.dropdown.settings") %>
<% end %>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="http://docs.bigbluebutton.org/install/greenlight.html" target="_blank">
<i class="dropdown-icon far fa-question-circle"></i> <%= t("header.dropdown.help") %>
</a>
<%= link_to logout_path, class: "dropdown-item" do %>
<i class="dropdown-icon fas fa-sign-out-alt"></i> <%= t("header.dropdown.signout") %>
<% end %>
</div>
</div>
<% else %>
<% if Rails.configuration.omniauth_bn_launcher && !current_user %>
<%= link_to t("login"), "#{Rails.configuration.relative_url_root}/auth/bn_launcher", :class => "btn btn-pill btn-outline-primary mx-2" %>
<% else %>
<%= link_to t("login"), "#loginModal", :class => "btn btn-pill btn-outline-primary mx-2", "data-toggle": "modal" %>
<% end %>
<% if allow_user_signup? %>
<%= link_to t("signup.title"), signup_path, :class => "btn btn-pill btn-outline-primary mx-2" %>
<% end %>
<%= render "shared/modals/login_modal" %>
<% end %>
</div>
</div>
</div>
</div>