Skip to content

Commit

Permalink
Added custom CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
DBinaghi authored May 6, 2020
1 parent 62233be commit bae0bae
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 37 deletions.
13 changes: 12 additions & 1 deletion HonorThyLibrariansPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class HonorThyLibrariansPlugin extends Omeka_Plugin_AbstractPlugin
'initialize',
'define_routes',
'config_form',
'config'
'config',
'public_head'
);

protected $_filters = array (
Expand All @@ -40,6 +41,7 @@ public function hookInstall()
set_option('honor_thy_librarians_pre_text', HONOR_THY_LIBRARIANS_PRE_TEXT);
set_option('honor_thy_librarians_post_text', HONOR_THY_LIBRARIANS_POST_TEXT);
set_option('honor_thy_librarians_sort_order', 'name');
set_option('honor_thy_librarians_use_css', 0);
}

public function hookUninstall()
Expand All @@ -49,6 +51,7 @@ public function hookUninstall()
delete_option('honor_thy_librarians_pre_text');
delete_option('honor_thy_librarians_post_text');
delete_option('honor_thy_librarians_sort_order');
delete_option('honor_thy_librarians_use_css');
}

public function hookInitialize()
Expand Down Expand Up @@ -88,8 +91,16 @@ public function hookConfig($args)
set_option('honor_thy_librarians_pre_text', $post['htl_pre_text']);
set_option('honor_thy_librarians_post_text', $post['htl_post_text']);
set_option('honor_thy_librarians_sort_order', $post['htl_sort_order']);
set_option('honor_thy_librarians_use_css', $post['htl_use_css']);
}

public function hookPublicHead()
{
if (get_option('honor_thy_librarians_use_css')) {
queue_css_file('honor-thy-librarians');
}
}

