Commit Graph

599 Commits

Author SHA1 Message Date
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
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
f527af9edb fixed notification note button style 2016-08-26 10:33:14 -06:00
Andy Miller
c0c885b318 various notification style fixes 2016-08-26 09:32:44 -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
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
Andy Miller
70aa5b806c minor alignment tweaks 2016-07-11 17:24:33 -06: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
Andy Miller
ae5347a297 fixes for 'install' pages 2016-07-10 07:18:09 -06:00
Andy Miller
3f29a75a14 Tweak styling to fit 2016-07-09 13:31:08 -06:00
Andy Miller
cb4faa19b7 Tweaked alignment 2016-07-09 13:25:14 -06:00
Djamil Legato
d2acf2dfe2 Implemented Sorting for Themes and Plugins views (fixes #583) 2016-06-27 18:54:02 -07:00
Andy Miller
73737ad220 Fix for front-end shortcut showing in mobile sidebar incorrectly 2016-06-14 18:35:37 +01:00
Flavio Copes
235c2c9e73 Fix #649 use color convention 2016-06-06 10:54:23 +02:00
Andy Miller
82805558e0 Drown font size fix #647 2016-06-04 17:52:50 -06:00
Andy Miller
8f9fd6fd78 Fix for scrollbars CSS breaking layout in IE9+ #644 2016-06-03 17:14:21 -06:00
Andy Miller
2bbcc16a90 Added page legend #637 2016-06-02 12:34:02 -06:00
Andy Miller
395a5e136d Page Preview CSS cleanup #634 2016-06-02 11:50:57 -06:00
Djamil Legato
7b0e691090 Do not show move cursor for Collections that aren't sortable (fixes #624) 2016-06-01 15:44:30 -07:00
Djamil Legato
38cff92ae9 Updated JS dependencies 2016-05-31 11:55:39 -07:00
Andy Miller
9500151aee highlight plugin rows #619 2016-05-26 22:03:28 -06:00
Djamil Legato
d879377020 Recompiled CSS 2016-05-26 16:37:51 -07:00
Andy Miller
470fca059f Added page name to delete dialog #511 2016-05-26 17:13:24 -06:00
Andy Miller
c94d50b41a Tweaked sidebar avatar layout #592 2016-05-26 16:50:49 -06: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
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
Andy Miller
e47816bd4d gulp recompile 2016-05-23 12:57:22 -06:00
Flavio Copes
218e97d484 Improve removing dependencies presentation 2016-05-20 14:18:50 +02: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
Djamil Legato
36412a5c8c Fixed editor tooltips in fullscreen mode and tablet devices rendering (fixes #566) 2016-05-10 19:04:28 -07:00
Djamil Legato
462efc43cc Merge branch 'develop' of github.com:getgrav/grav-plugin-admin into develop
# Conflicts:
#	themes/grav/css-compiled/template.css.map
2016-05-10 10:30:57 -07:00
Djamil Legato
267a6ccdb1 Fixed checks for sidebar scrollbar when in mobile view 2016-05-10 10:29:54 -07:00
Andy Miller
856b991a5d Various CSS fixes 2016-05-10 11:20:31 -06:00
Andy Miller
2f62a11043 Fix for custom logo not fitting in the small sidebar space 2016-05-10 10:50:29 -06:00
Andy Miller
9c3a7257ee Fix for tooltips and toggles 2016-05-08 15:49:36 -06:00
Andy Miller
f6f92f5c4a Fix hint overlay issues on top of toggles 2016-05-07 17:25:59 -06:00
Andy Miller
1a0237fc3f Fix for firefox issue with alignment of prepend/append 2016-05-06 16:44:05 -06:00
Andy Miller
176af80b7c overlay menu when in hover mode and large desktop breakpoint 2016-05-06 14:27:42 -06:00
Andy Miller
620eeaffbb Fix for broken updates icons in quick-open mode 2016-05-06 14:02:44 -06:00
Djamil Legato
70195ccfb2 Recompiled CSS 2016-05-05 17:19:29 -07:00
Andy Miller
cd02b44749 css alignment tweaks 2016-05-05 17:35:24 -06:00
Andy Miller
8c5a5ee7be Editor button alignment issues 2016-05-05 11:25:55 -06:00