Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 71718fa

Browse files
committed
Adding README for timeline
1 parent 9a69c3e commit 71718fa

7 files changed

Lines changed: 22565 additions & 22415 deletions

File tree

reactjs-adminlte/public/dist/js/buttons.bundle.js

Lines changed: 198 additions & 194 deletions
Large diffs are not rendered by default.

reactjs-adminlte/public/dist/js/dashboardV1.bundle.js

Lines changed: 235 additions & 208 deletions
Large diffs are not rendered by default.

reactjs-adminlte/public/dist/js/timeline.bundle.js

Lines changed: 248 additions & 257 deletions
Large diffs are not rendered by default.

reactjs-adminlte/public/dist/js/vendors.js

Lines changed: 21111 additions & 21126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reactjs-adminlte/public/dist/js/widgets.bundle.js

Lines changed: 596 additions & 607 deletions
Large diffs are not rendered by default.
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
#### [View components](./js/components/timeline)
2+
3+
## List of widgets
4+
5+
6+
### - [Timeline](./js/components/timeline/timeline.js)
7+
8+
The parent component which renders the entire timeline.
9+
10+
#### Usage:
11+
12+
You have 2 choices - you may either pass data for rendering the timeline via props, or you can pass components [Timelabel](./js/components/timeline/time-label.js) and [TimelineItem](./js/components/timeline/timeline-item/timeline-item.js) as children to Timeline.
13+
14+
Props: Timeline components takes `timelineInfo`, an array of objects. Each object is of the following structure -
15+
16+
```javascript
17+
18+
startDate: '10 Feb. 2014' (Beginning of one element in the timeline),
19+
endDate: '3 Jan. 2014' (End time of the element in the timeline),
20+
items: Array of objects containing data to be rendered for each individual element in the timeline
21+
[
22+
{
23+
icon: 'fa fa-envelope' (Any font-awesome icon as a marker for the timeline element),
24+
iconTheme: 'bg-blue' (Color of the marker),
25+
time: ' 12:05' (Date/Time for the element),
26+
27+
//For each of the option below, you can pass html elements or other component widgets as `markup` to render in each of the sections
28+
header: (Header section of the item) {
29+
url: '#',
30+
title: 'Support Team ',
31+
content: 'sent you an email'
32+
markup: (Optional, can be used to pass html)
33+
},
34+
body: (Body of the item) {
35+
content: 'Etsy doostang zoodles disqus groupon greplin oooj voxy zoodles, weebly ning heekya handango imeem plugg dopplr jibjab, movity jajah plickers sifteo edmodo ifttt zimbra. Babblely odeo kaboodle quora plaxo ideeli hulu weebly balihoo...',
36+
},
37+
footer:(Footer section of the item) {
38+
content: '',
39+
markup: [
40+
<a key="1" className="btn btn-primary btn-xs">Read more</a>,
41+
<a key="2" className="btn btn-danger btn-xs">Delete</a>
42+
]
43+
}
44+
}
45+
]
46+
```
47+
48+
#### Example:
49+
50+
```javascript
51+
var timelineInfo = [
52+
{
53+
startDate: '10 Feb. 2014',
54+
endDate: '3 Jan. 2014',
55+
items: [
56+
{
57+
icon: 'fa fa-envelope',
58+
iconTheme: 'bg-blue',
59+
time: ' 12:05',
60+
header: {
61+
url: '#',
62+
title: 'Support Team ',
63+
content: 'sent you an email'
64+
},
65+
body: {
66+
content: 'Etsy doostang zoodles disqus groupon greplin oooj voxy zoodles, weebly ning heekya handango imeem plugg dopplr jibjab, movity jajah plickers sifteo edmodo ifttt zimbra. Babblely odeo kaboodle quora plaxo ideeli hulu weebly balihoo...',
67+
},
68+
footer: {
69+
content: '',
70+
markup: [
71+
<a key="1" className="btn btn-primary btn-xs">Read more</a>,
72+
<a key="2" className="btn btn-danger btn-xs">Delete</a>
73+
]
74+
}
75+
},
76+
{
77+
icon: 'fa fa-user',
78+
iconTheme: 'bg-aqua',
79+
time: ' 5 mins ago',
80+
header: {
81+
url: '#',
82+
title: 'Sarah Young ',
83+
content: 'accepted your friend request'
84+
}
85+
},
86+
{
87+
icon: 'fa fa-comments',
88+
iconTheme: 'bg-yellow',
89+
time: ' 27 mins ago',
90+
header: {
91+
url: '#',
92+
title: 'Jay White ',
93+
content: 'commented on your post'
94+
},
95+
body: {
96+
content: 'Take me to your leader! Switzerland is small and neutral! We are more like Germany, ambitious and misunderstood!'
97+
},
98+
footer: {
99+
content: '',
100+
markup: <a className="btn btn-warning btn-flat btn-xs">View comment</a>
101+
}
102+
}
103+
]
104+
},{
105+
items: [
106+
{
107+
icon: 'fa fa-camera',
108+
iconTheme: 'bg-purple',
109+
time: ' 2 days ago',
110+
header: {
111+
url: '#',
112+
title: 'Mina Lee ',
113+
content: 'uploaded new photos'
114+
},
115+
body: {
116+
content: '',
117+
markup: [
118+
<img key="1" src="http://placehold.it/150x100" alt="..." className="margin" />,
119+
<img key="2" src="http://placehold.it/150x100" alt="..." className="margin" />,
120+
<img key="3" src="http://placehold.it/150x100" alt="..." className="margin" />,
121+
<img key="4" src="http://placehold.it/150x100" alt="..." className="margin" />
122+
]
123+
}
124+
},
125+
{
126+
icon: 'fa fa-video-camera',
127+
iconTheme: 'bg-maroon',
128+
time: ' 5 days ago',
129+
header: {
130+
url: '#',
131+
title: 'Mr. Doe ',
132+
content: 'shared a video'
133+
},
134+
body: {
135+
content: '',
136+
markup: <div className="embed-responsive embed-responsive-16by9">
137+
<iframe className="embed-responsive-item" src="https://www.youtube.com/embed/tMWkeBIohBs" frameBorder="0" allowFullScreen="">
138+
</iframe>
139+
</div>
140+
},
141+
footer: {
142+
content: '',
143+
markup: <a href="#" className="btn btn-xs bg-maroon">See comments</a>
144+
}
145+
}
146+
]
147+
}
148+
];
149+
150+
<Timeline timelineInfo={this.state.timelineInfo}/>
151+
```

