Files
codeocean/app/views/layouts/application.html.slim
2021-03-10 13:51:29 +01:00

71 lines
3.2 KiB
Plaintext

doctype html
html lang="#{I18n.locale || I18n.default_locale}"
head
meta charset='utf8'
meta name='viewport' content='width=device-width, initial-scale=1'
= render('breadcrumbs_and_title')
title
= yield(:title)
= favicon_link_tag('/favicon.png', type: 'image/png')
= favicon_link_tag('/favicon.png', rel: 'apple-touch-icon', type: 'image/png')
= action_cable_meta_tag
= stylesheet_pack_tag('application', media: 'all', 'data-turbolinks-track': true)
= stylesheet_pack_tag('stylesheets', media: 'all', 'data-turbolinks-track': true)
= stylesheet_link_tag('application', media: 'all', 'data-turbolinks-track': true)
= javascript_pack_tag('application', 'data-turbolinks-track': true)
= javascript_include_tag('application', 'data-turbolinks-track': true)
= yield(:head)
= csrf_meta_tags
= timeago_script_tag
script type="text/javascript"
| I18n.defaultLocale = "#{I18n.default_locale}";
| I18n.locale = "#{I18n.locale}";
- unless Sentry.configuration.environment == "development"
| Sentry.init({
| dsn: 'https://2616b10855e04ce1b748775203ff0f7c@o257002.ingest.sentry.io/5667283',
| attachStacktrace: true,
| release: "#{Sentry.configuration.release}",
| environment: "#{Sentry.configuration.environment}",
| });
| Sentry.setContext("initial",{
| cookie: document.cookie,
| csrf: $('meta[name="csrf-token"]').attr("content")
| });
- if @current_user
| Sentry.configureScope(function(scope) {
| scope.setUser({
| "id": "#{@current_user.id}",
| "type": "#{@current_user.class.name}",
| "username": "#{@current_user.displayname}",
| "consumer": "#{@current_user.consumer.name}"
| });
| });
body
- unless @embed_options[:hide_navbar]
nav.navbar.navbar-dark.bg-dark.navbar-expand-md.mb-4.py-1 role='navigation'
.container
.navbar-brand
i.fa.fa-code
= application_name
button.navbar-toggler data-target='#navbar-collapse' data-toggle='collapse' type='button' aria-expanded='false' aria-label='Toggle navigation'
span.navbar-toggler-icon
#navbar-collapse.collapse.navbar-collapse
= render('navigation', cached: true)
ul.nav.navbar-nav.ml-auto
= render('locale_selector', cached: true)
li.nav-item.mr-3 = link_to(t('shared.help.link'), '#modal-help', data: {toggle: 'modal'}, class: 'nav-link')
= render('session')
div data-controller=controller_name
= render('flash')
- if current_user.try(:admin?) or current_user.try(:teacher?) && !@embed_options[:hide_navbar]
= yield(:breadcrumbs)
- if (controller_name == "exercises" && action_name == "implement")
.container-fluid
= yield
- else
.container
= yield
- template_variables = {execution_environment: @exercise.execution_environment} if action_name == 'implement'
= render('shared/modal', classes: 'modal-lg', id: 'modal-help', template: 'application/help', template_variables: template_variables, title: t('shared.help.headline'))