public function filterPublicNavigationMain($nav)
{
$nav[] = array(
Expand Down
13 changes: 13 additions & 0 deletions config_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
$htl_pre_text = get_option('honor_thy_librarians_pre_text');
$htl_post_text = get_option('honor_thy_librarians_post_text');
$htl_sort_order = get_option('honor_thy_librarians_sort_order');
$htl_use_css = get_option('honor_thy_librarians_use_css');
$view = get_view();
?>

Expand Down Expand Up @@ -78,4 +79,16 @@
</p>
<?php echo $view->formSelect('htl_sort_order', $htl_sort_order, array(), array('name' => __('Name'), 'count' => __('Contributions'), 'date' => __('Last contribution date'))); ?>
</div>
</div>

<div class="field">
<div class="two columns alpha">
<?php echo $view->formLabel('htl_use_css', __('Style table with CSS')); ?>
</div>
<div class="inputs five columns omega">
<p class="explanation">
<?php echo __('If checked, will apply plugin css stylesheet to table.') ?>
</p>
<?php echo $view->formCheckbox('htl_use_css', $htl_use_css, null, array('1', '0')); ?>
</div>
</div>
Binary file modified languages/eo.mo
Binary file not shown.
66 changes: 50 additions & 16 deletions languages/eo.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Translation for the Honor Thy Librarians plugin for Omeka.
# Copyright (C) 2018 Daniele Binaghi
# This file is distributed under the same license as the Omeka package.
# Daniele Binaghi <admin@bitoteko.it>, 2018
# Daniele Binaghi <admin@bitoteko.it>, 2018-2020
#
msgid ""
msgstr ""
Expand All @@ -17,62 +17,96 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: config_form.php:19
#: config_form.php:20
msgid "Page settings"
msgstr "Paĝaj agordoj"

#: config_form.php:23
#: config_form.php:24
msgid "Page path"
msgstr "Paĝa dosierindiko"

#: config_form.php:27
#: config_form.php:28
msgid "The path to the page listing the librarians. For example, if your site is hosted at <code>http://my-omeka-site.org/</code>, and the value of this field is <code>librarians/</code>, then your page will be displayed at <code>http://my-omeka-site.org/librarians/</code>."
msgstr "La dosierindiko al la paĝo listiganta la bibliotekistojn. Ekzemple, se via retejo gastas ĉe <code>http://mia-retejo-omeka.org/</code>, kaj la valoro de tiu ĉi kampo estas <code>bibliotekistoj/</code>, la paĝo montriĝos ĉe <code>http://mia-retejo-omeka.org/bibliotekistoj/</code>."

#: config_form.php:35
#: config_form.php:36
msgid "Page title"
msgstr "Paĝa titolo"

#: config_form.php:39
#: config_form.php:40
msgid "The title that will display on the librarians page and in the main site navigation."
msgstr "La titolo, kiu montriĝos ĉe la bibliotekista paĝo kaj ĉe la ĉefa reteja menuo."

#: config_form.php:47
#: config_form.php:48
msgid "Pre display text"
msgstr "Komenca teksto"

#: config_form.php:51
#: config_form.php:52
msgid "The text that will display before the table of librarians."
msgstr "La teksto, kiu montriĝos antaŭ la tabelo de bibliotekistoj."

#: config_form.php:59
#: config_form.php:60
msgid "Post display text"
msgstr "Fina teksto"

#: config_form.php:63
#: config_form.php:64
msgid "The text that will display after the table of librarians."
msgstr "La teksto, kiu montriĝos post la tabelo de bibliotekistoj."

#: HonorThyLibrarian.php:13

#: config_form.php:70
msgid "Table settings"
msgstr "Tabelaj agordoj"

#: config_form.php:74
msgid "Sort order"
msgstr "Ordigo"

#: config_form.php:78
msgid "The order librarians will be sorted on."
msgstr "Ordo laŭ kiu bibliotekistoj estos montritaj."

#: config_form.php:80
msgid "Name"
msgstr "Nomo"

#: config_form.php:80
msgid "Contributions"
msgstr "Kontribuojn"

#: config_form.php:80
#: index.php:25
msgid "Last contribution date"
msgstr "Lasta kontribua dato"

#: config_form.php:86
msgid "Use custom CSS"
msgstr "Uzu propran CSS"

#: config_form.php:90
msgid "If checked, will apply plugin css stylesheet to table."
msgstr "Se markita, propra CSS estos uzita por la tabelo."

#: HonorThyLibrarian.php:14
msgid "Librarians"
msgstr "Bibliotekistoj"

#: HonorThyLibrarian.php:14
#: HonorThyLibrarian.php:15
msgid "The following people have contributed to this website."
msgstr "Tiuj ĉi homoj kontribuis al tiu ĉi retejo."

#: HonorThyLibrarian.php:15
#: HonorThyLibrarian.php:16
msgid "We want to thank them all very much for their help and support."
msgstr "Ni deziras danki al ili ĉiuj pro ilia helpo kaj subteno."

#: index.php:22
#: index.php:23
msgid "Librarian"
msgstr "Bibliotekist(in)o"

#: index.php:23
#: index.php:24
msgid "Items added/edited"
msgstr "Dokumentoj aldonitaj/redaktitaj"

#: index.php:50
#: index.php:57
msgid "Click to see all contributions by this librarian"
msgstr "Alklaku por vidi ĉiujn kontribuojn el tiu ĉi homo"
Binary file modified languages/it.mo
Binary file not shown.
63 changes: 48 additions & 15 deletions languages/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,62 +17,95 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: config_form.php:19
#: config_form.php:20
msgid "Page settings"
msgstr "Configurazione della pagina"

#: config_form.php:23
#: config_form.php:24
msgid "Page path"
msgstr "Percorso della pagina"

#: config_form.php:27
#: config_form.php:28
msgid "The path to the page listing the librarians. For example, if your site is hosted at <code>http://my-omeka-site.org/</code>, and the value of this field is <code>librarians/</code>, then your page will be displayed at <code>http://my-omeka-site.org/librarians/</code>."
msgstr "Il percorso della pagina che presenta la lista dei bibliotecari. Per esempio, se il sito è ospitato presso <code>http://mio-sito-omeka.org/</code>, e il valore di questo campo è <code>bibliotecari/</code>, allora la pagina verrà mostrata all'indirizzo <code>http://mio-sito-omeka.org/bibliotecari/</code>."

#: config_form.php:35
#: config_form.php:36
msgid "Page title"
msgstr "Titolo della pagina"

#: config_form.php:39
#: config_form.php:40
msgid "The title that will display on the librarians page and in the main site navigation."
msgstr "Il titolo che verrà mostrato nella pagina dei bibliotecari e nel menù principale del sito."

#: config_form.php:47
#: config_form.php:48
msgid "Pre display text"
msgstr "Testo iniziale"

#: config_form.php:51
#: config_form.php:52
msgid "The text that will display before the table of librarians."
msgstr "Il testo che verrà mostrato prima della tabella dei bibliotecari."

#: config_form.php:59
#: config_form.php:60
msgid "Post display text"
msgstr "Testo finale"

#: config_form.php:63
#: config_form.php:64
msgid "The text that will display after the table of librarians."
msgstr "Il testo che verrà mostrato dopo la tabella dei bibliotecari."

#: HonorThyLibrarian.php:13
#: config_form.php:70
msgid "Table settings"
msgstr "Impostazioni tabella"

#: config_form.php:74
msgid "Sort order"
msgstr "Ordinamento"

#: config_form.php:78
msgid "The order librarians will be sorted on."
msgstr "L'ordine in base al quale verranno mostrati i bibliotecari."

#: config_form.php:80
msgid "Name"
msgstr "Nome"

#: config_form.php:80
msgid "Contributions"
msgstr "Contributi"

#: config_form.php:80
#: index.php:25
msgid "Last contribution date"
msgstr "Data ultimo contributo"

#: config_form.php:86
msgid "Use custom CSS"
msgstr "Usa CSS personalizzato"

#: config_form.php:90
msgid "If checked, will apply plugin css stylesheet to table."
msgstr "Se selezionata, il foglio di stile css del plugin verrà applicato alla tabella."

#: HonorThyLibrarian.php:14
msgid "Librarians"
msgstr "Bibliotecari"

#: HonorThyLibrarian.php:14
#: HonorThyLibrarian.php:15
msgid "The following people have contributed to this website."
msgstr "Le seguenti persone hanno contribuito a questo sito web."

#: HonorThyLibrarian.php:15
#: HonorThyLibrarian.php:16
msgid "We want to thank them all very much for their help and support."
msgstr "Desideriamo ringraziarle tutte per il loro aiuto e supporto."

#: index.php:22
#: index.php:23
msgid "Librarian"
msgstr "Bibliotecario/a"

#: index.php:23
#: index.php:24
msgid "Items added/edited"
msgstr "Elementi aggiunti/modificati"

#: index.php:50
#: index.php:57
msgid "Click to see all contributions by this librarian"
msgstr "Clicca per vedere tutti i contributi di questo bibliotecario"
8 changes: 8 additions & 0 deletions views/public/css/honor-thy-librarians.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
thead {
border: 1px solid #E4DECE;
background-color: #D8CFB6;
}
tr.even {
border: 1px solid #E4E5DE;
background-color: #F3F3E7;
}
10 changes: 5 additions & 5 deletions views/public/index/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<table id="librarians">
<thead>
<tr>
<th class="even"><?php echo __('Librarian') ?></th>
<th class="even" style="text-align: center"><?php echo __('Items added/edited') ?></th>
<th class="even" style="text-align: center"><?php echo __('Last contribution date') ?></th>
<th><?php echo __('Librarian') ?></th>
<th style="text-align: center"><?php echo __('Items added/edited') ?></th>
<th style="text-align: center"><?php echo __('Last contribution date') ?></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -53,8 +53,8 @@
'submit_search' => 'Search')
);
// Create the table that displays the librarians
echo "<tr class='item " . (++$key%2 == 1 ? "odd" : "even") . "'>";
echo "<td><a href='" . $search_link ."' title='" . __("click to see all contributions by this librarian") . "'>" . $librarian['name'] . "</a></td>";
echo "<tr class='" . (++$key%2 == 1 ? "odd" : "even") . "'>";
echo "<td><a href='" . $search_link ."' title='" . __("Click to see all contributions by this librarian") . "'>" . $librarian['name'] . "</a></td>";
echo "<td style='text-align: right'>" . $librarian['total'] . "</td>";
echo "<td style='text-align: right'>" . format_date($librarian['lastdate']) . "</td>";
echo "</tr>\n";
Expand Down

0 comments on commit bae0bae

Please sign in to comment.