Sha256: 10c4bc7a09b4343ed75a21977a19f4f9f4e428c5e5047d5e8016df633f58c7c3

Contents?: true

Size: 1.66 KB

Versions: 3

Compression:

Stored size: 1.66 KB

Contents

#!/usr/bin/env ruby
# encoding: utf-8
# Html::View::Template -- ydim -- 12.01.2006 -- hwyss@ywesee.com

require 'htmlgrid/divtemplate'
require 'htmlgrid/span'
require 'ydim/html/view/htmlgrid'
require 'ydim/html/view/navigation'

module YDIM
	module Html
		module View
class Template < HtmlGrid::DivTemplate
	COMPONENTS = {
		[0,0]		=>	:subnavigation,
		[1,0]		=>	:foot,
		[0,1]		=>	:content,
		[0,2]		=>	:version,
		[1,2]		=>	'ydim',
	}
	CSS_MAP = ['head', 'content', 'foot',]
	DIV_CLASS = 'template'
	FOOT = Navigation
	LEGACY_INTERFACE = false
	def content(model)
		@content ||= super
	end
	def cpr_link(model)
		link = standard_link(:cpr_link, model)
		link.href = 'http://www.ywesee.com'
		link
	end
	def lgpl_license(model)
		link = standard_link(:lgpl_license, model)
		link.href = 'http://www.gnu.org/copyleft/lesser.html'
		link
	end
	def other_html_headers(context)
		res = super
		['dojo', 'ydim'].each { |name|
			properties = {
				"language"	=>	"JavaScript",
				"type"			=>	"text/javascript",
				"src"				=>	@lookandfeel.resource_global(:javascript, "#{name}.js"),
			}
			res << context.script(properties)
		}
		res
	end
	def standard_link(key, model)
		HtmlGrid::Link.new(key, model, @session, self)
	end
	def version(model)
		span = HtmlGrid::Span.new(model, @session, self)
		span.css_id = 'version'
		span.value = [ 
			lgpl_license(model), @lookandfeel.lookup('comma'), Time.now.year.to_s,
			cpr_link(model), @lookandfeel.lookup('comma'), ydim_version(model),
		]
		span
	end
	def ydim_version(model)
		link = standard_link(:ydim_version, model)
		link.href = 'https://github.com/zdavatz/ydim-html'
		link.set_attribute('title', YDIM_VERSION)
		link
	end
end
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ydim-html-1.0.3 lib/ydim/html/view/template.rb
ydim-html-1.0.2 lib/ydim/html/view/template.rb
ydim-html-1.0.1 lib/ydim/html/view/template.rb