Commit Graph

914 Commits

Author SHA1 Message Date
Djamil Legato
02eeca78e8 Support for Premium Resources (#809)
* Initial premium preparation for licenses and gpm handling

* Premium styling

* Removed unused import

* Synced CSS

* Updated selectize
2016-10-13 10:13:18 -07:00
Flavio Copes
04f17a02b3 Fix #821 issue in saving a page to a new language when the filename does not contain the filename yet.
Also extract determineFilenameIncludingLanguage() method  and add
corresponding test.
2016-10-13 16:44:11 +02:00
Flavio Copes
c284c8a26c Allow controller to be initialized in test without having to instantiate Grav 2016-10-13 16:44:11 +02:00
Flavio Copes
fd426b4d49 Show more helpful error message if destination is not specified in a file field 2016-10-10 13:07:34 +02:00
Flavio Copes
ef063f0e7d Show helpful error message if no tmp folder is found #811 2016-10-10 13:07:14 +02:00
Flavio Copes
0b42f8e34c Add an onAdminData event to allow plugins to add additional blueprints data 2016-10-04 16:51:41 +02:00
Djamil Legato
c4ed5aff44 Allow filepicker field to peak at the pending uploaded files and optimistically select them (fixes #792) 2016-10-02 14:00:53 -07:00
Djamil Legato
a011368e40 Fixed issue with file field in collections that caused unexpected duplication of items (fixes #775) 2016-09-30 21:55:49 -07:00
Andy Miller
1ea0a54903 Added new onAdminCreatePageFrontmatter event - https://github.com/getgrav/grav-plugin-admin/pull/781 2016-09-30 08:58:26 -06:00
Andy Miller
a77ac2f5be Added new onAdminTaskExecute() event to better support 3rd party plugin tasks 2016-09-27 18:30:55 -06:00
Matias Griese
8e5720f7b9 Improve multi-site support 2016-09-27 18:21:11 +03:00
Djamil Legato
aba43374de Clean up POST keys containing square brackets, allows for regex ranges in routes (fixes #776) 2016-09-15 12:57:28 -07:00
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
5176e5b3ff Use cache/tmp fallback rather than just cache/ 2016-09-08 08:56:48 -06: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
bccaa47544 Better date format guesser 2016-08-26 17:28:55 -06:00
Andy Miller
2dc2feca32 Fixed broken page types filtering 2016-08-26 13:45:22 -06:00
Djamil Legato
86c9d33b64 Fixed tmp find resource 2016-08-25 12:44:33 -07:00
Djamil Legato
19799ce2db Updated Selfupgrade and Install tasks to use tmp:// for storing the downloaded packages 2016-08-23 16:35:41 -07:00
Andy Miller
18c3b3e39f Potential Curl fix for invalid cert errors with News Feeds 2016-08-15 10:45:58 -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
Djamil Legato
e234acb581 Fixed issue in selfupgrade where the package would get downloaded in the wrong destination 2016-07-19 11:23:59 -07: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
Andy Miller
7295e2e3ca Fixed up the languages 2016-07-13 17:08:41 -06:00
Flavio Copes
1c19190929 Lint 2016-07-07 18:55:52 +02:00
Flavio Copes
e8ca08ed8d Fix method name 2016-07-07 18:53:37 +02:00
Flavio Copes
64a88c916c Feature: Ability to Login with Email
Thanks to @gsumpster for https://github.com/getgrav/grav-plugin-admin/pull/685

* implemented email-login, close #674
* changed placeholder text
* Fix Utils namespace thing
* Drop use
* Cleanup styling
2016-07-07 18:47:48 +02:00
Flavio Copes
35013859cf Remove unused method 2016-07-04 18:02:24 +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
Flavio Copes
c59a8c355f Remove special case of media now that we have types nested under media.types 2016-06-03 10:23:50 +02:00
Andy Miller
1bb97fdea9 Simply fall back to en if no admin language set. - #641 2016-06-02 17:21:34 -06: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
45e9e77179 Handle special case of media configuration (#638)
* Handle special case of media configuration

Since it's a list of dynamically generated entries, without parent, we
cannot merge in the post data with the defaults, or the defaults are
always saved, and we cannot remove existing fields

* Correctly handle reading and saving

* Improve implementation
2016-06-02 12:21:35 -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
Flavio Copes
e4f128438f Don't try to uninstall admin/form/login/email plugins 2016-05-27 14:41:33 +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