Commit Graph

57 Commits

Author SHA1 Message Date
Azareal 74e09efb63 Fixed a bug where it would use the wrong templates for Tempra Simple, Tempra Cursive, and Shadow
Likes are now done over AJAX.
Posts you have liked are now visually differentiated from those which you have not.
Added support for OR to the where parser.
|| and && now get translated to OR and AND in the where parser.
Added support for ( and ) in the where parser.
Added an adapter and builder method for getting the database version.
Multiple wheres can now be chained with the micro and accumulator builders.
Added the In method to the accumulator select builder.
Added the GetConn method to the builder.
/uploads/ files should now get cached properly.
Added more tooltips for topic titles and usernames.

Fixed a bug in the runners where old stale templates would be served.
Fixed a bug where liking topics didn't work.
Began moving the database initialisation logic out of {adapter}.go and into querygen.
Tweaked the alert direction to show the newest alerts rather than the oldest.
Tweaked the WS JS to have it handle messages more efficiently.
Partially fixed an issue where inline edited posts would lack newlines until the page is refreshed.
Used arrow functions in a few places in global.js to save a few characters.

Schema:
Added the liked, oldestItemLikedCreatedAt and lastLiked columns to the users table.
Added the createdAt column to the likes table.

MySQL Update Queries:
ALTER TABLE `users` ADD COLUMN `liked` INT NOT NULL DEFAULT '0' AFTER `topics`;
ALTER TABLE `users` ADD COLUMN `oldestItemLikedCreatedAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `liked`;
ALTER TABLE `users` ADD COLUMN `lastLiked` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `oldestItemLikedCreatedAt`;
ALTER TABLE `likes` ADD COLUMN `createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `sentBy`;
delete from `likes`;
delete from `activity_stream` where `event` = 'like';
delete from `activity_stream_matches` where `asid` not in(select `asid` from `activity_stream`);
update `topics` set `likeCount` = 0;
update `replies` set `likeCount` = 0;
2018-03-31 06:25:27 +01:00
Azareal b20e295375 Changed the defaultest default theme to Cosora... For now.
You need the ViewIPs permission to view IPs on logs now.
Added the leftOfNav and rightOfNav docks, more on this soon.
Added a max length for topic titles.
Added a max length for usernames.
Added none as a possible language for the language view counter.
We began adding the notice phrases.
Fixed a misnamed phrase which was spitting out placeholder text.
Localised unknown for the human language phrases.
Moved routeForums to routes.ForumList.
Moved routeRobotsTxt to routes.RobotsTxt.
Started tracking the views for routes.RobotsTxt.
Moved routeSitemapXml to routes.SitemapXml.
Started tracking the views for routes.SitemapXml.
Changed the fallback theme to Cosora.
Fixed changing the default theme to Cosora or Tempra Conflux.
Removed some redundant type definitions in template init.
Return ErrNoTitle instead of ErrNoBody when trying to create a topic with no title.
Moved some in-progress routes and helper functions for handling search engine crawlers to routes/api.go
2018-03-17 08:16:43 +00:00
Azareal 84dbe71bfc Use arrays for holding fragments rather than using a large number of micro variables.
Fixed a typo in a phrase.
Fixed a typo in a phrase name in Cosora.
Super mods can no longer see the group creation form or click on the groups in the Group Manager (which took them to a no permissions error).
Tweaked some of the uglier generated variables.
2018-03-12 04:52:47 +00:00
Azareal 3821e626ce Added support for phrases in CSS files.
Add support for phrases in template files.
Revamped every template to make them use phrases.
Revamped every CSS file to make them use phrases.

Tweaked the contributing document.
We now use LogError instead of log.Fatal() in a few places to capture more stack traces.
Fixed the suffixes on the topic and post count pages, as they were saying views instead of posts / topics.
Split the paginator into it's own template.
Refactored the theme logic to defer loading the static files to a later stage.
Greatly improved the accessibility with a number of ARIA attributes in places where there were none.
Removed the edit-topic and page templates.
Renamed the panel-adminlogs template to panel_adminlogs.
Non-existent phrases used by transpiled templates should now be logged.
Fixed a bug where alertbox was plopped down multiple times on one page.
The phrase placeholders are more informative now.
Added the CurrentLanguagePackName and GetLanguagePackByName API functions.
Notices are now shown when you delete, update, or create a forum.
2018-03-11 09:33:49 +00:00
Azareal 5a8b994877 Added support for phrases in templates.
The language of the end-user is now tracked and presented in the Analytics Manager.
Profile owners now get alerts when someone posts on their profiles.

