Commit Graph

2081 Commits

Author SHA1 Message Date
Toby Zerner
c3dfa3560a Allow extensions to add default model attributes
Extensions can add default column values in their migrations, but Eloquent doesn't know about this when it first saves a model to the database.

This is useful in flarum-ext-approval where the default value for is_approved on the posts table is true.
2016-05-28 09:37:43 +09:30
Toby Zerner
40a78d302e Fix permission logic priorities
This helps to fix a bug in flarum-ext-tags where a user could not rename or edit the tags of their own discussion if it was in a restricted tag. This was due to the order of GetPermission event listeners – the logic that determines that a user *can't* perform an action because of a restrictive tag was running before (and thus instead of) the logic that determines that a user *can* edit their own stuff.

The solution is to change the "catch-all" methods on Policies to "after" instead of "before" – that is, they will run only if the per-ability methods return null.

We also simplify the GetPermission event by passing the model as a sole "argument", as I can't imagine any cases where we'll need more than one argument.
2016-05-28 09:35:08 +09:30
Toby Zerner
7c0a72047a Make sure deprecated ConfigureClientView event still works 2016-05-27 14:57:27 +09:30
Toby Zerner
15adfc528f Fix installer/updater 2016-05-27 14:53:22 +09:30
Toby Zerner
be08c32c96 Simplify deleted post toggle CSS
(The animation was buggy anyway)
2016-05-27 13:56:56 +09:30
Toby Zerner
a9199ad9d9 Only check for reply permission for actual replies. fixes #917 2016-05-27 13:56:04 +09:30
Toby Zerner
fd44db407c Fix notifications dropdown not showing 2016-05-27 13:53:50 +09:30
Toby Zerner
240aa9e83b Improve permissions page
- Introduce the concept of "required permissions" - basically a permission dependency tree. In order for a group to be granted one permission, they must also have another.
- Improve redraw performance by not building dropdown menu contents until dropdown is opened

