There is little built into Caveman when it comes to JavaScript so the
code here is just a walk-through on adding JQuery to app.html (the
base template the others extend/inherit from).
Note the use of the '/js' directory in '/static/js'. I originally use
/scripts, instead of /js but Caveman did not recognise it. It looks
like you need to stick with /js for the JavaScript files.
This was hard to follow because the translation was quite bad. The
gist of was use 'throw-code' for quick and basic relay of error (using
HTTP response codes) and use 'on-exception' method to generate a more
involved HTML page to communicate the error (HTTP response code). At
least, I think that was the take-away.
There are some bugs within the code with this commit. The translation
from Japanese to English is making it hard to follow along in some
places. With that said, this repo. if for learning and becoming
familiar with Caveman2, Common Lisp and the other things it comes with.
This mostly sets up the basic CRUD operations you normally find on a
website. There is some code for CSRF, also.
There is one major bit of malfunctioning coding though. It is the
'setf' bit of code. I have tried to rearrange the code to see if I can
get it to work but I simply cannot work it out.
I have decided to leave the code as it is described in the
tutorial (for Chapter 6) and hope there is some incite in future
chapters to help me fix the problem.
These are minor changes -- just typo's, spacing issues Etc.
I added a for-loop to index.html just to get some data in the
'content' area in the 'main content area'. This will eventually be
replaced as I move throught the various chapters. I only added it to
see how the CSS rearranges the layout when there is some 'content' in
the main part of the page.
Demonstrates how (basic) routing works and how they connect to the
templates (I.E. views). Provides examples of how to use djula in said
templates and pass information to the views (accessed with djula).
Partial/shared views are added and shown how to be included within
other templates (views).
How the Caveman2 displays Static assets (I.E. images) in the templates
is shown and examples of links (<a> tags) are provided, too.