The login page is now transpiled, estimated to be sixty times faster.
The registration page is now transpiled, estimated to be sixty times faster.
The IP Search page is now transpiled, estimated to be sixty times faster.
The error pages are now transpiled, estimated to be sixty times faster.
The login page now uses phrases.
The registration page now uses phrases.
IP Search now uses phrases.
Renamed the ip-search template to ip_search.
Alerts are now held in an alertbox container div.
Added ids for the main container divs for the account manager sections.
Added an id to the main container for the topic list template.
Added an id to the main container for the forum list template.
Added an id to the main container for the forum template.
Added an avatar box CSS class for the avatar box in the account manager's avatar page.
Did a bit of renaming for a future refactor in the routes counter.
Did a bit of renaming for a future refactor in the operating system counter.
A notice is shown to the user now when their account is inactive.
The account activation status is now fetched by the user store.
We now track Slackbot.
You can now prepend strings to the start of router.DumpRequest request dumps to avoid tearing these bits of contextual data away from the bodies.
.action file extensions are now seen as suspicious by the router.
Moved routeWebsockets to common.RouteWebsockets for now.
Moved routeCreateReplySubmit to routes.CreateReplySubmit.
Moved alert.go into common.
Moved the WebSockets logic into common.
Escape strings a little earlier in the analytics routes and use integers instead of strings where possible.
We now show a success notification when you update a user via the User Manager.
Split the configuration properties off from CTemplateSet into CTemplateConfig.
Renamed some of the properties of CTemplateSet to make them easier to understand.
Removed some obsolete properties from CTemplateSet.
Did a bit of spring cleaning in the template transpiler to cut down on unneccessary lines and to reduce duplication.
Fixed a double else bug in ranges over maps in the template transpiler.
Split the minifiers off the main template transpilation file into their own file.
Refactored some of the routes which rely on alerts to use shared functions rather than having unique implementations in the routes themselves.

All Themes Except Cosora:
Refactored the opt nodes to make it easier to roll out bulk moderation.

Shadow:
Improved the notice CSS.
Tweaked the sticky border colour.

Cosora:
The theme JS file now uses strict mode.
Notices are shunted under rowhead with JS now, although this change might be reverted soon.
Added CSS for notices.
Fixed the padding under the avatar box in the account manager avatar page.

Schema:
Added the viewchunks_langs table.
2018-03-08 03:59:47 +00:00
Azareal be47066770 General:
Added better pagination to /forum/{id}
Fixed the ordering of the elements in the pagesets.
Added hooks to the task system.
Reduced the amount of boilerplate for RunVhook and RunVhookNoReturn.
Added RunVhookNeedHook to allow plugin developers to add custom content types to the report system.
Added BulkGetMap to the DefaultPollStore.
Renamed the MultiServer config setting to ServerCount and made it an integer.
Don't cache topic lists for empty groups.
Don't load replies for topics without any.

Tempra Simple:
Added chart and submenu CSS.
Improved the input and select CSS.
Fixed the pageset CSS.
Fixed the poll input CSS.

Tempra Conflux:
Fixed the quick reply button CSS.
Hid the avatar in the quick reply area.
Added the poll CSS.
Fixed the pageset CSS.

Shadow:
Fixed the time range selector CSS.
Fixed the poll input CSS.
2018-02-15 13:15:27 +00:00
Azareal e919812ee2 Added support for meta descriptions. You can configure this from the Control Panel's Setting Manager.
Added tests for forum creation.
2017-12-25 06:12:19 +00:00
Azareal bdbd80319f Made some minor tweaks.
The DefaultRoute parameter in the configuration struct is now a string.
Fixed a few mismatched HTML tags.
Added the profile_comments_row template.
Added more alt attributes for images and associated title=""s in a few places.
Connections should now be closed properly.
Custom Pages no longer have a .html file extension in their URLs.
We now track route views for the default route and the custom page route.

Began work on cleaning up the profiles on Cosora.
2017-12-22 03:32:23 +00:00
Azareal 10a0c62823 The Cosora Theme is almost complete and is being rolled out on the site to demo it.
We now track the views on a per-route basis. We have plans for an admin UI for this, global views, etc. which will come in a future commit.

The local error JSON is now properly formed.
Fixed an outdated line in topic.go which was using the old cache system.
We now use fuzzy dates for relative times between three months ago and a year ago.
Added the super admin middleware and the associated tests.
Added the route column to the viewchunks table.
Added more alt attributes to images.
Added a few missing ARIA attributes.

Began refactoring the route generator to use text/template instead of generating everything procedurally.
Began work on per-topic view counts.
2017-12-19 03:53:13 +00:00
Azareal abfe0a472a Made a huge amount of progress on the Cosora Theme in the Control Panel, it's almost ready for deployment.
Added the view counter, it currently collects data without exposing it to the admin.

Added an API for scheduling tasks which run once every second and once every fifteen minutes.
Added a generated map containing all the routes with the function names as keys.
Added the request counter to the generated router.
Added more ARIA Labels and moved various bits and pieces into the CSS files for flexibility.
Removed a bunch of redundant avatar checks in the templates.
Improved the mobile friendliness of Cosora.
Fixed various issues in the other themes.
Refactored the file listener.
Gosora now resyncs newly created theme files not just modified ones.
Gosora now resyncs renamed theme files not just modified ones.
2017-12-10 03:43:30 +00:00
Azareal 0e9cebfa47 Overhauled the widget system. You can now specify more complex logic for where a widget can show up and you can now place widgets in the footer.
Added fsnotify as a dependency, we'll be using it, Rez, and Riot (maybe) soon.
Removed the intercept_build_widgets vhook.
You can now pass an ID to BlankReply() for mocking replies or whatever else you want to do with this.
Added the dock template function for widget docks.
Added the logf internal function to the template transpiler and did some minor clean-up.
Removed the Sidebars property from theme.json and added the more general Docks one.
Improved the footer and the associated CSS.
Added the about widget, previously the AboutSegment feature.
Removed the about_segment_title and about_segment_body settings.
Gosora now exits when it receives the appropriate OS signal.
Refactored the modlogs route.

