adsa-cms: Index | Files

package action_bar

import ""


Package Files

action_bar.go controller.go

func SwitchMode Uses

func SwitchMode(context *admin.Context)

SwitchMode is handle to store switch status in cookie

type Action Uses

type Action struct {
    Name string
    Link string

Action define a addition action(link), will append to the top-right menu.

type ActionBar Uses

type ActionBar struct {
    Actions []*Action
    // contains filtered or unexported fields

ActionBar stores configuration about a action bar.

func New Uses

func New(admin *admin.Admin, auth admin.Auth) *ActionBar

New will create a ActionBar object

func (*ActionBar) EditMode Uses

func (bar *ActionBar) EditMode(w http.ResponseWriter, r *http.Request) bool

EditMode return whether current mode is `Preview` or `Edit`

func (*ActionBar) RegisterAction Uses

func (bar *ActionBar) RegisterAction(action *Action)

RegisterAction registered a new action

func (*ActionBar) Render Uses

func (bar *ActionBar) Render(w http.ResponseWriter, r *http.Request) template.HTML

Render will return the HTML of the bar, used this function to render the bar in frontend page's template or layout

Package action_bar imports 4 packages (graph) and is imported by 1 packages. Updated 2017-06-20. Refresh now. Tools for package owners.