Skip to content

Commit c1344ac

Browse files
author
Mattia Roccoberton
committed
refactor: change template references to view_template
1 parent c533b8f commit c1344ac

38 files changed

+39
-39
lines changed

extra/sample_features_app/admin/sample_page.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Admin
44
class SamplePage < TinyAdmin::Views::DefaultLayout
5-
def template
5+
def view_template
66
super do
77
h1 { 'Sample page' }
88
p { 'This is a sample page' }

extra/sample_features_app/admin/sample_page2.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Admin
44
class SamplePage2 < TinyAdmin::Views::DefaultLayout
5-
def template
5+
def view_template
66
super do
77
h1 { 'Sample page 2' }
88
p { 'This is another sample page' }

extra/tiny_admin_settings.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class SamplePage < TinyAdmin::Views::DefaultLayout
4-
def template
4+
def view_template
55
super do
66
h1 { 'Sample page' }
77
p { 'This is a sample page' }
@@ -10,7 +10,7 @@ def template
1010
end
1111

1212
class SamplePage2 < TinyAdmin::Views::DefaultLayout
13-
def template
13+
def view_template
1414
super do
1515
h1 { 'Sample page 2' }
1616
p { 'This is another sample page' }

lib/tiny_admin/views/actions/index.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Index < DefaultLayout
1313
:records,
1414
:slug
1515

16-
def template
16+
def view_template
1717
super do
1818
div(class: 'index') {
1919
div(class: 'row') {

lib/tiny_admin/views/actions/show.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Show < DefaultLayout
1111
:reference,
1212
:slug
1313

14-
def template
14+
def view_template
1515
super do
1616
div(class: 'show') {
1717
div(class: 'row') {

lib/tiny_admin/views/components/field_value.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def initialize(field, value, record:)
1212
@record = record
1313
end
1414

15-
def template
15+
def view_template
1616
translated_value = field.translate_value(value)
1717
value_class = field.options[:options]&.include?('value_class') ? "value-#{value}" : nil
1818
if field.options[:link_to]

lib/tiny_admin/views/components/filters_form.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Components
66
class FiltersForm < BasicComponent
77
attr_accessor :filters, :section_path
88

9-
def template
9+
def view_template
1010
form(class: 'form_filters', method: 'get') {
1111
filters.each do |field, filter|
1212
name = field.name

lib/tiny_admin/views/components/flash.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Components
66
class Flash < BasicComponent
77
attr_accessor :messages
88

9-
def template
9+
def view_template
1010
@messages ||= {}
1111
notices = messages[:notices]
1212
warnings = messages[:warnings]

lib/tiny_admin/views/components/head.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Components
66
class Head < BasicComponent
77
attr_accessor :extra_styles, :page_title, :style_links
88

9-
def template
9+
def view_template
1010
head {
1111
meta charset: 'utf-8'
1212
meta name: 'viewport', content: 'width=device-width, initial-scale=1'

lib/tiny_admin/views/components/navbar.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Components
66
class Navbar < BasicComponent
77
attr_accessor :current_slug, :items, :root_path, :root_title
88

9-
def template
9+
def view_template
1010
nav(class: 'navbar navbar-expand-lg') {
1111
div(class: 'container') {
1212
a(class: 'navbar-brand', href: root_path) { root_title }

0 commit comments

Comments
 (0)