More progress on the theme in the Control Panel.
2017-11-29 02:34:02 +00:00
Azareal 381ce3083a Added the AboutSegment feature, you can see this in use on Cosora, it's a little raw right now, but I'm planning to polish it in the next commit.
Refactored the code to use switches instead of if blocks in some places.
Refactored the Dashboard to make it easier to add icons to it like I did with Cosora.
You can now use maps in transpiled templates.
Made progress on Cosora's footer.
Swapped out the ThemeName property in the HeaderVars struct for a more general and flexible Theme property.
Added the colstack CSS class to make it easier to style the layouts for the Control Panel and profile.
Renamed the FStore variable to Forums.
Renamed the Fpstore variable to FPStore.
Renamed the Gstore variable to Groups.
Split the MemoryTopicStore into DefaultTopicStore and MemoryTopicCache.
Split the MemoryUserStore into DefaultUserStore and MemoryUserCache.
Removed the NullUserStore, SQLUserStore, and SQLTopicStore.
Added the NullTopicCache and NullUserCache.
Moved the Reload method out of the TopicCache interface and into the TopicStore one.
Moved the Reload method out of the UserCache interface and into the UserStore one.
Added the SetCache and GetCache methods to the TopicStore and UserStore.
Added the BypassGetAll method to the WordFilterMap type.
Renamed routePanelSetting to routePanelSettingEdit.
Renamed routePanelSettingEdit to routePanelSettingEditSubmit.
Moved the page titles into the english language pack.
Split main() into main and afterDBInit to avoid code duplication in general_test.go
Added the ReqIsJson method so that we don't have to sniff the headers every time.
Added the LogStore interface.
Added the SQLModLogStore and the SQLAdminLogStore.
Refactored the phrase system to use getPhrasePlaceholder instead of hard-coding the string to return in a bunch of functions.
Removed a redundant rank check.
Added the GuildStore to plugin_guilds.
Added the about_segment_title and about_segment_body settings.
Refactored the setting system to use predefined errors to make it easier for an upstream caller to filter out sensitive error messages as opposed to safe errors.
Added the BypassGetAll method to the SettingMap type.
Added the Update method to the SettingMap type.
BulkGet is now exposed via the MemoryUserCache.
Refactored more logs in the template transpiler to reduce the amount of indentation.
Refactored the tests to take up fewer lines.
Further improved the Cosora theme's colours, padding, and profiles.
Added styling for the Control Panel Dashboard to the Cosora Theme.
Reduced the amount of code duplication in the installer query generator and opened the door to certain types of auto-migrations.
Refactored the Control Panel Dashboard to reduce the amount of code duplication.
Refactored the modlog route to reduce the amount of code duplication and string concatenation.
2017-11-23 05:37:08 +00:00
Azareal fb8fa10570 Let plugins define imports to custom templates.
Things should work now.
2017-11-11 06:33:08 +00:00
Azareal d2a8fb1267 Fixed the template transpiler.
Fixed the PreRoute middleware.
Renamed makeDummyForum to BlankForum.

Began adding the plugin_guilds routers to the template transpiler for extra speed.
2017-11-11 05:22:33 +00:00
Azareal f30ea7a9bb Finished moving the files into the subpackage, this should open more doors to us.
Moved more queries out of the global stmt holder.
Refactored several things.
2017-11-11 04:06:16 +00:00
Azareal 14a14b7e80 More work on Cosora, we have a screenshot of it up now, although it's super experimental at the moment.
This commit might be a little broken, another is coming to fix things up!

The topics list is now paginated.
Refactored the error handling system.
Added the Trumboyg WYSIWYG editor for Cosora.
Moved Delete() out of the TopicStore and into *Topic
You can now bulk delete and bulk lock topics on Cosora.
h1s are now formatted properly on Firefox.
Added more ARIA Labels.
SuperModOnly is now a piece of middleware for the Control Panel routes.
Refactored and extended the router generator.
Improved the SEO for the paginators.
Added bits of Microdata to improve SEO further.
Wrote benchmarks for users.Get() and users.BypassGet()
More errors are caught now.
You can now attach pcss files to posts.
Improved the error logging for JavaScript.
Topic list avatars now link to the associated profiles.
Added last poster avatars to the forum list.
2017-10-30 09:57:08 +00:00
Azareal f7942b42ac Continued the work on Cosora.
Trying to add support for Travis CI.

