Commit Graph

8 Commits

Author SHA1 Message Date
Collin J. Doering 5bbacb1725 Added initial implementation of error messages
Cleans up error reporting when an ajax call fails, and thus
the #page-content div can't be filled. This is accomplished by using
a #status which has a p.message element that can be populated for text
displaying status messages. By adding either .error or .success
to #status causes it to be highlighted as either a error or success message
respectively.

When its the first load of the page, and #page-content hasn't yet been
populated with content, an error message is shown in the #page-content
div.

Removed the /posts/ and /tags/ fallbacks in the generated
manifest.appcache because even when online, ajax calls for invalid URLs
under those paths return the respective fallback page instead of an
error message, and populate the #page-content div with the fallback. So
from this point forward the fact that the website is offline will be
handled from JavaScript.

When a page is not accessible in the application cache and the user is
offline, an error message is displayed using the mechanism mentioned
above.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:29 -05:00
Collin J. Doering 0bf8f8a6a1 Remove repeated copyFileCompiler Rules
Instead use a single pattern (providing the route also remains
unchanged; that is, idRoute)

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-01-14 04:50:28 -05:00
Collin J. Doering 891fadf3a2 Paginate tag pages
Paginate tag pages, allowing maximum 2 pages per tag to be app cached.
Setup virtual paths for tag pages such that /tags/tagname.html loads
/tags/tagname1.html similar to how pages are handed. This is similar to
how pages are handled in that /pagename.html loads /pages/pagename.html.

Dry up blog page's pagination and create a dry template for pagination
because it is also used on the tag pages.

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
Collin J. Doering 5a23b9c90a Fix whitespace in src/site.hs
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
Collin J. Doering c1c82e397f Don't appcache empty file pages/blog.html
This causes a bug when using the android browser. Specifically, because
pages/blog.html is appcached it always prefers the appcached version and
thus loads an empty blog (unless you explicit request pages/blog1.html)

This empty file is required while generating the navigation. There seems
to be no way to not write a file once within the Rules monad (or at
least it's not simple).

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
Collin J. Doering 001d4c05f0 Finished up pagination and cleanup
Paginate URLs now working correctly. In posts and pages a link to a page can be given
using either:
 - absolute url (eg. /pages/somepage.html)
 - virtual page path (eg. /#/somepage.html)

This is achieved in js/default.js by treating a tags with the rel
attribute as virtual. Specifically, the rel attribute should be of the
form "address:/virtual/path.html" , though this isn't tested for. If a
value val, is found in the rel attribute then it is used as the URL in
loadPageContent where if it doesn't match certain regexps it is assumed
to be a page and "pages" + val is loaded into the page-content div. See
loadPageContent for more details.

Placed first page, previous page, next page, and last page links at
bottom of blog pages to switch between pages.

Still incomplete:
 - pagination menu needs to be further styled with images, tool tips, etc.
 - check if rel conforms to the form /address:.*/ and if not don't treat
   is specially (as virtual)

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
Collin J. Doering a0aed31d54 Pagination working but still needs to be cleaned up
- pagination of posts now works (they are output to pages/blog<n>.html
  where <n> is a number from 1 to some natural x)
- pages in pages/* are weighted 1 to some natural y for the purposes of
  generating the menu; but now items that are weighted 0 will not show
  up in the menu and instead will be hidden. This allows for the
  paginated pages to be generated to _site/pages/blog<n>.html as above
  but also avoids showing them in the generated menu.

Now there still is the issue of showing the pages. js/default.js has
been slightly modified to allow the new format of the paginated blog
pages along with the original blog page.

Things yet to complete for pagination:
- the original blog page still needs to be removed as it will be
  replaced by the paginated pages
- need to modify templates/partials/post-teaser-list.haml to show the
  forward/backward buttons from the paginate context.
- paginate tag pages
- find a clean way for the paginated pages (blgo and tags) can be
  viewed/selected

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00
Collin J. Doering 7e33aa7fe5 Initial cabalization of site
Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2015-01-14 04:50:28 -05:00