Cache rendered templates

This commit is contained in:
Maximilian Grundke
2018-08-20 14:59:40 +02:00
parent 45b6b16c5b
commit eb2af34543
3 changed files with 14 additions and 9 deletions

View File

@ -9,9 +9,14 @@
li = link_to(t('breadcrumbs.dashboard.show'), admin_dashboard_path) li = link_to(t('breadcrumbs.dashboard.show'), admin_dashboard_path)
li = link_to(t('breadcrumbs.statistics.show'), statistics_path) li = link_to(t('breadcrumbs.statistics.show'), statistics_path)
li.divider li.divider
= render('navigation_submenu', title: t('activerecord.models.exercise.other'), models: [Exercise, ExerciseCollection, ProxyExercise, Tag], link: exercises_path) = render('navigation_submenu', title: t('activerecord.models.exercise.other'),
= render('navigation_submenu', title: t('navigation.sections.users'), models: [InternalUser, ExternalUser]) models: [Exercise, ExerciseCollection, ProxyExercise, Tag], link: exercises_path, cached: true)
= render('navigation_collection_link', model: ExecutionEnvironment) = render('navigation_submenu', title: t('navigation.sections.users'), models: [InternalUser, ExternalUser],
= render('navigation_submenu', title: t('navigation.sections.errors'), models: [ErrorTemplate, ErrorTemplateAttribute]) cached: true)
= render('navigation_submenu', title: t('navigation.sections.files'), models: [FileType, FileTemplate]) = render('navigation_collection_link', model: ExecutionEnvironment, cached: true)
= render('navigation_submenu', title: t('navigation.sections.integrations'), models: [Consumer, CodeHarborLink]) = render('navigation_submenu', title: t('navigation.sections.errors'),
models: [ErrorTemplate, ErrorTemplateAttribute], cached: true)
= render('navigation_submenu', title: t('navigation.sections.files'), models: [FileType, FileTemplate],
cached: true)
= render('navigation_submenu', title: t('navigation.sections.integrations'), models: [Consumer, CodeHarborLink],
cached: true)

View File

@ -3,4 +3,4 @@ li.dropdown.dropdown-submenu
a href=link class="dropdown-toggle" data-toggle="dropdown" = title a href=link class="dropdown-toggle" data-toggle="dropdown" = title
ul class="dropdown-menu" ul class="dropdown-menu"
- models.each do |model| - models.each do |model|
= render('navigation_collection_link', model: model) = render('navigation_collection_link', model: model, cached: true)

View File

@ -26,9 +26,9 @@ html lang='en'
i.fa.fa-code i.fa.fa-code
= application_name = application_name
#navbar-collapse.collapse.navbar-collapse #navbar-collapse.collapse.navbar-collapse
= render('navigation') = render('navigation', cached: true)
ul.nav.navbar-nav.navbar-right ul.nav.navbar-nav.navbar-right
= render('locale_selector') = render('locale_selector', cached: true)
li = link_to(t('shared.help.link'), '#modal-help', data: {toggle: 'modal'}) li = link_to(t('shared.help.link'), '#modal-help', data: {toggle: 'modal'})
= render('session') = render('session')
.container data-controller=controller_name .container data-controller=controller_name