Added the NullUserStore for tests.
Moved more text out of the templates.
Removed an unnecessary dependency for Cosora.
Fixed a few more bugs in the MSSQL Adapter.
Disabled upserts for now, as it isn't working on MySQL.
Refactored the scheduled group logic to reduce the number of potential bugs and to stop using upserts.
Fixed many bugs in the Markdown Plugin.
Added the ability to escape Markdown.
Fixed a number of tests, commented unneccesary ones, and added new ones to probe for new problems.
Added the wink smiley.
Cleaned up some of the JavaScript.
Refactored the permissions logic to use transactions and avoid duplicating logic.
Added the ChangeRank method to the Group struct.
Added the ChangeGroup method to the User struct.
Added the currently unused LogWarning function.
Added the transaction versions of the builder methods. Better ones coming up soon!
The IsBanned flag is always set to false on mod and admin groups now.
Refactored the group creation logic to use transactions.
Fixed a bug in the group creator where new groups aren't visible to Exists().
The installer now drops tables for MySQL Databases, if they already exist to make it easier for us to run automated tests.
Added more ARIA Attributes.
2017-10-21 01:27:47 +01:00
Azareal fdb6304e32 Mostly a mid-way technical commit to make reading diffs easier on me.
Split the relativeTime function into relativeTime and relativeTimeFromString.
Refactored the installer.
Made a lot of progress with PgSQL and MSSQL support, mostly MSSQL.
Made a lot of progress on the automated testing suite.
Added eqcss to the file extension list.
..depressed..
Fixed various bugs here and there.
gen_mysql.go is now properly excluded when the pgsql or mssql build tag is passed.
The BBCode plugin is now always initialised prior to it's test.
We've begun transitioning towards deserializing database times directly into time.Times rather than doing it every time on the spot.
Added more dev flags.
The tests now make use of a test database rather than the production database.
2017-10-14 08:39:22 +01:00
Azareal 97860d4f79 Began work on the new theme, Cosora.
Added the ReplyStore and the ProfileReplyStore.
Added more allowed file extensions for attachments.
The tif, webp, and apng extensions are now recognised as images.
Added the Delete method to the Reply struct.
Added the Like method to the Reply struct.
Refactored the topic list avatars to make things easier on Cosora.
The attachment cap should now work properly on topics.
You can now attach files to replies.
The Markdown parser now ignores URLs rather than mangling them.
Fixed a bug where themes weren't able to register custom resources.
Added the ability to embed images.
Added the ability to embed videos.
Made the requirements for URLs looser.

Misc improvements to the themes and templates.
2017-10-12 04:24:14 +01:00
Azareal 22650aad27 Added Quick Topic.
Added Attachments.
Added Attachment Media Embeds.

Renamed a load of *Store and *Cache methods to reduce the amount of unneccesary typing.
Added petabytes as a unit and cleaned up a few of the friendly units.
Refactored the username change logic to make it easier to maintain.
Refactored the avatar change logic to make it easier to maintain.
Shadow now uses CSS Variables for most of it's colours. We have plans to transpile this to support older browsers later on!
Snuck some CSS Variables into Tempra Conflux.
Added the GroupCache interface to MemoryGroupStore.
Added the Length method to MemoryGroupStore.
Added support for a site short name.
Added the UploadFiles permission.
Renamed more functions.
Fixed the background for the left gutter on the postbit for Tempra Simple and Shadow.
Added support for if statements operating on int8, int16, int32, int32, int64, uint, uint8, uint16, uint32, uint64, float32, and float64 for the template compiler.
Added support for if statements operating on slices and maps for the template compiler.
Fixed a security exploit in reply editing.
Fixed a bug in the URL detector in the parser where it couldn't find URLs with non-standard ports.
Fixed buttons having blue outlines on focus on Shadow.
Refactored the topic creation logic to make it easier to maintain.

Made a few responsive fixes, but there's still more to do in the following commits!
2017-10-05 11:20:28 +01:00
Azareal 91f70d2a4a Add a per-user theme switcher. The CSS might be slightly broken in the themes, that'll be fixed in a follow-up commit.
Added basic support for server sync.

Re-added a few missing defers.
Renamed TO-DO to TODO across the entire codebase.
Renamed StaticForumStore to MemoryForumStore.
The ForumStore is now built on a sync.Map with a view slice for generating /forums rather than a slice.
Renamed many more functions and variables to satisfy the linter.
increase_post_user_stats() and decrease_post_user_stats() are now methods on the User struct. We also fix a bug where they take the moderator's score rather than the target user's into account when recalculating their level after a post / topic is deleted.
Transitioned the topic list to CSS Grid for Tempra Simple, with a float fallback.
Cosmo and Cosmo Conflux are now hidden from the theme list.
Fixed more data races.
Added more debug data to the template compiler logs.
2017-09-10 17:57:22 +01:00
Azareal ba36814d8d Refactored the code to follow best standards better.
Added Basic IP Search.
Added more items to .gitignore
Add a VSCode settings file.
Refactored the theme system to allow me to add a per-user theme switcher in the following commit.
Fixed h1s, rowmenus, profiles and the Control Panel Dashboard on Tempra Simple.
We now catch more extreme edge case errors.
Renamed route_panel_themes_default to route_panel_themes_set_default.
Centralised some of the per-route ExtData fields.
Added an ExtData field to headerLite.
Moved SettingLabels into the Phrase System.
2017-09-03 05:50:31 +01:00
Azareal 5a43432b80 Replaced most of the uses of fmt with log.
Replaced the io.Writers with http.ResponseWriters.
Refactored the compiled template calls.
Redirect port 443 to port 80.
Catch more errors from templates.
Fixed a few mutexes which are never unlocked.
Eliminated an unnecessary parameter in InternalError()
Temporarily commented out users_penalties so that the installer will succeed.
A couple more template types can be remapped now.
Tweaked the theme.
2017-08-13 12:22:34 +01:00
Azareal f41c281e43 Added support for HTTP/2 Push.
The themes are still going to be a little broken for a while, but here's the progress I've made.

