<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ceres/view, branch 0.4.0</title>
<subtitle>Recipe server for your favorite dishes</subtitle>
<id>https://cgit.xengineering.eu/ceres/atom?h=0.4.0</id>
<link rel='self' href='https://cgit.xengineering.eu/ceres/atom?h=0.4.0'/>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/'/>
<updated>2024-05-17T15:14:35Z</updated>
<entry>
<title>view: Fix time stamp bug</title>
<updated>2024-05-17T15:14:35Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-17T15:06:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=0416f520cff9716792ac0f3ade5f71187d07ac2e'/>
<id>urn:sha1:0416f520cff9716792ac0f3ade5f71187d07ac2e</id>
<content type='text'>
The recipe edit page HTML template did not contain the two time stamps
"Created" and "LastChanged" as hidden form values.

Thus the information was not passed from the backend to the frontend. On
a save the recipe without time stamp information was injected into the
backend.

This effectively deleted any time stamp information. This commit fixes
that bug by including all fields of the model.Recipe struct inside the
form of the recipe-edit.html template.
</content>
</entry>
<entry>
<title>view: Use number input for ingredient amount</title>
<updated>2024-05-17T15:14:29Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-17T13:51:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=c61e45a5a260d9804ebc4f54814edf1e1b471ac3'/>
<id>urn:sha1:c61e45a5a260d9804ebc4f54814edf1e1b471ac3</id>
<content type='text'>
This accepts only real numbers with a minimum step of 0.001 as input for
the amount field of a recipe ingredient.

The browser has the chance to give the user direct feedback that a
non-numeric string will not work.
</content>
</entry>
<entry>
<title>view: Remove empty ingredient summaries</title>
<updated>2024-05-15T18:42:09Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-15T18:42:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=d14aece3295405b4377ea20aabd9c621aace4922'/>
<id>urn:sha1:d14aece3295405b4377ea20aabd9c621aace4922</id>
<content type='text'>
If the recipe has no ingredients at all the "Ingredient summary:" text
used to be displayed. This is not useful and confusing. It is removed
with this commit.
</content>
</entry>
<entry>
<title>view: Require text for steps</title>
<updated>2024-05-15T17:39:17Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-15T17:39:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=34880a0194f66e2b1808b45abfb01497d4816aaf'/>
<id>urn:sha1:34880a0194f66e2b1808b45abfb01497d4816aaf</id>
<content type='text'>
It does not make sense to add empty steps.
</content>
</entry>
<entry>
<title>view: Require ingredient type</title>
<updated>2024-05-15T17:37:05Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-15T17:37:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=29c8c305c52b97248e505cdfc6b86e96f57d0a53'/>
<id>urn:sha1:29c8c305c52b97248e505cdfc6b86e96f57d0a53</id>
<content type='text'>
It does make sense to add an ingredient only with a type and no amount
or unit like 'salt'. But it does not make sense to add an ingredient
without a type like '5' or '2 l'.
</content>
</entry>
<entry>
<title>view: Update to simple.css v2.3.0</title>
<updated>2024-05-15T17:33:11Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-15T17:33:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=45a0a10c070e3dba33be01d4de4d094fd7f7394a'/>
<id>urn:sha1:45a0a10c070e3dba33be01d4de4d094fd7f7394a</id>
<content type='text'>
This is the latest available release. Updated to keep up to date and
adopt fixes.
</content>
</entry>
<entry>
<title>view: Rename to 'Ingredient summary:'</title>
<updated>2024-05-15T17:27:05Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-15T17:27:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=b48f4514a44450da1ad5da68ce434c2b87e721d0'/>
<id>urn:sha1:b48f4514a44450da1ad5da68ce434c2b87e721d0</id>
<content type='text'>
This used to be named 'Ingredients: which might be confusing since
ingredients are defined per step and the list at the top of the recipe
is just a summary.
</content>
</entry>
<entry>
<title>When adding a recipe step or an ingredient the browser should focus on</title>
<updated>2024-05-15T17:20:01Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-15T17:20:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=d8b40f0a0a2ac2bcb8b9b690166ae7594c067298'/>
<id>urn:sha1:d8b40f0a0a2ac2bcb8b9b690166ae7594c067298</id>
<content type='text'>
the first text input of that new element.

