Skip to content

Commit

Permalink
solve bug 00000073
Browse files Browse the repository at this point in the history
  • Loading branch information
domjos1994 committed Oct 5, 2018
1 parent fd9c09b commit 143f481
Show file tree
Hide file tree
Showing 10 changed files with 169 additions and 43 deletions.
18 changes: 17 additions & 1 deletion Classes/Domain/Model/TimelineEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,22 @@ class TimelineEvent extends AbstractEntity {
* @var string
* */
protected $format = '';

/**
* The Direction of the event
*
* @var int
* */
protected $side = 0;

public function __construct($title = '', $description = '', $startDate = null, $endDate = null, $format = '') {
public function __construct($title = '', $description = '', $startDate = null, $endDate = null, $format = '', $side = null) {
$this->title = $title;
$this->eventLink = "";
$this->description = $description;
$this->startDate = $startDate;
$this->endDate = $endDate;
$this->format = $format;
$this->side = $side;
}

public function setTitle($title) {
Expand Down Expand Up @@ -105,5 +113,13 @@ public function getFormat() {
return $this->format;
}

public function setSide($side) {
$this->side = $side;
}

public function getSide() {
return $this->side;
}

}

15 changes: 14 additions & 1 deletion Configuration/TCA/tx_timeline_domain_model_timelineevent.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,22 @@
'default' => 'd.m.Y'
]
],
'side' => [
'label' => 'LLL:EXT:timeline/Resources/Private/Language/locallang_db.xlf:tx_timeline_domain_model_timelineevent.item_side',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => array(
array('LLL:EXT:timeline/Resources/Private/Language/locallang_db.xlf:tx_timeline_domain_model_timelineevent.item_side.right', '0'),
array('LLL:EXT:timeline/Resources/Private/Language/locallang_db.xlf:tx_timeline_domain_model_timelineevent.item_side.left', '1'),
),
'size' => 1,
'maxitems' => 1,
]
],
],
'types' => [
'0' => ['showitem' => 'title, event_link, description, start_date, end_date, format']
'0' => ['showitem' => 'title, event_link, description, start_date, end_date, format, side']
]
];

1 change: 1 addition & 0 deletions Configuration/Typoscript/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ page.footerData.10.value (
$('ul.timeline1 li.work div.content').css("background-color", $var);
$('ul.timeline1 li.work div.relative span.circle').css("background-color", $var);
$('ul.timeline2 li div.timeline-panel h4').css("color", $var);
$('ul.timeline3').css("border-left", "4px solid " + $var);
}
});
});
Expand Down
12 changes: 12 additions & 0 deletions Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
<source>Date-Format</source>
<target>Datumsformat</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side">
<source>Direction</source>
<target>Richtung</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side.left">
<source>Left</source>
<target>Links</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side.right">
<source>Right</source>
<target>Rechts</target>
</trans-unit>

<trans-unit id="tx_timeline_domain_model_timeline">
<source>TimeLine</source>
Expand Down
12 changes: 12 additions & 0 deletions Resources/Private/Language/es.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
<source>Date-Format</source>
<target>Formato de fecha</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side">
<source>Direction</source>
<target>Dirección</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side.left">
<source>Left</source>
<target>Izquierda</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side.right">
<source>Right</source>
<target>Derecho</target>
</trans-unit>

<trans-unit id="tx_timeline_domain_model_timeline">
<source>TimeLine</source>
Expand Down
12 changes: 12 additions & 0 deletions Resources/Private/Language/fr.locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
<source>Date-Format</source>
<target>Format de date</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side">
<source>Direction</source>
<target>Direction</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side.left">
<source>Left</source>
<target>Gauche</target>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side.right">
<source>Right</source>
<target>Droit</target>
</trans-unit>

<trans-unit id="tx_timeline_domain_model_timeline">
<source>TimeLine</source>
Expand Down
9 changes: 9 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
<trans-unit id="tx_timeline_domain_model_timelineevent.item_format">
<source>Date-Format</source>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side">
<source>Direction</source>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side.left">
<source>Left</source>
</trans-unit>
<trans-unit id="tx_timeline_domain_model_timelineevent.item_side.right">
<source>Right</source>
</trans-unit>

