/[Arh]/lib/Arh/Bootstrap.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/Arh/Bootstrap.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations)
Thu Nov 29 17:17:16 2007 UTC (16 years, 4 months ago) by dpavlin
File size: 1983 byte(s)
added users/passowrds all over the place
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 $user = Arh::Model::User->new;
19
20 $user->create(
21 name => 'Admin',
22 lastname => 'User',
23 email => 'admin@example.com',
24 email_confirmed => 1,
25 password => 'siteadmin',
26 administrator => 1,
27 organization => 'Site administrator',
28 );
29
30 my $pt = Arh::Model::PictureType->new(current_user => $system_user);
31
32 $pt->create( name => $_ ) foreach ( qw/
33 tlocrt
34 slika
35 rekonstrukcija
36 aksiometrija
37 arhitektura
38 namještaj
39 / );
40
41 my $chronology = Arh::Model::Chronology->new(current_user => $system_user);
42 $chronology->create(
43 name => 'kraj 8. stoljeća',
44 );
45
46 my $material = Arh::Model::Material->new;
47 $material->create(
48 name => 'tvrdi vapnenac',
49 );
50
51 my $location = Arh::Model::Location->new;
52 $location->create(
53 name => 'Lapidarij u Balama',
54 );
55
56 my $place = Arh::Model::Place->new;
57 $place->create(
58 name => 'mjesto iskapanja',
59 );
60
61 my $campaign = Arh::Model::Campaign->new(current_user => $system_user);
62 $campaign->create(
63 place => $place,
64 name => 'prvo iskapanje',
65 date_from => '2007-11-28',
66 date_to => '2008-03-15',
67 );
68
69 my $unit = Arh::Model::Unit->new(current_user => $system_user);
70 $unit->create(
71 name => 'Mali kapitel stupića mnolitnog oltara',
72 number => 'SMV - 96/60',
73 campaign => $campaign,
74 dimensions => 'visina kapitola 13,5 cm; ukupna visina: 14,5 cm; presjek 13,5x13,5x5cm; manji presjek 11cm',
75 position => 'otkriveno cca 12m od istočne fasade crkve',
76 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.',
77 chronology => $chronology,
78 location => $location,
79 );
80
81 my $um = Arh::Model::UnitMaterial->new;
82 $um->create(
83 unit => $unit,
84 material => $material,
85 );
86 }
87
88 1;

  ViewVC Help
Powered by ViewVC 1.1.26