Skip to content

Commit

Permalink
Merge pull request #39 from plone/revert-38-addVLT
Browse files Browse the repository at this point in the history
Revert "Add vlt"
  • Loading branch information
Molochem authored Jan 12, 2024
2 parents 94919c2 + 376d875 commit aeded77
Show file tree
Hide file tree
Showing 22 changed files with 3,305 additions and 28 deletions.
4 changes: 1 addition & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
"@kitconcept/volto-export": "1.1.0",
"@kitconcept/volto-heading-block": "2.4.0",
"@kitconcept/volto-introduction-block": "1.0.0",
"@kitconcept/volto-light-theme": "3.0.0-alpha.1",
"@kitconcept/volto-separator-block": "4.0.0",
"@kitconcept/volto-slider-block": "5.1.1",
"@plone-collective/volto-authomatic": "1.3.0",
Expand Down Expand Up @@ -178,6 +177,5 @@
"volta": {
"node": "16.20.0",
"yarn": "3.5.1"
},
"theme": "@kitconcept/volto-light-theme"
}
}
6 changes: 1 addition & 5 deletions frontend/src/addons/volto-plonede/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
"scripts": {
"i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon"
},
"addons": [
"@kitconcept/volto-light-theme"
],
"dependencies": {
"@plone/scripts": "*",
"@kitconcept/volto-light-theme":"3.0.0-alpha.1"
"@plone/scripts": "*"
}
}
12 changes: 12 additions & 0 deletions frontend/src/addons/volto-plonede/src/components/theme/Style.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// import React from 'react';
// import ThemeSwitcher from './ThemeSwitcher';

// const Style = () => {
// return (
// <>
// <ThemeSwitcher />
// </>
// );
// };

// export default Style;
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// import { useState } from 'react';
// import { BodyClass } from '@plone/volto/helpers';
// import { Icon } from '@plone/volto/components';
// import Logo from '../../icons/logo.svg';

// const themeSwitcher = () => {
// const [darkMode, setDarkMode] = useState(false);
// return (
// <>
// <BodyClass className={darkMode ? 'dark' : 'light'} />
// <div>
// <button
// onClick={() => setDarkMode(!darkMode)}
// className="themeSwitcher"
// >
// <Icon className="themeSwitcherIcon" name={Logo} size="20" />
// </button>
// </div>
// </>
// );
// };

// export default themeSwitcher;
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import React from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { Segment, Header, List } from 'semantic-ui-react';
import {
When,
Recurrence,
} from '@plone/volto/components/theme/View/EventDatesInfo';

const messages = defineMessages({
what: {
id: 'event_what',
defaultMessage: 'What',
},
when: {
id: 'event_when',
defaultMessage: 'When',
},
allDates: {
id: 'event_alldates',
defaultMessage: 'All dates',
},
downloadEvent: {
id: 'Download Event',
defaultMessage: 'Download Event',
},
where: {
id: 'event_where',
defaultMessage: 'Where',
},
contactName: {
id: 'event_contactname',
defaultMessage: 'Contact Name',
},
contactPhone: {
id: 'event_contactphone',
defaultMessage: 'Contact Phone',
},
attendees: {
id: 'event_attendees',
defaultMessage: 'Attendees',
},
website: {
id: 'event_website',
defaultMessage: 'Website',
},
visitWebsite: {
id: 'visit_external_website',
defaultMessage: 'Visit external website',
},
});

const EventDetails = ({ content, display_as = 'aside' }) => {
const intl = useIntl();
return (
<Segment
as={display_as}
{...(display_as === 'aside' ? { floated: 'right' } : {})}
>
{content.subjects?.length > 0 && (
<>
<Header dividing sub>
{intl.formatMessage(messages.what)}
</Header>
<List items={content.subjects} />
</>
)}
<Header dividing sub>
{intl.formatMessage(messages.when)}
</Header>
<When
start={content.start}
end={content.end}
whole_day={content.whole_day}
open_end={content.open_end}
/>
{content.recurrence && (
<>
<Header dividing sub>
{intl.formatMessage(messages.allDates)}
</Header>
<Recurrence recurrence={content.recurrence} start={content.start} />
</>
)}
{content.location && (
<>
<Header dividing sub>
{intl.formatMessage(messages.where)}
</Header>
<p>{content.location}</p>
</>
)}
{content.contact_name && (
<>
<Header dividing sub>
{intl.formatMessage(messages.contactName)}
</Header>
<p>
{content.contact_email ? (
<a href={`mailto:${content.contact_email}`}>
{content.contact_name}
</a>
) : (
content.contact_name
)}
</p>
</>
)}
{content.contact_phone && (
<>
<Header dividing sub>
{intl.formatMessage(messages.contactPhone)}
</Header>
<p>{content.contact_phone}</p>
</>
)}
{content.attendees?.length > 0 && (
<>
<Header dividing sub>
{intl.formatMessage(messages.attendees)}
</Header>
<List items={content.attendees} />
</>
)}
{content.event_url && (
<>
<Header dividing sub>
{intl.formatMessage(messages.website)}
</Header>
<p>
<a
href={content.event_url}
target="_blank"
rel="noopener noreferrer"
>
{intl.formatMessage(messages.visitWebsite)}
</a>
</p>
</>
)}
</Segment>
);
};

