diff --git a/2016/event.php b/2016/event.php
index 49e1287..9ae3d77 100644
--- a/2016/event.php
+++ b/2016/event.php
@@ -1,305 +1,311 @@
.
require 'load.php';
$conference = FullConference::factoryFromUID( CURRENT_CONFERENCE_UID )
->queryRow();
if( !$conference ) {
die_with_404();
}
if( !isset( $_GET['uid'] ) ) {
die_with_404();
}
$event = FullEvent::factoryByConferenceAndUID(
$conference->getConferenceID(),
$_GET['uid']
)->queryRow();
if( !$event ) {
die_with_404();
}
$args = [
'title' => sprintf(
__("%s: %s"),
$event->getChapterName(),
$event->getEventTitle()
),
'url' => $event->getEventURL( true ),
];
if( $event->hasEventImage() ) {
$args['og'] = [
'image' => $event->getEventImage( true ),
];
}
Header::spawn( null, $args );
?>
+
isEventEditable() ): ?>
-
= HTML::a(
- $event->getFullEventEditURL(),
- __("Modifica evento") . icon('edit', 'left')
- ) ?>
+ = HTML::a(
+ $event->getFullEventEditURL(),
+ __("Modifica") . icon('edit', 'left')
+ ) ?>
+ isEventTranslatable() ): ?>
+ = HTML::a(
+ $event->getEventTranslateURL(),
+ __("Traduci") . icon('edit', 'left')
+ ) ?>
= icon('folder', 'left'); echo __("Tema") ?>
= $event->getTrackName() ?>
= $event->getTrackLabel() ?>
= icon('room', 'left'); echo __("Dove") ?>
= $event->getRoomName() ?>
@ = HTML::a(
$conference->getLocationGeoOSM(),
$conference->getLocationName(),
$conference->getLocationAddress(),
null,
'target="_blank"'
) ?>
= $conference->getLocationAddress() ?>
= icon('access_time', 'left'); echo __("Quando") ?>
= $event->getEventHumanStart() ?>
getEventStart('d/m/Y'),
$event->getEventStart('H:i')
) ?>
= HTML::a(
$event->getEventCalURL(),
__( "Scarica promemoria calendario" )
) ?>
hasEventAbstract() ): ?>
= __("Abstract") ?>
= $event->getEventAbstractHTML( ['p' => 'flow-text'] ) ?>
hasEventDescription() ): ?>
= __("Descrizione") ?>
= $event->getEventDescriptionHTML( ['p' => 'flow-text'] ) ?>
hasEventNote() ): ?>
= __("Note") ?>
= $event->getEventNoteHTML( ['p' => 'flow-text'] ) ?>
factorySharebleByEvent()
->queryGenerator();
?>
valid() ): ?>
= __("Materiale") ?>
isSharableDownloadable() ): ?>
getSharablePath(),
icon('attachment', 'left') . $sharable->getSharableTitle(['prop' => true]),
null,
null,
'target="_blank"'
),
$sharable->getSharableLicense()->getLink()
) ?>
isSharableVideo() ): ?>
getSharablePath(),
icon('share', 'left') . $sharable->getSharableTitle( ['prop' => true] ),
null,
null,
'target="_blank"'
),
$sharable->getSharableLicense()->getLink()
) ?>
= __("Relatori") ?>
factoryUserByEvent()
->queryGenerator(); ?>
valid() ): ?>
= HTML::a(
$user->getUserURL(),
"
" . esc_html( $user->getUserFullname() ) . " ",
sprintf(
__("Profilo di %s"),
$user->getUserFullname()
),
'valign'
) ?>
= __("L'elenco dei relatori non è ancora noto.") ?>
factoryPreviousFullEvent()
->select('event_uid', 'event_title', 'chapter_uid', 'conference_uid', 'event_start')
->limit(1)
->queryRow();
$next = $event->factoryNextFullEvent()
->select('event_uid', 'event_title', 'chapter_uid', 'conference_uid', 'event_start')
->limit(1)
->queryRow();
?>
= icon('navigate_before'); echo __("Preceduto da") ?>
= HTML::a(
$previous->getEventURL(),
esc_html( $previous->getEventTitle() )
) ?>
= $previous->getEventHumanStart() ?>
= __("A seguire"); echo icon('navigate_next') ?>
= HTML::a(
$next->getEventURL(),
esc_html( $next->getEventTitle() )
) ?>
= $next->getEventHumanStart() ?>
.
require 'load.php';
$event = FullEvent::factory()
->select( Location::fields() )
->joinLocation()
->whereConferenceUID( CURRENT_CONFERENCE_UID )
->whereEventUID( $_GET['uid' ] )
->queryRow();
if( !$event ) {
die_with_404();
}
// well, this Event has all the Conference stuff
$conference = $event;
$args = [
'conference' => $conference,
'title' => sprintf(
__("%s: %s"),
$event->getChapterName(),
$event->getEventTitle()
),
'canonical' => $event->getEventURL( true ),
];
if( $event->hasEventImage() ) {
$args['og'] = [
'image' => $event->getEventImage( true ),
];
}
template( 'header', $args );
?>
= esc_html( $event->getEventTitle() ) ?>
hasEventSubtitle() ): ?>
= esc_html( $event->getEventSubtitle() ) ?>
isEventEditable() ): ?>
- = HTML::a(
- $event->getFullEventEditURL(),
- __("Modifica") . icon('edit', 'left')
- ) ?>
+
+
+ = HTML::a(
+ $event->getFullEventEditURL(),
+ __("Modifica") . icon('edit', 'left')
+ ) ?>
+
+ isEventTranslatable() ): ?>
+
+
+ = HTML::a(
+ $event->getEventTranslateURL(),
+ __("Traduci") . icon('edit', 'left')
+ ) ?>
+
+
= icon('folder', 'left'); echo __("Tema") ?>
= $event->getTrackName() ?>
= $event->getTrackLabel() ?>
= icon('room', 'left'); echo __("Dove") ?>
= $event->getRoomName() ?>
@ = HTML::a(
$conference->getLocationGeoOSM(),
esc_html( $conference->getLocationName() ),
$conference->getLocationAddress(),
null,
'target="_blank"'
) ?>
= esc_html( $conference->getLocationAddress() ) ?>
= icon('access_time', 'left'); echo __("Quando") ?>
= $event->getEventHumanStart() ?>
getEventStart('d/m/Y'),
$event->getEventStart('H:i')
) ?>
= HTML::a(
$event->getEventCalURL(),
__( "Scarica promemoria calendario" )
) ?>
hasEventAbstract() ): ?>
= __("Abstract") ?>
= $event->getEventAbstractHTML( ['p' => 'flow-text'] ) ?>
hasEventDescription() ): ?>
= __( "Descrizione" ) ?>
= $event->getEventDescriptionHTML( ['p' => 'flow-text'] ) ?>
hasEventNote() ): ?>
= __("Note") ?>
= $event->getEventNoteHTML( ['p' => 'flow-text'] ) ?>
factorySharebleByEvent()
->queryGenerator();
?>
valid() ): ?>
= __("Materiale") ?>
isSharableDownloadable() ): ?>
getSharablePath(),
icon('attachment', 'left') . $sharable->getSharableTitle(['prop' => true]),
null,
null,
'target="_blank"'
),
$sharable->getSharableLicense()->getLink()
) ?>
isSharableVideo() ): ?>
getSharablePath(),
icon('share', 'left') . $sharable->getSharableTitle( ['prop' => true] ),
null,
null,
'target="_blank"'
),
$sharable->getSharableLicense()->getLink()
) ?>
= __("Relatori") ?>
factoryUserByEvent()
->queryGenerator(); ?>
valid() ): ?>
= HTML::a(
$user->getUserURL(),
"
" . esc_html( $user->getUserFullname() ) . " ",
sprintf(
__("Profilo di %s"),
$user->getUserFullname()
)
) ?>
= __("L'elenco dei relatori non è ancora noto.") ?>
factoryPreviousFullEvent()
->limit( 1 )
->queryRow();
$next = $event->factoryNextFullEvent()
->limit( 1 )
->queryRow();
?>
= __( "Preceduto da" ) ?>
= HTML::a(
$previous->getEventURL(),
icon( 'arrow-left' ) . ' ' . esc_html( $previous->getEventTitle() )
) ?>
= $previous->getEventHumanStart() ?>
= __( "A seguire" ) ?>
= HTML::a(
$next->getEventURL(),
esc_html( $next->getEventTitle() ) . ' ' . icon( 'arrow-right' )
) ?>
= $next->getEventHumanStart() ?>
true,
] );
diff --git a/2019/index.php b/2019/index.php
index 3de932c..1f8b095 100644
--- a/2019/index.php
+++ b/2019/index.php
@@ -1,529 +1,535 @@
.
require 'load.php';
enqueue_js('jquery');
enqueue_js('typed');
enqueue_js('leaflet');
enqueue_js('leaflet.init');
enqueue_css('leaflet');
$conference = FullConference::factoryFromUID( CURRENT_CONFERENCE_UID )
->queryRow();
if( !$conference ) {
die_with_404();
}
template( 'header', [
'conference' => $conference,
'title' => $conference->getConferenceTitle(),
'intro' => true,
'canonical' => $conference->getConferenceURL( true ),
] );
?>
= __( "Tutti insieme" ) ?>
= __( "LAN party, installation party, mini Restart Party. Porta un amico da convertire: ci divertiremo insieme a tutte le community." ) ?>
= __( "Scegli fra l'aula base , l'aula per sistemisti o programmatori e divertiti!" ) ?>
= __( "Programmatori, ingegneri, avvocati, professionisti nell'ambito del software libero. Tutti insieme a Torino." ) ?>
= __( "Programma" ) ?>
= __( "Ecco un assaggio dei temi che verranno affrontati:" ) ?>
getConferenceStart();
?>
get( Event::START ) ?>
= HTML::a(
$event->getEventURL(),
esc_html( $event->getEventTitle() )
) ?>
hasEventSubtitle() ): ?>
= esc_html( $event->getEventSubtitle() ) ?>
= sprintf(
__( "Di %s"),
Homepage19::listEventAuthors( $event, __( "Speaker Segreto" ) )
) ?>
=
$event->getEventStart( 'H:i' )
?> (= $event->getHumanEventDuration( [ 'long' => false ] ) ?>)
hasEventAbstract() ) {
echo $event->getEventAbstractHTML();
}
?>
info
= __( "Memo" ) ?>
isEventEditable() ): ?>
= HTML::a(
$event->getFullEventEditURL(),
__( "Modifica" )
) ?>
+ isEventTranslatable() ): ?>
+ = HTML::a(
+ $event->getEventTranslateURL(),
+ __( "Traduci" )
+ ) ?>
+
add( $one_hour );
$last_event_end = clone $last_event_start;
$last_event_end->add( $one_hour );
?>
= __( "Nello stesso momento" ) ?>…
= sprintf(
__( "Cos'è il %s" ),
"Linux Installation Party"
) ?>
= __( "Porta con te il tuo computer portatile, uno smartphone, un tostapane, una centrale termonucleare, o qualsiasi cosa che potrebbe essere convertita a GNU/Linux e aiuteremo noi nella loro liberazione!" ) ?>
= sprintf(
__( "L'immagine di %s e di %s disponibili rispettivamente in licenza %s e %s." ),
// DS Linux
HTML::a(
'https://commons.wikimedia.org/wiki/File:Ds_lite_with_slot-2_device_running_dslinux.jpg',
"DSLinux"
),
// GNU & Freedo
HTML::a(
'https://commons.wikimedia.org/wiki/File:GNU_and_Freedo.svg',
"GNU & Freedo"
),
// DS Linux's license
__( "pubblico dominio" ),
// GNU & Freedo license
sprintf(
"%s+%s",
// GNU is in GNU FDL
license( 'gnu-fdl' )->getLink(),
// Freedo is in CC BY SA 2.0
license( 'cc-by-sa-2.0' )->getLink()
)
) ?>
= __( "Ma non finisce qui!" ) ?>
" />
= __( "Corsi GNU/Linux" ) ?>
= __( "Ti aspettiamo al Linux Day, ma nei giorni successivi organizzeremo anche dei veri e propri corsi (gratuiti!) di livello base ed avanzato, sull'uso di GNU/Linux in ambito personale e industriale." ) ?>
= __( "Che aspetti? Prenota un posto anche per i corsi!" ) ?>
= __( "Iscrizione ai corsi GNU/Linux" ) ?>
= __( "Assistenza tecnica" ) ?>
= __( "Ti aspettiamo al Linux Day, ma dopo questa conferenza non ti lasceremo certo da solo!" ) ?>
= Markdown::parse( __( "Ogni mercoledì, sportello di assistenza gratuita al software libero, all'**Officina Informatica Libera**, in via Oddino Morgari 14, a Torino." ) ) ?>
= __( "Contatti" ) ?> (= sprintf(
__( "prossimo: %s" ),
__( "30 ottobre" )
) ?>)
= Markdown::parse( __( "Ogni terzo sabato del mese, sportello di assistenza gratuita al software libero, con il **GLugTO**, al Polo culturale Lombroso16" ) ) ?>
= __( "Contatti" ) ?> (= sprintf(
__( "prossimo: %s" ),
__( "2 novembre" )
) ?>)
FAQ
= __( "Domande frequenti" ) ?>
= __( "È un evento nazionale che si svolge da quasi 20 anni. Si svolge in tutta Italia, parallelamente, e a Torino non mancheremo." ) ?>
= HTML::a(
'https://www.linuxday.it/',
__( "Informazioni sul Linux Day nazionale" )
) ?>
= __( "Porta rispetto per il tuo amico. Ma soprattutto porta il tuo amico! Abbandonalo all'aula \"base\" e vedrai che non si annoierà. Oppure portalo all'installation party e lo aiuteremo nella migrazione al software libero!" ) ?>
= __( "L'evento è completamente gratuito ed è unicamente possibile grazie al sostegno di tutte le community di Torino e di chi crede in loro." ) ?>
= __( "Per favore cerca di venire di persona! Abbiamo bisogno del tuo aiuto fisico per rendere questa community attiva e straordinaria! In ogni caso il nostro Media Partner farà il possibile per registrare più tracce possibili, forse anche con uno streaming." ) ?>
= __( "Comunicaci la tua taglia ed il genere (uomo/donna) e te la terremo da parte fresca per l'evento!" ) ?>
= __( "Seriamente, ti conviene dircelo prima perchè alcune taglie finiscono molto velocemente, e ogni anno molte persone rimangono spoglie." ) ?>
= __( "Dove" ) ?>
= __( "La sede del Linux Day Torino 2019 sarà Toolbox Coworking, in via Agostino da Montefeltro 2." ) ?>
= __( "Per raggiungerci puoi:" ) ?>
= __("Abilita JavaScript per vedere la mappa") ?>
= $conference->printLocationLeaflet() ?>
= __( "Con il patrocinio di…" ) ?>
.
trait EventTrait {
/**
* Get event ID
*
* @return int
*/
public function getEventID() {
return $this->nonnull( Event::ID );
}
/**
* Get event UID
*
* @return string
*/
public function getEventUID() {
return $this->get( Event::UID );
}
/**
* Get localized event title
*
* @return string
*/
public function getEventTitle() {
return __( $this->get( Event::TITLE ) );
}
/**
* Check if the Event has a subtitle
*
* @return boolean
*/
public function hasEventSubtitle() {
$title = $this->get( Event::SUBTITLE );
return !empty( $title );
}
/**
* Get localized event subtitle
*
* @return string
*/
public function getEventSubtitle() {
return __( $this->get( Event::SUBTITLE ) );
}
/**
* Get an human event start date
*
* @return string
*/
public function getEventHumanStart() {
return HumanTime::diff( $this->getEventStart() );
}
/**
* Get an human event end date
*
* @return string
*/
public function getEventHumanEnd() {
return HumanTime::diff( $this->getEventEnd() );
}
/**
* Get event start date
*
* @param string If present, format of the date
* @return DateTime|string
*/
public function getEventStart( $format = null ) {
$date = $this->get( Event::START );
if( $format ) {
return $date->format( $format );
}
return $date;
}
/**
* When event end date
*
* @param string If present, format of the date
* @return DateTime|string
*/
public function getEventEnd( $format = null ) {
$date = $this->get( Event::END );
if( $format ) {
return $date->format( $format );
}
return $date;
}
/**
* Get the event duration
*
* @return DateInterval
*/
public function getEventDuration( $format ) {
$start = $this->get( Event::START );
$end = $this->get( Event::END );
return $start->diff( $end )->format( $format );
}
/**
* Get the Event duration in a human-readable format
*
* @return string
*/
public function getHumanEventDuration( $args = [] ) {
if( !isset( $args['adverb'] ) ) {
$args['adverb'] = false;
}
return HumanTime::diff(
$this->get( Event::START ),
$this->get( Event::END ),
$args
);
}
/**
* It has an Event image?
*
* @return bool
*/
public function hasEventImage() {
return $this->has( Event::IMAGE );
}
/**
* Get the path to the Event image
*
* @param boolean $absolute Try to force an absolute URL
* @return string
*/
public function getEventImage( $absolute = false ) {
return site_page( $this->get( Event::IMAGE ), $absolute );
}
/**
* It has event description?
*
* @return bool
*/
public function hasEventDescription() {
return null !== $this->get( Event::DESCRIPTION );
}
/**
* It has an event abstract?
*
* @return bool
*/
public function hasEventAbstract() {
return null !== $this->get( Event::ABSTRACT );
}
/**
* It has an event note?
*
* @return bool
*/
function hasEventNote() {
return null !== $this->get( Event::NOTE );
}
/**
* Get the event description
*
* @return string
*/
public function getEventDescription() {
return $this->get( Event::DESCRIPTION );
}
/**
* Get the event abstract
*
* @return string
*/
public function getEventAbstract() {
return $this->get( Event::ABSTRACT );
}
/**
* Get the event note
*
* @return string
*/
public function getEventNote() {
return $this->get( Event::NOTE );
}
/**
* Get the Event description rendered in HTML
*
* @return string
*/
public function getEventDescriptionHTML( $args = [] ) {
return Markdown::parse( $this->getEventDescription(), $args );
}
/**
* Get the Event abstract rendered in HTML
*
* @return string
*/
public function getEventAbstractHTML( $args = [] ) {
return Markdown::parse( $this->getEventAbstract(), $args );
}
/**
* Get the Event notes rendered in HTML
*
* @return string
*/
public function getEventNoteHTML( $args = [] ) {
return Markdown::parse( $this->getEventNote(), $args );
}
/**
* Factory Users by this event
*
* @return Query
*/
public function factoryUserByEvent() {
return User::factoryByEvent( $this->getEventID() );
}
/**
* Factory Sharables by this event
*
* @return Query
*/
public function factorySharebleByEvent() {
return Sharable::factoryByEvent( $this->getEventID() );
}
/**
* You can edit this event?
*
* @return bool
*/
public function isEventEditable() {
return has_permission('edit-events');
}
+ /**
+ * Check if I can translate this Event
+ *
+ * @return boolean
+ */
+ public function isEventTranslatable() {
+ return $this->isEventEditable() || has_permission( 'translate' );
+ }
+
/**
* Insert subscription if not exists
*/
function addSubscription($email) {
$exists = Subscription::getStandardQuery( $email, $this->getEventID() )->getRow('Subscription');
$exists || Subscription::insert( $email, $this->getEventID() );
return $exists;
}
/**
* Get URL to trop-iCal API for this event
*
* @param boolean $absolute Set to true for an absolute URL
* @return string
*/
public function getEventCalURL( $absolute = false ) {
$event = urlencode( $this->getEventUID() );
$conf = urlencode( $this->getConferenceUID() );
return site_page( "api/tropical.php?conference=$conf&event=$event", $absolute );
}
/**
* Are event subscriptions available?
*
* @return bool
*/
public function areEventSubscriptionsAvailable() {
return $this->get( 'event_subscriptions' ) && ! $this->isEventPassed();
}
/**
* Is event passed?
*
* @return bool
*/
public function isEventPassed() {
$now = new DateTime('now');
return $now->diff( $this->get('event_end') )->invert === 1;
}
+ /**
+ * Get the URL to the page that allow to translate this Event
+ *
+ * @return string
+ */
+ public function getEventTranslateURL() {
+ // well, actually the translate page it's in the 2016 directory :^)
+ $page = ROOT . '/2016/event-translate.php';
+
+ return http_build_get_query( $page, [
+ 'id' => $this->getEventID(),
+ ] );
+ }
+
/**
* Normalize an Event object
*/
protected function normalizeEvent() {
$this->integers( Event::ID );
$this->datetimes(
Event::START,
Event::END
);
$this->booleans('event_subscriptions');
}
}
/**
* An Event can be a talk or a lesson etc.
*/
class Event extends Queried {
use EventTrait;
/**
* Database table name
*/
const T = 'event';
/**
* ID column name
*/
const ID = 'event_ID';
/**
* UID column name
*/
const UID = 'event_uid';
/**
* Title column name
*/
const TITLE = 'event_title';
/**
* Subtitle column name
*/
const SUBTITLE = 'event_subtitle';
/**
* Image column name
*/
const IMAGE = 'event_img';
/**
* Start column name
*/
const START = 'event_start';
/**
* End column name
*/
const END = 'event_end';
/**
* Description column name
*/
const DESCRIPTION = 'event_description';
/**
* Description column name
*/
const ABSTRACT = 'event_abstract';
/**
* Note column name
*/
const NOTE = 'event_note';
/**
* Language column name
*/
const LANGUAGE = 'event_language';
/**
* Complete ID column name
*/
const ID_ = self::T . DOT . self::ID;
/**
* Complete conference ID column name
*/
const CONFERENCE_ = self::T . DOT . Conference::ID;
/**
* Complete room ID column name
*/
const ROOM_ = self::T . DOT . Room::ID;
/**
* Complete track ID column name
*/
const TRACK_ = self::T . DOT . Track::ID;
/**
* Complete chapter ID column name
*/
const CHAPTER_ = self::T . DOT . Chapter::ID;
/**
* Maximum UID length
*
* @override
*/
const MAXLEN_UID = 100;
/**
* Constructor
*/
public function __construct() {
$this->normalizeEvent();
}
/**
* Generate the appropriate SELECT for the User Abstract
*
* @return string
*/
public static function ABSTRACT_L10N() {
return i18n_coalesce( self::ABSTRACT );
}
/**
* Generate the appropriate SELECT for the User Description
*
* @return string
*/
public static function DESCRIPTION_L10N() {
return i18n_coalesce( self::DESCRIPTION );
}
/**
* Generate the appropriate SELECT for the User Description
*
* @return string
*/
public static function NOTE_L10N() {
return i18n_coalesce( self::NOTE );
}
/**
* All the public Event fields
*
* @return array
*/
public static function fields() {
return [
self::ID_,
self::UID,
self::TITLE,
self::DESCRIPTION_L10N(),
self::ABSTRACT_L10N(),
self::NOTE_L10n(),
self::SUBTITLE,
self::IMAGE,
self::START,
self::END,
self::LANGUAGE,
];
}
/**
* Get all the fields that support internationalization
*
* @return array
*/
public static function fields_i18n() {
return [
self::ABSTRACT,
self::DESCRIPTION,
self::NOTE,
];
}
}