This supports using Ceres without a mouse and only with tab-based
navigation with a keyboard.
</content>
</entry>
<entry>
<title>view: Complete ingredient editing</title>
<updated>2024-05-14T18:43:41Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-14T18:14:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=a87128138bdb301ede64049ec5068e47abb5c839'/>
<id>urn:sha1:a87128138bdb301ede64049ec5068e47abb5c839</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Add HTML for editing recipe ingredients</title>
<updated>2024-05-13T19:52:48Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-13T19:51:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=b5b72880a0b6e9f188b532c9b2ad360ff1dab2ea'/>
<id>urn:sha1:b5b72880a0b6e9f188b532c9b2ad360ff1dab2ea</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Add ingredient overview to recipe read page</title>
<updated>2024-05-12T18:52:25Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-04-07T10:04:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=bf328dd38a28cf44cfa81c7f1dcd95936d2d0301'/>
<id>urn:sha1:bf328dd38a28cf44cfa81c7f1dcd95936d2d0301</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Show ingredients on read page</title>
<updated>2024-05-12T18:52:25Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-04-07T09:56:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=01d97189d245300d65ca31d650dd868d1d1fc0d8'/>
<id>urn:sha1:01d97189d245300d65ca31d650dd868d1d1fc0d8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Use HTML template to add recipe steps</title>
<updated>2024-05-12T18:38:24Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-12T18:38:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=fec2fea87615e6ee3a6e73f7f98e021eee1b7098'/>
<id>urn:sha1:fec2fea87615e6ee3a6e73f7f98e021eee1b7098</id>
<content type='text'>
This makes the JS function way simpler and removes a duplication of the
step HTML code.
</content>
</entry>
<entry>
<title>view: Create new html/recipe-step.html</title>
<updated>2024-05-12T18:20:14Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-12T18:20:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=64ece1c4455ed6f8e8be5cb8f060f14b6131823f'/>
<id>urn:sha1:64ece1c4455ed6f8e8be5cb8f060f14b6131823f</id>
<content type='text'>
This allows to use it in two places:

- template for loop for backend-generated steps
- a HTML template tag for frontend- / JS-generated steps
</content>
</entry>
<entry>
<title>view: Move all JS code to static/ceres.js</title>
<updated>2024-05-12T18:06:17Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-12T18:06:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=f2800e8289e9637bb3227a5f9622edabf6529b0f'/>
<id>urn:sha1:f2800e8289e9637bb3227a5f9622edabf6529b0f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Remove global JS code in recipe-edit.html</title>
<updated>2024-05-12T18:01:02Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-12T18:01:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=cfeff398f0ad7e4205dc26b66ca2b46ebca24606'/>
<id>urn:sha1:cfeff398f0ad7e4205dc26b66ca2b46ebca24606</id>
<content type='text'>
This makes it impossible to move the whole JS functionality into the
central ceres.js script. Moving that JS code there makes caching
possible and bundles all JS-related code in one file.

The overall goal is to get rid of as many JS code as possible.
</content>
</entry>
<entry>
<title>view: Add unit test for index handler</title>
<updated>2024-05-11T21:08:42Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-11T21:08:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=907bd7e63f4cf3cb01bc678e09fc5b8962afe750'/>
<id>urn:sha1:907bd7e63f4cf3cb01bc678e09fc5b8962afe750</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Fix cancel button on recipe create</title>
<updated>2024-05-09T10:19:35Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-04-23T16:47:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=a2aa866e630c45e1db4fadbb20cb1a9d24384a79'/>
<id>urn:sha1:a2aa866e630c45e1db4fadbb20cb1a9d24384a79</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Replace HTML form labels by placeholders</title>
<updated>2024-05-09T10:19:35Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-04-23T15:42:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=eb000e0cc514ebca753970ddb9135e09cb885d7a'/>
<id>urn:sha1:eb000e0cc514ebca753970ddb9135e09cb885d7a</id>
<content type='text'>
This takes up way less space in the code and the actual user view.
</content>
</entry>
<entry>
<title>Remove default recipe name</title>
<updated>2024-05-09T10:19:30Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-04-23T15:42:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=2704cb76554b02f546bf3f9d2d11be98f2854b7b'/>
<id>urn:sha1:2704cb76554b02f546bf3f9d2d11be98f2854b7b</id>
<content type='text'>
To avoid not clickable recipes on the /recipes page a default name used
to be inserted on recipe creation.

This was not a proper fix for the problem and also was annoying that the
user first had to remove the default recipe name.