ref #904
2016-05-27 12:42:19 +09:30
Toby Zerner
1177880483 Give PostEdited default cursor; make info slightly more compact 2016-05-27 12:39:15 +09:30
Toby Zerner
607b3a66ae Fix PostEdited tooltip not updating 2016-05-27 12:38:28 +09:30
Toby Zerner
96eda5cfeb Fix detection of whether or not an asset file is "empty"
We can't rely on files/strings for this, since the Locale JsCompiler doesn't use either, but still has content.
2016-05-27 12:20:14 +09:30
Franz Liedke
0b0c1055d6
Make StyleCI happy and fix some docblocks 2016-05-27 09:07:49 +09:00
Davis
2b9ec71a81 Trim spaces in getPlainContent, prevent images from loading
fixes #834 closes #963
2016-05-27 07:34:57 +09:30
Toby Zerner
6aa017659f Recompile dist JS 2016-05-27 07:32:36 +09:30
Davis
f0f668fb93 Fix Permission Name (#965) 2016-05-26 23:54:25 +09:00
Toby Zerner
b322cf669a Bring post controls dropdown in front of the composer again
The underlying problem is fixed in flarum-ext-mentions.
2016-05-26 22:25:39 +09:30
Toby Zerner
8e99059f62 Don't write/serve empty asset files
The new locale-specific CSS file doesn't have any content by default, so it's a waste to write it and serve it to the user.
2016-05-26 22:24:56 +09:30
Toby Zerner
1b7a0ecb33 Rename Server register API to extend
More consistent with how extensions work
2016-05-26 19:12:32 +09:30
Toby Zerner
9bfb797fdc Refactor the web app bootstrapping code
- All custom JS variables are now preloaded into the `app.data` object, rather than directly on the `app` object. This means that admin settings are available in `app.data.settings` rather than `app.settings`, etc.
- Cleaner route handler generation
- Renamed ConfigureClientView to ConfigureWebApp, though the former still exists and is deprecated
- Partial fix for #881 (strips ?nojs=1 from URL if possible, so that refreshing will attempt to load JS version again)
2016-05-26 19:04:24 +09:30
Franz Liedke
2525e3e7ad
Recompile dist JS 2016-05-23 22:54:48 +09:00
Dominion
a14562b100 Pluralize Turkish (#967)
- Changes the pluralization category of Turkish.
- See: https://discuss.flarum.org/d/2937-pluralization-problems
2016-05-23 22:53:33 +09:00
Franz Liedke
d3606b7f7e
Update TextFormatter to next release
This fixes some minor issues with emojis working correctly in the dropdown,
but not when rendered in the live preview or from the server.
2016-05-23 22:48:59 +09:00
Dominion
ac096926af Clean up translation keys (#964)
- Corrects the suffix on a key in the Change Email modal.
- Extracts the title of the Edit User modal.
2016-05-21 22:03:57 +09:30
Davis
909f52522b Show post IP address in meta dropdown. closes #956 closes #657 2016-05-21 22:02:42 +09:30
Toby Zerner
38c15c5a08 Correct order of compiled JavaScript modules 2016-05-21 20:32:06 +09:30
Toby Zerner
1f5764e5e3 Add API to allow skeleton to customise the Application instance 2016-05-21 20:31:42 +09:30
Toby Zerner
28f72d5648 Fix crash on reset password page 2016-05-21 20:29:38 +09:30
Toby Zerner
9f69b7b846 Fix wonky avatar display when expanding a deleted post 2016-05-21 20:29:04 +09:30
Toby Zerner
c05f8b732d Move details from post edited indicator back into a tooltip
Showing the username and time of edit is TMI (too much information). This commit changes the visible text to "Edited", and shows the full edit information in a tooltip.

ref #446
2016-05-21 20:27:56 +09:30
Toby Zerner
58c9a6164a Automatically support basic HTML tags in translations
This allows front-end translations to use basic (attributeless) HTML tags freely, without the need for the translator call to supply a matching vdom element. Translations can thus make use of styling (<em>, <code>, etc.) as they see fit. The translator call can still optionally supply a vdom element to substitute in more complex tags where necessary (e.g. hyperlinks).

/cc @dcsjapan
2016-05-21 20:25:32 +09:30
Franz Liedke
60e50713e7
Customize behavior for various navigation callbacks, pass KeyboardEvent instance to callback
Refs #264.
2016-05-15 23:09:59 +09:00
Franz Liedke
513c586be3
Make key callback registration more concise
Refs #264.
2016-05-15 22:58:41 +09:00
Franz Liedke
9f8c2ed458
First shot at extracting keyboard navigation code to separate util class
Refs #264.
2016-05-15 22:34:16 +09:00
Franz Liedke
0cc75be55e
Add a heading to the admin mail page 2016-05-15 20:46:58 +09:00
Franz Liedke
fa7871cc16
Admin menu: Move email tab closer to the top 2016-05-15 20:31:23 +09:00
Franz Liedke
a884a3592b
Tweak structure of mail settings page
Refs #258 and #933.
2016-05-15 20:28:05 +09:00
Franz Liedke
9637d27b56
Fix translation keys 2016-05-15 12:08:11 +09:00
Franz Liedke
3866e518fa
Fix post controls not being clickable in some circumstances
Closes #908.
2016-05-14 18:07:43 +09:00
Franz Liedke
9d2d302f2d
Cleanup code (unused import, variable name) 2016-05-14 17:19:01 +09:00
David Sevilla Martín
99dbea4524 Replace pencil & tooltip w/ just text; Fixes #446 (#954) 2016-05-14 17:06:02 +09:00
Niels Tholenaar
77837ef7d1 Fixed LESS compile error (#958) 2016-05-13 23:15:33 +09:00
Franz Liedke
3f9fe7d33e
Fix font-awesome LESS source not being found in some cases 2016-05-13 23:04:14 +09:00
Franz Liedke
dd0dc44dd8
Merge branch 'pr/933'
Closes #258.
2016-05-13 00:25:27 +09:00
Franz Liedke
18ee8578e8
Remove unused import 2016-05-13 00:25:11 +09:00
Franz Liedke
7256122a43
Compile dist JS for 3c6429a 2016-05-12 23:58:09 +09:00
Franz Liedke
696f562b0e
Merge branch 'pr/936'
Closes #814.
2016-05-12 23:56:47 +09:00
Franz Liedke
aca497e7be
Final tweaks to inline code styling
Refs #814.
2016-05-12 23:56:12 +09:00
Maxim Chistyakov
bc34b858a2 SQL Performance tuning (#952)
MySQL has problems with executing this subquery efficiently.
2016-05-12 23:07:41 +09:00
Franz Liedke
251862222c
Add a comment 2016-05-12 23:03:37 +09:00
Lyntor Paul Figueroa
006ea02227 Fix avatar upload on Windows servers - Issue #893 (#927)
* Fix avatar upload on Windows servers - Issue #893

* Remove @ to show errors if any
2016-05-12 23:01:51 +09:00