Admin Panel includes a generic confirmation modal for links, out of the box. Using HTML data attributes on <a>-tags the modal can be configured in different ways. Just add a data attribute to your link and you’re all set.
Triggering the modal will append a HTML-element form to the DOM, containing title, text, confirm button and dismiss button.
By default confirm submits the form and dismiss will remove the HTML-element from the DOM
Basic usage
<a href="#" data-confirm="true">Open modal</a>
Data Attributes
Attribute
Description
example
data-confirm
Initialize the modal
data-confirm="true"
data-title
Sets the title of the modal
data-title="Please confirm"
data-text
Sets the text of the modal
data-text="Are you sure you want to continue?"
data-button
Sets bootstrap css selector for the confirm button
admin-panel
Features
Confirm Modal
Admin Panel includes a generic confirmation modal for links, out of the box. Using HTML data attributes on
<a>
-tags the modal can be configured in different ways. Just add a data attribute to your link and you’re all set.Triggering the modal will append a HTML-element form to the DOM, containing title, text, confirm button and dismiss button.
By default confirm submits the form and dismiss will remove the HTML-element from the DOM
Basic usage
Data Attributes
data-confirm="true"
data-title="Please confirm"
data-text="Are you sure you want to continue?"
data-button="danger"
[primary,secondary,success,danger,warning,info,light,dark]data-confirm-btn="Yes"
data-confirm-btn="No"
Override default behavior
Leaf tags
Admin panel comes with a variety of leaf tags for generating certain HTML/js elements
#adminPanel:avatarURL
Use user image or fallback to Adorable avatars
email
url
Example usage
#adminPanel:config
Convenience method to output configuration strings such as app or environment name or paths to certain templates
Supported input values and what they output
name
: App namebaseURL
: App base URLsidebarMenuPath
: Path to sidebar menu view templatedashboardPath
: Path to dashboard view templateenvironment
: Environment nameconfigName
Example usage
#adminPanel:user
Outputs a field on the current user object as a string
fieldName
Example usage
#adminPanel:user:requireRole
Make sure user has required role to output element. If not throws an error.
roleName
Example usage
#adminPanel:user:hasRequiredRole
Check if user has a required role
roleName
Example usage
#adminPanel:sidebar:heading
Renders a header, styled in a certain way, for the navigation sidebar.
Example usage
#adminPanel:sidebar:menuItem
Renders a sidebar menu item, styled in a certain way, for the navigation sidebar.
url
icon
activeURLPatterns
Example usage