Commit Graph

359 Commits

Author SHA1 Message Date
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
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
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
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
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
Djamil Legato
e15d188270 Better error handling for 500 Internal Server Errors, when Fetch fails. 2016-08-15 13:16:31 -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
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
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
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
0633bbd2b6 Redraw Dashboard Charts when collapsing/expanding the sidebar 2016-07-15 16:02:17 -07:00
Flavio Copes
5852eb59da Check for null payload before going on, refs #526 2016-07-15 17:09:15 +02:00
Djamil Legato
105d48d5c2 Definitive fix for multi form submission in Microsoft Edge causing the Save to not work (fixes #694) 2016-07-14 23:10:50 -07:00
Djamil Legato
0fac7a35b2 Fixed issue with forms causing creation of new pages not to work (#698, getgrav/grav#934) 2016-07-14 21:59:51 -07:00
Djamil Legato
4cc60c2fe4 Fixed issue with Save in Microsoft Edge (fixes #694) 2016-07-13 14:08:27 -07:00
Djamil Legato
74fa8f93db Fixed inconsistency in the way selectized fields would be rendered (fixes #692) 2016-07-12 14:58:41 -07:00
Djamil Legato
201640545e Fixed Fullscreen tooltip in Editor displaying off screen (when in fullscreen mode) (fixes #677) 2016-07-11 17:04:46 -07:00
Djamil Legato
93457434be Added new Enabled sorting option for Plugins list view 2016-07-11 16:19:06 -07:00
Djamil Legato
cf3114d730 Added a filter field in Plugins and Themes list views, to allow for quick search of a particular resource 2016-07-11 16:04:22 -07:00
Djamil Legato
39cffadbf5 Prevent external links (like the Preview button) to trigger the "Changes Detected" notice (fixes #689) 2016-07-08 21:42:19 -07:00
Djamil Legato
d2acf2dfe2 Implemented Sorting for Themes and Plugins views (fixes #583) 2016-06-27 18:54:02 -07:00
Flavio Copes
8a13d06401 Fix #672 confirm deletion of multiple images 2016-06-23 18:50:26 +02:00
Flavio Copes
88f3b8192f Fix #658 clearing all cache 2016-06-20 18:50:53 +02:00
Flavio Copes
99bc525095 Translate some missing string, fix #629 2016-06-10 15:10:24 +02:00
Djamil Legato
bc7db5ce35 Fixed issue with checkbox in toggleables getting submitted with the form even when disabled (fixes #646) 2016-06-07 15:01:16 -07:00
Djamil Legato
719ce4331c Fixed regression in collections lists where items could get wiped out entirely after adding/removing items and saving 2016-06-02 10:13:58 -07:00
Djamil Legato
d3b33fb648 Properly handle Collections that specify a custom key, rather than falling back to indexed list (#632) 2016-06-01 16:30:23 -07:00
Djamil Legato
ae087668ba Properly handle Collections that specify a custom key, rather than falling back to indexed list (fixes #632) 2016-06-01 15:46:27 -07:00
Djamil Legato
38cff92ae9 Updated JS dependencies 2016-05-31 11:55:39 -07:00
Djamil Legato
f279a662db Enabling / Disabling a Plugin doesn't trigger the expand / collapse details anymore (fixes #614) 2016-05-26 16:37:45 -07: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
Flavio Copes
39b4a4e67b Disable double click on most actions on the page view 2016-05-24 19:25:06 +02:00
Flavio Copes
b2c4d3d385 Disable save button once clicked
Done via CSS `pointer-events`, now supported by all major browsers, to
avoid messing with the form's js processing
2016-05-24 18:52:05 +02:00