Skip to content

Commit afa2619

Browse files
committed
v2-Beta8 release
1 parent 0bd8a5d commit afa2619

37 files changed

+118
-44
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bench build --app frappe_better_attach_control
6262
bench --site [sitename] install-app frappe_better_attach_control
6363
```
6464

65-
5. Check the usage section below
65+
5. Check the [usage](#usage) section below
6666

6767
#### Update
6868
1. Go to app directory
@@ -131,13 +131,16 @@ bench restart
131131
### Usage
132132
1. Go to Customization > Customize Form
133133
2. Enter the form type/name (Ex: 'User')
134-
3. Scroll down to the form fields area and create an **Attach** or **Attach Image** field or edit an existing custom field
135-
4. In the **options** property of the field, add a JSON object of the customizations you want. Example:
134+
3. Scroll down to the form fields area
135+
4. Create an **Attach** or **Attach Image** field or edit an existing custom field
136+
5. Inside the field's custom property, **Better Attach Options**, add a JSON object of the customizations you want. Example:
136137
```
137138
{"allowed_file_types": ["jpg", "png", "gif"]}
138139
```
139140

140-
ℹ️ **Note: You can't modify the original fields of a doctype, so create a new field or clone and modify the entire doctype.**
141+
ℹ️ **Notes**
142+
1. **You can't modify the original fields of a doctype, so create a new field or clone and modify the entire doctype.**
143+
2. **The plugin creates a custom field property called Better Attach Options to protect the plugin customizations from any modification and to make the plugin work in web forms.**
141144

142145
---
143146

@@ -150,7 +153,7 @@ bench restart
150153
| `allowed_file_types` | Array of allowed file types (mimes) or extensions to upload.<br/><br/>- Example: `["image/*", "video/*", ".pdf", ".doc"]`<br/>- Default: `null` or `["image/*"]` |
151154
| `max_number_of_files` | Maximum number of files allowed to be uploaded if multiple upload is allowed.<br/><br/>⚠️ *(Bypassing the maximum attachments of doctype might not work)*<br/>- Example: `4`<br/>- Default: `Value of maximum attachments set for the doctype` |
152155
| `crop_image_aspect_ratio` | Crop aspect ratio for images (Frappe >= v14.0.0).<br/><br/>- Example: `1` or `16/9` or `4/3`<br/>- Default: `null` |
153-
| `as_public` | Force uploads to be saved in public folder.<br/><br/>- Default: `false` |
156+
| `as_public` | Force uploads to be saved in public folder by default.<br/><br/>- Default: `false` |
154157
| `allow_reload` | Allow reloading attachments (Frappe >= v13.0.0).<br>ℹ️ Affect the visibility of the reload button.ℹ️<br/><br/>- Default: `true` |
155158
| `allow_remove` | Allow removing and clearing attachments.<br>ℹ️ Affect the visibility of the remove and clear buttons.ℹ️<br/><br/>- Default: `true` |
156159

frappe_better_attach_control/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file

frappe_better_attach_control/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file

frappe_better_attach_control/api/attachment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file

frappe_better_attach_control/api/file_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file

frappe_better_attach_control/config/desktop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file

frappe_better_attach_control/config/docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file

frappe_better_attach_control/hooks.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frappe Better Attach Control © 2022
1+
# Frappe Better Attach Control © 2023
22
# Author: Ameen Ahmed
33
# Company: Level Up Marketing & Software Development Services
44
# Licence: Please refer to LICENSE file
@@ -35,4 +35,9 @@
3535
'/assets/frappe_better_attach_control/js/better_attach.js'
3636
] if is_frappe_above_v12 else [
3737
'/assets/frappe_better_attach_control/js/better_attach_v12.js'
38-
])
38+
])
39+
40+
41+
after_install = "frappe_better_attach_control.setup.install.after_install"
42+
after_migrate = "frappe_better_attach_control.setup.install.after_install"
43+
after_uninstall = "frappe_better_attach_control.setup.uninstall.after_uninstall"

0 commit comments

Comments
 (0)