Skip to content

Commit

Permalink
Terms file
Browse files Browse the repository at this point in the history
  • Loading branch information
javicarrillo committed Feb 13, 2020
1 parent 23cff12 commit 9298a8e
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Resources/templates/responsive/workshop/partials/main_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@
</div>
<?php endif; ?>

<?php if($this->workshop->terms_file_url): ?>
<div class="file-icon-label terms">
<?= $this->text('workshop-terms-label') ?>
</div>
<div class="file-icon">
<a target="_blank" href="<?= $this->workshop->terms_file_url ?>">
<i class="fa fa-file">
</i>
</a>
</div>
<?php endif; ?>

<div class="share-label">
<?= $this->text('workshop-share') ?>
</div>
Expand Down
14 changes: 14 additions & 0 deletions Resources/translations/ca/workshop.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
workshop-regular: 'Taller'
workshop-register: 'Inscriu-te'
workshop-intro-text: 'Asistiendo a los talleres conocerás cómo las tecnologías digitales revolucionan la relación entre financiadores y proyectos a financiar, potenciando modelos de financiación más transparentes, abiertos y participativos.'
workshop-where-label: 'On estarem?'
workshop-how-label: 'Com arribar?'
workshop-related: 'Conoce otros Fundlabs'
workshop-btn-action: 'Quiero mi Fundlab'
workshop-count-down: 'Queden %s dias!'
workshop-file-label: 'Programa'
workshop-terms-label: 'Basses'
workshop-share: 'Comparteix!'
workshop-partner-text: 'This project has received funding from the European Union''s Horizon 2020 research and innovation programme under grant agreement No.727812'
workshop-type-fundlab: 'Fundlab'
workshop-type-fundlab-esil: 'Fundlab ESIL'
workshsop-partner-promote: 'Promou:'
workshsop-partner-finances: 'Amb el finançament de:'
1 change: 1 addition & 0 deletions Resources/translations/es/workshop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ workshop-related: 'Conoce otros Fundlabs'
workshop-btn-action: 'Quiero mi Fundlab'
workshop-count-down: '¡Quedan %s días!'
workshop-file-label: 'Programa'
workshop-terms-label: 'Bases'
workshop-share: '¡Compártelo!'
workshop-partner-text: 'This project has received funding from the European Union''s Horizon 2020 research and innovation programme under grant agreement No.727812'
workshop-type-fundlab: 'Fundlab'
Expand Down
51 changes: 51 additions & 0 deletions db/migrations/20200213165929_goteo_workshop_terms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* Migration Task class.
*/
class GoteoWorkshopTerms
{
public function preUp()
{
// add the pre-migration code here
}

public function postUp()
{
// add the post-migration code here
}

public function preDown()
{
// add the pre-migration code here
}

public function postDown()
{
// add the post-migration code here
}

/**
* Return the SQL statements for the Up migration
*
* @return string The SQL string to execute for the Up migration.
*/
public function getUpSQL()
{
return "
ALTER TABLE `workshop` ADD COLUMN `terms_file_url` TINYTEXT NULL AFTER `schedule_file_url`;
";
}

/**
* Return the SQL statements for the Down migration
*
* @return string The SQL string to execute for the Down migration.
*/
public function getDownSQL()
{
return "
ALTER TABLE `workshop` DROP COLUMN `terms_file_url`
";
}

}
3 changes: 3 additions & 0 deletions public/assets/sass/layouts/_workshop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ body.workshop {
div.file-icon-label{
text-align: center;
}
div.terms{
margin-top: 30px;
}
div.file-icon{
text-align: center;
display: block;
Expand Down
4 changes: 3 additions & 1 deletion src/Goteo/Model/Workshop.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static public function get($id, $lang = null) {
workshop.date_in,
workshop.date_out,
workshop.schedule_file_url,
workshop.terms_file_url,
$fields,
workshop.url,
workshop.call_id,
Expand Down Expand Up @@ -408,7 +409,8 @@ public function save(&$errors = array()) {
'how_to_get',
'map_iframe',
'workshop_location',
'schedule_file_url'
'schedule_file_url',
'terms_file_url'
);

if($this->call_id) $fields[] = 'call_id';
Expand Down

0 comments on commit 9298a8e

Please sign in to comment.