1
0

Faster Tagz

This commit is contained in:
2013-12-15 04:06:34 +07:00
parent 47d5ab67a0
commit e031b29205
9 changed files with 167 additions and 150 deletions
+32
View File
@@ -0,0 +1,32 @@
module TagzTemplates
class Big < Base
def render
html_{
head_{
title_ 'Customers List'
}
body_{
@customers.each{ |customer|
dl_{
dt_ 'Name:'
dd_ customer['name']
dt_ 'Age:'
dd_ customer['age']
dt_ 'Address:'
dd_{
[
customer['zip'],
customer['country'],
customer['city'],
customer['address']
].join("\n")
}
dt_ 'Employer:'
dd_ customer['employer']
}
}
}
}
end
end
end
-26
View File
@@ -1,26 +0,0 @@
html_{
head_{
title_ 'Customers List'
}
body_{
customers.each{ |customer|
dl_{
dt_ 'Name:'
dd_ customer['name']
dt_ 'Age:'
dd_ customer['age']
dt_ 'Address:'
dd_{
[
customer['zip'],
customer['country'],
customer['city'],
customer['address']
].join("\n")
}
dt_ 'Employer:'
dd_ customer['employer']
}
}
}
}
+25
View File
@@ -0,0 +1,25 @@
module TagzTemplates
class Small < Base
def render
html_{
head_{
title_ @window_title
}
body_{
h1_ "Hello, #{@username}!"
p_{
<<-END
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
END
}
}
}
end
end
end
-19
View File
@@ -1,19 +0,0 @@
html_{
head_{
title_ window_title
}
body_{
h1_ "Hello, #{username}!"
p_{
<<-END
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
END
}
}
}