Changed the rendering of comments, will probably change that macro later if it looks like I need it.
* render_comment and render_childcomments macros, but only render_comment is used right now.
* rendering comments works.
Working on some layout and such.
* Check so that the user is allowed to view the user's collections, which means that the current user either is an admin or the user that he is viewing.
* Adding style rules.
* Adding some classes to the divs so that we can style them, and see what they hold.
* Since the proxy that Flask_login uses doesn't have a function called allowed_to_remove_category we must first check if the user is active, since that means that it isn't a flask_login proxy.
* Adding divs and classes to layout.html
* Also in main.html, aswell as some moving around.
* We must first check if the user is allowed to view that other users collections.
Moving some stuff from main.html to layout.html since it should be persistent.
* Gotta check if the user is active, since AnonymousUserMixin hasn't got status, doh.
* More css.
* Moved stuff from main.html to layout.html and also added the from _formhelpers.html macro import since render_collection_dense wasn't defined.
* Main.html is now a lot more empty and only has the things that should be there.
* Adding some stuff to g since that makes it a lot easier to implement the layout.html things. Might be bad if we got a lot of users, but that is something to be optimized later.
Working on the finer details.
* Added a allowed_to_remove_comment function to User so that we can later remove comments if we need to.
* Added a delte_comment function, but at this time it doesn't actually work, since there isn't any form that allows you to do it yet.
* Displays what categories you are moderator in a nicer way.
* Adding files to moderate categories, posts and users, this will allow us to remove, delete, edit, ban and so on.
Adding links to collections is now a lot easier with the embedded select box.
* Getting the user is now case insensitive.
*We want to have a cascading delete on removal of category. Otherwise it will get odd if you remove a category and the posts stick around, or the moderators.
*Added a column for random, this will be used for verifying that the user is allowed to watch the shared collection. With a sufficiently large number ther shouldn't be anyway to guess it. Generates as number from 1000000000000000000 to 9223372036854775807, PostGresql BigInteger max.
*Raise 404 if the post or category doesn't exist, so that you can watch the post /c/index/p/1 in /c/about/p/1 since they share the same post table. Now it will Raise a 404 instead if you don't go to the correct category.
*Check to see if there exists a row in Link with the given url and add that to the collection instead of creating a new one.
*More css.
*Description on the sharing of collections.
Added some documentation and implemented the sharing of collections.
* get_base64 function on Collection that will give you are base64 version of collectionid and random which is then used to verify that the user is allowed to view that collection. Might have to do some more handling later so that disallowed buttons get removed and such.
* A decode_base64_with_split function that takes the Collection base64 and then returns collectionid and random.
* A post that doesn't exist gets a 404 value returned.
* redirect to CategoryView instead of to MainView when you delete a post.
* Checks if category exists and if it doesn't gives a good message instead of just crashing.
* RegisterView checks both if username and or email if valid, if it isn't gie both messages, since it will confuse the user otherwise.
* If the collectionid isn't a digit return abort(404) instead of just an error
* A __get function that allows us to choose what to display with the share part of collection. Better than using get, even though it might be a bit non DRY.
* Implemented the sharing of collections with the helper functions already mentioned. This is done via a base64 string, and it should be pretty secure, you shouldn't be able to guess the random part of the string and as such will be only for people who decide to share the link.
* Displays the base64 string, but it's not a link or anything like that yet, must fix that soon.
* If the user hasn't got any collections, display You haven't got any collections, as it was intended instead of just an empty list of All your collections:
* Added statusid to both Post and Comment. I should use alembic, but that is to annoying to set up, so I do it manually instead. Status allows us to set the Post and Comment to deleted, without actually physically remove the Post/Comment.
* Added a remove function that removes, i.e. sets the status to deleted, instead of deleting the post. Also for Comments.
* Changed from allowed_to_remove_post to current_user.allowed_to_remove_post, no real change though.
* Changed the flash messages to actually represent what they do, there is a difference between delete and remove.
* Fixing some inspection things.
* Changed rom categoryname, status, title to categoryname, title, status so it made sense in doing the positional arguemnts in creating Categories.