2015-10-20 14:42:17 -04:00
|
|
|
var injectIntl = require('react-intl').injectIntl;
|
2015-10-25 11:58:12 -04:00
|
|
|
var omit = require('lodash.omit');
|
2015-09-02 15:08:58 -04:00
|
|
|
var React = require('react');
|
2015-10-16 15:10:17 -04:00
|
|
|
var render = require('../../lib/render.jsx');
|
2015-09-02 15:08:58 -04:00
|
|
|
|
|
|
|
var Api = require('../../mixins/api.jsx');
|
2015-09-03 22:41:27 -04:00
|
|
|
var Session = require('../../mixins/session.jsx');
|
|
|
|
|
2015-09-08 22:54:55 -04:00
|
|
|
var Activity = require('../../components/activity/activity.jsx');
|
2015-10-19 14:15:56 -04:00
|
|
|
var AdminPanel = require('../../components/adminpanel/adminpanel.jsx');
|
2015-10-22 17:19:31 -04:00
|
|
|
var Banner = require('../../components/banner/banner.jsx');
|
2015-09-08 18:15:02 -04:00
|
|
|
var Box = require('../../components/box/box.jsx');
|
2015-10-19 14:15:56 -04:00
|
|
|
var Button = require('../../components/forms/button.jsx');
|
2015-09-08 18:15:02 -04:00
|
|
|
var Carousel = require('../../components/carousel/carousel.jsx');
|
2015-09-09 22:16:03 -04:00
|
|
|
var Intro = require('../../components/intro/intro.jsx');
|
2015-10-22 18:40:04 -04:00
|
|
|
var Modal = require('../../components/modal/modal.jsx');
|
2015-09-02 15:08:58 -04:00
|
|
|
var News = require('../../components/news/news.jsx');
|
2015-10-22 12:21:47 -04:00
|
|
|
var Welcome = require('../../components/welcome/welcome.jsx');
|
2015-09-02 15:08:58 -04:00
|
|
|
|
2016-01-06 14:23:47 -05:00
|
|
|
require('../../main.scss');
|
2015-09-02 15:08:58 -04:00
|
|
|
require('./splash.scss');
|
|
|
|
|
2016-01-06 14:23:47 -05:00
|
|
|
var Navigation = require('../../components/navigation/navigation.jsx');
|
|
|
|
var Footer = require('../../components/footer/footer.jsx');
|
|
|
|
|
2015-10-20 14:42:17 -04:00
|
|
|
var Splash = injectIntl(React.createClass({
|
2015-10-09 16:16:37 -04:00
|
|
|
type: 'Splash',
|
2015-09-02 15:08:58 -04:00
|
|
|
mixins: [
|
2015-09-03 22:41:27 -04:00
|
|
|
Api,
|
|
|
|
Session
|
2015-09-02 15:08:58 -04:00
|
|
|
],
|
|
|
|
getInitialState: function () {
|
|
|
|
return {
|
2015-09-09 22:16:03 -04:00
|
|
|
projectCount: 10569070,
|
2015-09-03 22:41:27 -04:00
|
|
|
activity: [],
|
|
|
|
news: [],
|
2015-10-20 13:18:57 -04:00
|
|
|
featuredCustom: {},
|
2015-10-22 18:40:04 -04:00
|
|
|
featuredGlobal: {},
|
2015-10-28 08:57:05 -04:00
|
|
|
showEmailConfirmationModal: false,
|
|
|
|
refreshCacheStatus: 'notrequested'
|
2015-09-02 15:08:58 -04:00
|
|
|
};
|
|
|
|
},
|
2015-10-07 16:23:08 -04:00
|
|
|
componentDidUpdate: function (prevProps, prevState) {
|
2015-10-20 13:18:57 -04:00
|
|
|
if (this.state.session.user != prevState.session.user) {
|
|
|
|
if (this.state.session.user) {
|
|
|
|
this.getActivity();
|
2015-10-21 15:12:41 -04:00
|
|
|
this.getFeaturedCustom();
|
2015-10-20 13:18:57 -04:00
|
|
|
this.getNews();
|
|
|
|
} else {
|
|
|
|
this.setState({featuredCustom: []});
|
2015-10-24 14:52:11 -04:00
|
|
|
this.setState({activity: []});
|
|
|
|
this.setState({news: []});
|
2015-10-21 14:12:34 -04:00
|
|
|
this.getProjectCount();
|
2015-10-25 12:05:52 -04:00
|
|
|
}
|
|
|
|
if (this.shouldShowEmailConfirmation()) {
|
|
|
|
window.addEventListener('message', this.onMessage);
|
|
|
|
} else {
|
2015-10-23 19:02:00 -04:00
|
|
|
window.removeEventListener('message', this.onMessage);
|
2015-10-20 13:18:57 -04:00
|
|
|
}
|
2015-10-07 16:23:08 -04:00
|
|
|
}
|
|
|
|
},
|
2015-09-02 15:08:58 -04:00
|
|
|
componentDidMount: function () {
|
2015-10-21 15:12:41 -04:00
|
|
|
this.getFeaturedGlobal();
|
2015-10-07 16:23:08 -04:00
|
|
|
if (this.state.session.user) {
|
2015-10-20 12:25:30 -04:00
|
|
|
this.getActivity();
|
2015-10-21 15:12:41 -04:00
|
|
|
this.getFeaturedCustom();
|
2015-10-20 13:18:57 -04:00
|
|
|
this.getNews();
|
2015-10-21 14:12:34 -04:00
|
|
|
} else {
|
|
|
|
this.getProjectCount();
|
2015-10-07 16:23:08 -04:00
|
|
|
}
|
2015-10-25 12:05:52 -04:00
|
|
|
if (this.shouldShowEmailConfirmation()) window.addEventListener('message', this.onMessage);
|
2015-09-02 15:08:58 -04:00
|
|
|
},
|
2015-10-23 19:02:00 -04:00
|
|
|
componentWillUnmount: function () {
|
|
|
|
window.removeEventListener('message', this.onMessage);
|
|
|
|
},
|
|
|
|
onMessage: function (e) {
|
|
|
|
if (e.origin != window.location.origin) return;
|
2015-10-25 12:06:34 -04:00
|
|
|
if (e.source != this.refs.emailConfirmationiFrame.contentWindow) return;
|
2015-10-23 19:02:00 -04:00
|
|
|
if (e.data == 'resend-done') {
|
|
|
|
this.hideEmailConfirmationModal();
|
|
|
|
} else {
|
|
|
|
var data = JSON.parse(e.data);
|
|
|
|
if (data['action'] === 'leave-page') {
|
|
|
|
window.location.href = data['uri'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2015-10-21 15:12:41 -04:00
|
|
|
getActivity: function () {
|
2015-10-20 12:25:30 -04:00
|
|
|
this.api({
|
2015-10-21 15:12:41 -04:00
|
|
|
uri: '/proxy/users/' + this.state.session.user.username + '/activity?limit=5'
|
2015-10-20 12:25:30 -04:00
|
|
|
}, function (err, body) {
|
2015-10-23 19:02:00 -04:00
|
|
|
if (!err) this.setState({activity: body});
|
2015-10-20 12:25:30 -04:00
|
|
|
}.bind(this));
|
|
|
|
},
|
2015-10-21 15:12:41 -04:00
|
|
|
getFeaturedGlobal: function () {
|
2015-10-20 12:25:30 -04:00
|
|
|
this.api({
|
2015-10-21 15:12:41 -04:00
|
|
|
uri: '/proxy/featured'
|
2015-10-20 12:25:30 -04:00
|
|
|
}, function (err, body) {
|
2015-10-21 15:12:41 -04:00
|
|
|
if (!err) this.setState({featuredGlobal: body});
|
|
|
|
}.bind(this));
|
|
|
|
},
|
|
|
|
getFeaturedCustom: function () {
|
|
|
|
this.api({
|
|
|
|
uri: '/proxy/users/' + this.state.session.user.id + '/featured'
|
|
|
|
}, function (err, body) {
|
|
|
|
if (!err) this.setState({featuredCustom: body});
|
|
|
|
}.bind(this));
|
|
|
|
},
|
|
|
|
getNews: function () {
|
|
|
|
this.api({
|
|
|
|
uri: '/news?limit=3'
|
|
|
|
}, function (err, body) {
|
2015-10-23 19:02:00 -04:00
|
|
|
if (!err) this.setState({news: body});
|
2015-10-20 12:25:30 -04:00
|
|
|
}.bind(this));
|
|
|
|
},
|
2015-10-21 14:12:34 -04:00
|
|
|
getProjectCount: function () {
|
|
|
|
this.api({
|
|
|
|
uri: '/projects/count/all'
|
|
|
|
}, function (err, body) {
|
|
|
|
if (!err) this.setState({projectCount: body.count});
|
|
|
|
}.bind(this));
|
|
|
|
},
|
2015-10-28 08:57:05 -04:00
|
|
|
refreshHomepageCache: function () {
|
|
|
|
this.api({
|
2015-10-30 09:14:49 -04:00
|
|
|
host: '',
|
2015-10-28 08:57:05 -04:00
|
|
|
uri: '/scratch_admin/homepage/clear-cache/',
|
|
|
|
method: 'post',
|
|
|
|
useCsrf: true
|
|
|
|
}, function (err, body) {
|
|
|
|
if (err) return this.setState({refreshCacheStatus: 'fail'});
|
|
|
|
if (!body.success) return this.setState({refreshCacheStatus: 'inprogress'});
|
|
|
|
return this.setState({refreshCacheStatus: 'pass'});
|
|
|
|
}.bind(this));
|
|
|
|
},
|
|
|
|
getHomepageRefreshStatus: function () {
|
|
|
|
var status = {
|
|
|
|
status: this.state.refreshCacheStatus,
|
|
|
|
disabled: false,
|
|
|
|
content: 'Refresh'
|
|
|
|
};
|
|
|
|
if (this.state.refreshCacheStatus === 'inprogress') {
|
|
|
|
status.disabled = true;
|
|
|
|
status.content = 'In Progress';
|
|
|
|
} else if (this.state.refreshCacheStatus === 'pass') {
|
|
|
|
status.disabled = true;
|
|
|
|
status.content = 'Requested';
|
|
|
|
} else if (this.state.refreshCacheStatus == 'fail') {
|
|
|
|
status.disabled = false;
|
|
|
|
status.content = 'Error';
|
|
|
|
}
|
|
|
|
return status;
|
|
|
|
},
|
2015-10-22 18:40:04 -04:00
|
|
|
showEmailConfirmationModal: function () {
|
2015-10-23 19:02:00 -04:00
|
|
|
this.setState({emailConfirmationModalOpen: true});
|
2015-10-22 18:40:04 -04:00
|
|
|
},
|
|
|
|
hideEmailConfirmationModal: function () {
|
2015-10-23 19:02:00 -04:00
|
|
|
this.setState({emailConfirmationModalOpen: false});
|
2015-10-22 18:40:04 -04:00
|
|
|
},
|
2015-10-22 17:17:27 -04:00
|
|
|
handleDismiss: function (cue) {
|
|
|
|
this.api({
|
|
|
|
host: '',
|
|
|
|
uri: '/site-api/users/set-template-cue/',
|
|
|
|
method: 'post',
|
|
|
|
useCsrf: true,
|
|
|
|
json: {cue: cue, value: false}
|
|
|
|
}, function (err) {
|
|
|
|
if (!err) window.refreshSession();
|
|
|
|
});
|
2015-10-22 12:21:47 -04:00
|
|
|
},
|
2015-10-24 12:05:18 -04:00
|
|
|
shouldShowWelcome: function () {
|
|
|
|
if (!this.state.session.user || !this.state.session.flags.show_welcome) return false;
|
|
|
|
return (
|
|
|
|
new Date(this.state.session.user.dateJoined) >
|
|
|
|
new Date(new Date - 2*7*24*60*60*1000) // Two weeks ago
|
|
|
|
);
|
|
|
|
},
|
2015-10-25 12:05:52 -04:00
|
|
|
shouldShowEmailConfirmation: function () {
|
|
|
|
return (
|
|
|
|
this.state.session.user && this.state.session.flags.has_outstanding_email_confirmation &&
|
|
|
|
this.state.session.flags.confirm_email_banner);
|
|
|
|
},
|
2016-01-07 09:57:34 -05:00
|
|
|
getHomepageComponentMessages: function () {
|
|
|
|
var formatMessage = this.props.intl.formatMessage;
|
|
|
|
var messages = {};
|
|
|
|
|
|
|
|
if (this.state.session.user) {
|
|
|
|
messages['news'] = {
|
|
|
|
'general.viewAll': formatMessage({id: 'general.viewAll'}),
|
|
|
|
'news.scratchNews': formatMessage({id: 'news.scratchNews'})
|
|
|
|
};
|
|
|
|
if (this.shouldShowWelcome()) {
|
|
|
|
messages['welcome'] = {
|
|
|
|
'welcome.welcomeToScratch': formatMessage({id: 'welcome.welcomeToScratch'}),
|
|
|
|
'welcome.learn': formatMessage({id: 'welcome.learn'}),
|
|
|
|
'welcome.tryOut': formatMessage({id: 'welcome.tryOut'}),
|
|
|
|
'welcome.connect': formatMessage({id: 'welcome.connect'})
|
|
|
|
};
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
messages['intro'] = {
|
|
|
|
'intro.aboutScratch': formatMessage({id: 'intro.aboutScratch'}),
|
|
|
|
'intro.forEducators': formatMessage({id: 'intro.forEducators'}),
|
|
|
|
'intro.forParents': formatMessage({id: 'intro.forParents'}),
|
|
|
|
'intro.joinScratch': formatMessage({id: 'intro.joinScratch'}),
|
|
|
|
'intro.seeExamples': formatMessage({id: 'intro.seeExamples'}),
|
|
|
|
'intro.tagLine': formatMessage({id: 'intro.tagLine'}),
|
|
|
|
'intro.tryItOut': formatMessage({id: 'intro.tryItOut'})
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return messages;
|
|
|
|
},
|
2015-10-20 13:18:57 -04:00
|
|
|
renderHomepageRows: function () {
|
2015-10-20 14:42:17 -04:00
|
|
|
var formatMessage = this.props.intl.formatMessage;
|
2015-10-23 10:07:50 -04:00
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
var rows = [
|
2015-10-20 14:42:17 -04:00
|
|
|
<Box
|
|
|
|
title={formatMessage({
|
|
|
|
id: 'splash.featuredProjects',
|
|
|
|
defaultMessage: 'Featured Projects'})}
|
|
|
|
key="community_featured_projects">
|
2015-10-20 13:18:57 -04:00
|
|
|
<Carousel items={this.state.featuredGlobal.community_featured_projects} />
|
|
|
|
</Box>,
|
2015-10-20 14:42:17 -04:00
|
|
|
<Box
|
|
|
|
title={formatMessage({
|
|
|
|
id: 'splash.featuredStudios',
|
|
|
|
defaultMessage: 'Featured Studios'})}
|
|
|
|
key="community_featured_studios">
|
2015-10-23 10:07:50 -04:00
|
|
|
<Carousel items={this.state.featuredGlobal.community_featured_studios}
|
|
|
|
settings={{slidesToShow: 4, slidesToScroll: 4, lazyLoad: false}} />
|
2015-10-20 13:18:57 -04:00
|
|
|
</Box>
|
|
|
|
];
|
|
|
|
|
2015-10-21 16:49:50 -04:00
|
|
|
if (this.state.featuredGlobal.curator_top_projects &&
|
|
|
|
this.state.featuredGlobal.curator_top_projects.length > 4) {
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
rows.push(
|
|
|
|
<Box
|
|
|
|
key="curator_top_projects"
|
|
|
|
title={
|
|
|
|
'Projects Curated by ' +
|
|
|
|
this.state.featuredGlobal.curator_top_projects[0].curator_name}
|
2015-10-20 14:42:17 -04:00
|
|
|
moreTitle={formatMessage({id: 'general.learnMore', defaultMessage: 'Learn More'})}
|
2015-10-20 13:18:57 -04:00
|
|
|
moreHref="/studios/386359/">
|
2015-10-21 16:49:50 -04:00
|
|
|
<Carousel
|
2015-10-23 10:07:50 -04:00
|
|
|
items={this.state.featuredGlobal.curator_top_projects} />
|
2015-10-20 13:18:57 -04:00
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-10-21 16:49:50 -04:00
|
|
|
if (this.state.featuredGlobal.scratch_design_studio &&
|
|
|
|
this.state.featuredGlobal.scratch_design_studio.length > 4) {
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
rows.push(
|
|
|
|
<Box
|
|
|
|
key="scratch_design_studio"
|
|
|
|
title={
|
2015-10-20 14:42:17 -04:00
|
|
|
formatMessage({
|
|
|
|
id: 'splash.scratchDesignStudioTitle',
|
|
|
|
defaultMessage: 'Scratch Design Studio' })
|
|
|
|
+ ' - ' + this.state.featuredGlobal.scratch_design_studio[0].gallery_title}
|
|
|
|
moreTitle={formatMessage({id: 'splash.visitTheStudio', defaultMessage: 'Visit the studio'})}
|
2015-10-20 13:18:57 -04:00
|
|
|
moreHref={'/studios/' + this.state.featuredGlobal.scratch_design_studio[0].gallery_id + '/'}>
|
2015-10-21 16:49:50 -04:00
|
|
|
<Carousel
|
2015-10-23 10:07:50 -04:00
|
|
|
items={this.state.featuredGlobal.scratch_design_studio} />
|
2015-10-20 13:18:57 -04:00
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-10-21 16:49:50 -04:00
|
|
|
if (this.state.session.user &&
|
|
|
|
this.state.featuredGlobal.community_newest_projects &&
|
|
|
|
this.state.featuredGlobal.community_newest_projects.length > 0) {
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
rows.push(
|
2015-10-20 14:42:17 -04:00
|
|
|
<Box
|
|
|
|
title={
|
|
|
|
formatMessage({
|
|
|
|
id: 'splash.recentlySharedProjects',
|
|
|
|
defaultMessage: 'Recently Shared Projects' })}
|
|
|
|
key="community_newest_projects">
|
2015-10-21 16:49:50 -04:00
|
|
|
<Carousel
|
2015-10-23 10:07:50 -04:00
|
|
|
items={this.state.featuredGlobal.community_newest_projects} />
|
2015-10-20 13:18:57 -04:00
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-10-21 16:49:50 -04:00
|
|
|
if (this.state.featuredCustom.custom_projects_by_following &&
|
|
|
|
this.state.featuredCustom.custom_projects_by_following.length > 0) {
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
rows.push(
|
2015-10-21 16:49:50 -04:00
|
|
|
<Box title={
|
2015-10-20 14:42:17 -04:00
|
|
|
formatMessage({
|
|
|
|
id: 'splash.projectsByScratchersFollowing',
|
|
|
|
defaultMessage: 'Projects by Scratchers I\'m Following'})}
|
2015-10-21 16:49:50 -04:00
|
|
|
key="custom_projects_by_following">
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
<Carousel items={this.state.featuredCustom.custom_projects_by_following} />
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|
2015-10-21 16:49:50 -04:00
|
|
|
if (this.state.featuredCustom.custom_projects_loved_by_following &&
|
|
|
|
this.state.featuredCustom.custom_projects_loved_by_following.length > 0) {
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
rows.push(
|
2015-10-21 16:49:50 -04:00
|
|
|
<Box title={
|
2015-10-20 14:42:17 -04:00
|
|
|
formatMessage({
|
|
|
|
id: 'splash.projectsLovedByScratchersFollowing',
|
|
|
|
defaultMessage: 'Projects Loved by Scratchers I\'m Following'})}
|
2015-10-21 16:49:50 -04:00
|
|
|
key="custom_projects_loved_by_following">
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
<Carousel items={this.state.featuredCustom.custom_projects_loved_by_following} />
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-10-21 16:49:50 -04:00
|
|
|
if (this.state.featuredCustom.custom_projects_in_studios_following &&
|
|
|
|
this.state.featuredCustom.custom_projects_in_studios_following.length > 0) {
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
rows.push(
|
2015-10-21 16:49:50 -04:00
|
|
|
<Box title={
|
2015-10-20 14:42:17 -04:00
|
|
|
formatMessage({
|
|
|
|
id:'splash.projectsInStudiosFollowing',
|
|
|
|
defaultMessage: 'Projects in Studios I\'m Following'})}
|
2015-10-21 16:49:50 -04:00
|
|
|
key="custom_projects_in_studios_following">
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
<Carousel items={this.state.featuredCustom.custom_projects_in_studios_following} />
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
rows.push(
|
2015-10-21 16:49:50 -04:00
|
|
|
<Box title={
|
2015-10-20 14:42:17 -04:00
|
|
|
formatMessage({
|
|
|
|
id: 'splash.communityRemixing',
|
|
|
|
defaultMessage: 'What the Community is Remixing' })}
|
2015-10-21 16:49:50 -04:00
|
|
|
key="community_most_remixed_projects">
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
<Carousel items={this.state.featuredGlobal.community_most_remixed_projects} showRemixes={true} />
|
|
|
|
</Box>,
|
2015-10-21 16:49:50 -04:00
|
|
|
<Box title={
|
2015-10-20 14:42:17 -04:00
|
|
|
formatMessage({
|
|
|
|
id: 'splash.communityLoving',
|
|
|
|
defaultMessage: 'What the Community is Loving' })}
|
2015-10-21 16:49:50 -04:00
|
|
|
key="community_most_loved_projects">
|
|
|
|
|
2015-10-20 13:18:57 -04:00
|
|
|
<Carousel items={this.state.featuredGlobal.community_most_loved_projects} showLoves={true} />
|
|
|
|
</Box>
|
|
|
|
);
|
|
|
|
|
|
|
|
return rows;
|
|
|
|
},
|
2015-09-02 15:08:58 -04:00
|
|
|
render: function () {
|
2015-10-20 13:18:57 -04:00
|
|
|
var featured = this.renderHomepageRows();
|
2015-10-25 11:58:12 -04:00
|
|
|
var emailConfirmationStyle = {width: 500, height: 330, padding: 1};
|
2015-10-28 08:57:05 -04:00
|
|
|
var homepageCacheState = this.getHomepageRefreshStatus();
|
2016-01-07 09:57:34 -05:00
|
|
|
|
|
|
|
var messages = this.getHomepageComponentMessages();
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
return (
|
2015-10-22 17:19:31 -04:00
|
|
|
<div className="splash">
|
2015-10-25 12:05:52 -04:00
|
|
|
{this.shouldShowEmailConfirmation() ? [
|
2015-10-22 17:19:31 -04:00
|
|
|
<Banner key="confirmedEmail"
|
|
|
|
className="warning"
|
|
|
|
onRequestDismiss={this.handleDismiss.bind(this, 'confirmed_email')}>
|
2015-10-22 18:40:04 -04:00
|
|
|
<a href="#" onClick={this.showEmailConfirmationModal}>Confirm your email</a>
|
2015-10-23 19:02:00 -04:00
|
|
|
{' '}to enable sharing.{' '}
|
2015-10-22 17:19:31 -04:00
|
|
|
<a href="/info/faq/#accounts">Having trouble?</a>
|
2015-10-22 18:40:04 -04:00
|
|
|
</Banner>,
|
|
|
|
<Modal key="emailConfirmationModal"
|
2015-10-23 19:02:00 -04:00
|
|
|
isOpen={this.state.emailConfirmationModalOpen}
|
2015-10-22 18:40:04 -04:00
|
|
|
onRequestClose={this.hideEmailConfirmationModal}
|
2015-10-25 11:58:12 -04:00
|
|
|
style={{content: emailConfirmationStyle}}>
|
2015-10-25 12:06:34 -04:00
|
|
|
<iframe ref="emailConfirmationiFrame"
|
|
|
|
src="/accounts/email_resend_standalone/"
|
|
|
|
{...omit(emailConfirmationStyle, 'padding')} />
|
2015-10-22 18:40:04 -04:00
|
|
|
</Modal>
|
2015-10-22 17:19:31 -04:00
|
|
|
] : []}
|
|
|
|
<div key="inner" className="inner">
|
|
|
|
{this.state.session.user ? [
|
|
|
|
<div key="header" className="splash-header">
|
2015-10-25 16:34:32 -04:00
|
|
|
{this.shouldShowWelcome() ? [
|
2016-01-07 09:57:34 -05:00
|
|
|
<Welcome key="welcome"
|
|
|
|
onDismiss={this.handleDismiss.bind(this, 'welcome')}
|
|
|
|
messages={messages['welcome']} />
|
2015-10-22 17:19:31 -04:00
|
|
|
] : [
|
|
|
|
<Activity key="activity" items={this.state.activity} />
|
|
|
|
]}
|
2016-01-07 09:57:34 -05:00
|
|
|
<News items={this.state.news} messages={messages['news']} />
|
2015-10-22 17:19:31 -04:00
|
|
|
</div>
|
|
|
|
] : [
|
2016-01-07 09:57:34 -05:00
|
|
|
<Intro projectCount={this.state.projectCount} messages={messages['intro']} key="intro"/>
|
2015-10-22 17:19:31 -04:00
|
|
|
]}
|
2015-10-20 13:18:57 -04:00
|
|
|
|
2015-10-22 17:19:31 -04:00
|
|
|
{featured}
|
2015-10-20 13:18:57 -04:00
|
|
|
|
2015-10-22 17:19:31 -04:00
|
|
|
<AdminPanel>
|
|
|
|
<dt>Tools</dt>
|
|
|
|
<dd>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<a href="/scratch_admin/tickets">Ticket Queue</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="/scratch_admin/ip-search/">IP Search</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="/scratch_admin/email-search/">Email Search</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</dd>
|
|
|
|
<dt>Homepage Cache</dt>
|
|
|
|
<dd>
|
|
|
|
<ul className="cache-list">
|
|
|
|
<li>
|
2015-10-28 08:57:05 -04:00
|
|
|
<div className="button-row">
|
|
|
|
<span>Refresh row data:</span>
|
|
|
|
<Button onClick={this.refreshHomepageCache}
|
|
|
|
className={homepageCacheState.status}
|
2015-10-30 09:14:49 -04:00
|
|
|
disabled={homepageCacheState.disabled}>
|
2015-10-28 08:57:05 -04:00
|
|
|
<span>{homepageCacheState.content}</span>
|
|
|
|
</Button>
|
|
|
|
</div>
|
2015-10-22 17:19:31 -04:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</dd>
|
|
|
|
</AdminPanel>
|
|
|
|
</div>
|
2015-09-02 15:08:58 -04:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2015-10-20 14:42:17 -04:00
|
|
|
}));
|
2015-09-02 15:08:58 -04:00
|
|
|
|
2016-01-06 14:23:47 -05:00
|
|
|
render(<Navigation />, document.getElementById('navigation'));
|
|
|
|
render(<Footer />, document.getElementById('footer'));
|
2015-10-16 15:10:17 -04:00
|
|
|
render(<Splash />, document.getElementById('view'));
|