This commit removes this default name.
</content>
</entry>
<entry>
<title>view: Enforce recipe titles</title>
<updated>2024-05-09T10:07:48Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-04-22T19:51:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=c5e7551dc2da9798ff51d91aa238098f5ac4605f'/>
<id>urn:sha1:c5e7551dc2da9798ff51d91aa238098f5ac4605f</id>
<content type='text'>
In addition to the enforcement of titles in the model package the HTML
form field for the title is set to 'required' to give the user feedback
via the browser that a title is required.
</content>
</entry>
<entry>
<title>Introduce model.Transaction()</title>
<updated>2024-05-08T20:26:00Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-08T19:53:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=0ba1a7661a81200db98e40149eef1e39fd22f407'/>
<id>urn:sha1:0ba1a7661a81200db98e40149eef1e39fd22f407</id>
<content type='text'>
It is a very common pattern that some function needs to access the
database and wants to wrap all the actions into one transaction.

The advantage of a transaction is that it is ACID:

- atomic
- consistent
- isolated
- durable

In Go it is required to request a new transaction, execute functionality
on it and handle rollback or commit of this transaction based on the
success of the operation.

All this and the error handling can be written down in the
model.Transaction() function exactly once. The full signature of it is:

	func Transaction(f func(*sql.Tx) error) error

It requires a function or closure passed as argument which takes the
transaction (*sql.Tx) and returns an error which might be nil.

This is very generic. It is applied to:

- injecting test data
- database migrations
- data read requests
- data write requests
</content>
</entry>
<entry>
<title>view: Use init() function to parse templates</title>
<updated>2024-05-07T19:35:40Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-07T19:35:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=5b3f0a81abea93b198825b5537297f3f04d1f7c1'/>
<id>urn:sha1:5b3f0a81abea93b198825b5537297f3f04d1f7c1</id>
<content type='text'>
This makes it unnecessary to call this functionality from main().
</content>
</entry>
<entry>
<title>view: Add /version endpoint</title>
<updated>2024-05-01T08:56:26Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-05-01T08:56:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=d982951ec15326487eefa80261a0f466d64e2ba0'/>
<id>urn:sha1:d982951ec15326487eefa80261a0f466d64e2ba0</id>
<content type='text'>
This allows to get the server version via HTTP. The output of `git
describe --dirty --always` and a line break is returned together with
HTTP 200.

If the server build contains no version information an error message and
HTTP 404 is returned.
</content>
</entry>
<entry>
<title>model: Add helper function for safe CRUD</title>
<updated>2024-04-07T08:47:36Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-04-07T08:42:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=c4a4a8b5f60a568abd2af614ca4a5d06855bc3a1'/>
<id>urn:sha1:c4a4a8b5f60a568abd2af614ca4a5d06855bc3a1</id>
<content type='text'>
This removes the redundant setup of a database/sql.Tx in each HTTP
handler.
</content>
</entry>
<entry>
<title>model: Always pass *sql.Tx to CRUD methods</title>
<updated>2024-04-06T11:12:17Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-04-06T11:12:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=f65b11a5b3011f370df5b4d32239225f3708ecd5'/>
<id>urn:sha1:f65b11a5b3011f370df5b4d32239225f3708ecd5</id>
<content type='text'>
When nesting objects like steps into other objects like recipes it is
required to pass a *sql.Tx value to the CRUD methods of the inner
object to be able to roll back the whole transaction.

The top level object used to be responsible for the creation of this
*sql.Tx inside its CRUD methods.

This is now moved to the caller of the CRUD methods (here the HTTP
handler function). The advantage is that all CRUD methods now accept a
*sql.Tx as only argument which makes those methods more consistent.
</content>
</entry>
<entry>
<title>view: Add recipe step adding</title>
<updated>2024-04-04T12:51:01Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-03-23T19:50:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=9985d6f86fcee9d3c1d1148a5977190b673a8e8e'/>
<id>urn:sha1:9985d6f86fcee9d3c1d1148a5977190b673a8e8e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Add step removal</title>
<updated>2024-03-24T09:10:54Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-03-23T18:04:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=36412cdf206f4766f818694fee5d0a00ce6bef46'/>
<id>urn:sha1:36412cdf206f4766f818694fee5d0a00ce6bef46</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Add editing of existing recipe steps</title>
<updated>2024-03-24T09:10:54Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-03-17T19:14:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=f4edf94a7bcf94d34eaf91397e3c0eeefec0cc8b'/>
<id>urn:sha1:f4edf94a7bcf94d34eaf91397e3c0eeefec0cc8b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>view: Add steps to recipe page</title>
<updated>2024-03-24T09:10:54Z</updated>
<author>
<name>xengineering</name>
<email>me@xengineering.eu</email>
</author>
<published>2024-03-16T20:24:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit.xengineering.eu/ceres/commit/?id=40a576737de18af2fb20387b3b76b12053910fe9'/>
<id>urn:sha1:40a576737de18af2fb20387b3b76b12053910fe9</id>
<content type='text'>
</content>
</entry>
</feed>
