Skip to content

Commit

Permalink
Inclui preprints na listagem de coleções
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Fonseca authored and gustavofonseca committed Apr 23, 2020
1 parent 294e167 commit 605e2f1
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 3 deletions.
3 changes: 2 additions & 1 deletion application/language/english/scielo_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$lang['journals_singular'] = 'journal';
$lang['journals'] = 'journals';
$lang['books'] = 'Books';
$lang['preprints'] = 'Preprints';
$lang['journals_list'] = 'Journals';
$lang['development_list'] = 'In development';
$lang['discontinued_list'] = 'Discontinued';
Expand Down Expand Up @@ -110,4 +111,4 @@
<br><br>
If you did not find what you were looking for, please <a href="/en/about-scielo/contact/">contact us</a>.
';
$lang['updated'] = 'Updated';
$lang['updated'] = 'Updated';
3 changes: 2 additions & 1 deletion application/language/portuguese-brazilian/scielo_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$lang['journals_singular'] = 'periódico';
$lang['journals'] = 'periódicos';
$lang['books'] = 'Livros';
$lang['preprints'] = 'Preprints';
$lang['journals_list'] = 'Periódicos';
$lang['development_list'] = 'Em desenvolvimento';
$lang['discontinued_list'] = 'Descontinuadas';
Expand Down Expand Up @@ -108,4 +109,4 @@
<br><br>
Caso não tenha encontrado o que procurava, entre em <a href="/pt/sobre-o-scielo/contato/">contato</a> conosco.
';
$lang['updated'] = 'Atualizado';
$lang['updated'] = 'Atualizado';
3 changes: 2 additions & 1 deletion application/language/spanish/scielo_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$lang['journals_singular'] = 'revista';
$lang['journals'] = 'revistas';
$lang['books'] = 'Libros';
$lang['preprints'] = 'Preprints';
$lang['journals_list'] = 'Revistas';
$lang['development_list'] = 'En desarrollo';
$lang['discontinued_list'] = 'Discontinuadas';
Expand Down Expand Up @@ -109,4 +110,4 @@
<br><br>
Si no ha encontrado lo que busca, póngase en <a href="/es/sobre-el-scielo/contacto/">contacto con nosotros</a>.
';
$lang['updated'] = 'Actualizado';
$lang['updated'] = 'Actualizado';
20 changes: 20 additions & 0 deletions application/models/Collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class Collections
*/
private $books_list = array();

/**
* List of all the data used in the collections preprints section.
*
* @var array
*/
private $preprints_list = array();

/**
* List of all the data used in the others collections section.
*
Expand Down Expand Up @@ -106,6 +113,17 @@ public function get_books_list()
return $this->books_list;
}

/**
* Returns the preprints list.
*
* @return array
*/
public function get_preprints_list()
{

return $this->preprints_list;
}

/**
* Returns the journals list.
*
Expand Down Expand Up @@ -199,6 +217,8 @@ private function set_collection_lists()
}
} else if($collection['type'] == 'books') {
$this->books_list[] = (object)$collection;
} else if($collection['type'] == 'preprints') {
$this->preprints_list[] = (object)$collection;
}
} else {
if ($collection['type'] == 'journals') {
Expand Down
15 changes: 15 additions & 0 deletions application/views/partials/collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@
</dd>
<?php endforeach; ?>

<?php
// Preprints
$counter = 0;
foreach ($this->Collections->get_preprints_list() as $key => $preprint) :
?>
<dd class="scielo-preprints scielo-preprints-no-data <?php if($counter == 0):?> first-node-collection <?php endif;?>">
<?php if($counter++ == 0):?>
<h3><?= lang('preprints') ?></h3>
<?php endif;?>
<a href="https://<?= $preprint->domain ?>">
<h4><?= $preprint->name[$lang_index] ?></h4>
</a>
</dd>
<?php endforeach; ?>

<?php
// Livros
$counter = 0;
Expand Down
4 changes: 4 additions & 0 deletions static/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ section{
}

&.scielo-books,
&.scielo-preprints,
&.flag-generic,
&.flag-spa,
&.flag-wid{ // genericos X
Expand All @@ -465,6 +466,7 @@ section{
margin-top:-2px;
}

&.scielo-preprints-no-data,
&.scielo-books-no-data{
h4{
margin-top:.8rem;
Expand Down Expand Up @@ -610,6 +612,7 @@ section{
}


&.scielo-preprints-no-data,
&.scielo-books-no-data{
&::before{
margin-top: 27px;
Expand Down Expand Up @@ -646,6 +649,7 @@ section{
margin-top: 22px;
}

&.scielo-preprints-no-data,
&.scielo-books-no-data{
&::before{
margin-top: 26px;
Expand Down

0 comments on commit 605e2f1

Please sign in to comment.