Renamed the topics_trow_assign hook to topics_topic_row_assign.
Added more debug code to the generated router.
Added a robots.txt file.
Gosora now responds to favicon.ico requests with a 404 rather than the topic list.
Fixed the tests and some of the benchmarks.
Changed the default UserCacheCapacity from 100 to 120.
Changed the default TopicCacheCapacity from 100 to 200.
Added the last replyer to the topics list and the forum pages.
Added the BulkCascadeGetMap method to the UserStore.
Refactored the topics list and forum page to load the users with a call to the UserStore rather than via a join.
WebSockets now work on SSL.
Fixed a race condition when the user permissions are initialised at the start of a request.
Fixed a race condition when the user permissions for the OP of a topic are initialised.
The rows.Close() calls are deferred once more, so that we can catch problems with recover()
Improved support for struct pointers in the template compiler.
Added a pin emoji to pinned topics to make them stand-out on the Shadow theme, we have some other ideas in mind for this, but I'd like to get Shadow fully functional for this commit.
Fixed a bug an issue with Chrome not detecting XHTML style closes on <form>s.
Fixed a visual issue with `color` not being set for textarea elements for the Shadow theme.
Fixed a function which wasn't getting renamed for PGSQL.

Added seven new UserStore tests.
2017-08-06 16:22:18 +01:00
Azareal 41c620b988 Shadow is now fully responsive and almost done! Just a few places like the dashboard and a few glitches to patch up!
Fixed the indentation in alerts.go, Atom replaced the tabs with spaces for some reason x.x
Made the friendly URL logic more flexible.
Made the supermod menu item hiding more JS friendly.
strconv is now an optional dependency for compiled template files.
Revamped the profile template.
2017-07-29 15:04:20 +01:00
Azareal d976a192fb Added the new theme, Shadow. It still isn't complete yet.
Revamped the configuration system.
If you have trouble installing this, try installing my fork of gopsutil with `go get` and delete the users_penalties table from the schema folder. That stuff will be cleaned up in the next commit.

Fixed an issue with the links for the Uncategorised forum being broken.
Swapped out NOW() for UTC_TIMESTAMP() in MySQL queries.
We now get an error message when the server goes down for whatever reason.
The template compiler now supports pointers.
Swapped out shirou/gopsutil for a fork locked on an older and more stable commit of the same library.
Fixed a bug where the preprocessor didn't play nice with empty CSS files.

Added the site name to the navbar.
Added more things to .gitignore
Laid the foundations for the next commit.
2017-07-17 11:23:42 +01:00
Azareal dd8f68b6d2 Added the Social Groups plugin. This is still under construction.
Made a few improvements to the ForumStore, including bringing it's API closer in line with the other datastores, adding stubs for future subforum functionality, and improving efficiency in a few places.
The auth interface now handles all the authentication stuff.
Renamed the debug config variable to debug_mode.
Added the PluginPerms API.
Internal Errors will now dump the stack trace in the console.
Added support for installable plugins.
Refactored the routing logic so that the router now handles the common PreRoute logic(exc. /static/)
Added the CreateTable method to the query generator. It might need some tweaking to better support other database systems.
Added the same CreateTable method to the query builder.
Began work on PostgreSQL support.

Added the string-string hook type
Added the pre_render hook type.
Added the ParentID and ParentType fields to forums.
Added the get_forum_url_prefix function.
Added a more generic build_slug function.
Added the get_topic_url_prefix function.
Added the override_perms and override_forum_perms functions for bulk setting and unsetting permissions.
Added more ExtData fields in a few structs and removed them on the Perms struct as the PluginPerms API supersedes them there.
Plugins can now see the router instance.
The plugin initialisation handlers can now throw errors.
Plugins are now initialised after all the forum's subsystems are.
Refactored the unit test logic. For instance, we now use the proper .Log method rather than fmt.Println in many cases.
Sorry, we'll have to break Github's generated file detection, as the build instructions aren't working, unless I put them at the top, and they're far, far more important than getting Github to recognise the generated code as generated code.
Fixed an issue with mysql.go's _init_database() overwriting the dbpassword variable. Not a huge issue, but it is a "gotcha" for those not expecting a ':' at the start.
Fixed an issue with forum creation where the forum permissions didn't get cached.
Fixed a bug in plugin_bbcode where negative numbers in rand would crash Gosora.
Made the outputs of plugin_markdown and plugin_bbcode more compliant with the tests.
Revamped the phrase system to make it easier for us to add language pack related features in the future.
Added the WidgetMenu widget type.
Revamped the theme again. I'm experimenting to see which approach I like most.
- Excuse the little W3C rage. Some things about CSS drive me crazy :p

Tests:
Added 22 bbcode_full_parse tests.
Added 19 bbcode_regex_parse tests.
Added 27 markdown_parse tests.
Added four UserStore tests. More to come when the test database functionality is added.
Added 18 name_to_slug tests.

