Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ RUN echo "deb http://archive.debian.org/debian buster main contrib non-free" > /
ruby ruby-dev libpq-dev gnupg git \
libfreetype6-dev libjpeg62-turbo-dev libpng-dev sudo procps \
#instalação do node 14
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs \
&& curl -fsSL https://nodejs.org/dist/v14.21.3/node-v14.21.3-linux-x64.tar.xz \
| tar -xJ -C /usr/local --strip-components=1 \
# Install uglify and terser
&& npm install -g \
terser \
Expand Down
20 changes: 10 additions & 10 deletions compose/local/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ RUN sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list \
&& apt-get update

RUN apt-get install -y --no-install-recommends \
curl libcurl4-gnutls-dev locales imagemagick libmagickcore-dev libmagickwand-dev zip unzip \
ruby ruby-dev libpq-dev gnupg nano iputils-ping git \
libfreetype6-dev libjpeg62-turbo-dev libpng-dev less vim \
sudo procps
curl libcurl4-gnutls-dev locales imagemagick libmagickcore-dev libmagickwand-dev zip unzip \
ruby ruby-dev libpq-dev gnupg nano iputils-ping git \
libfreetype6-dev libjpeg62-turbo-dev libpng-dev less vim \
sudo procps

RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs
RUN curl -fsSL https://nodejs.org/dist/v14.21.3/node-v14.21.3-linux-x64.tar.xz \
| tar -xJ -C /usr/local --strip-components=1

RUN rm -rf /var/lib/apt/lists

# Install uglify and terser
RUN npm install -g \
terser \
uglifycss \
autoprefixer
terser \
uglifycss \
autoprefixer

# Install sass
RUN gem install sass -v 3.4.22
Expand Down Expand Up @@ -52,7 +52,7 @@ RUN yes | pecl install xdebug-2.9.8 \
RUN docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd

# Install composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php --version=1.10.16 --install-dir=/usr/local/bin && \
Expand Down
6 changes: 4 additions & 2 deletions src/protected/application/conf/agent-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
return Utils::formatCnpjCpf($value);
},
'validations' => array(
'v::cnpj()' => \MapasCulturais\i::__('O número de CNPJ informado é inválido.')
'v::cnpj()' => \MapasCulturais\i::__('O número de CNPJ informado é inválido.'),
'unique' => 'Este CNPJ já está cadastrado em nosso sistema.',
),
'available_for_opportunities' => true,
),
Expand All @@ -145,7 +146,8 @@
return Utils::formatCnpjCpf($value);
},
'validations' => array(
'v::cpf()' => \MapasCulturais\i::__('O número de CPF informado é inválido.')
'v::cpf()' => \MapasCulturais\i::__('O número de CPF informado é inválido.'),
'unique' => 'Este CPF já está cadastrado em nosso sistema.',
),
'available_for_opportunities' => true,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function POST_respond()
$this->verifyResponsePermission($counterArgument->registration);
$this->validateResponsePeriod($counterArgument->registration->opportunity);
$this->verifyResponseOwner($counterArgument->response);
$this->verifyPublishedResponse($counterArgument->response);

try {
$this->counterArgumentService->saveResponse($data);
Expand Down Expand Up @@ -123,7 +124,10 @@ public function GET_getStatuses()
{
$this->requireAuthentication();

$this->json(['statuses' => CounterArgument::STATUSES]);
$statuses = CounterArgument::STATUSES;
unset($statuses[CounterArgument::STATUS_WAITING]);

$this->json(['statuses' => $statuses]);
}

private function validateRegistrationOwner($registration)
Expand Down Expand Up @@ -176,4 +180,12 @@ private function verifyCounterArgumentsWithoutResponse($counterArguments)
return;
}
}

