manager.tpl 10.7 KB
Newer Older
1 2 3 4 5 6 7
<TMPL_INCLUDE NAME="header.tpl">

  <title>LemonLDAP::NG Manager</title>
  <link rel="prefetch" href="<TMPL_VAR NAME="STATIC_PREFIX">forms/home.html" />
  <link rel="prefetch" href="<TMPL_VAR NAME="STATIC_PREFIX">struct.json" />
</head>

8
<body ng-app="llngManager" ng-controller="TreeCtrl" ng-csp>
9 10 11 12 13 14 15 16

  <TMPL_INCLUDE NAME="menubar.tpl">

  <div id="content" class="row container-fluid">

    <TMPL_INCLUDE NAME="tree.tpl">

    <!-- Right(main) div -->
17
    <div id="right" class="col-lg-8 col-md-8 col-sm-7 col-xs-12 scrollable" ng-class="{'hidden-xs':showT&&!showM}">
18 19 20
      <!-- Form container -->
      <div id="top">
        <!-- Menu buttons -->
21
        <div class="lmmenu navbar navbar-default" ng-class="{'hidden-xs':!showM}">
22 23
          <div class="navbar-collapse" ng-class="{'collapse':!showM}" id="formmenu">
            <ul class="nav navbar-nav">
24 25 26 27
              <li><a class="link" ng-click="home()"><i class="glyphicon glyphicon-home"></i></a></li>
              <li>
                <a id="save" class="link" ng-click="save()" tabIndex="-1">
                  <i class="glyphicon glyphicon-cloud-upload"></i>
28
                  {{translate('save')}}
29 30
                </a>
              </li>
31
              <li >
32
                <input id="forcesave" type="checkbox" ng-model="forceSave" uib-tooltip="{{translate('forceSave')}}" tooltip-placement="right" ng-show="confirmNeeded||currentCfg.next" role="checkbox" aria-label="Force save">
33
              </li>
34 35 36
              <li uib-dropdown>
                <a id="navmenu" name="menu" uib-dropdown-toggle data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="glyphicon glyphicon-cog"></i> {{translate('browse')}} <span class="caret"></span></a>
                <ul uib-dropdown-menu aria-labelled-by="navmenu">
37 38 39 40 41
                  <li ng-class="{'disabled':!currentCfg.prev}"><a class="link" ng-click="currentCfg.prev && getCfg(currentCfg.prev)" title="Configuration {{currentCfg.prev}}"><i class="glyphicon glyphicon-arrow-left"></i> {{translate('previous')}}</a></li>
                  <li ng-class="{'disabled':!currentCfg.next}"><a class="link" ng-click="currentCfg.next && getCfg(currentCfg.next)" title="Configuration {{currentCfg.next}}"><i class="glyphicon glyphicon-arrow-right"></i> {{translate('next')}}</a></a></li>
                  <li><a class="link" ng-click="getCfg('latest')" title="Latest configuration"><i class="glyphicon glyphicon-refresh"></i> {{translate('latest')}}</a></li>
                </ul>
              </li>
42
              <li><a class="link hidden-xs" ng-click="setShowHelp()"><i class="glyphicon" ng-class="{'glyphicon-eye-close': showH,'glyphicon-eye-open': !showH}" ></i> {{ translate((showH ? 'hideHelp' : 'showHelp')) }}</a></li>
Xavier Guimard's avatar
Xavier Guimard committed
43
              <li ng-repeat="button in menu()" ng-include="'menubutton.html'"></li>
44 45
              <li uib-dropdown class="visible-xs">
                <a id="langmenu" name="menu" uib-dropdown-toggle data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{translate('menu')}} <span class="caret"></span></a>
46 47 48
                <ul uib-dropdown-menu aria-labelled-by="langmenu" role="grid">
                  <li ng-repeat="link in links"><a href="{{link.target}}" role="row"><i ng-if="link.icon" class="glyphicon glyphicon-{{link.icon}}"></i> {{translate(link.title)}}</a></li>
                  <li ng-repeat="menulink in menulinks"><a href="{{menulink.target}}" role="row"><i ng-if="menulink.icon" class="glyphicon glyphicon-{{menulink.icon}}"></i> {{translate(menulink.title)}}</a></li>
49 50 51
                  <li ng-include="'languages.html'"></li>
                </ul>
              </li>
52 53 54
            </ul>
          </div>
        </div>
