Giter Site home page Giter Site logo

calendar-bundle's Introduction

Contao Open Source CMS

About

Contao is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the project website for more information.

Purpose

The purpose of this package is to develop the Contao bundles in a monorepo. Use it when you want to create a pull request or report an issue.

The monorepo is automatically split into separate packages:

Please do not use contao/contao in production! Use the split packages instead.

Platinum partners

Thanks to our platinum partners for helping us fund the development of Contao.

Development

To create a pull request and to test your changes within a running Contao application, it is the easiest to use the Contao Managed Edition. Start by installing it in your current directory:

composer create-project --no-install contao/managed-edition <directory> <branch>

Replace <directory> with the directory where you want to install the Managed Edition (use . for the current directory). Replace <branch> with 5.x-dev if you want to add a new feature, or with <lts-version>.x-dev (currently 4.13.x-dev) if you want to fix a bug.

Then adjust the require section in your composer.json file, so Composer loads the monorepo instead of the individual bundles:

"require": {
    "php": "^8.1",
    "contao/contao": "5.x-dev"
},

Again, use 5.x-dev if you want to add a new feature or <lts-version>.x-dev if you want to fix a bug.

Next, install the dependencies:

composer update

Composer automatically clones the Git repository into the vendor/contao/contao folder. You can complete the setup by running vendor/bin/contao-setup on the command line.

Any changes you make in vendor/contao/contao will be tracked via Git, so you can submit your pull request directly from your application.

Running scripts

First install the code quality tools:

composer bin all install

Then run the code quality scripts via Composer:

composer all

You can also run the scripts separately:

composer rector
composer ecs
composer service-linter
composer monorepo-tools
composer unit-tests
composer functional-tests
composer phpstan
composer depcheck

Use the -- argument to pass additional flags to the underlying commands:

composer unit-tests -- --filter CoreBundle
composer ecs -- --clear-cache

Functional tests

To set up the functional tests, create a database named contao_test:

mysql -e "CREATE DATABASE contao_test"

If your database uses credentials, copy the file core-bundle/phpunit.xml.dist to core-bundle/phpunit.xml and adjust the following line:

<php>
    <env name="DATABASE_URL" value="mysql://root@localhost:3306/contao_test" />
</php>

Then run the functional tests via Composer:

composer functional-tests

Yarn 4

To build the assets and to run the end-to-end tests (see below), you need to enable Corepack, a package manager that allows you to manage different Yarn package versions across multiple projects:

corepack enable

If Corepack is not bundled with your Node.js installation, you might have to install it as a separate package, e.g. using npm install -g corepack or brew install corepack.

End-to-end tests

The Contao end-to-end tests are availabe as an NPM package. You can install and run them via Yarn:

yarn add contao-e2e-tests --dev
yarn contao-e2e-tests

License

Contao is licensed under the terms of the LGPLv3.

Getting support

Visit the support page to learn about the available support options.

calendar-bundle's People

Contributors

aschempp avatar ausi avatar bezin avatar bytehead avatar cmsworker avatar defcon0 avatar dmolineus avatar floxn avatar fritzmg avatar heimseiten avatar janborg avatar leofeyer avatar m-vo avatar marcobiedermann avatar mynyx avatar physiklehrer avatar qzminski avatar richardhj avatar severingloeckle avatar toflar avatar xchs avatar zoglo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

calendar-bundle's Issues

Loading models eagerly

Now that @fritzmg has debugged the memory issues caused by eagerly loaded models, I want to discuss eager loading in general. Take this code for example:

// Link to an article
case 'article':
if (($objArticle = \ArticleModel::findByPk($objEvent->articleId, array('eager'=>true))) !== null && ($objPid = $objArticle->getRelated('pid')) instanceof PageModel)
{
/** @var PageModel $objPid */
self::$arrUrlCache[$strCacheKey] = ampersand($objPid->getFrontendUrl('/articles/' . ($objArticle->alias ?: $objArticle->id)));
}
break;

With array('eager'=>true) we instruct Contao to also load all related models. Here's what we get:

  • ArticleModel
  • PageModel (pid)
  • UserModel (author)

However, we are not using the UserModel in this case, so we would not have needed to create it. On the other hand, using array('eager'=>true) has saved us one additional database query.

@contao/developers Would you prefer having more database queries and no unneeded models over having less database queries and potentially unneeded models?

Make it possible to highlight events like news

In the news module you can star out/highlight news but not in the event module.

The highlighting feature is a great feature to show specific items of an archive on a page like the homepage for example. Why not use this advantage for higlighting events at a specific page?

