Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add placeholder for filename without extension #1833

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/common/eventmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ func (p *EventParams) getStringReplacements(addObjectData, jsonEscaped bool) []s
"{{VirtualTargetPath}}", p.getStringReplacement(p.VirtualTargetPath, jsonEscaped),
"{{FsTargetPath}}", p.getStringReplacement(p.FsTargetPath, jsonEscaped),
"{{ObjectName}}", p.getStringReplacement(p.ObjectName, jsonEscaped),
"{{ObjectBaseName}}", p.getStringReplacement(strings.TrimSuffix(path.Base(p.ObjectName), path.Ext(p.ObjectName)), jsonEscaped),
"{{ObjectType}}", p.ObjectType,
"{{FileSize}}", strconv.FormatInt(p.FileSize, 10),
"{{Elapsed}}", strconv.FormatInt(p.Elapsed, 10),
Expand Down
3 changes: 3 additions & 0 deletions templates/webadmin/eventaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,9 @@ <h3 data-i18n="actions.placeholders_modal_title" class="modal-title">Supported p
<p>
<span class="shortcut">{{`{{ObjectName}}`}}</span> => <span data-i18n="actions.placeholders_modal.object_name">File/directory name, for example "afile.txt" or provider object name.</span>
</p>
<p>
<span class="shortcut">{{`{{ObjectBaseName}}`}}</span> => <span data-i18n="actions.placeholders_modal.object_basename">Filename without extension, for example "afile" if the filename is "afile.txt".</span>
</p>
<p>
<span class="shortcut">{{`{{ObjectType}}`}}</span> => <span data-i18n="actions.placeholders_modal.object_type">Object type for provider events: "user", "group", "admin", etc.</span>
</p>
Expand Down