app/views/layouts/admin.html.erb in tkh_admin_panel-0.1.1 vs app/views/layouts/admin.html.erb in tkh_admin_panel-0.2

- old
+ new

@@ -2,11 +2,13 @@ <html lang="<%= I18n.locale.to_s || 'en' %>"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> - <% if defined?(APP_SETTINGS) && APP_SETTINGS['site_name'] %> + <% if defined?(Setting) && !Setting.first.site_name.blank? %> + <%= t("admin_panel_for") + ' ' + Setting.first.site_name %> + <% elsif defined?(APP_SETTINGS) && APP_SETTINGS['site_name'] %> <%= t("admin_panel_for") + ' ' + APP_SETTINGS['site_name'] %> <% else %> <%= t 'admin_panel' %> <% end %> </title> @@ -29,11 +31,13 @@ <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <%= render 'shared/login_info' %> <h1> - <% if defined?(APP_SETTINGS) && APP_SETTINGS['site_name'] %> - <%= (t("admin_panel_for") + ' ' + link_to(APP_SETTINGS['site_name'], root_path)).html_safe %> + <% if defined?(Setting) && !Setting.first.site_name.blank? %> + <%= (t("admin_panel_for") + ' ' + link_to(Setting.first.site_name, root_path)).html_safe %> + <% elsif defined?(APP_SETTINGS) && APP_SETTINGS['site_name'] %> + <%= t("admin_panel_for") + ' ' + APP_SETTINGS['site_name'] %> <% else %> <%= t 'admin_panel' %> <% end %> </h1>