-
Notifications
You must be signed in to change notification settings - Fork 6
Contact Widget #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KoenWouters
wants to merge
15
commits into
master
Choose a base branch
from
feature/contact
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Contact Widget #16
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
aa607d6
[WIP] Add contact widget
KoenWouters 595e676
Merge branch 'feature/status-reports' of https://github.com/FriendsOf…
KoenWouters d7bb45a
Merge branch 'master' of https://github.com/FriendsOfTYPO3/widgets in…
KoenWouters ad6a57f
[TASK] configure Contact Widget base
KoenWouters 842cd8a
Merge branch 'bugfix/yarn.lock-security-issue-braces' of https://gith…
KoenWouters 3b22115
Merge branch 'bugfix/yarn.lock-security-issue-braces' of https://gith…
KoenWouters cec518f
[TASK] Add contactWidget styling and content handling
KoenWouters 6bdbcd8
[TASK] Add button to contactWidget
KoenWouters 7bfe93f
Merge branch 'master' into feature/contact
2e023bb
[BUGFIX] Add config for reportsWidgets in grunt file
bd4de51
[TASK] Add country to contact widget
KoenWouters 8efff97
Merge branch 'master' of https://github.com/FriendsOfTYPO3/widgets in…
KoenWouters e2e1437
[TASK] Refactor frontend and default widget information
KoenWouters 95510a7
[TASK] Add contact widget documentation
KoenWouters cecb008
Merge branch 'master' of github.com:FriendsOfTYPO3/widgets into featu…
KoenWouters File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| .DS_Store | ||
| /.idea | ||
| /composer.lock | ||
| /.vscode | ||
| /.DS_Store | ||
| /.ddev | ||
| /logs | ||
| /var | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /* | ||
| * This file is part of the TYPO3 CMS project. | ||
| * | ||
| * It is free software; you can redistribute it and/or modify it under | ||
| * the terms of the GNU General Public License, either version 2 | ||
| * of the License, or any later version. | ||
| * | ||
| * For the full copyright and license information, please read the | ||
| * LICENSE.txt file that was distributed with this source code. | ||
| * | ||
| * The TYPO3 project - inspiring people to share! | ||
| */ | ||
|
|
||
| namespace FriendsOfTYPO3\Widgets\Widgets; | ||
|
|
||
| use TYPO3\CMS\Dashboard\Widgets\AdditionalCssInterface; | ||
| use TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface; | ||
| use TYPO3\CMS\Dashboard\Widgets\WidgetInterface; | ||
| use TYPO3\CMS\Fluid\View\StandaloneView; | ||
|
|
||
| class ContactWidget implements WidgetInterface, AdditionalCssInterface | ||
| { | ||
| /** | ||
| * @var WidgetConfigurationInterface | ||
| */ | ||
| private $configuration; | ||
|
|
||
| /** | ||
| * @var StandaloneView | ||
| */ | ||
| private $view; | ||
|
|
||
| /** | ||
| * @var array | ||
| */ | ||
| private $options; | ||
|
|
||
| /** | ||
| * @var null | ||
| */ | ||
| private $buttonProvider; | ||
|
|
||
| public function __construct( | ||
| WidgetConfigurationInterface $configuration, | ||
| StandaloneView $view, | ||
| $buttonProvider = null, | ||
| array $options = [] | ||
| ) { | ||
| $this->configuration = $configuration; | ||
| $this->view = $view; | ||
| $this->buttonProvider = $buttonProvider; | ||
| $this->options = $options; | ||
| } | ||
|
|
||
| public function getCssFiles(): array | ||
| { | ||
| return [ | ||
| 'EXT:widgets/Resources/Public/Css/contactWidget.css', | ||
| ]; | ||
| } | ||
|
|
||
| public function renderWidgetContent(): string | ||
| { | ||
|
|
||
| $this->view->setTemplate('Widget/ContactWidget'); | ||
| $this->view->assignMultiple([ | ||
| 'options' => $this->options, | ||
| 'button' => $this->buttonProvider, | ||
| 'configuration' => $this->configuration, | ||
| ]); | ||
| return $this->view->render(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| .. include:: ../Includes.txt | ||
|
|
||
| .. _contact-widget: | ||
|
|
||
| =========================== | ||
| Contact Widget | ||
| =========================== | ||
|
|
||
| This widget will show you the contact information of your your TYPO3 supplier. | ||
| To show your supplier contact information some configuration is required. | ||
|
|
||
|
|
||
| .. figure:: ../Images/ContactWidget.png | ||
| :class: with-shadow | ||
| :alt: Show the contact information | ||
| :width: 500px | ||
|
|
||
| An example of the contact widget with supplier information. | ||
|
|
||
|
|
||
| Options | ||
| ------- | ||
| This widget has some options. To override the default options, see :ref:`Adjust settings of registered widgets <dashboard:adjust-settings-of-registered-widgets>`. | ||
|
|
||
| An example: | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| dashboard.buttons.contact: | ||
| class: 'TYPO3\CMS\Dashboard\Widgets\Provider\ButtonProvider' | ||
| arguments: | ||
| $title: 'Support' | ||
| $link: 'https://maxserv.com/support' | ||
| $target: '_blank' | ||
|
|
||
| widgets.dashboard.widget.contact: | ||
| class: 'FriendsOfTYPO3\Widgets\Widgets\ContactWidget' | ||
| arguments: | ||
| $view: '@dashboard.views.widget' | ||
| $buttonProvider: '@dashboard.buttons.contact' | ||
| $options: | ||
| template: 'Widget/ContactWidget' | ||
| introText: '' | ||
| company: 'MaxServ' | ||
| address: 'Taxandriaweg 11' | ||
| postalCode: '5142 PA' | ||
| place: 'Waalwijk' | ||
| country: 'The Netherlands' | ||
| tel: '+31 416 30 10 00' | ||
| mail: 'info@maxserv.com' | ||
| website: 'https://www.maxserv.com' | ||
| logoPath: 'https://typo3.com/fileadmin/partner/logo-maxserv-zonder-groot.png' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| @import "Base"; | ||
|
|
||
| .widget { | ||
| .widget-contact-logo { | ||
| width: 75%; | ||
| max-width: 290px; | ||
| margin-bottom: 20px; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers" data-namespace-typo3-fluid="true"> | ||
| <f:layout name="Widget/Widget"/> | ||
|
|
||
| <f:section name="main"> | ||
| <f:if condition="{options.company}"> | ||
| <f:then> | ||
| <f:variable name="logoName">{f:translate(key: options.company, default: options.company)}</f:variable> | ||
| </f:then> | ||
| <f:else> | ||
| <f:variable name="logoName">{f:translate(key: 'widgets.dashboard.widget.contact.defaultCompany')}</f:variable> | ||
| </f:else> | ||
| </f:if> | ||
| <f:if condition="{options.logoPath}"> | ||
| <img src="{f:uri.image(src: options.logoPath, maxWidth: '290')}" | ||
| class="widget-contact-logo" | ||
| alt="{logoName}"/> | ||
| </f:if> | ||
|
|
||
| <f:if condition="{options.introText}"> | ||
| <p> | ||
| {f:translate(key: options.introText, default: options.introText) -> f:format.raw()} | ||
| </p> | ||
| </f:if> | ||
| <p> | ||
| <f:if condition="{options.company}"> | ||
| <strong>{options.company}</strong> <br/> | ||
| </f:if> | ||
| <f:if condition="{options.address}"> | ||
| {options.address} <br/> | ||
| </f:if> | ||
| <f:if condition="{options.postalCode} || {options.place}"> | ||
| {options.postalCode} {options.place} <br/> | ||
| </f:if> | ||
| <f:if condition="{options.country}"> | ||
| {options.country} <br/> | ||
| </f:if> | ||
| </p> | ||
KoenWouters marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <f:if condition="{options.tel} || {options.mail}"> | ||
| <p> | ||
| <f:if condition="{options.tel}"> | ||
| <f:translate key="telephone" extensionName="widgets"/> | ||
| {options.tel} <br/> | ||
| </f:if> | ||
| <f:if condition="{options.mail}"> | ||
| <f:translate key="mail" extensionName="widgets"/> | ||
| <f:link.email email="{options.mail}" class="contact-widget-link"> | ||
| <strong>{options.mail}</strong></f:link.email> | ||
| <br/> | ||
| </f:if> | ||
| </p> | ||
| </f:if> | ||
| <f:if condition="{options.website}"> | ||
| <p> | ||
| <a href="{options.website}" target="_blank" class="contact-widget-link"><strong>{options.website}</strong></a> | ||
| </p> | ||
| </f:if> | ||
| </f:section> | ||
|
|
||
| <f:section name="footer"> | ||
| <f:if condition="{button.title}"> | ||
| <a href="{button.link}" target="{button.target}" class="widget-cta">{f:translate(id: button.title, default: button.title)}</a> | ||
| </f:if> | ||
| </f:section> | ||
|
|
||
| </html> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .widget .widget-contact-logo{width:75%;max-width:290px;margin-bottom:20px} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.