private function verifyPublishedResponse($response)
{
if ($response && $response->published) {
$this->json(['message' => 'Esta resposta já foi publicada e não pode mais ser editada.'], 403);
return;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ const counterArgumentAdmin = {
icon: 'success',
allowOutsideClick: false,
}).then(res => {
if (res.isConfirmed) {
window.location.reload()
}
if (res.isConfirmed) window.location.reload()
})
},
error(err) {
Expand Down Expand Up @@ -116,6 +114,7 @@ $(() => {
const counterArgumentId = event.currentTarget.dataset.id
const text = event.currentTarget.dataset.text
const status = event.currentTarget.dataset.status
const statuses = new Map(Object.entries(counterArgumentAdmin.statuses).sort((a, b) => a[1].localeCompare(b[1])))

let quillEditor

Expand All @@ -129,8 +128,7 @@ $(() => {
<label for="counter-argument-status" class="sweetalert-label">Situação:</label>
<select class="form-control" id="counter-argument-status">
<option selected disabled>--- Selecione uma situação ---</option>
<option ${status == 10 ? 'selected' : ''} value="10">Deferida</option>
<option ${status == 3 ? 'selected' : ''} value="3">Indeferida</option>
${Array.from(statuses.entries()).map(([key, value]) => `<option value="${key}" ${key == status ? 'selected' : ''}>${value}</option>`).join('')}
</select>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ const counterArgument = {
icon: 'success',
allowOutsideClick: false,
}).then(res => {
if (res.isConfirmed) {
window.location.reload()
}
if (res.isConfirmed) window.location.reload()
})
},
error(err) {
Expand Down Expand Up @@ -153,9 +151,10 @@ const counterArgument = {

$(() => {
$('[open-counter-argument]').on('click', function (event) {
let quillEditor
const registration = event.currentTarget.dataset.registration

let quillEditor

Swal.fire({
title: 'Abrir Contrarrazão',
html: `
Expand Down Expand Up @@ -253,9 +252,7 @@ $(() => {
showCancelButton: true,
allowOutsideClick: false,
}).then(res => {
if (res.isConfirmed) {
counterArgument.removeFile(fileId)
}
if (res.isConfirmed) counterArgument.removeFile(fileId)
})
})
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php /** @var MapasCulturais\App $app */ ?>
<li>
<a href="<?= $app->createUrl('panel', 'cotas-e-politicas') ?>">
<span class="icon icon-opportunity"></span>
<span class="icon icon-afirmative-politics"></span>
Políticas de ações afirmativas
</a>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@
.sweetalert-plain-text {
margin-bottom: 20px;
}

.swal2-icon {
transform: scale(1.5) !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,36 @@ h1 .icon {
content: $unicode-opportunity;
}
}
.icon-registrations {
&:before {
content: $unicode-registrations;
}
}
.icon-recourses {
&:before {
content: $unicode-recourses;
}
}
.icon-counter-arguments {
&:before {
content: $unicode-counter-arguments;
}
}
.icon-accountability {
&:before {
content: $unicode-accountability;
}
}
.icon-public-consultation {
&:before {
content: $unicode-public-consultation;
}
}
.icon-afirmative-politics {
&:before {
content: $unicode-afirmative-politics;
}
}
.icon-download {
&:before {
content: $unicode-download;
Expand Down Expand Up @@ -262,4 +292,5 @@ h1 .icon {
top: 18px;
right: -1px;
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,29 @@ $unicode-search: "\55" !default;
// used on .icon-group on _icons.scss
$unicode-group: "\e08b" !default;

//** Registrations icon
// used on .icon-registrations on _icons.scss file
$unicode-registrations: "\e101" !default;

//** Recourse icon
// used on .icon-recourses on _icons.scss file
$unicode-recourses: "\e0e6" !default;

//** Counter Arguments icon
// used on .icon-counter-arguments on _icons.scss file
$unicode-counter-arguments: "\e104" !default;

//** Accountability icon
// used on .icon-accountability on _icons.scss file
$unicode-accountability: "\e0ed" !default;

//** Public Consultation icon
// used on .icon-public-consultation on _icons.scss file
$unicode-public-consultation: "\e0e3" !default;

//** Afirmative Politics icon
// used on .icon-afirmative-politics on _icons.css file
$unicode-afirmative-politics: "\e106" !default;

$unicode-show-advanced-filters: "\54" !default;

Expand Down
23 changes: 11 additions & 12 deletions src/protected/application/themes/BaseV1/assets/js/mapasculturais.js
Original file line number Diff line number Diff line change
Expand Up @@ -1125,19 +1125,18 @@ MapasCulturais.Video = {
callback(videoData, $element);
return videoData;
});
} else if (videoData.parsedURL.attr('host').indexOf('vimeo') != -1) {
} else if (videoData.parsedURL.attr('host').indexOf('vimeo') !== -1) {
videoData.provider = 'vimeo';
var tmpArray = videoData.parsedURL.attr('path').split('/');
videoData.videoID = tmpArray[tmpArray.length - 1];
$.getJSON('http://www.vimeo.com/api/v2/video/' + videoData.videoID + '.json?callback=?', { format: "json" }, function (data) {
videoData.details = data[0];
videoData.thumbnailURL = data[0].thumbnail_small;
videoData.playerURL = '//player.vimeo.com/video/' + videoData.videoID + '';
videoData.videoTitle = data[0].title;
callback(videoData, $element);
MapasCulturais.Video.collection[videoURL] = videoData;
return videoData;
});

const tmpArray = videoData.parsedURL.attr('path').split('/');
videoData.videoID = tmpArray.pop();

videoData.playerURL = '//player.vimeo.com/video/' + videoData.videoID;
videoData.thumbnailURL = 'https://vumbnail.com/' + videoData.videoID + '.jpg';
videoData.videoTitle = '';

MapasCulturais.Video.collection[videoURL] = videoData;
callback(videoData, $element);
} else {
//no valid provider
videoData.thumbnailURL = 'http://www.bizreport.com/images/shutterstock/2013/04/onlinevideo_135877229-thumb-380xauto-2057.jpg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<section id="home-intro" class="js-page-menu-item home-entity clearfix">
<section id="home-intro" style="background-image:url('<?= $this->subsiteInstance && $this->subsiteInstance->background ? $this->subsiteInstance->background->url : '' ?>'); background-size: cover;" class="js-page-menu-item home-entity clearfix">
<?php $this->applyTemplateHook('home-search','begin'); ?>
<div class="box">
<h1><?php echo $app->view->renderMarkdown($this->dict('home: title',false)); ?></h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@
<?php $this->applyTemplateHook('nav.panel.opportunities','after'); ?>

<?php $this->applyTemplateHook('nav.panel.registrations','before'); ?>
<li><a <?php if($this->template == 'panel/registrations') echo 'class="active"'; ?> href="<?php echo $app->createUrl('panel', 'registrations') ?>"><span class="icon icon-opportunity"></span> <?php \MapasCulturais\i::_e("Minhas Inscrições");?></a></li>
<li><a <?php if($this->template == 'panel/registrations') echo 'class="active"'; ?> href="<?php echo $app->createUrl('panel', 'registrations') ?>"><span class="icon icon-registrations"></span> <?php \MapasCulturais\i::_e("Minhas Inscrições");?></a></li>
<?php $this->applyTemplateHook('nav.panel.registrations','after'); ?>

<?php $this->applyTemplateHook('nav.panel.counterArguments','before'); ?>
<li>
<a <?php if ($this->template == 'panel/counter-arguments') echo 'class="active"'; ?> href="<?= $app->createUrl('panel', 'counterArguments') ?>">
<span class="icon icon-opportunity"></span> Minhas Contrarrazões
<span class="icon icon-counter-arguments"></span> Minhas Contrarrazões
</a>
</li>
<?php $this->applyTemplateHook('nav.panel.counterArguments','after'); ?>

<?php $this->applyTemplateHook('nav.panel.accountability', 'before'); ?>
<li>
<a <?php if ($this->template == 'panel/accountability') echo 'class="active"'; ?> href="<?php echo $app->createUrl('panel', 'accountability') ?>">
<span class="icon icon-opportunity"></span> <?php \MapasCulturais\i::_e("Prestações de Contas"); ?>
<span class="icon icon-accountability"></span> <?php \MapasCulturais\i::_e("Prestações de Contas"); ?>
</a>
</li>
<?php $this->applyTemplateHook('nav.panel.accountability', 'after'); ?>
Expand All @@ -85,17 +85,7 @@
</a>
</li>
<?php $this->applyTemplateHook('nav.panel.userManagement','after'); ?>
<?php endif; ?>

<?php if($app->user->is('superAdmin')): ?>
<?php $this->applyTemplateHook('nav.panel.adminManagement','before'); ?>
<li>
<a <?php if ($this->template == 'panel/user-management' && isset($_GET['admin'])) echo 'class="active"'; ?> href="<?php echo $app->createUrl('panel', 'userManagement')?>?admin">
<span class="icon icon-group"></span> <?php \MapasCulturais\i::_e("Administradores");?>
</a>
</li>
<?php $this->applyTemplateHook('nav.panel.adminManagement','after'); ?>
<?php endif; ?>
<?php endif; ?>

<?php $app->applyHookBoundTo($this, 'panel.menu:after') ?>
</ul>
Expand Down
12 changes: 0 additions & 12 deletions src/protected/application/themes/Subsite/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ function _init() {
}";
}

if($bg = $this->subsiteInstance->background){
$main_scss .= "
#home-watermark {
background-image: url({$bg->url});
}";
} else {
$main_scss .= "
#home-watermark {
background-image: url('');
}";
}

$main_scss .= "
nav#about-nav{
padding: 0.45rem 1.5rem
Expand Down