=== Luntsi – Lunch Menu ===
Contributors: mopetti
Tags: lunch menu, lounaslista, lounas, daily menu, restaurant
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Weekly lunch menu (lounaslista) for restaurants. Write the week once; "Today's lunch" and the whole week update themselves on your site.

== Description ==

Luntsi is made for lunch restaurants. Write the week's lunch once and your site shows the right day every day, without anyone remembering to update it.

Made in Finland for the *lounas*, *lounaslista* and *ruokalista* (Swedish: *lunchmeny*, *dagens lunch*) of Finnish lunch restaurants, and it works for any daily lunch menu, such as the Spanish *menú del día*.

* **Today's lunch and the whole week.** Show today's (or tomorrow's) lunch on the front page and the whole week on the lunch page.
* **Old menus hide themselves.** A saved week appears on its own week and disappears when it is over. On weekends the week view switches to next week as soon as it is published.
* **Never shows yesterday's lunch from a cache.** The views pick the right day in the visitor's browser, so page caches and CDNs cannot serve an old day.
* **Fast to write.** One dish per line, diet markings in parentheses: `Pea soup (L, G)`. "Copy previous week" fills the week from last week's menu.
* **Public holidays built in (Finland and Spain).** Good Friday, Midsummer, Christmas and the rest are marked closed automatically for the country you choose. Any single holiday can be opened, and any other day closed.
* **Meat origin.** Show the origin country of meat, which restaurants in Finland are required to display in writing.
* **Diet markings.** L, VL, M, G, K and VE out of the box, editable.
* **A role for the kitchen.** The "Lunch editor" role can edit the lunch menu and nothing else.
* **Works everywhere.** Native Divi 5 modules (with live preview in the Visual Builder), Elementor widgets with style controls, blocks for the block editor, and the `[luntsi]` shortcode for any other theme or page builder.
* **Image for Facebook and Instagram.** One click turns the week's menu into a ready image (A4 for Facebook, 4:5 for Instagram) with your logo and colour. On a phone the image goes straight to the share sheet. Made in the browser: no external service.
* **Search engines understand it.** The week is published as schema.org Menu data.
* **Accessible.** The views and the editor are tested against WCAG 2.2 AA with axe-core.
* **Private.** No external services, no tracking, no cookies. The font for the image ships with the plugin.
* In English, with Finnish and Swedish coming through translate.wordpress.org.

= Luntsi Pro =

[Luntsi Pro](https://luntsi.fi) adds lunch lines with their own prices, several locations, a dish bank with the 14 EU allergens, an info screen for a TV, a printable A4 menu, reminder e-mails, more image templates, Stories images and a brand kit. Luntsi itself is complete without it.

= Shortcodes =

* `[luntsi]` – today's lunch
* `[luntsi view="tomorrow"]` – tomorrow's lunch
* `[luntsi view="week"]` – the whole week
* `[luntsi prices="no" origins="no" link="https://example.com/lunch/"]`
* `[luntsi view="week" info="no"]`

= For developers =

Lunch lines (e.g. lunch, soup lunch, vegetarian lunch with their own prices) and several locations on one site are built in and defined with the `luntsi_lines` and `luntsi_locations` filters; Luntsi Pro adds a user interface for them. Shortcode: `[luntsi location="slug"]`.

Templates can be overridden by copying `templates/today.php` or `templates/week.php` to `your-theme/luntsi/`. Colours follow the theme; the accent colour is the CSS custom property `--luntsi-accent`. After inserting a view with JavaScript, call `window.Luntsi.refresh()`.

== Installation ==

1. Install and activate the plugin.
2. Open **Lunch menu** in the dashboard and write this week's lunch.
3. Add Luntsi to your pages: the **Luntsi** modules in Divi 5, the **Lunch menu** widgets in Elementor, the **Today's lunch** and **Lunch menu: week** blocks in the block editor, or the `[luntsi]` shortcode anywhere else.
4. In **Lunch menu → Settings**, add your prices, lunch hours and meat origin.

== Frequently Asked Questions ==

= Does it work with Divi 4? =

Use the `[luntsi]` shortcode in a Text or Code module. The native modules are for Divi 5.

= Is the image made on your server? =

No. It is drawn in your browser and downloaded or shared directly from there.

= Does the menu change by itself every day? =

Yes. You save the week once; the site shows the right day and hides the week when it is over.

= My site uses a page cache. Will visitors see yesterday's lunch? =

No. The page carries the current and next week, and a small script picks the right day in the visitor's browser. Luntsi also clears common page caches when you save and right after midnight.

= Can kitchen staff update the menu without access to the rest of the site? =

Yes. Give them the "Lunch editor" role. They land directly on the lunch menu after logging in and can write the menu, but not change the settings.

= We are open on a public holiday. =

Turn on "Open on this public holiday" for that day in the menu editor, or turn off automatic holiday closing in the settings.

= Where is the source code? =

The JavaScript in `build/` is compiled. Its readable source ships with the plugin in `src/`, together with `package.json` and `webpack.config.js`. To build it yourself, run `npm install` and `npm run build` in the plugin folder (Node.js 18 or newer).

== Screenshots ==

1. Write the week once: one dish per line, diet markings in parentheses.
2. The whole week on your site. Today is highlighted and the week changes by itself.
3. Today's lunch for the front page.
4. A ready image of the week for Facebook and Instagram.
5. Settings: prices, lunch hours, meat origin, serving days, public holidays and diet markings.
6. Blocks for the block editor. Divi 5 modules and Elementor widgets work the same way.
7. Kitchen staff can update the menu on a phone.

== Privacy ==

Luntsi does not send data anywhere, set cookies or track visitors. Menus and settings are stored in your WordPress database and removed when the plugin is deleted.

== Changelog ==

= 1.1.0 =
* Settings: country for public holidays, Finland or Spain. Spain covers the national holidays; regional and local holidays are closed in the menu editor. A new site in Spanish (Spain), Catalan, Galician or Basque starts with Spain.
* The menu editor keeps the week, unsaved changes and the chosen location when you visit another tab, and picks up changed settings straight away.

= 1.0.2 =
* Translations come from translate.wordpress.org.
* The Lunch menu item sits after the WordPress core menu items.

= 1.0.1 =
* A public holiday on which the restaurant is open now shows its name in the week view, today's lunch, the images, the printout and the info screen.
* Settings: "Lunch also on weekends" switch (Saturday, or Saturday and Sunday).

= 1.0.0 =
* First public release.
* Weekly editor, today/tomorrow/week views, Finnish public holidays, meat origin, diet markings, Lunch editor role.
* Divi 5 modules, Elementor widgets, blocks and the [luntsi] shortcode.
* Facebook and Instagram image of the week.
* Lunch lines and locations in the data model (defined with filters, UI in Luntsi Pro).
* Works on multisite networks (network or per-site activation); uninstall cleans every site.
* Finnish and Swedish translations.

= 0.2.0 =
* Divi 5 modules "Today's lunch" and "Lunch menu week" with live Visual Builder preview and Divi design options.
* Elementor widgets with colour, typography and spacing controls.
* Facebook (A4) and Instagram (4:5) image of the week with logo, accent colour and contact line. Bundled font, no Google Fonts.

= 0.1.0 =
* First version: weekly editor, today/tomorrow/week views, blocks, shortcode, Finnish public holidays, meat origin, diet markings, lunch editor role, Finnish and Swedish translations.