<trans-unit id="tx_timeline_domain_model_timeline">
<source>TimeLine</source>
Expand Down
68 changes: 30 additions & 38 deletions Resources/Private/Templates/Timeline/List.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@
</li>
</f:case>
<f:case value="2">
<li>
<f:switch expression="{event.side}">
<f:case value="0">
<li>
</f:case>
<f:case value="1">
<li class="timeline-inverted">
</f:case>
</f:switch>
<div class="timeline-badge">
<a><i class="fa fa-circle" id=""></i></a>
</div>
Expand Down Expand Up @@ -97,54 +104,39 @@ <h4>{event.title}</h4>
</div>
</li>
</f:case>
<f:case value="2">
<li class='work'>
<f:if condition="{objIterator.cycle}==1">
<f:then>
<input class='radio' id='work{uid}{objIterator.index}' name='works' type='radio' checked="checked">
</f:then>
<f:else>
<input class='radio' id='work{uid}{objIterator.index}' name='works' type='radio'>
</f:else>
</f:if>

<div class="relative">
<label for='work{uid}{objIterator.index}'>{event.title}</label>
<f:if condition="{event.endDate}==0">
<f:case value="3">
<f:if condition="{event.endDate}==0">
<f:then>
<f:if condition="{onlyYear}">
<f:then>
<f:if condition="{onlyYear}">
<f:then>
<span class='date'><f:format.date format="Y">{event.startDate}</f:format.date></span>
</f:then>
<f:else>
<span class='date'><f:format.date format="{event.format}">{event.startDate}</f:format.date></span>
</f:else>
</f:if>
<li class="event" data-date='<f:format.date format="Y">{event.startDate}</f:format.date>'>
</f:then>
<f:else>
<f:if condition="{onlyYear}">
<f:then>
<span class='date'><f:format.date format="Y">{event.startDate}</f:format.date> - <f:format.date format="Y">{event.endDate}</f:format.date></span>
</f:then>
<f:else>
<span class='date'><f:format.date format="{event.format}">{event.startDate}</f:format.date> - <f:format.date format="{event.format}">{event.endDate}</f:format.date></span>
</f:else>
</f:if>
<li class="event" data-date='<f:format.date format="{event.format}">{event.startDate}</f:format.date>'>
</f:else>
</f:if>
<span class='circle'></span>
</div>
<div class='content'>
<p>
{event.description}
</f:then>
<f:else>
<f:if condition="{onlyYear}">
<f:then>
<li class="event" data-date='<f:format.date format="Y">{event.startDate}</f:format.date> - <f:format.date format="Y">{event.endDate}</f:format.date>'>
</f:then>
<f:else>
<li class="event" data-date='<f:format.date format="{event.format}">{event.startDate}</f:format.date> - <f:format.date format="{event.format}">{event.endDate}</f:format.date>'>
</f:else>
</f:if>
</f:else>
</f:if>
<h3>{event.title}</h3>
<p>
{event.description}
<f:if condition="{event.eventLink}">
<f:then>
<br/>
<f:link.typolink parameter="{event.eventLink}">More Details</f:link.typolink>
</f:then>
</f:if>
</p>
</div>
</p>
</li>
</f:case>
</f:switch>
Expand Down
62 changes: 60 additions & 2 deletions Resources/Public/Css/timeline.css
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,66 @@ ul.timeline2 {
}
}



/******************************************************************************/
/* Styles for Timeline 3 */
/******************************************************************************/

.timeline3 {
border-left: 4px solid #4298C3;
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
background: rgba(255, 255, 255, 0.3);
color: black;
margin: 50px auto;
letter-spacing: 0.5px;
position: relative;
line-height: 1.4em;
font-size: 1.03em;
padding: 50px;
list-style: none;
text-align: left;
font-weight: 100;
}
.timeline3 h1,
.timeline3 h2,
.timeline3 h3 {
letter-spacing: 1.5px;
font-weight: 100;
font-size: 1.4em;
}
.timeline3 .event {
border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
padding-bottom: 25px;
margin-bottom: 50px;
position: relative;
}
.timeline3 .event:last-of-type {
padding-bottom: 0;
margin-bottom: 0;
border: none;
}
.timeline3 .event:before,
.timeline3 .event:after {
position: absolute;
display: block;
top: 0;
}
.timeline3 .event:before {
left: -217.5px;
color: black;
content: attr(data-date);
text-align: right;
font-weight: 100;
font-size: 0.9em;
min-width: 120px;
}
.timeline3 .event:after {
box-shadow: 0 0 0 4px gray;
left: -57.85px;
background: #313534;
border-radius: 50%;
height: 11px;
width: 11px;
content: "";
top: 5px;
}
3 changes: 2 additions & 1 deletion ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ CREATE TABLE tx_timeline_domain_model_timelineevent (
start_date int(11) DEFAULT '0' NOT NULL,
end_date int(11) DEFAULT '0',
timetable_id int(11) unsigned DEFAULT '0',
format text NOT NULL,
format text NOT NULL DEFAULT 'd.M.Y',
side int(11) unsigned NOT NULL DEFAULT '0',

tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
Expand Down

0 comments on commit 143f481

Please sign in to comment.