Commit Graph

140 Commits

Author SHA1 Message Date
Toby Zerner
f03f046efe Add event to modify user search 2015-05-03 12:07:15 +09:30
Toby Zerner
d966c9831a Add event for registering user search gambits 2015-05-03 12:06:01 +09:30
Toby Zerner
b38878da80 Add delete avatar action 2015-05-03 12:05:18 +09:30
Toby Zerner
29be20c91a Fix incorrect function call 2015-05-03 12:04:57 +09:30
Toby Zerner
8f29679b46 Convert the rest of the API to new action architecture
Also make some tweaks:
- Merge SerializeAction::$include and
SerializeAction::$includeAvailable into a keyed boolean array
- Set defaults for SerializeAction::$limit and $limitMax
- Rename SerializeAction::$sortAvailable to $sortFields
2015-05-03 12:04:43 +09:30
Toby Zerner
ecdb2becd4 Assign user input to data property on EditDiscussionCommand 2015-05-02 09:01:27 +09:30
Toby Zerner
f67f34e287 Add removed posts as an API attribute 2015-05-02 09:00:22 +09:30
Toby Zerner
8ee9480205 Update discussion/post sort semantics inline with new API actions
Instead of $sort and $order being separate, they are now a single
array, allowing multiple sort criteria: `[‘foo’ => ‘asc', ‘bar’ =>
‘desc’]`
2015-05-02 09:00:07 +09:30
Toby Zerner
22ff8a203d Make sure serializers work with relations implemented with magic (via __call) 2015-05-02 08:58:28 +09:30
Toby Zerner
db31d9f772 Making a note that we should not use Actor as a singleton 2015-05-02 08:57:14 +09:30
Toby Zerner
a426fa6560 Update API action architecture
- An API action handles a Flarum\Api\Request, which is a simple object
containing an array of params, the actor, and optionally an HTTP
request object
- Most API actions use SerializeAction as a base, which parses request
input according to the JSON-API spec (creates a JsonApiRequest object),
runs the child class method to get data, then serializes it and assigns
it to a JsonApiResponse (standard HTTP response with a
Tobscure\JsonApi\Document as content)
- The JSON-API request input parsing is subject to restrictions as
defined by public static properties on the action (i.e. extensible)
- Also the actor is given to the serializer instance now, instead of
being a static property
2015-05-02 08:56:43 +09:30
Toby Zerner
288fd694a8 Extensibility: data when starting a new discussion 2015-05-02 08:39:44 +09:30
Toby Zerner
60e69ae7b9 Add an event to register discussion gambits 2015-05-02 08:12:30 +09:30
Toby Zerner
66b374b1c1 Add API to collect posts that were removed during an action
This is useful for both the Sticky and Categories extensions, where if
you sticky a discussion and then immediately unsticky it, or if you
move it to a category and then immediately move it back, the last
“activity” post will be removed.
2015-05-02 08:12:09 +09:30
Toby Zerner
a2fd60ed0c Define assets in a more appropriate spot, make extensible 2015-05-02 08:10:06 +09:30
Toby Zerner
c3aecbceaa Extract config into database 2015-05-02 08:07:51 +09:30
Toby Zerner
ac269683ed Merge remote-tracking branch 'upstream/master' 2015-04-25 22:45:27 +09:30
Toby Zerner
52b476dc6b Return more relations when a discussion is created 2015-04-25 22:37:25 +09:30
Toby Zerner
34d150b24b Fix read discussion command action 2015-04-25 22:37:04 +09:30
Toby Zerner
0548ebd54c Allow custom relation to be specified as string 2015-04-25 22:36:34 +09:30
Toby Zerner
8fdc1ba548 Add BootForum event so extensions can add assets 2015-04-25 22:35:41 +09:30
Toby Zerner
b6613dbdc2 Recompile assets every time a file changes 2015-04-25 22:34:56 +09:30
Toby Zerner
a57e3fc028 Use Less_Parser cache feature to speed up LESS generation 2015-04-25 22:34:46 +09:30
Toby Zerner
c6079c53c9 Fix email confirmation route 2015-04-25 22:34:33 +09:30
Toby Zerner
8491c4cbf8 Rename assets directory 2015-04-25 22:34:26 +09:30
Toby Zerner
b68a4711dc Replace Ember app with Mithril app 2015-04-25 22:28:39 +09:30
Franz Liedke
a4ccc020e7 Fix class name conflict. 2015-04-15 13:44:35 +02:00
Toby Zerner
6f67b8c247 Fix attribute serialisation event mutability 2015-04-03 17:04:59 +10:30
Toby Zerner
0bcaaaa9b9 Add an event to modify search queries 2015-04-03 17:04:41 +10:30
Toby Zerner
6898e0acbb Refactor Flarum\Web and Flarum\Admin
- In order to be consistent with the Ember/LESS naming scheme, renamed
Flarum\Web to Flarum\Forum.
- Moved common classes into Flarum\Support so that Flarum\Admin doesn’t
depend on Flarum\Forum. Also moved Actor into Flarum\Support as it
doesn’t belong in the domain.
2015-03-30 16:17:04 +10:30
Toby Zerner
8e0a27de49 Oops 2015-03-30 12:56:41 +10:30
Toby Zerner
3b4beaa6ca "See" a user on the initial page load too 2015-03-30 12:55:39 +10:30
Toby Zerner
a43957e1e2 Don't allow guests into the admin area 2015-03-30 12:43:55 +10:30
Toby Zerner
7051b608a0 Update administration page title 2015-03-30 10:42:13 +10:30
Toby Zerner
3886efffef Turns out putting a . there breaks Laravel 2015-03-29 22:27:37 +10:30
Toby Zerner
40a6d77e74 Big front-end asset/filestructure refactor
- Extract shared Ember components into a “flarum-common” ember-cli
addon. This can be used by both the forum + admin Ember apps, keeping
things DRY
- Move LESS styles into their own top-level directory and do a similar
thing (extract common styles)
- Add LESS/JS compilation and versioning to PHP (AssetManager)
- Set up admin entry point

