1 module deepmagic.layout.code_black.head_block.head_block; 2 3 import deepmagic.layout.code_black; 4 5 class AppLayoutHeadBlock : HeadElement{ 6 private string _charset = "UTF-8"; 7 private string _description = "Randora Server Template"; 8 private string _format_detection = "telephone=no"; 9 private string _keywords = "Bootstrap, Template"; 10 private string _viewport = "width=device-width, initial-scale=1.0, maximum-scale=1.0"; 11 12 private string _title = "asdf"; 13 14 private string[] _stylesheets = null; 15 16 this(){ 17 super(); 18 this._stylesheets ~= "/css/bootstrap.min.css"; 19 this._stylesheets ~= "/css/animate.min.css"; 20 this._stylesheets ~= "/css/font-awesome.min.css"; 21 this._stylesheets ~= "/css/form.css"; 22 this._stylesheets ~= "/css/calendar.css"; 23 this._stylesheets ~= "/css/style.css"; 24 this._stylesheets ~= "/css/icons.css"; 25 this._stylesheets ~= "/css/generics.css"; 26 27 this.init(); 28 } 29 30 override void init(){ 31 MetaElement viewport = new MetaElement(); 32 viewport.tag.attr["name"] = "viewport"; 33 viewport.tag.attr["content"] = this._viewport; 34 35 MetaElement format_detection = new MetaElement(); 36 format_detection.tag.attr["name"] = "format-detection"; 37 format_detection.tag.attr["content"] = this._format_detection; 38 39 MetaElement charset = new MetaElement(); 40 charset.tag.attr["charset"] = this._charset; 41 42 MetaElement description = new MetaElement(); 43 description.tag.attr["name"] = "description"; 44 description.tag.attr["content"] = this._description; 45 46 MetaElement keywords = new MetaElement(); 47 keywords.tag.attr["name"] = "keywords"; 48 keywords.tag.attr["content"] = this._keywords; 49 50 TitleElement title = new TitleElement(); 51 title ~= new Text(this._title); 52 53 this ~= title; 54 this ~= viewport; 55 this ~= format_detection; 56 this ~= charset; 57 this ~= description; 58 this ~= keywords; 59 60 foreach(int i, string stylesheet; this._stylesheets){ 61 LinkElement link = new LinkElement(); 62 link.tag.attr["href"] = stylesheet; 63 link.tag.attr["rel"] = "stylesheet"; 64 this ~= link; 65 } 66 } 67 }