Xavier Guimard's avatar
Xavier Guimard committed
55
        <form class="form-group slide-animate-container" ng-include="formPrefix+form+'.html'" scope="$scope" />
56 57
      </div>
      <!-- Help container -->
58
      <div id="bottom" ng-if="showH" class="hidden-xs">
59
        <div class="panel panel-default">
60
          <div class="panel-body">
61
            <iframe id="helpframe" width="100%" height="100%" ng-src="{{translate('/doc/')+'pages/documentation/current/'+helpUrl}}" frameborder="0"></iframe>
62 63
          </div>
        </div> 
64 65 66 67 68 69 70
      </div>
    </div>
  </div>

  <!-- HTML recursive templates (used in `ng-repeat... ng-include="'template.html'") -->
  <!-- Tree nested node template -->
  <script type="text/ng-template" id="nodes_renderer.html">
Clément OUDOT's avatar
Clément OUDOT committed
71
    <div ui-tree-handle class="tree-node panel-info" ng-class="{'bg-info':this.$modelValue===currentNode,'tree-node-default':this.$modelValue!==currentNode}">
72 73 74
      <!-- Glyph icons -->
      <span ng-switch="node.nodes||node.nodes_cond?1:((node._nodes&&node._nodes.length>0)||(node._nodes_cond&&node._nodes_cond.length>0)?3:(node.cnodes&&node.cnodes.length>0?2:0))">
        <!-- Undownloaded nodes (hash data)-->
Clément OUDOT's avatar
Clément OUDOT committed
75
        <a class="btn btn-sm" id="a-{{node.id}}" ng-switch-when="2" ng-click="openCnode(this)">
76 77 78
          <span class="glyphicon glyphicon-chevron-right"></span>
        </a>
        <!-- Javascript nodes not yet bind to DOM -->
Clément OUDOT's avatar
Clément OUDOT committed
79
        <a class="btn btn-sm" id="a-{{node.id}}" ng-switch-when="3" ng-click="stoggle(this)">
80 81 82
          <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed, 'glyphicon-chevron-down': !collapsed}"></span>
        </a>
        <!-- Nodes already loaded and binded -->
Clément OUDOT's avatar
Clément OUDOT committed
83
        <a class="btn btn-sm" id="a-{{node.id}}" ng-switch-when="1" ng-click="toggle(this)">
84 85 86
          <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed, 'glyphicon-chevron-down': !collapsed}"></span>
        </a>
        <!-- Leaf -->
Clément OUDOT's avatar
Clément OUDOT committed
87
        <a class="btn btn-sm" ng-switch-default ng-click="displayForm(this)">
88 89 90 91
          <span class="glyphicon glyphicon-pencil"></span>
        </a>
      </span>
      <!-- Node text with/without translation -->
Clément OUDOT's avatar
Clément OUDOT committed
92
      <span id="t-{{node.id}}" ng-if="keyWritable(this)" ng-click="displayForm(this)">{{node.title}}</span>
93 94 95
      <span id="t-{{node.id}}" ng-if="!keyWritable(this)" ng-click="displayForm(this)" trspan="{{node.title}}" />
    </div>
    <!-- Subnodes -->
Clément OUDOT's avatar
Clément OUDOT committed
96
    <ol ui-tree-nodes="btn btn-sm" ng-model="node.nodes" ng-class="{hidden: collapsed}">
97 98 99
      <li ng-repeat="node in node.nodes track by node.id" ui-tree-node ng-include="'nodes_renderer.html'" collapsed="true"></li>
    </ol>
    <!-- Filtered subnodes (authParams mechanism) -->
Clément OUDOT's avatar
Clément OUDOT committed
100
    <ol ui-tree-nodes="btn btn-sm" ng-model="node.nodes_cond" ng-class="{hidden: collapsed}">
101 102 103 104
      <li ng-repeat="(name,node) in node.nodes_cond track by node.id" ng-if="node.show" ui-tree-node ng-include="'nodes_renderer.html'" collapsed="true"></li>
    </ol>
  </script>

105 106
  <!-- Prompt -->
  <script type="text/ng-template" id="prompt.html">
107
  <div role="alertdialog" aria-labelledby="ptitle" aria-describedby="ptitle">
108
    <div class="modal-header">
109
      <h3 id="ptitle" class="modal-title" trspan="{{elem('message').title}}" />
110 111
    </div>
    <div class="modal-body">
112
      <div class="input-group maxw">
113 114
        <label class="input-group-addon" id="promptlabel" for="promptinput" trspan="{{elem('message').field}}"/>
        <input id="promptinput" class="form-control" ng-model="result" aria-describedby="promptlabel"/>
115 116 117
      </div>
    </div>
    <div class="modal-footer">
118 119
      <button class="btn btn-primary" id="promptok" ng-click="ok()" trspan="ok" role="button"></button>
      <button class="btn btn-warning" ng-click="cancel()" trspan="cancel" role="button"></button>
120
    </div>
121
  </div>
122 123
  </script>

124 125
  <!-- Message display -->
  <script type="text/ng-template" id="message.html">
126
  <div role="alertdialog" aria-labelledby="mtitle" aria-describedby="mbody">
127
    <div class="modal-header">
128
      <h3 id="mtitle" class="modal-title" trspan="{{elem('message').title}}" />
129
    </div>
130
    <div id="mbody" class="modal-body">
131 132 133 134 135 136
      <div class="modal-p">{{translateP(elem('message').message)}}</div>
      <ul class="main-modal-ul" ng-model="elem('message').items">
        <li ng-repeat="item in elem('message').items" ng-include="'messageitem.html'"/>
      </ul>
    </div>
    <div class="modal-footer">
137 138
      <button class="btn btn-primary" id="messageok" ng-click="ok()" trspan="ok" role="button"></button>
      <button class="btn btn-warning" ng-click="cancel()" ng-if="elem('message').displayCancel" trspan="cancel" role="button"></button>
139
    </div>
140
  </div>
141 142 143 144 145 146 147 148 149 150 151
  </script>

  <script type="text/ng-template" id="messageitem.html">
    <div class="modal-p">{{translateP(item.message)}}</div>
    <ul class="modal-ul" ng-model="item.items">
      <li ng-repeat="item in item.items" ng-include="'messageitem.html'"/>
    </ul>
  </script>

  <!-- Password question -->
  <script type="text/ng-template" id="password.html">
152
  <div role="alertdialog" aria-labelledby="pwtitle" aria-describedby="pwtitle">
153
    <div class="modal-header">
154
      <h3 id="pwtitle" class="modal-title" trspan="enterPassword" />
155 156
    </div>
    <div class="modal-body">
157
      <div class="input-group maxw">
158 159
        <label class="input-group-addon" id="mlabel" for="mdPwd" trspan="password"/>
        <input id="mdPwd" class="form-control" ng-model="result" aria-describedby="mlabel"/>
160 161 162
      </div>
    </div>
    <div class="modal-footer">
163 164
      <button class="btn btn-primary" id="passwordok" ng-click="ok()" trspan="ok" role="button"></button>
      <button class="btn btn-warning" ng-click="cancel()" trspan="cancel" role="button"></button>
165
    </div>
166
  </div>
167 168 169 170
  </script>

  <!-- Save confirm -->
  <script type="text/ng-template" id="save.html">
171
  <div role="alertdialog" aria-labelledby="stitle" aria-describedby="sbody">
172
    <div class="modal-header">
173
      <h3 id="stitle" class="modal-title" trspan="savingConfirmation" />
174
    </div>
175
    <div id="sbody" class="modal-body">
176
      <div class="input-group maxw">
177 178
        <label id="slabel" class="input-group-addon" for="longtextinput" trspan="cfgLog"/>
        <textarea id="longtextinput" rows="5" class="form-control" ng-model="result" aria-describedby="slabel" />
179 180 181
      </div>
    </div>
    <div class="modal-footer">
182 183
      <button class="btn btn-primary" id="saveok" ng-click="ok()" trspan="ok" role="button"></button>
      <button class="btn btn-warning" ng-click="cancel()" trspan="cancel" role="button"></button>
184
    </div>
185
  </div>
186 187 188 189
  </script>

  <TMPL_INCLUDE NAME="scripts.tpl">

190 191 192 193 194 195 196 197 198
  <!-- //if:jsminified
    <script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/conftree.min.js"></script>
    <script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/filterFunctions.min.js"></script>
    <script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/manager.min.js"></script>
  //else -->
    <script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/conftree.js"></script>
    <script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/filterFunctions.js"></script>
    <script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/manager.js"></script>
  <!-- //endif -->
199 200

<TMPL_INCLUDE NAME="footer.tpl">