(Theoretical) upgrade instructions:
- Delete everything in [app_root]/public
- Set up tooling in forum/admin Ember apps (npm install/update, bower
install/update) and then build them (ember build)
- php artisan vendor:publish
- Upgrade flarum/flarum repo (slight change in a config file)
- If you need to trigger a LESS/JS recompile, delete the .css/.js files
in [app_root]/public/flarum. I set up LiveReload to do this for me when
I change files in less/ or ember/

Todo:
- Start writing admin app!
- Remove bootstrap/font-awesome from repo and instead depend on their
composer packages? Maybe? (Bower is not an option here)
2015-03-29 22:13:26 +10:30
Toby Zerner
950d2f0eb9 Move forum ember app into a subdir, preparing for admin app to exist alongside 2015-03-28 19:10:52 +10:30
Toby Zerner
52a7b536c4 Fix scope removal of bindings 2015-03-28 16:31:26 +10:30
Toby Zerner
bc9be30a02 More powerful/extensible notifications
- Notifications can be delivered in multiple ways (alert, email)
- Different notification types can implement interfaces to allow
themselves to be delivered in these various ways
- User preferences for each notification type/method combination are
automatically registered
2015-03-28 15:43:58 +10:30
Toby Zerner
49c3fa09e6 Change "renamed" post type to more descriptive "discussionRenamed" 2015-03-28 15:43:58 +10:30
Toby Zerner
89eca757e6 Give MappedMorphTo a more generic property name 2015-03-28 15:43:58 +10:30
Toby Zerner
afa4b98c4a Only get posts with registered types.
This is so that if an extension adds a post type, and the database gets
populated with posts of that type, but then if the extension is
disabled, we wouldn’t want those posts to display because we would have
no knowledge about how to deal with/render them.
2015-03-28 15:43:58 +10:30
Toby Zerner
38ebb15334 Track user "last seen" time and display whether they are online or not
according to their preferences
2015-03-28 15:43:58 +10:30
Toby Zerner
359f44552e Implement user preferences API
Preferences must be registered (optionally with a callback to transform
data, and a default value) on the User model.
2015-03-28 15:43:57 +10:30
Ciarán O'Mara
be067ae1b6 Fix comment count update.
Addresses the following error when using pqsql.

[PDOException]
  SQLSTATE[42703]: Undefined column: 7 ERROR:  column "comment" does not exist
  LINE 1: ...d) FROM posts WHERE user_id = users.id and type = "comment")
2015-03-28 05:38:56 +11:00
Toby Zerner
257a3fde1a Refresh avatar display after uploading 2015-03-27 11:49:26 +10:30
Franz Liedke
9621e72b9b Fix order of arguments. 2015-03-26 22:03:55 +01:00
Franz Liedke
a19f35e8c1 Construct filesystem correctly. 2015-03-26 22:03:47 +01:00
Franz Liedke
18ccec4190 Pass newly configured filesystem disk to upload handler. 2015-03-26 22:01:58 +01:00
Franz Liedke
cf8e02977f Change name of avatar field in users table. 2015-03-26 20:59:06 +01:00