1:- module(ag_skin, []).    2
    3:- use_module(library(http/html_write)).    4:- use_module(library(http/html_head)).    5
    6:- use_module(library(semweb/rdf_db)).    7:- use_module(library(semweb/rdfs)).    8:- use_module(library(semweb/rdf_label)).    9
   10
   11:- use_module(cliopatria(hooks)).   12:- use_module(library(yui3_beta)).   13:- use_module(skin(cliopatria)).   14:- use_module(components(label)).   15% :- use_module(components(menu)).
   16% :- use_module(components(simple_search)).
   17
   18
   19:- set_setting_default(graphviz:format, svg).   20
   21:- html_resource(css('amalgame.css'),
   22		 [requires([ css('cliopatria.css')
   23			   ])
   24		 ]).   25:- html_resource(cliopatria,
   26		 [ virtual(true),
   27		   requires([ css('amalgame.css')
   28			    ])
   29		 ]).   30
   31:- html_resource(sortable,
   32		 [ virtual(true),
   33		   requires([ js('sorttable.js')
   34			    ])
   35		 ]).   36
   37cliopatria:display_link(literal(type(XSD,L)), _Options) -->
   38	{
   39	 rdf_equal(XSD, xsd:dateTime)
   40	},
   41	format_xsd_timestamp(L).
   42
   43cliopatria:display_link(Cell, _Options) -->
   44	{
   45	 rdfs_individual_of(Cell, align:'Cell'),
   46	 resource_link(Cell, HREF)
   47	},
   48	html(a([class(r_def), href(HREF)], ['Map: ', \turtle_label(Cell)])).
   49
   50cliopatria:display_link(SkosXLLabel, _Options) -->
   51	{ rdfs_individual_of(SkosXLLabel, skosxl:'Label'),
   52	  rdf_has(SkosXLLabel, skosxl:literalForm, Literal),
   53	  literal_text(Literal, Label),
   54	  resource_link(SkosXLLabel, HREF)
   55	},
   56	html(a([class('skosxllabel'), href(HREF)], Label)).
   57
   58rdf_label:display_label_hook(Cell, _Lang, Label) :-
   59	rdfs_individual_of(Cell, align:'Cell'),
   60	atom_concat('Map: ', Cell, Label).
   61
   62cliopatria:predicate_order(P, "zzz") :- rdf_equal(align:map, P).
   63cliopatria:predicate_order(P, 400) :-
   64	rdf_has(P, rdfs:isDefinedBy, 'http://www.w3.org/ns/prov#').
   65cliopatria:predicate_order(P, 405) :-
   66	rdf_has(P, rdfs:isDefinedBy, 'http://purl.org/vocabularies/amalgame').
   67
   68% Amalgame is an extension of ClioPatria and uses the ClioPatria
   69% skin.
   70
   71:- multifile
   72        user:body//2.   73
   74user:body(amalgame(app), Body) -->
   75	html([ \html_requires(cliopatria),
   76	       \html_requires(css('application.css')),
   77	       \yui3_combo(yui3,
   78			   ['cssreset/cssreset-min.css',
   79			    'cssgrids/cssgrids-min.css',
   80			    'cssfonts/cssfonts-min.css'
   81			   ]),
   82	       meta([name(viewport),
   83                   content('width=device-width, initial-scale=1')]),
   84	       body(class(['yui3-skin-sam',
   85			   'yui-skin-sam',
   86			   cliopatria]),
   87		    [ Body
   88		    ]),
   89	       \server_address(amalgame)
   90	     ]).
   91
   92format_xsd_timestamp(L) -->
   93	{
   94	 sub_atom(L,St,_Wt,_Et,'T'),
   95	 sub_atom(L,_Sp,_Wp,Ep,'+'), ST is St + 1, ET is Ep +1,
   96	 sub_atom(L,0,St,_,DatePart),
   97	 sub_atom(L,ST,_,ET,TimePart)
   98	},
   99	html(span(class('time:instant'), [TimePart, ' on ',DatePart]))