export default EventDetails;
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/**
* Footer component.
* @module components/theme/Footer/Footer
*/

import React from 'react';
import { Container, List, Segment } from 'semantic-ui-react';

import { FormattedMessage, defineMessages, injectIntl } from 'react-intl';
import { useSelector } from 'react-redux';
import { UniversalLink, Logo } from '@plone/volto/components';
import config from '@plone/volto/registry';

const messages = defineMessages({
copyright: {
id: 'Copyright',
defaultMessage: 'Copyright',
},
});

/**
* Component to display the footer.
* @function Footer
* @param {Object} intl Intl object
* @returns {string} Markup of the component
*/
const Footer = ({ intl }) => {
const { settings } = config;
const lang = useSelector((state) => state.intl.locale);
return (
<Segment
role="contentinfo"
vertical
padded
inverted
textAlign="center"
id="footer"
>
<Container>
<Segment basic inverted className="discreet">
<FormattedMessage
id="The {plonecms} is {copyright} 2000-{current_year} by the {plonefoundation} and friends."
defaultMessage="The {plonecms} is {copyright} 2000-{current_year} by the {plonefoundation} and friends."
values={{
plonecms: (
<FormattedMessage
id="Plone{reg} Open Source CMS/WCM"
defaultMessage="Plone{reg} Open Source CMS/WCM"
values={{ reg: <sup>®</sup> }}
/>
),
copyright: (
<abbr title={intl.formatMessage(messages.copyright)}>©</abbr>
),
current_year: new Date().getFullYear(),
plonefoundation: (
<a className="item" href="http://plone.org/foundation">
<FormattedMessage
id="Plone Foundation"
defaultMessage="Plone Foundation"
/>
</a>
),
}}
/>{' '}
<FormattedMessage
id="Distributed under the {license}."
defaultMessage="Distributed under the {license}."
values={{
license: (
<a
className="item"
href="http://creativecommons.org/licenses/GPL/2.0/"
>
<FormattedMessage
id="GNU GPL license"
defaultMessage="GNU GPL license"
/>
</a>
),
}}
/>
</Segment>
<List horizontal inverted>
{/* wrap in div for a11y reasons: listitem role cannot be on the <a> element directly */}
<div role="listitem" className="item">
<UniversalLink
className="item"
href={settings.isMultilingual ? `/${lang}/sitemap` : '/sitemap'}
>
<FormattedMessage id="Site Map" defaultMessage="Site Map" />
</UniversalLink>
</div>
<div role="listitem" className="item">
<UniversalLink
className="item"
href={
settings.isMultilingual
? `/${lang}/accesibility-info`
: '/accesibility-info'
}
>
<FormattedMessage
id="Accessibility"
defaultMessage="Accessibility"
/>
</UniversalLink>
</div>
<div role="listitem" className="item">
<UniversalLink
className="item"
href={
settings.isMultilingual
? `/${lang}/contact-form`
: '/contact-form'
}
>
<FormattedMessage id="Contact" defaultMessage="Contact" />
</UniversalLink>
</div>
<div role="listitem" className="item">
<UniversalLink
className="item"
href={settings.isMultilingual ? `/${lang}/imprint` : '/imprint'}
>
<FormattedMessage id="Imprint" defaultMessage="Imprint" />
</UniversalLink>
</div>
<br />
<br />
<br />
<Logo />
<br />
<div role="listitem" className="item">
<a className="item" href="https://plone.org">
<FormattedMessage
id="Powered by Plone & Python"
defaultMessage="Powered by Plone & Python"
/>
</a>
</div>
</List>
</Container>
</Segment>
);
};

/**
* Property types.
* @property {Object} propTypes Property types.
* @static
*/
Footer.propTypes = {
/**
* i18n object
*/
};

export default injectIntl(Footer);
Loading

0 comments on commit aeded77

Please sign in to comment.