1 |
use warnings; |
2 |
use strict; |
3 |
|
4 |
package Arh::Bootstrap; |
5 |
use base qw(Jifty::Bootstrap); |
6 |
|
7 |
=head1 Bootstrap application data |
8 |
|
9 |
Create initial data |
10 |
|
11 |
=cut |
12 |
|
13 |
sub run { |
14 |
my $self = shift; |
15 |
|
16 |
my $system_user = Arh::CurrentUser->superuser( _bootstrap => 1 ); |
17 |
|
18 |
my $pt = Arh::Model::PictureType->new(current_user => $system_user); |
19 |
|
20 |
$pt->create( name => $_ ) foreach ( qw/ |
21 |
tlocrt |
22 |
slika |
23 |
rekonstrukcija |
24 |
aksiometrija |
25 |
arhitektura |
26 |
namještaj |
27 |
/ ); |
28 |
|
29 |
my $chronology = Arh::Model::Chronology->new(current_user => $system_user); |
30 |
$chronology->create( |
31 |
name => 'kraj 8. stoljeća', |
32 |
); |
33 |
|
34 |
my $material = Arh::Model::Material->new; |
35 |
$material->create( |
36 |
name => 'tvrdi vapnenac', |
37 |
); |
38 |
|
39 |
my $location = Arh::Model::Location->new; |
40 |
$location->create( |
41 |
name => 'Lapidarij u Balama', |
42 |
); |
43 |
|
44 |
my $place = Arh::Model::Place->new; |
45 |
$place->create( |
46 |
name => 'mjesto iskapanja', |
47 |
); |
48 |
|
49 |
my $campaign = Arh::Model::Campaign->new(current_user => $system_user); |
50 |
$campaign->create( |
51 |
place => $place, |
52 |
name => 'prvo iskapanje', |
53 |
date_from => '2007-11-28', |
54 |
date_to => '2008-03-15', |
55 |
); |
56 |
|
57 |
my $unit = Arh::Model::Unit->new(current_user => $system_user); |
58 |
$unit->create( |
59 |
name => 'Mali kapitel stupića mnolitnog oltara', |
60 |
number => 'SMV - 96/60', |
61 |
campaign => $campaign, |
62 |
dimensions => 'visina kapitola 13,5 cm; ukupna visina: 14,5 cm; presjek 13,5x13,5x5cm; manji presjek 11cm', |
63 |
position => 'otkriveno cca 12m od istočne fasade crkve', |
64 |
description => 'Ukrašen u doljnjem dijelu astragalom. U dobrom stanju. Abakus ukrašen na klasičan način, astragal u dva pojasa. Pojasnica sa spojenim listovima.', |
65 |
chronology => $chronology, |
66 |
location => $location, |
67 |
); |
68 |
|
69 |
my $um = Arh::Model::UnitMaterial->new; |
70 |
$um->create( |
71 |
unit => $unit, |
72 |
material => $material, |
73 |
); |
74 |
} |
75 |
|
76 |
1; |