Hooks:
Added the pre_render hook.
Added the pre_render_forum_list hook.
Added the pre_render_view_forum hook.
Added the pre_render_topic_list hook.
Added the pre_render_view_topic hook.
Added the pre_render_profile hook.
Added the pre_render_custom_page hook.
Added the pre_render_overview hook.
Added the pre_render_create_topic hook.

Added the pre_render_account_own_edit_critical hook.
Added the pre_render_account_own_edit_avatar hook.
Added the pre_render_account_own_edit_username hook.
Added the pre_render_account_own_edit_email hook.
Added the pre_render_login hook.
Added the pre_render_register hook.
Added the pre_render_ban hook.

Added the pre_render_panel_dashboard hook.
Added the pre_render_panel_forums hook.
Added the pre_render_panel_delete_forum hook.
Added the pre_render_panel_edit_forum hook.
Added the pre_render_panel_settings hook.
Added the pre_render_panel_setting hook.
Added the pre_render_panel_plugins hook.
Added the pre_render_panel_users hook.
Added the pre_render_panel_edit_user hook.
Added the pre_render_panel_groups hook.
Added the pre_render_panel_edit_group hook.
Added the pre_render_panel_edit_group_perms hook.
Added the pre_render_panel_themes hook.
Added the pre_render_panel_mod_log hook.
Added the pre_render_error hook.
Added the pre_render_security_error hook.

Added the create_group_preappend hook.
Added the intercept_build_widgets hook.
Added the simple_forum_check_pre_perms hook.
Added the forum_check_pre_perms hook.
2017-07-09 13:06:04 +01:00
Azareal 9a93f799bf Added friendly URLs.
Added the Forum Store. Rewrote all the forum slice calls to use it.

Remapped sql.ErrNoRows to ErrNoRows for portability.
Removed a pointless column in the login query.
Revamped the tags and buttons on Tempra Simple, and on the profiles for the other themes.
Fixed a padding bug.
Tweaked the font sizes and padding in the Control Panel for Tempra Simple.
More progress with widgets.
2017-06-28 13:05:26 +01:00
Azareal 21d623cba4 Static CSS files are now processed by the template system. This will be most likely be superseded by a more sophisticated system in the future.
Added the authentication interface and associated struct to better organise / escapsulate the authentication logic.
Added the LogError function. We'll put together a custom logger at some point which will supersede this.
Reorganised things a little.
Moved two queries into the query generator and inlined four with the query builder.
Added SimpleInsertLeftJoin to the query generator.
Added SimpleInsertSelect, SimpleInsertLeftJoin, and SimpleInsertInnerJoin to the query builder.
Removed the undocumented password reset mechanism for security reasons. We have a proper interface for this in the control panel.
Made one of the template compiler errors less cryptic.
Fixed the CSS on widget_simple.
Fixed a glitch in the weak password detector regarding unique character detection.
Moved the responsive CSS in media.partial.css for Tempra Conflux, and Tempra Simple.
Added the CreateUser method to the UserStore.
Users are no longer logged out on all devices when logging out.

Took the first step towards SEO URLs.
2017-06-25 10:56:39 +01:00
Azareal 1cc1e47582 Added an algorithm for sniffing out weak passwords upon registration.
Themes can now inject their own stylesheets and JavaScript files into the header.

Added friendlier errors for developers / designers when something goes wrong in the system.
Moved three queries to the query generator.
_process_where() in the query generator now uses an arbitrary expression parser, thus allowing more complex constructs like IN.
Began work on the widget system.
Added SimpleLeftJoin and SimpleInnerJoin to the inline query builder.
Added SimpleInsertSelect and SimpleInsertInnerJoin to the query generator.
_process_columns() now supports parametisation.
Fixed a bug in _process_set() where _ was considered an invalid character in column names.
Fixed a typo in the interpreter template mapping for topics.
2017-06-19 09:06:54 +01:00
Azareal c4e109adb7 Added the HeaderVars struct which is now used in the header template.
The NoticeList field in the various page structs is now part of the HeaderVars struct.
The Left / Right hotkeys will no longer take you to the next or previous page, if you have a textarea, input, or select element selected.
Added the panel.css file.
Added the PanelSessionCheck and SimplePanelSessionCheck functions.
Reworked the ExtData field in the page structs, we'll have some hooks for you to inject stuff in here soon!
Fixed a problem with the templates not getting remapped properly with Tempra Conflux when the compiled templates are missing.
More Atom Madness.
2017-06-16 11:41:30 +01:00
Azareal e099dfd40e Added the query generator. It's a work in progress and in constant flux.
Added forum descriptions.
Began work on the Advanced Forum Editor. Not to be confused with the Quick Forum Editor. You can access it by going to /panel/forums/edit/{forumid} We'll fix it so the Forum Manager links to it in the next commit.
Fixed the Linux shell scripts.
Fixed an issue with relative timess being off by an hour due to timezones.
Added reply count and author names to the topic list and forum pages.
Improved the look of the forum list, forum page, and topic list.
Added an overlay effect for when the alert list is open on mobile.
You can now close the alert list by clicking on the bell.
Removed the "Report:" prefix from report posts.
Fixed a bug in the template system where "and" and "or" wouldn't work on non-boolean values.
Improved the debug logging in the template system.
Fixed a bug in the forum creator where the "Hidden?" value was inverted.
Fixed a visual bug in the profile where the Ban button rendered in a glitchy way.
Added support for hidden fields to the JS Framework for inline editing rows.
Fixed a bug with the like counter rendering on-top of the alert list.
Atom's stripping trailing tabs for some reason, so don't be confused if there are a bunch of weird changes.
2017-06-05 12:57:27 +01:00
Azareal 42eb509448 Added the Group Creator.
Generated files should now be detected by Github. I'll work on making the detection method a little less ugly once Github lets me put that thing on something other than the first line.
Fixed a race condition in the Forum Creator.
Fixed a few forgotten error checks in permmap_to_query.
2017-03-27 08:09:28 +01:00
Azareal cf480947d3 I'm still working on alerts. I've worked out the client-side UI for Cosmo, the UI will be tweaked for the other themes shortly. The client-side JS also now pulls the alerts from the server.
The errors are now sent properly via JSON.
The success JSON messages are now sent properly.
Optimised the message for guests.
Added the opthead class for adding a nice Cosmo specific enhancement.
2017-03-01 11:36:50 +00:00
Azareal 9fce51a3d7 Added the InternalErrorJS and LocalErrorJS error handler functions.
Hid the themes which aren't under construction yet from the Theme Manager.
Fixed a bug in the BBCode parser where every post had ten spaces appended to them.
Added the get_reply() internal API function for plugins to make use of.
Added the bell to the theme.
Fixed some bits of the Cosmo theme where the rowhead wasn't appearing.
Added a "Don't have an account?" link to the login page.

