//~OPTIONS
{
  access: ["root"],
}

//~ARGUMENTS
{
  userProjection:     fcf.argProg(),
  userFieldsReadMode: fcf.argProg(),
  userFieldsEditMode: fcf.argProg(),
}

//~TEMPLATE
<h4>!{{List of users}}!</h4>

@{{
  render.template("@dbcontrols:table", 
                  {
                    fcfAlias:         "table",
                    enableToolbar:    true,
                    enableSearch:     true,
                    projection:       "___fcf___users", 
                    toolbarLeftItems: fcf.argVal([fcf.argTmpl("@controls:button", { title: fcf.t("New"), fcfEventClick: "parent.getParent().onNew()" })]),
                    columns: [
                      "id",
                      "user",
                      "groups",
                      "active",
                      "initialized",
                      "time_creation",
                      "last_login_attempt",
                      "number_login_attempts",
                      {
                        alias:    "view",
                        title:    "",
                        template: "fcfManagement:templates/pages/access/tabs/users.tmpl+buttons",
                        args: {
                          id: "@{record.id}@",
                        }
                      },
                    ]
                  });
}}@

//~ARGUMENTS buttons
{
  id:         "",
}

//~TEMPLATE buttons
@{{ render.template("@controls:button", { title: fcf.t("View"), fcfEventClick: "parent.getParent().getParent().onView(\"" + args.id + "\")"  } ) }}@
@{{ render.template("@controls:button", { title: fcf.t("Edit"), fcfEventClick: "parent.getParent().getParent().onEdit(\"" + args.id + "\")" } ) }}@
@{{ render.template("@controls:button", { title: fcf.t("Remove"), fcfEventClick: "parent.getParent().getParent().onRemove(\"" + args.id + "\")" } ) }}@