Endzeit wird automatisch geleert, wenn 01:00 Uhr eingegeben wird

Wenn bei einer Veranstaltung die Endzeit auf 01:00 Uhr gesetzt wird, dann wird das nach dem Speichern einfach wieder entfernt.
Das hängt wohl hiermit zusammen:
https://github.com/contao/calendar-bundle/blob/4.x/src/Resources/contao/dca/tl_calendar_events.php#L777

Das ist echt ungünstig, da das Event nun mal leider um 01:00 Uhr endet. Also was nun machen? Kann ja schlecht einstellen, dass es dann 01:01 Uhr endet :D

Das ganze ist reproduzierbar in der Demo. Unsere Installation ist übrigens auch Contao 4.9

Make the end-time selection empty if not used

While you can leave the end-date empty you have to set a end-time to leave it open. This is confusing and not consequent. I suggest to leave the end-time empty too if it is not used!

image

If you change the start-time you every time have to set the end-time again if you want to leave it open!

Extend/improve event microdata (schema.org)

Hello Contao team,

to get the events shown in Google search results, at least the "location" field should be added with microdata, because this is a required field (from Google perspective). Currently the location is only published as plain HTML text (at least in the Demo).

Please also see the errors in the Google Structured Data Testing Tool with Contao example event page - the missing location is throwing an error.

Besides that: Is there a reason why the event pages in Contao are so... "basic"? To have a useful events component with correct microdata support, it should be possible to prepare different locations in a separate content table (to avoid duplicate content in the CMS and the microdata could be used directly from the locations entries) and also have some more fields eg for performers, door time, event status and much more, see event on schema.org with many examples... Also an option to select the type of the event would be usefull (MusicEvent, BusinessEvent, ChildrenEvent, Festival, SportsEvent...)

Or is this all ment to be added by external plugins and extensions? If so, why is the calendar and events module part of the core and not an optional module? (I'm not against the calendar module, I just want to know why it is so basic and rudimentary).

Thank you all for your great Contao work and effords!

Tag calendar and event in 4.6

Here's the page example. Should be added on bothtl_calendar and tl_calendar_event, imho.

// Tag the response
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
{
    /** @var ResponseTagger $responseTagger */
    $responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
    $responseTagger->addTags(array('contao.db.tl_page.' . $objPage->id));
}

Hide running events (Laufende Events ausblenden) has no effect

Unabhängig, ob in der Modulkonfiguration dieses Flag aktiviert ist oder nicht, werden laufende Events immer angezeigt.
Beim Format ist ansonsten eingestellt: "All upcoming events" (Alle zukünftigen Events).
Getestet unter Contao 4.4.18 und 4.5.8 in der Contao-Demo.

external redirect will not be linked in template

Abridged reproduction:

  1. Create a new event.
  2. Set Redirect target to External URL.
  3. Set Link target to https://www.google.com/.
  4. Create an Event list module and set the Event template to event_teaser.
  5. Integrate the module somewhere in the front end.
  6. Open the front end.

The headline of the created event will not be linked. Also there will be no Read more… link. Thus you are unable to actually go the the external URL.

Tested with Contao 4.4.12. Same problem exists in Contao 3.5.31 probably.

Cause

This is caused by these lines:

// Show the teaser text of redirect events (see #6315)
if (\is_bool($event['details']))
{
    $objTemplate->hasDetails = false;
}

This is a problem for the event_teaser template, since it will only show links when hasDetails is true. The other templates like event_list or event_upcoming always create a link, regardless of hasDetails.

The current behaviour is inconsistent with the news module. In the news module, the headline is linked when it is an external redirect and the default news_latest template shows a Read more… link as well, when the news entry is an external redirect.

Endzeit wird automatisch 01:00 wen keine Zeit eingegeben wird.

Wird einer Veranstaltung eine Startzeit gegeben muss wohl auch eine Endzeit eingegeben werden.
Möchte man nun aber keine Endzeit im Frontend ausgeben löscht man den Eintrag ja wieder im Backend.
Nach dem Speichern steht dann nun aber ein 01:00 und wird auch so im Frontend als Endzeit ausgegeben.

Im Frontend erscheint nur keine Endzeit, wenn Endzeit = Startzeit.
Ist denn eine Endzeit zwingend?

Reproduzierbar in der Demo:

  • Neues Event anlegen.
  • Haken bei "Zeit hinzufügen" setzen
  • Starzeit eintragen
  • Endzeit löschen
  • speichern
  • Endzeit ansehen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.