forked from academiadocodigo/TBGWebCharts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jumbotron.pas
68 lines (54 loc) · 1.47 KB
/
Jumbotron.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
unit Jumbotron;
interface
uses
Interfaces;
type
TModelJumbotron = class(TInterfacedObject, iModelJumbotron)
private
[weak]
FParent : iModelHTML;
FTitle : String;
FDescription : String;
public
constructor Create(Parent : IModelHTML);
destructor Destroy; override;
class function New(Parent : IModelHTML) : iModelJumbotron;
function Title(Value : String) : iModelJumbotron;
function Description(Value : String) : iModelJumbotron;
function &End : iModelHTML;
end;
implementation
{ TModelHTMLJumbotron }
constructor TModelJumbotron.Create(Parent: IModelHTML);
begin
FParent := Parent;
end;
function TModelJumbotron.Description(Value: String): iModelJumbotron;
begin
Result := Self;
FDescription := Value;
end;
destructor TModelJumbotron.Destroy;
begin
inherited;
end;
function TModelJumbotron.&End: iModelHTML;
begin
Result := FParent;
FParent.HTML('<div class="jumbotron jumbotron-fluid">');
FParent.HTML('<div class="container">');
FParent.HTML('<h1 class="display-4">' + FTitle + '</h1>');
FParent.HTML('<p class="lead">' + FDescription + '</p>');
FParent.HTML('</div>');
FParent.HTML('</div>');
end;
class function TModelJumbotron.New(Parent: IModelHTML): iModelJumbotron;
begin
Result := self.Create(Parent);
end;
function TModelJumbotron.Title(Value: String): iModelJumbotron;
begin
Result := Self;
FTitle := Value;
end;
end.