Commit Graph

257 Commits

Author SHA1 Message Date
Flavio Copes
fd8c7889d1 Fix #1034 redirect of page creation procedure when system.home.hide_in_urls is enabled 2016-09-13 13:45:09 +02:00
Flavio Copes
a86623f432 Fix issue with checking the package dependencies when more than one package is being inspected 2016-09-08 19:37:50 +02:00
Andy Miller
8a02b72307 Fallback for missing tmp:// stream and unified method 2016-09-07 22:00:57 -06:00
Flavio Copes
11666e3329 pagemediaselect is now an extend of filepicker. Add default for folder field. Fill changelog. 2016-09-05 15:12:27 +02:00
Flavio Copes
8a39b36603 Filepicker form field (#750)
# What this PR introduces
This PR introduces a `filepicker` field which is a replacement for the `pagemediaselect` field. 

This field loads the files list via AJAX each time it's triggered. This means you can now upload a file via FTP or via Admin and the new file is immediately available to be selected.

Previously, `pagemediaselect` required a page reload to see the newly added files.
--

### Options

#### `accept`

`accept` allows file extensions. For example, to only allow `yaml` and `json` files:

```yaml
accept:
  - .yaml
  - .json
```

By default, any file is listed.

#### `folder`
```yaml
folder: 'user/plugins/testing`
```

folder has been enhanced to allow `self@` as well as `page@:` and `theme@:` prefixes.
Example of usage, assuming we have a blog item at the route `/blog/ajax-upload` (physical location being `user/pages/02.blog/ajax-upload`), with the `page@:` prefix the folder would be:

```yaml
folder: 'page@:/blog/ajax-upload'
```

#### `preview_images`
```yaml
preview_images: true
```

If enabled, shows a preview for the images file types

> ### NOTE: `self@` is not allowed outside of the Pages scope, an error will be thrown. 


## Example usage


```
            header.a_file:
              type: filepicker
              folder: 'user/plugins/admin'
              label: Select a file
```
2016-09-02 18:29:47 +02:00
Djamil Legato
6b34336599 [WIP] Ajax Files Upload (#748)
* Reworked the `file` field. All files get uploaded via Ajax and are stored upon Save

This improves the Save task tremendously as now there is no longer the need of waiting for the files to finish uploading. Fully backward compatible, `file` field now includes also a `limit` and `filesize` option in the blueprints. The former determines how many files are allowed to be uploaded when in combination with `multiple: true` (default: 10), the latter determines the file size limit (in MB) allowed for each file (default: 5MB)

* Added support for `accept: [‘*’]` to allow any file type

* Minor tweaks in the comments and messages

* Delete any orphan file when discarding the uploaded files session

* Minor optimization

* Fixed issue with `_json` elements where nested fields merging would get stored in an unexpected way

* Potential fix for wrong order of value in Datetime

* Fixed nested fields for files

* Fixed tmp streams

* Minor cleanup

* Update JSON data when removing a file. Implemented task to remove files that haven’t been saved yet, from the flash object session

* Ensure temporary files are deleted when removing un-saved files from the flash object session

* Fixed wrong reference of HTML file field when clicking on the drop zone area to pick a file

* Added JSON template for pages

* fix a CSS issue in page order

* More CSS fixes

* Trigger file field mutation when adding or removing a file

* Recompiled JS

* Removed twig templates that are no longer needed

* Fixed issue with nested header fields in a page, not properly merging data

* [internal] Fixed issue with collections not capable of handling both param and dot notations at the same time

* Reorganized FileField structure to be more consistent with the other fields

* Added support for dynamically created file fields (ie, autoinitialization on new lists items)

* Added translationable strings for file uploads errors

* Added translasions for all Dropzone available strings

* Changed default values
2016-08-29 11:12:09 -07:00
Andy Miller
2dc2feca32 Fixed broken page types filtering 2016-08-26 13:45:22 -06:00
Flavio Copes
988f4a0389 [WIP] Notifications (#599)
Adds a new notifications feature to the Admin plugin. It will now lookup notifications which are set up on getgrav.org and will inform users, and also alert for new updates and provide awareness on various topics.

Also fixes issue with Array field in `value_only` mode, improperly displaying the key when novalue was set, and fixes issue with drag handlers in Array not showing/hiding properly (#950)

Updated FontAwesome to 4.6.3
2016-08-11 19:17:02 +02:00
Flavio Copes
4a50d2f0e2 Only avoid overwriting files (introduced in b159581156) if avoid_overwriting is set on the field 2016-08-02 17:48:07 +02:00
Flavio Copes
b159581156 Avoid overwriting a file when uploaded with the same filename through the Admin blueprint file type 2016-08-02 16:22:20 +02:00
Andy Miller
65cfce624e Get media 'fresh' every time 2016-07-18 15:42:38 -06:00
Andy Miller
1382223fe6 cache/compiled upload fix for https://github.com/getgrav/grav/issues/938 2016-07-16 10:52:06 -06:00
Flavio Copes
1c19190929 Lint 2016-07-07 18:55:52 +02:00
Flavio Copes
a4e3f262e9 Assign the correct ordering when saving a page that didn't have ordering set before 2016-06-21 16:26:44 +02:00
Flavio Copes
d76e75cb04 Handle case where $input['order'] is set but empty.
Re #628 fix issue when saving a modular child folder as 05.something
and being reset to 01.something upon save
2016-06-21 15:38:34 +02:00
Flavio Copes
3cac054de6 Append progressive number to the copied page title. Fix #394 2016-06-15 13:55:16 +02:00
Flavio Copes
1ad76c04f9 Re #394 update slug, route and raw route with appended number when doing a copy of the page (#537)
Does not change the page title, just the page route property if set in the header, to avoid two pages with the same slug / route / raw route. Handles ordering too, and pages with custom slug. Independently updates the slug and the folder name.
2016-06-07 23:10:34 +02:00
Andy Miller
7b13526e1e Another missed reference 2016-06-02 15:14:14 -06:00
Andy Miller
77e2e65c60 Don't show email address when sending forgot pw instructions #571 2016-06-02 12:38:49 -06:00
Flavio Copes
9c35c8f5a9 Fix #635 Activating a theme throw "Data type 'system' doesn't exist!" error 2016-06-02 11:55:59 +02:00
Andy Miller
8cd0279b01 Feature/upload improvements (#617)
* various improvements.. needs cleanup

* more progress - supports deeply nested + pages

* Getting close now!

* more progress!

* some cleanup

* use data[_json] to store page-based upload

* Smarter logic to get nested form fields

* some refactoring/cleanup

* Fixed issue with removing multiple files in pages

* Refactor and support `destination: page@:/images` and `destination: self@` syntax for file fields

* Prettifying the upload field

* Handling Files API to better represent the selected files in the input field

* Better plurarl string

* Fixed harcoded height for input field

* revamped CSS!!!

* `fancy: false` turns off fancy styling

* Create folder if not exists

* Add support for @theme/theme@ destination

* Fixed create directory functionality to take into account resolved paths

* Don't allow @self on page to be uploaded to if not created

* added field languages

* css tweaks

* language integration
2016-05-26 14:49:45 -06:00
Djamil Legato
bb362cd1e8 Minor cleanup to controller 2016-05-17 18:24:56 -07:00
Djamil Legato
809600b3c5 File fix, ensure FILES object is available before continuing 2016-05-17 16:59:16 -07:00
Andy Miller
48f311b458 Fix for #595 2016-05-17 16:52:22 -06:00
Andy Miller
2d9d71c444 Feature/file upload refactor (#598)
* refactor

* Added support for multiple files

* fixed appearance a bit

* Always store files as full path => obj data

* added some error handling

* Do not go nested when storing file

* Refactored to not need blueprint set in blueprint
2016-05-17 16:46:00 -06:00
Andy Miller
b0ce609c4c escape and lowercase username in all cases #577 2016-05-09 19:29:27 -06:00
Andy Miller
3fd928ac18 Fix forgot/reset password process of sending escaped HTML emails 2016-05-06 13:55:36 -06:00
Andy Miller
50c4b5dc61 fix for username not finding anyone 2016-05-06 13:34:54 -06:00
Andy Miller
c99bedf111 Better error messages for exceptions thrown in obj->validate() #594 2016-05-05 10:35:40 -06:00
Flavio Copes
4afa565382 Fix #563 Invalid argument supplied for foreach 2016-05-05 16:28:56 +02:00
Andy Miller
98a19f01e4 Fixed login/logout message translations. 2016-05-03 13:36:06 -06:00
Flavio Copes
cf72ea93fc Fix passing the correct version property to the json_response 2016-04-29 16:23:45 +02:00
Flavio Copes
ad5aa7588d Fix version in Grav update message 2016-04-29 15:20:45 +02:00
Flavio Copes
45f7665d2d Change user view name 2016-04-27 22:44:42 +02:00
Flavio Copes
33e363affa Merge pull request #524 from getgrav/feature/show-account-page-for-login-acl
Show account page for users with admin.login ACL
2016-04-27 11:48:16 -06:00
Flavio Copes
2cc07fe883 Remove leftover return 2016-04-21 09:25:45 +02:00
Djamil Legato
69459ec611 Fixed toggler for stable/testing channel 2016-04-20 15:59:46 -07:00
Flavio Copes
85922f93ac Handle gpm events in Admin (#508)
* Fix removing packages

* npm install "babel-preset-es2015": "^6.6.0"

* Run gulp

* Handle messages in packages install/remove/update procedures
2016-04-20 18:55:58 +02:00
Andy Miller
16d2f0a752 Added new Toggle and Task for switching gpm release 2016-04-15 16:18:02 -06:00
Flavio Copes
927a0f4ad1 Revert "Fix for modular preview not functioning as expected #254"
This reverts commit a2275b8b73.
2016-04-12 14:14:52 +02:00
Flavio Copes
9da5f5595a Return 401 unauthorized and exit if trying to access a file outside the backups folder 2016-04-08 10:49:59 +02:00
Flavio Copes
f81f21e0ae Use scope also in admin registration / login form
BC issue: if using Admin `develop/ 1.1` with Form != latest develop,
the Admin-side registration form (the one that pops up when Admin is
installed but no accounts are found) will not work. Not something users
would stumble upon: only appears when Admin  1.1 it'll be possible to
use config-title@: theme.antimatter.some_config to set the title
dynamically based on a theme config option is installed but it's not
yet configured, and Form is not up to date. When 1.1 will be released,
also the Form plugin will have a newer update that will be installed
automatically.
2016-04-07 13:09:26 +02:00
Flavio Copes
3677c498f9 Fix redirect after switching language in a page exiting context 2016-04-04 11:13:57 +02:00
Flavio Copes
6d9f9a0886 Merge branch 'develop' into feature/admin-gpm-dependencies 2016-03-26 18:00:19 +01:00
Flavio Copes
57a7a60efd Avoid returning an error in Admin itself, just in the JSON response
This prevents the error to appear on a subsequent admin page reload
2016-03-19 15:41:46 +01:00
Flavio Copes
1044ffebf1 Show a more meaningful error message if post_max_size is too low to handle a media upload 2016-03-19 11:54:19 +01:00
Flavio Copes
2c00618b87 Handle error when trying to remove a package that other packages depend on. 2016-03-17 15:57:10 +01:00
Flavio Copes
fd6f1691af Merge branch 'develop' into feature/admin-gpm-dependencies 2016-03-16 11:46:51 +01:00
Matias Griese
de82a05194 Issue when saving tab-based plugin configuration (#452) 2016-03-16 11:09:48 +02:00
Flavio Copes
6b22932d43 Call GPM::checkPackagesCanBeInstalled() when trying to install/update a package 2016-03-15 19:36:00 +01:00