reactjs-adminlte/public/src/timeline-page/js/components/timeline/timeline.js

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,34 @@ define (
99
render: function(){
1010
var timelineInfo = [];
1111

12-
this.props.timelineInfo.map(function(timelineElement, iterator){
12+
if(this.props.children){
13+
timelineInfo = this.props.children;
14+
}else{
15+
this.props.timelineInfo.map(function(timelineElement, iterator){
1316

14-
if(timelineElement.endDate){
15-
timelineInfo.push(<TimeLabel key={"label1"+iterator} theme="bg-red" content={timelineElement.endDate} />);
16-
}
17-
18-
19-
timelineElement.items.map(function(item, i){
20-
timelineInfo.push(
21-
<TimelineItem
22-
key={"item"+iterator+i}
23-
icon={item.icon}
24-
iconTheme={item.iconTheme}
25-
time= {item.time}
26-
header={item.header}
27-
body={item.body}
28-
footer={item.footer} >
29-
</TimelineItem>
30-
)
17+
if(timelineElement.endDate){
18+
timelineInfo.push(<TimeLabel key={"label1"+iterator} theme="bg-red" content={timelineElement.endDate} />);
19+
}
20+
21+
timelineElement.items.map(function(item, i){
22+
timelineInfo.push(
23+
<TimelineItem
24+
key={"item"+iterator+i}
25+
icon={item.icon}
26+
iconTheme={item.iconTheme}
27+
time= {item.time}
28+
header={item.header}
29+
body={item.body}
30+
footer={item.footer} >
31+
</TimelineItem>
32+
)
33+
});
34+
35+
if(timelineElement.startDate){
36+
timelineInfo.push(<TimeLabel key={"label2"+iterator} theme="bg-green" content={timelineElement.startDate} />)
37+
}
3138
});
32-
33-
if(timelineElement.startDate){
34-
timelineInfo.push(<TimeLabel key={"label2"+iterator} theme="bg-green" content={timelineElement.startDate} />)
35-
}
36-
});
39+
}
3740

3841
return (
3942
<div className="col-md-12">

0 commit comments

Comments
 (0)