I began work on the alerts system, I took a little break, so it's a little further behind than you might expect, but it shouldn't take too long for me to finish it up.
I haven't finished the back-end portions of it yet, so there's not much to see yet!
2017-02-28 09:27:28 +00:00
Azareal 61358b5449 Added support for likes to the other themes. I'm pondering over how to best show the like counter on them.
Cleaned up the alternate topic layout, no longer do we have buttons on the topic header.
Added the topic specific permissions to the templates and removed the reliance on the Is_Mod flag.
Fixed a bug where the nav menu refuses to acknowledge that you're logged in.
2017-02-15 15:29:05 +00:00
Azareal 6fdf615cf5 Topic and user edits should now update the caches. Ditto for topic deletions.
The tests and benchmarks now run again.
gloinit() is always called prior to the tests and benchmarks now.
The tests and benchmarks no longer use hard-coded session strings for admin route tests.
Added some new route tests.
We now pull the database version into a variable.
Fixed an issue with guest perms not applying properly.
Tweaked the router to make it a little more efficient.
Moved more topic / user parsing logic into CascadeGet
Profiles now use the user cache.
Added the Set method to the caches. Set is used when you don't know if an item exists in a cache or not.
Added the Load method to the caches. Load is used to forcefully reload an item in a cache from the database.
2017-02-15 10:49:30 +00:00
Azareal 399128c208 Added the topic and user memory caches. Currently used in an extremely limited way, we plan to expand this!
Added a template minifier which strips out many types of whitespace.
Stop the router from blocking the other goroutines.
Content is no longer an interface{} in the TopicUser and Reply structs
Allow plugins to add new routes without any potential race coditions occuring
Use non-breaking spaces in the topic view to make it harder for the minifier to break things.
2017-02-11 14:51:16 +00:00
Azareal 534ef10194 You can now upvote topics and replies. The number of upvotes is visible on the posts.
The static resources now support Gzip Compression. Software-wide support is coming with the upcoming router rewrite!
Revamped Tempra Simple's topic view. We now use emojis instead of text for the fields. Experimental.
Simplified the json permissions in the installer.
Fixed some places where the wrong error handler is used.
Fixed a bug in the word counter where it was off by one.
The word count is now tracked by the topics and replies.
2017-02-10 13:39:13 +00:00
Azareal 0e5d0e649e Relative times are now shown for all the topics on /topics/ and /forum/
You can now see which forum the topics are in on the topic list.
Relative times are now calculated in real-time rather than once at start-up. I'm not sure how it ended up like that.
Fixed an issue with the lastReplyAt field not being populated for topics.
We now have relative times for weeks and months.
2017-02-06 04:52:19 +00:00
Azareal dca8670eed Per-Forum Permissions work everywhere now.
Removed some unnecessary user parameters from the error handlers.
Added a PreError type for when the user data isn't available yet.
2017-02-05 16:36:54 +00:00
Azareal df5f70ee6b You can now post in any forum you want via the Board selector.
Added a lock indicator for forums you don't have permission to post in.
Added a New Topic option in forums you have permission to post in.
General is now the default forum for topics.
/topics/ no longer shows topics for forums you aren't able to access.
2017-02-05 14:41:53 +00:00
Azareal f8e657ee39 You can now create forums with a specific permission preset. The ability to change the preset of a forum and more granular control over it's permissions is coming soon.
Fixed a bug in the /forums/ route over which forums were visible.
2017-02-04 06:19:55 +00:00
Azareal f5c6f6b552 Added Per-Forum Permissions. The admin side of this is under development.
Added the Not Loggedin group.
The Reports Forum is now only available to staff.
Groups are now stored in a slice instead of a map for extra concurrency and speed.
Testing background SVGs.
You can now toggle a forum's visibility via the Forum Manager.
Added the Inline Form API to global.js
The reports forum can now be edited but not deleted.
Tempra Simple and Tempra Conflux now support backgrounds.
2017-01-31 05:13:38 +00:00
Azareal 5e3b61d910 Added pagination for forums.
You can now use the left and right keyboard keys to go to the next and previous page.
Making the shell files a little friendlier. Needs testing.
The main executable will always be named gosora.exe or the Linux equivalent ./Gosora
Reports is now a physical forum and not a "virtual" one.
Added create_forum() and delete_forum() for creating and deleting forums.
Synced the installer's config.go with the main one.
Forums are now stored in slices rather than maps for improved performance and concurrency.
You can now set a forum as hidden when initially creating it.
BBCode tag names may only be seven characters long now. This is part of a new anti-overflow measure that's much faster and simpler than the previous one.
Updated the last block of code in routes.go which uses the antiquated "success = 0" error detection method.
Fixed a visual bug in the Control Panel CSS.
Seperated the system forums from the normal ones in the Forum Manager.
You can now see if a forum is marked as Hidden in the Forum Manager.
Fixed the position of the lock status indicator.
IP Addresses now have a simple title attribute explaining that this long incomprehensible string is in fact an IP Address.
Textareas look a little better now.
Next / Previous buttons are now visible on mobile.
.bat files always say what they're doing now.
2017-01-26 13:37:50 +00:00
Azareal d4ad7f1a4c Dramatically improved Gosora's speed by two to four times.
Admins and mods can now see the IP Addresses of users.
The last IP Address of a user is now tracked.
The IP Addresses a user used to create replies and topics are now tracked.
Dramatically improved the speed of templates with the new Fragment System. More optimisations to come!
Decreased the memory usage of compiled templates with the new Fragment System.
build.bat now provides more information on what it's doing.
Added the `go generate` command to the .bat files in preparation for the future.
We're currently in the process of overhauling the benchmark system to run tests in parallel rather than serially. More news on that later.
We're also looking into the best way of integrating pprof with the benchmarks for detailed profiling.
The internal and notfound errors are now static pages.
Internal Error pages are now served properly.
Optimised most of the errors.
Added an internal flag for checking if the plugins have been initialised yet. Mainly for tests.
Decoupled the global initialisation code from the tests.
Removed URL Tags from Tempra Simple. We're pondering over how to re-introduce this in a less intrusive way.
Template file writing is now multi-threaded.
The number of maximum open connections is now explicitly set.
Removed the Name field from the page struct.
Turned some of the most frequently hit queries into prepared statements.
Added the [rand] BBCode.
Converted the NoticeList map into a slice.
Added the missing_tag error type to the [url] tag.
error_notfound is now used for when the router can't find a route.
Fixed a bug in the custom page route where both the page AND the error is served when the page doesn't exist.
Removed some deferrals.
Reduced the number of allocations on the topic page.
run.bat now provides more information on what it's doing.
2017-01-17 07:55:46 +00:00
Azareal 2f50da8cd8 Dramatically improved mobile friendliness on Tempra Conflux, Cosmo Conflux and Cosmo themes.
Made minor improvements to the mobile friendliness on the Tempra Simple theme.
Added levels to the other three themes.
Added the group tags to the Tempra Conflux and Cosmo Conflux themes.
Added more screenshots and updated some of the existing ones.
Made a small cosmetic improvement to the theme list.
2017-01-12 14:01:35 +00:00
Azareal e835ca4148 Added an installer which automatically populates the configuration file with information you provide. It also seeds the database with the necessary tables and data.
Added the likes table. This is a sign of what's to come.
Improved the installation instructions in README.md
Fixed the SQL in data.sql so that it no longer errors out.
The Admin user now has a default password.
Fixed a status indicator which I overlooked in the previous commit.
The Status field for topics is now deprecated.
Improved the efficiency of plugin_bbcode
Added more bat and shell files to make it easier for you to get things done.
2017-01-10 06:51:28 +00:00
Azareal 7833ad72fc [url] tags now use a custom parser.
Added more images and updated others.
The [code] tag is now enabled by default.
Fixed some visual flaws in the profiles.
Profile comments are no longer overriden by Tempra Conflux's post layout CSS.
A lock emoji is now used instead of [Status|closed] blocks.
Moved more inline CSS into the stylesheets.
Usernames now link to the profiles in the Tempra Conflux, Cosmo and Cosmo Conflux themes.
2017-01-08 16:02:19 +00:00
Azareal bbbd0c381f Added the Cosmo and Cosmo Conflux themes. Freshly ported over from one of my other projects.
The porting is still underway, part of it relies on functionality which hasn't be implemented in Gosora yet like sidebars and alerts.

Restructured the BBCode parser plugin.
Added the [code] tag to the BBCode parser. Disabled by default for now.
Added a benchmark for comparing performance between when [code] is enabled and when it isn't.
Tweaked the templates to make them more flexible, thus allowing a wider variety of themes.
Images of the themes can now be found in the Theme Manager.
There's an emoji on each theme row to show which themes are mobile friendly and which aren't.
Fixed editing and deleting posts on Tempra Conflux.
Moved a large portion of the inline CSS in the topic_alt template into the stylesheets.
2017-01-07 06:31:04 +00:00