Commit Graph

157 Commits

Author SHA1 Message Date
Gergely Polonkai 2136546390 Add a __repr__ method to the Profile method 2018-07-09 10:12:14 +02:00
Gergely Polonkai acb7566d1b [Code Cleanup] Remove the unused wraps import from calsocial.__init__ 2018-07-09 10:12:14 +02:00
Gergely Polonkai 295e19198e [Bugfix] Fix the default timezone setting 2018-07-09 10:12:14 +02:00
Gergely Polonkai d14d32767c Make PyLint happy with the models code 2018-07-09 08:15:40 +02:00
Gergely Polonkai 531faa1ce7 Add PyLint as a development dependency
Use `pylint calsocial` to run the static analysis.
2018-07-09 08:15:40 +02:00
Gergely Polonkai 5283599da2 Create the Profile model
It is capable of holding both local and remote profiles
2018-07-09 08:15:40 +02:00
Gergely Polonkai 12eb91d012 Log an audit message when a user logs out 2018-07-08 23:18:16 +02:00
Gergely Polonkai 23d0cd4b55 Log an audit message when a user successfully logs in 2018-07-08 23:18:16 +02:00
Gergely Polonkai aede5873d2 Add our own login form
We gain multiple things with this, but the main point is to do audit logging in case a valid user
enters an invalid password.
2018-07-08 23:14:39 +02:00
Gergely Polonkai 2b8e976543 AuditLog model 2018-07-08 23:00:58 +02:00
Gergely Polonkai f392505441 [Bugfix] Fix for the anonymous user’s timezone
It returned `None` instead of the application default.
2018-07-08 23:00:58 +02:00
Gergely Polonkai 7a39fca449 Add the force_locale utility function
It will be needed when sending emails and generating log messages.
2018-07-08 22:56:10 +02:00
Gergely Polonkai c770e6cfa6 Create our own anonymous user class
This is required so the anonymous user also has a time zone (which is required to render public events.)
2018-07-08 22:36:47 +02:00
Gergely Polonkai 943021e152 Add the timezone property to app
It will make it easier to get a default time zone.
2018-07-08 22:32:41 +02:00
Gergely Polonkai ba7c766316 Allow displaying event details 2018-07-03 14:22:03 +02:00
Gergely Polonkai bba44a3c7f Add user settings with time zones 2018-07-03 13:15:17 +02:00
Gergely Polonkai d07e34a182 Display event timestamps in the current user’s time zone 2018-07-03 12:11:38 +02:00
Gergely Polonkai 8a7772917c Add the User.timezone property
It either queries the user’s `timezone` setting, uses the app’s default time zone (stored in the
`DEFAULT_TIMEZONE` configuration key), or uses UTC as a final fallback.
2018-07-03 12:11:38 +02:00
Gergely Polonkai 60aab91c08 User settings 2018-07-03 12:09:44 +02:00
Gergely Polonkai 3cf2c15d3d [Refactor] Refactor Event.__as_tz() so it accepts a timezone
Until now it could only convert to the event’s timezone
2018-07-03 12:09:44 +02:00
Gergely Polonkai 76bcd21e0a [Refactor] Make the app routes static methods
They don’t use self, so PyLint complains.
2018-07-03 10:07:48 +02:00
Gergely Polonkai 2f66fdb83e [Docs] Add/update docstrings and license text in every file 2018-07-03 09:52:25 +02:00
Gergely Polonkai a5bf841898 [Code Cleanup] Fix a broad except call
It is enough to catch `UnknownTimeZoneError` here.
2018-07-03 09:52:25 +02:00
Gergely Polonkai 6e0d50552d [Code Cleanup] Remove an unused import 2018-07-03 09:52:19 +02:00
Gergely Polonkai 5300e4978e [Code Cleanup] Wrap some long lines 2018-07-03 09:52:15 +02:00
Gergely Polonkai 5f5ccaa1ea [Code Cleanup] Update some variable names to conform with PEP8 2018-07-03 09:51:31 +02:00
Gergely Polonkai 9dd2a1120f [Refactor] Change GregorianCalendar.day_events() to a static method
It takes a date as its parameter, and doesn’t use the class’ timestamp, so there’s no point making
it an instance method.
2018-07-03 09:51:30 +02:00
Gergely Polonkai 894024aa88 [Bugfix] Fix a method call in TimezoneField
It wasn’t a method call, but it should have been.
2018-07-03 09:28:06 +02:00
Gergely Polonkai 8a46f3c66a Add proper time zone support
Until now event timestamps were saved in the server’s time zone.  Now they are saved in UTC,
considering the time zone set by the creator of the event.
2018-07-02 17:32:06 +02:00
Gergely Polonkai 26c31bcc04 [Bugfix] Fix the ordering of events
They were in SQL order.  Now they are ordered by start time.
2018-07-02 17:27:42 +02:00
Gergely Polonkai 32c84725a9 [Bugfix] Fix day-event fetching
It returned today’s events regardless of the day.
2018-07-02 16:52:37 +02:00
Gergely Polonkai df2af81083 [Bugfix] One more fix for the babalex transition 2018-07-02 14:33:47 +02:00
Gergely Polonkai 4c03829264 Add the previous/next year/month links to the month view 2018-07-02 14:07:38 +02:00
Gergely Polonkai f41cf43f80 [Bugfix] Fix for "Move from Flask-Babel to Flask-BabelEx"
I forgot to fix this in calendar_system.gregorian…
2018-07-02 13:34:47 +02:00
Gergely Polonkai 7cb46c476b [Bugfix] Move from Flask-Babel to Flask-BabelEx
It is used internally by Flask-Security anyway, so it’s one less package to install.  Also, using
Flask-Babel causes trouble with Flask-Security…
2018-07-02 13:27:26 +02:00
Gergely Polonkai 3a1cdf8f6a [Refactor] Move app-level views into the CalendarSocialApp class 2018-07-02 10:54:02 +02:00
Gergely Polonkai 723cabbe72 [Refactor] Move the application running code from __init__ to __main__ 2018-07-02 10:47:34 +02:00
Gergely Polonkai 7846d9017d [Refactor] Rename the app module to calsocial
Just for clarity
2018-07-02 10:41:32 +02:00
Gergely Polonkai 6b3d36ff21 Add an app icon
It doesn’t cover all use cases (see [this article](https://css-tricks.com/favicon-quiz/), but it’s
a good start.
2018-07-01 07:24:44 +02:00
Gergely Polonkai 4668089901 Add event creation 2018-06-30 06:44:45 +02:00
Gergely Polonkai a25e869eca Load events for the month view 2018-06-30 06:02:46 +02:00
Gergely Polonkai bac17faed2 Create the Event model 2018-06-30 06:02:46 +02:00
Gergely Polonkai 6c4eb97c01 Create a basic month view 2018-06-30 06:02:46 +02:00
Gergely Polonkai 448ae1bce0 Make the web app select the language based on browser values
Language also can be selected using the `?l=langcode` query string.
2018-06-29 14:56:57 +02:00
Gergely Polonkai bc47310cfb Registration 2018-06-29 14:27:50 +02:00
Gergely Polonkai 57bc0b2a77 [Bugfix] Don’t display the “Logged in as” text if no one is logged in 2018-06-29 13:59:58 +02:00
Gergely Polonkai 495df6d709 Update User and Role so they have a proper __repr__ method 2018-06-29 13:25:18 +02:00
Gergely Polonkai e7f891d648 Add Flask-Babel to Pipfile 2018-06-29 13:07:44 +02:00
Gergely Polonkai b68788f65c Allow users to login 2018-06-29 10:40:55 +02:00
Gergely Polonkai e5e93c60b3 Initialise Babel on application startup 2018-06-29 10:39:57 +02:00