1. André Walker
  2. perl-pro

Commits

André Walker  committed d9b0a0f

Make account / profile update forms work

  • Participants
  • Parent commits ff043b5
  • Branches master

Comments (0)

Files changed (5)

File lib/PerlPro/Schema/ResultSet/Company.pm

View file
     return {
         register => Data::Verifier->new(
             profile => {
-                name        => { required => 1, type => Str },
+                name    => { required => 1, type => Str },
+                email   => { required => 1, type => EmailAddress },
+                phone   => { required => 0, type => Str },
+                address => { required => 0, type => Str },
+                city    => { required => 0, type => Str },
+                state   => { required => 0, type => Str },
+            },
+            filters => [
+                sub { HTML::Entities::encode_entities( $_[0], qr{<>&"'} ) }
+            ],
+        ),
+        account => Data::Verifier->new(
+            profile => {
+                name_in_url => { required => 1, type => Str },
+                login       => { required => 1, type => Str },
                 email       => { required => 1, type => EmailAddress },
                 phone       => { required => 0, type => Str },
                 address     => { required => 0, type => Str },
                 city        => { required => 0, type => Str },
                 state       => { required => 0, type => Str },
             },
-            filters => [
-                sub { HTML::Entities::encode_entities( $_[0], qr{<>&"'} ) }
-            ],
+        ),
+        public_profile => Data::Verifier->new(
+            profile => {
+                name_in_url => { required => 1, type => Str },
+                name        => { required => 1, type => Str },
+                description => { required => 0, type => Str },
+                website     => { required => 0, type => Uri, coerce => 1 },
+                email       => { required => 0, type => EmailAddress },
+                phone       => { required => 0, type => Str },
+                address     => { required => 0, type => Str },
+                city        => { required => 0, type => Str },
+                state       => { required => 0, type => Str },
+            },
         ),
         add_email => Data::Verifier->new(
             profile => {
                 description => $values{description},
             });
 
-            $row->add_to_company_emails({ email => $values{email}, is_main_address => 1 });
+            $row->add_to_company_emails({
+                email           => $values{email},
+                is_main_address => 1,
+                is_public       => 0
+            });
             if ($values{phone}) {
                 $row->add_to_company_phones({
                     phone         => $values{phone},
                     is_main_phone => 1,
+                    is_public     => 0,
                 });
             }
 
-            $row->add_to_company_locations({
-                address         => $values{address},
-                city            => $values{city},
-                state           => $values{state},
-                country         => 'Brazil', # later on, it won't be hardcoded
-                is_main_address => 1,
+            if ($values{city} && $values{state}) {
+                $row->add_to_company_locations({
+                    address         => $values{address},
+                    city            => $values{city},
+                    state           => $values{state},
+                    country         => 'Brazil', # later on, it won't be hardcoded
+                    is_main_address => 1,
+                    is_public       => 0,
+                });
+            }
+
+            return $row;
+        },
+        account => sub {
+            my %values = shift->valid_values;
+
+            my $row = $self->find($values{name_in_url});
+
+            $row->company_emails->search({ is_public => 0 })->delete;
+            $row->company_phones->search({ is_public => 0 })->delete;
+            $row->company_locations->search({ is_public => 0 })->delete;
+
+            $row->add_to_company_emails({ is_public => 0, email => $values{email} });
+            if ($values{phone}) {
+                $row->add_to_company_phones({ is_public => 0, phone => $values{phone} });
+            }
+            if ($values{city} && $values{state}) {
+                $row->add_to_company_locations({
+                    is_public => 0,
+                    address   => $values{address},
+                    city      => $values{city},
+                    state     => $values{state},
+                    country   => 'Brazil',
+                });
+            }
+
+            my $user = $row->users->first;
+            $user->update({ login => $values{login} });
+            $user->user_emails->search({ is_main_address => 1 })->first->update({
+                email => $values{email}
             });
 
             return $row;
         },
+        public_profile => sub {
+            my %values = shift->valid_values;
+
+            my $row = $self->find($values{name_in_url});
+            $row->update({
+                name        => $values{name},
+                description => $values{description},
+            });
+
+            $row->company_websites->delete;
+            $row->company_emails->search({ is_public => 1 })->delete;
+            $row->company_phones->search({ is_public => 1 })->delete;
+            $row->company_locations->search({ is_public => 1 })->delete;
+
+            if ($values{website}) {
+                $row->add_to_company_websites({ url => $values{website} });
+            }
+
+            if ($values{email}) {
+                $row->add_to_company_emails({ is_public => 1, email => $values{email} });
+            }
+
+            if ($values{phone}) {
+                $row->add_to_company_phones({ is_public => 1, phone => $values{phone} });
+            }
+
+            if ($values{city} && $values{state}) {
+                $row->add_to_company_locations({
+                    is_public => 1,
+                    address   => $values{address},
+                    city      => $values{city},
+                    state     => $values{state},
+                    country   => 'Brazil',
+                });
+            }
+
+            return $row;
+        },
         add_email => sub {
             my %values = shift->valid_values;
             my $row = $self->find($values{company});
 
     my @phones = map {
         $_->phone
-    } $company->company_phones->search({}, {
+    } $company->company_phones->search({ is_public => 1 }, {
         order_by => { -desc => 'is_main_phone' }
     })->all;
 
     my @emails = map {
         $_->email
-    } $company->company_emails->search({}, {
+    } $company->company_emails->search({ is_public => 1 }, {
         order_by => { -desc => 'is_main_address' }
     })->all;
 
     my @locations = map {
         $_->address . ", " . $_->city  . " - " . $_->state
-    } $company->company_locations->search({}, {
+    } $company->company_locations->search({ is_public => 1 }, {
         order_by => { -desc => 'is_main_address' }
     })->all;
 
     }
 }
 
-sub get_to_edit {
+sub get_to_update_account {
+    my ($self, $login, $id) = @_;
+
+    my $company = $self->find($id);
+
+    return unless $company;
+
+    my @phones = $company->company_phones->search(
+        { is_public => 0 },
+        { rows => 1 }
+    )->all;
+    my @emails = $company->users->find($login)->user_emails->search(
+        {},
+        {
+            order_by => { -desc => 'is_main_address' },
+            rows     => 1,
+        }
+    )->all;
+    my @locations = $company->company_locations->search(
+        { is_public => 0 },
+        { rows => 1 }
+    )->all;
+
+    my ($phone) = map { $_->phone } @phones;
+    my ($email) = map { $_->email } @emails;
+    my ($address, $city, $state) = map { ($_->address, $_->city, $_->state) } @locations;
+
+    my %account = (
+        email          => $email,
+        phone          => $phone,
+        address        => $address,
+        city           => $city,
+        state          => $state,
+        login          => $login,
+        open_positions => $company->jobs->search({ status => 'active' })->count,
+    );
+
+    return {
+        map { ( "company.account.$_" => $account{$_} ) } keys %account
+    };
+}
+
+sub get_to_update_public_profile {
     my ($self, $id) = @_;
 
     my $company = $self->find($id);
     return unless $company;
 
     my @websites = $company->company_websites->search({}, {
-        order_by => { -desc => 'is_main_website' }
+        order_by => { -desc => 'is_main_website' },
+        rows => 1,
     })->all;
-    my @phones   = $company->company_phones->search({}, {
-        order_by => { -desc => 'is_main_phone' }
+    my @phones   = $company->company_phones->search({ is_public => 1 }, {
+        order_by => { -desc => 'is_main_phone' },
+        rows => 1,
     })->all;
-    my @emails   = $company->company_emails->search({}, {
-        order_by => { -desc => 'is_main_address' }
+    my @emails   = $company->company_emails->search({ is_public => 1 }, {
+        order_by => { -desc => 'is_main_address' },
+        rows => 1,
     })->all;
-    my @locations = $company->company_locations->search({}, {
-        order_by => { -desc => 'is_main_address' }
+    my @locations = $company->company_locations->search({ is_public => 1 }, {
+        order_by => { -desc => 'is_main_address' },
+        rows => 1,
     })->all;
 
-    my $email = scalar @emails ? $emails[0]->email : '';
+    my ($website) = map { $_->url } @websites;
+    my ($phone) = map { $_->phone } @phones;
+    my ($email) = map { $_->email } @emails;
+    my ($address, $city, $state) = map { ($_->address, $_->city, $_->state) } @locations;
 
-    return {
-        name_in_url    => $company->name_in_url,
+    my %profile = (
+        name_in_url    => $id,
         name           => $company->name,
         description    => $company->description,
-        websites       => \@websites,
-        emails         => \@emails,
-        phones         => \@phones,
-        locations      => \@locations,
+        website        => $website,
         email          => $email,
-        login          => $company->users->first->login,
-        open_positions => $company->jobs->search({ status => 'active' })->count,
-    }
+        phone          => $phone,
+        address        => $address,
+        city           => $city,
+        state          => $state,
+    );
+
+    return {
+        map { ( "company.public_profile.$_" => $profile{$_} ) } keys %profile
+    };
 }
 
 sub get_featured_companies {

File lib/PerlPro/Web/Controller/Company/Data.pm

View file
 
 BEGIN { extends 'Catalyst::Controller' }
 
-sub base :Chained('/company/auth/requires_login') PathPart('') CaptureArgs(0) {}
+sub base :Chained('/company/auth/requires_login') PathPart('') CaptureArgs(0) {
+    my ( $self, $ctx ) = @_;
+
+    $ctx->stash(current_model => 'DB::Company');
+}
 
-sub home :Chained('base') Args(0) GET {
+sub home :Chained('base') Does('DisplayExecute') Args(0) {
     my ( $self, $ctx ) = @_;
 
     $ctx->stash(
         template     => 'company/home.tx',
         current_page => 'home',
-        c            => $ctx->model('DB::Company')->get_to_edit($ctx->stash->{company}),
+        fields       => $ctx->model->get_to_update_account(
+            $ctx->user->get_object->login,
+            $ctx->stash->{company}
+        ),
     );
 }
 
-sub profile :Chained('base') Args(0) GET {
+sub home_execute {
+    my ( $self, $ctx ) = @_;
+
+    $ctx->stash->{DO_NOT_APPLY_DM} = 1;
+
+    my $dm      = $ctx->model('DataManager');
+    my $params  = $ctx->req->params;
+    my $company = $params->{company}{account};
+    $company->{name_in_url} = $ctx->stash->{company};
+
+    $dm->apply_one( 'company.account', $company );
+
+    if (my $obj = $dm->get_outcome_for('company.account')) {
+        $ctx->set_authenticated($ctx->find_user({ login => $obj->users->first->login }));
+    }
+}
+
+
+sub profile :Chained('base') Does('DisplayExecute') Args(0) {
     my ( $self, $ctx ) = @_;
 
     $ctx->stash(
         template     => 'company/profile.tx',
         current_page => 'profile',
-        c            => $ctx->model('DB::Company')->get_to_edit($ctx->stash->{company}),
+        fields       => $ctx->model->get_to_update_public_profile(
+            $ctx->stash->{company}
+        ),
     );
 }
 
-sub update : Chained('base') PathPart('data') Args(1) PUT {
-    my ( $self, $ctx, $field ) = @_;
-    # update a given field (by AJAX)
-}
-
-sub add_data : Chained('base') PathPart('add_data') Args(0) POST {
+sub profile_execute {
     my ( $self, $ctx ) = @_;
-    # add a new item of the given field (by AJAX), e.g., add new phone
-}
 
-sub remove_data : Chained('base') PathPart('remove') Args(2) DELETE {
-    my ( $self, $ctx, $field, $item ) = @_;
-    # remove item of the given field (by AJAX), e.g., delete phone
+    $ctx->stash->{DO_NOT_APPLY_DM} = 1;
+
+    my $dm      = $ctx->model('DataManager');
+    my $params  = $ctx->req->params;
+    my $company = $params->{company}{public_profile};
+    $company->{name_in_url} = $ctx->stash->{company};
+
+    $dm->apply_one( 'company.public_profile', $company );
 }
 
 __PACKAGE__->meta->make_immutable;

File root/src/company/home.tx

View file
 </div><!-- end .row -->
 
 <div id="account-home" class="content">
+:   if ($messages && $messages.count()) {
+        <div class="alert alert-danger">
+            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+            <h4><: $l('Erro ao salvar') :></h4>
+            <ul>
+:           for $messages.messages -> $message {
+                <li><: $lm($message); :></li>
+:           }
+            </ul>
+        </div>
+:   }
+:   if ($is_success) {
+        <div class="alert alert-success">
+            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+            <h4><: $l('Dados salvos com sucesso') :></h4>
+        </div>
+:   }
+
+:   block main_form | fif($fields) -> {
+    <form method="post" action="<: $uri('/account/home') :>">
     <div class="row">
 
         <div class="col-md-6">
                     <div class="form-group">
                         <label for="login" class="col-lg-3 control-label">Login</label>
                         <div class="col-lg-6">
-                            <input type="text" class="form-control" id="login" placeholder="Digite o usuário" value="<: $c.login :>">
+                            <input type="text" class="form-control" id="login" name="company.account.login" placeholder="Digite o usuário">
                         </div>
                         <label for="login" class="col-lg-2 control-label secundary-label">Alterar</label>
                     </div>
                         <label class="col-lg-3 control-label"><: $l('Anúncios') :></label>
                         <div class="col-lg-6">
                             <span><:
-                                if $c.open_positions == 0 {
+                                if $fields['company.account.open_positions'] == 0 {
                                     "Nenhum anúncio cadastrado.";
                                 }
-                                elsif $c.open_positions == 1 {
+                                elsif $fields['company.account.open_positions'] == 1 {
                                     "1 anúncio cadastrado.";
                                 }
                                 else {
-                                    $c.open_positions;
+                                    $fields['company.account.open_positions'];
                                     " anúncios cadastrados.";
                                 }
 
         </div><!-- end .col-md-6 -->
 
         <div class="col-md-6">
-            <div id="account_contacts" class="content-block">
+            <div class="content-block">
 
                 <h2><: $l('Contatos Administrativos') :></h2>
                 <hr>
 
-                <form class="form-horizontal" role="form">
-
-                    <div class="form-group">
-                        <label for="website" class="col-lg-2 control-label"><span class="glyphicon glyphicon-globe"></span></label>
-                        <div class="col-lg-6">
-                            <input type="url" class="form-control" id="website" placeholder="Website">
-                            <small><a class="add-link" href="#">Adicionar site</a></small>
-                        </div>
-                    </div>
+                <div class="form-horizontal" role="form">
 
                     <div class="form-group">
                         <label for="email" class="col-lg-2 control-label"><span class="glyphicon glyphicon-envelope"></span></label>
                         <div class="col-lg-6">
-                            <input type="email" class="form-control" id="email" placeholder="Email">
-                            <small><a class="add-link" href="#">Adicionar email</a></small>
+                            <input type="email" class="form-control" id="email" name="company.account.email" placeholder="Email">
                         </div>
                     </div>
 
                     <div class="form-group">
                         <label for="phone" class="col-lg-2 control-label"><span class="glyphicon glyphicon-earphone"></span></label>
                         <div class="col-lg-6">
-                            <input type="tel" class="form-control" id="phone" placeholder="Telefone">
-                            <small><a class="add-link" href="#">Adicionar telefone</a></small>
+                            <input type="tel" class="form-control" id="phone" name="company.account.phone" placeholder="Telefone">
                         </div>
                     </div>
 
                     <div class="form-group">
                         <label for="address" class="col-lg-2 control-label"><span class="glyphicon glyphicon-map-marker"></span></label>
                         <div class="col-lg-6">
-                            <input type="text" class="form-control" id="address" placeholder="Endereço">
-                            <small><a class="add-link" href="#">Adicionar endereço</a></small>
+                            <input type="text" class="form-control" id="address" name="company.account.address" placeholder="Endereço">
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <div class="col-lg-6 col-lg-offset-2">
+                            <input type="text" class="form-control" id="city" name="company.account.city" placeholder="Cidade">
+                        </div>
+                        <div class="col-lg-4">
+                            <select name="company.account.state" class="form-control">
+                                <option value="">Estado</option>
+                                <option value="ac">Acre</option>
+                                <option value="al">Alagoas</option>
+                                <option value="ap">Amapá</option>
+                                <option value="am">Amazonas</option>
+                                <option value="ba">Bahia</option>
+                                <option value="ce">Ceará</option>
+                                <option value="df">Distrito Federal</option>
+                                <option value="es">Espírito Santo</option>
+                                <option value="go">Goiás</option>
+                                <option value="ma">Maranhão</option>
+                                <option value="mt">Mato Grosso</option>
+                                <option value="ms">Mato Grosso do Sul</option>
+                                <option value="mg">Minas Gerais</option>
+                                <option value="pa">Pará</option>
+                                <option value="pb">Paraíba</option>
+                                <option value="pr">Paraná</option>
+                                <option value="pe">Pernambuco</option>
+                                <option value="pi">Piauí</option>
+                                <option value="rj">Rio de Janeiro</option>
+                                <option value="rn">Rio Grande do Norte</option>
+                                <option value="rs">Rio Grande do Sul</option>
+                                <option value="ro">Rondônia</option>
+                                <option value="rr">Roraima</option>
+                                <option value="sc">Santa Catarina</option>
+                                <option value="sp">São Paulo</option>
+                                <option value="se">Sergipe</option>
+                                <option value="to">Tocantins</option>
+                            </select>
                         </div>
                     </div>
 
-                </form>
+                </div>
 
 
             </div><!-- end .content-block -->
 
     </div><!-- end .row -->
 
+    <div class="row">
+
+        <div class="col-md-12">
+            <div class="pull-right">
+                <button type="submit" class="btn btn-success"><: $l('Salvar') :></button>
+            </div>
+            <div class="clearfix"></div>
+        </div>
+
+    </div><!-- end .row -->
+    </form>
+:   }
+
 </div><!-- end #account-home.content -->
 : }

File root/src/company/profile.tx

View file
         <div class="page-title">
 
             <div class="pull-right">
-                <a class="btn btn-warning" href="#">Ver página</a>
+                <a class="btn btn-warning" href="<: $uri('/company/' ~ $fields['company.public_profile.name_in_url']) :>">Ver página</a>
             </div>
 
             <h1 class="underlined"><: $l('Perfil Público') :></h1>
 </div><!-- end .row -->
 
 <div id="account-profile" class="content">
+:   if ($messages && $messages.count()) {
+        <div class="alert alert-danger">
+            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+            <h4><: $l('Erro ao salvar') :></h4>
+            <ul>
+:           for $messages.messages -> $message {
+                <li><: $lm($message); :></li>
+:           }
+            </ul>
+        </div>
+:   }
+:   if ($is_success) {
+        <div class="alert alert-success">
+            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+            <h4><: $l('Dados salvos com sucesso') :></h4>
+        </div>
+:   }
+
+:   block main_form | fif($fields) {
+    <form action="<: $uri('/account/profile') :>" method="post">
     <div class="row">
 
         <div class="col-md-6">
             <div id="profile_data" class="content-block">
 
-                <h2>Informações Básicas</h2>
+                <h2><: $l('Informações Básicas') :></h2>
                 <hr>
 
-                <form class="form-horizontal" role="form">
+                <div class="form-horizontal" role="form">
 
                     <div class="form-group">
-                        <label for="corporate_name" class="col-lg-3 control-label">Logotipo</label>
+                        <label for="corporate_name" class="col-lg-3 control-label"><: $l('Logotipo') :></label>
                         <div class="col-lg-4">
                             <img src="http://lorempixel.com/180/160/abstract/" alt="Logo <: $c.name :>" width="100%" />
                         </div>
                     </div>
 
                     <div class="form-group">
-                        <label for="trading_name" class="col-lg-3 control-label">Nome</label>
+                        <label for="company_name" class="col-lg-3 control-label"><: $l('Nome') :></label>
                         <div class="col-lg-9">
-                            <input type="text" class="form-control" id="trading_name" placeholder="Nome da empresa">
+                            <input type="text" class="form-control" id="company_name" placeholder="Nome da empresa" name="company.public_profile.name">
                         </div>
                     </div>
 
                     <div class="form-group">
                         <label for="description" class="col-lg-3 control-label">Descrição</label>
                         <div class="col-lg-9">
-                            <textarea class="form-control" name="description" placeholder="Digite uma breve descrição da empresa" rows="10"></textarea>
+                            <textarea class="form-control" id="description" name="company.public_profile.description" placeholder="Digite uma breve descrição da empresa" rows="10"></textarea>
                         </div>
                     </div>
 
-                </form>
+                </div>
 
             </div><!-- end .content-block -->
         </div><!-- end .col-md-6 -->
         <div class="col-md-6">
             <div id="public_contacts" class="content-block">
 
-                <h2>Contatos públicos</h2>
+                <h2><: $l('Contatos públicos') :></h2>
                 <hr>
 
-                <form class="form-horizontal" role="form">
+                <div class="form-horizontal" role="form">
 
                     <div class="form-group">
                         <label for="website" class="col-lg-2 control-label"><span class="glyphicon glyphicon-globe"></span></label>
                         <div class="col-lg-6">
-                            <input type="url" class="form-control" id="website" placeholder="Website">
-                            <small><a class="add-link" href="#">Adicionar site</a></small>
+                            <input type="url" class="form-control" id="website" placeholder="Website" name="company.public_profile.website">
                         </div>
                     </div>
 
                     <div class="form-group">
                         <label for="email" class="col-lg-2 control-label"><span class="glyphicon glyphicon-envelope"></span></label>
                         <div class="col-lg-6">
-                            <input type="email" class="form-control" id="email" placeholder="Email">
-                            <small><a class="add-link" href="#">Adicionar email</a></small>
+                            <input type="email" class="form-control" id="email" placeholder="Email" name="company.public_profile.email">
                         </div>
                     </div>
 
                     <div class="form-group">
                         <label for="phone" class="col-lg-2 control-label"><span class="glyphicon glyphicon-earphone"></span></label>
                         <div class="col-lg-6">
-                            <input type="tel" class="form-control" id="phone" placeholder="Telefone">
-                            <small><a class="add-link" href="#">Adicionar telefone</a></small>
+                            <input type="tel" class="form-control" id="phone" placeholder="Telefone" name="company.public_profile.phone">
                         </div>
                     </div>
 
                     <div class="form-group">
                         <label for="address" class="col-lg-2 control-label"><span class="glyphicon glyphicon-map-marker"></span></label>
                         <div class="col-lg-6">
-                            <input type="text" class="form-control" id="address" placeholder="Endereço">
-                            <small><a class="add-link" href="#">Adicionar endereço</a></small>
+                            <input type="text" class="form-control" id="address" placeholder="Endereço" name="company.public_profile.address">
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <div class="col-lg-6 col-lg-offset-2">
+                            <input type="text" class="form-control" id="city" name="company.public_profile.city" placeholder="Cidade">
+                        </div>
+                        <div class="col-lg-4">
+                            <select name="company.public_profile.state" class="form-control">
+                                <option value="">Estado</option>
+                                <option value="ac">Acre</option>
+                                <option value="al">Alagoas</option>
+                                <option value="ap">Amapá</option>
+                                <option value="am">Amazonas</option>
+                                <option value="ba">Bahia</option>
+                                <option value="ce">Ceará</option>
+                                <option value="df">Distrito Federal</option>
+                                <option value="es">Espírito Santo</option>
+                                <option value="go">Goiás</option>
+                                <option value="ma">Maranhão</option>
+                                <option value="mt">Mato Grosso</option>
+                                <option value="ms">Mato Grosso do Sul</option>
+                                <option value="mg">Minas Gerais</option>
+                                <option value="pa">Pará</option>
+                                <option value="pb">Paraíba</option>
+                                <option value="pr">Paraná</option>
+                                <option value="pe">Pernambuco</option>
+                                <option value="pi">Piauí</option>
+                                <option value="rj">Rio de Janeiro</option>
+                                <option value="rn">Rio Grande do Norte</option>
+                                <option value="rs">Rio Grande do Sul</option>
+                                <option value="ro">Rondônia</option>
+                                <option value="rr">Roraima</option>
+                                <option value="sc">Santa Catarina</option>
+                                <option value="sp">São Paulo</option>
+                                <option value="se">Sergipe</option>
+                                <option value="to">Tocantins</option>
+                            </select>
                         </div>
                     </div>
 
-                </form>
+                </div>
 
 
             </div><!-- end .content-block -->
         </div><!-- end .col-md-6 -->
 
     </div><!-- end .row -->
+    <div class="row">
+
+        <div class="col-md-12">
+            <div class="pull-right">
+                <button type="submit" class="btn btn-success"><: $l('Salvar') :></button>
+            </div>
+            <div class="clearfix"></div>
+        </div>
+
+    </div><!-- end .row -->
+:   }
 </div><!-- end #account-home.content -->
 : }

File root/src/public/company/profile.tx

View file
 :                       for $c.emails -> $email {
                         <li><span class="glyphicon glyphicon-envelope"></span> <: $email :></li>
 :                       }
+:                       for $c.phones -> $phone {
+                        <li><span class="glyphicon glyphicon-earphone"></span> <: $phone :></li>
+:                       }
                     </ul>
                 </div>
 
 
             </div>
         </div><!-- end one-job -->
+:       } else {
+        <div class="col-md-12">
+            <div class="content-block">
+                <p class="lead"><: $l('A empresa ainda não inseriu nenhuma vaga de emprego.') :></p>
+            </div>
+        </div>
 :       }
 
     </div><!-- end .row -->