Commit Graph

1240 Commits

Author SHA1 Message Date
Djamil Legato
f808e523c2 Recompiled JS 2016-10-02 23:58:27 -07:00
Djamil Legato
f4ef20de99 Tiny code enhancement 2016-10-02 14:13:12 -07: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
74b756d6a8 Dramatically improved filepicker performance. Data is only ever loaded when the dropdown is on focus, as it was supposed to be. Image preview of a selected item won't be rendered unless the field gains focus to avoid wasting resources. (fixes #788) 2016-10-01 00:09:01 -07:00
Djamil Legato
74b6b1edd8 Fixed regression when disabling the submit button upon save (#802) 2016-09-30 19:09:36 -07:00
Djamil Legato
31b22a322b Fixed issue when reading the file size setting if set to 0 (in Pagemedia and File fields) 2016-09-30 18:18:45 -07:00
Djamil Legato
0219b1c4e3 Fixed Submit buttons getting disabled in case of form invalidity disallowing to submit again (fixes #802) 2016-09-29 17:14:27 -07:00
Djamil Legato
2930625923 Fixed UI for pagemedia notes when files cannot yet be uploaded (fixes #798) 2016-09-29 08:54:17 -07:00
Djamil Legato
6914ad7999 More dynamic save task detector (internal use) 2016-09-27 14:24:17 -07:00
Djamil Legato
4cd6b52fb0 Handle errors when a resource fails to install 2016-09-24 21:22:18 -07:00
Djamil Legato
a50e269793 Better error handling for Feed when unable to connect 2016-09-18 16:03:53 -07:00
Flavio Copes
58df17dc71 Commit minified JS from previous commit 2016-09-16 18:08:57 +02:00
Flavio Copes
9ebecb7910 Fix #773 allow filepicker work inside lists, respond to mutation event 2016-09-16 15:19:54 +02: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
Djamil Legato
0512a7f4f6 Media (Page): Do not extend parent metehod for sending files since Safari and IE APIs for FormData don’t implement delete (fixes #772) 2016-09-14 18:04:29 -07:00
Djamil Legato
8e483f101b Fix for newsfeed widget URI 2016-09-14 16:34:58 -07:00
Andy Miller
1f097a7500 added update styles back 2016-09-08 08:50:25 -06:00
Andy Miller
f119da9f36 Fixed some conflicts 2016-09-08 08:48:29 -06:00
Flavio Copes
2584004787 Update template.css 2016-09-08 13:06:43 +02:00
Flavio Copes
820313161e Fix #767 Add styling for new HTML5 input field types
Fields introduced in
https://github.com/getgrav/grav-plugin-form/commit/a14e28f15105c2e5e6258
afb4fbe72b43a663ebd
2016-09-08 13:06:21 +02: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
ee8e3250f9 Fix #754 lowercase plugin name upon search 2016-09-03 11:30:29 +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
Djamil Legato
2c07a1f209 Allowing some actions to always reload the page, even when there are changes 2016-08-27 11:45:24 -07:00
Djamil Legato
50268dc78b Fixed beforeunload and preventClickAway event not prompting to offer the choice to stay on the page in case of unsaved changes 2016-08-27 11:01:23 -07:00
Andy Miller
d3efa4226a unified JSON twig templates 2016-08-26 14:32:11 -06:00
Andy Miller
f527af9edb fixed notification note button style 2016-08-26 10:33:14 -06:00
Flavio Copes
8b3f7f73ef Push admin.min.js 2016-08-26 18:20:54 +02:00
Flavio Copes
54b2d16476 Changelog, minified js 2016-08-26 18:14:15 +02:00
Flavio Copes
6c188a222c Fix notifications with html issue in feed 2016-08-26 18:13:10 +02:00
Andy Miller
c0c885b318 various notification style fixes 2016-08-26 09:32:44 -06:00
Andy Miller
cdeb11100f Added clear-tmp to clear dropdown 2016-08-25 21:40:37 -06:00
Andy Miller
4c71b38746 minor lang dropdown css fix 2016-08-25 17:32:34 -06:00
Djamil Legato
e15d188270 Better error handling for 500 Internal Server Errors, when Fetch fails. 2016-08-15 13:16:31 -07:00
Andy Miller
e88a9ea015 Fix for Firefox News Feed dashboard widget 2016-08-12 18:26:29 -06:00
Djamil Legato
b6712a057d More lists fixes 2016-08-11 11:27:00 -07:00
Djamil Legato
32c1020bf2 Cherry-picked the new lists implementation 2016-08-11 11:16:33 -07: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
c837942669 Allow translating field description fix #729 2016-08-04 16:18:10 +02:00
Djamil Legato
8d99ddaad0 It is now possible to sort via drag & drop the Array fields (fixes getgrav/grav#950) 2016-08-01 18:52:30 -07:00
Djamil Legato
cb8b7db922 Lists: mobile tweaks for the new UI 2016-08-01 17:56:19 -07:00
Djamil Legato
352d80e9a3 Lists now features a new YAML option collapsed: [true|false] (default: false) and a new UI/UX that allows for collapsing / expanding collection items, allowing to better managing long lists of items. It is advised to always put as first field the most significant one, so that when a list is collapsed it can be still easily browsed.
Reworked List UI to better handle drag & drop sort. To sort it is now required to use the left drag handle (fixes #724)
2016-08-01 17:37:31 -07:00
Djamil Legato
b23a194318 Minor typos 2016-08-01 16:43:08 -07:00
Djamil Legato
d0972b0454 Lists now features two new YAML options sortby: [field] (default: disabled) and sortby_dir: [asc|desc] (default: asc) which will display a new Sorting button in the list allowing to automatically reindex the collection based on the given sort field set. 2016-08-01 16:40:04 -07:00
Djamil Legato
1d55ffc616 Fixed Lists issue when reindexing, causing Radio fields to potentially lose their checked status 2016-08-01 16:38:03 -07:00
Djamil Legato
9182e6dbc1 Lists now features a new YAML option controls: [top|bottom|both] (default: bottom) which will display the "Add Item" button at the Top and/or Bottom position relative to the list. When the Top button is pressed, a new item will be added at the beginning of the list, when the Bottom button is pressed, a new item will be appended to the list. 2016-08-01 12:52:01 -07:00
Djamil Legato
1a55ebe110 Recompiled JS 2016-08-01 11:17:31 -07:00
Djamil Legato
153bd0c7ff Updated modules dependencies 2016-08-01 11:14:59 -07:00
Benny
93e58dd607 Hide tab when user is not authorized to access it (#712) 2016-07-20 14:52:31 +02:00