lemonldap-ng/lemonldap-ng-manager/site/htdocs/static/forms
Christophe Maudoux 15bd74927f Fix menu order
2019-09-08 21:50:38 +02:00
..
authChoice.html Add "over" feature to choice (#1500) 2018-10-08 16:57:24 +02:00
authChoiceContainer.html Fix input text width 2018-09-20 21:53:43 +02:00
authParams.html Some WAI-ARIA improvment (#1111) 2017-03-24 15:03:40 +00:00
authParamsText.html Some WAI-ARIA improvment (#1111) 2017-03-24 15:03:40 +00:00
authParamsTextContainer.html Some WAI-ARIA improvment (#1111) 2017-03-24 15:03:40 +00:00
blackWhiteList.html Some WAI-ARIA improvment (#1111) 2017-03-24 15:03:40 +00:00
bool.html Fix SAML attribute default value (#1635) 2019-01-31 22:55:15 +01:00
boolOrExpr.html Fix SAML attribute default value (#1635) 2019-01-31 22:55:15 +01:00
casAppMetaDataNode.html Prepare CAS partners managment (#1183) 2017-04-12 16:45:49 +00:00
casAppMetaDataNodeContainer.html Prepare CAS partners managment (#1183) 2017-04-12 16:45:49 +00:00
casSrvMetaDataNode.html Fix IDP/CAS deleteEntry icon 2019-09-06 09:47:24 +02:00
casSrvMetaDataNodeContainer.html Prepare CAS partners managment (#1183) 2017-04-12 16:45:49 +00:00
catAndAppList.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
cmbModule.html Fix type display (#867) 2017-04-19 11:01:46 +00:00
cmbModuleContainer.html Fix type display (#867) 2017-04-19 11:01:46 +00:00
doubleHash.html Fix #1207 2017-05-17 08:56:29 +00:00
file.html Prepare test to verify that SAML conf is not lost (#1311) 2017-11-12 17:10:41 +01:00
grant.html Fix grant rules display issue (#1627) 2019-02-04 19:00:39 +01:00
grantContainer.html Append rule at the end (#1510) 2018-10-01 22:32:10 +02:00
home.html Remove trailing whitespaces 2019-04-03 14:15:16 +02:00
homeViewer.html Remove trailing whitespaces 2019-04-03 14:15:16 +02:00
int.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
keyText.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
keyTextContainer.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
longtext.html Fix CSP errors (closes: #1197) 2017-03-15 15:57:46 +00:00
menuApp.html Fix menu order 2019-09-08 21:50:38 +02:00
menuCat.html Fix menu order 2019-09-08 21:50:38 +02:00
mini.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
oidcOPMetaDataNode.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
oidcOPMetaDataNodeContainer.html Fix OIDC GUI 2018-07-15 15:04:48 +02:00
oidcRPMetaDataNode.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
oidcRPMetaDataNodeContainer.html Fix OIDC GUI 2018-07-15 15:04:48 +02:00
password.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
portalskin.html Fix CSP errors (closes: #1197) 2017-03-15 15:57:46 +00:00
portalskinbackground.html Clean link (#1184) 2017-03-16 06:30:33 +00:00
post.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
postContainer.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
README.md Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
restore.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
RSAKey.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
RSAKeyNoPassword.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
rule.html Append rule at the end (#1510) 2018-10-01 22:28:04 +02:00
ruleContainer.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
samlAssertion.html Some WAI-ARIA improvment (#1111) 2017-03-24 15:03:40 +00:00
samlAttribute.html Fix menu order 2019-09-08 21:50:38 +02:00
samlAttributeContainer.html Some WAI-ARIA improvment (#1111) 2017-03-24 15:03:40 +00:00
samlIDPMetaDataNode.html Fix IDP/CAS deleteEntry icon 2019-09-06 09:47:24 +02:00
samlIDPMetaDataNodeContainer.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
samlService.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
samlSPMetaDataNode.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
samlSPMetaDataNodeContainer.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
select.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
sfExtra.html Add labels and logos to all 2F providers (#1873) 2019-08-01 17:27:14 +02:00
sfExtraContainer.html Add labels and logos to all 2F providers (#1873) 2019-08-01 17:27:14 +02:00
simpleInputContainer.html Fix boolean display with YAML backend (Fixes: #1684) 2019-03-26 22:55:52 +01:00
text.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
trool.html Fix SAML attribute default value (#1635) 2019-01-31 22:55:15 +01:00
virtualHost.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
virtualHostContainer.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00
white.html Harmonize manager to portal (dir htdocs) 2017-02-22 21:48:52 +00:00

Lemonldap::NG::Manager forms

This files contains the form used to expose configuration attributes. The form is chosen by looking at the type property of the current data.

This property is defined in Lemonldap::NG::Manager::Build::Attributes package. By default, it is set to text.

Lemonldap::NG::Manager::Build::Attributes is compiled into JSON/JS files by jsongenerator.plscript.

1. Form file architecture

Form files must be called <type>.json where is the declared type of configuration property to display.

Form files must contain only HTML that will be included in the manager DOM (in #form div). It must consist of two blocks:

  • a <div class="panel panel-default"> div that contains the form,
  • a <script type="text/menu"> script that defines which item to display in context menu.

Basic example:

<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">{{translate(currentNode)}}</h3>
  </div>
  <div class="panel-body">
    <div class="input-group">
      <label class="input-group-addon" for="textinput" trspan="value"></label>
      <input id="textinput" class="form-control" ng-model="currentNode.data"/>
    </div>
  </div>
</div>
<script type="text/menu">
[{
  "title": "cancel"
}]
</script>

2. Form main div

Based on bootstrap CSS, the main div part may look like:

If configuration item name is read-only:

<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">{{translate(currentNode)}}</h3>
  </div>
  <div class="panel-body">
  __ FORM INPUTS __
  </div>
</div>

If configuration item name may be modified:

<div class="panel panel-default">
  <div class="panel-heading"> <!-- optional -->
    <h3 class="panel-title" trspan="OptionalTitle"></h3>
  </div>
  <div class="panel-body">
  __ FORM INPUTS __
  </div>
</div>

Note that keywords to translate must be set in all languages/*.json files.

2.1. AngularJS bindings

Some AngularJS variables are available :

  • currentNode: the data subnode corresponding to the selected tree item
  • currentScope: the AngularJS scope corresponding to the selected tree item

You can simply used them as follow:

<input class="form-control" ng-model="currentNode.data"/>

3. Script part

Form div must define which item menu to display. It is done via the script part of the file:

Empty context menu:

<script type="text/menu">
[]
</script>

Else:

<script type="text/menu">
[
  {<menu item1>},
  {<menu item2>},
  {<menu item3>}
]
</script>

3.1. Menu item

3.1.1. Simple case

Menu item is a javascript object with at least the key title.

<script type="text/menu">
[
  { "title": "cancel" }
]
</script>

In this case, the item will be displayed using the translation of cancel. It will launch the function $scope.cancel() declared in AngularJS controller (js/manager.js file) without any argument: functions in the controller can access to controller properties and methods.

3.1.2. Dropdown item

You can have sub items simply using buttons key which must then be an array of menu items.

<script type="text/menu">
[{
  "title": "textToTranslate",
  "buttons": [
    { "title": "cancel" },
    { "other": "item" }
  ]
}]
</script>

3.1.3. Specify function to use

<script type="text/menu">
[{
  "title": "addVirtualHost",
  "action": "addVhost"
}]
</script>

Same as below except that it will launch $scope.addVhost().

Tips

You can access to the parent using this:

  • currentScope.$parentNodeScope for the parent scope
  • currentScope.$parentNodeScope.$modelValue for the parent node

3.1.5 Icons

<script type="text/menu">
[{
  "title": "addVirtualHost",
  "action": "addVhost",
  "icon": "plus-sign",
}]
</script>

The field icon can be set to define the Bootstrap glyphicon to use.

4. Modal window

You can use a modal window to display a choice (look at forms/portalSkin.html for a complete example):

<button class="btn btn-info" ng-click="showModal('portalSkinChoice.html')">

A modal window will be displayed using portalSkinChoice.html template. This template must be declared in the file:

<script type="text/ng-template" id="portalSkinChoice.html">
  <div class="modal-header">
    <h3 class="modal-title" trspan="chooseSkin"></h3>
  </div>
  <div class="modal-body">
    <div class="btn-group">
      <button class="btn" ng-repeat="b in currentNode.select" ng-click="ok(currentNode.data=b.k)">
        {{b.v}}
      </button>
    </div>
  </div>
  <div class="modal-footer">
    <button class="btn btn-primary" ng-click="ok()" trspan="ok"></button>
    <button class="btn btn-warning" ng-click="cancel()" trspan="cancel"></button>
  </div>
</script>