notifications.tpl 6.53 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<TMPL_INCLUDE NAME="header.tpl">

  <title>LemonLDAP::NG notifications explorer</title>
</head>

<body ng-app="llngNotificationsExplorer" ng-controller="NotificationsExplorerCtrl">

  <TMPL_INCLUDE NAME="menubar.tpl">

  <div id="content" class="row container-fluid">
    <div id="pleaseWait" ng-show="waiting"><span trspan="waitingForDatas"></span></div>

    <!-- Tree -->
    <aside id="left" class="col-lg-4 col-md-4 col-sm-5 col-xs-12 scrollable " ng-class="{'hidden-xs':!showT}" role="complementary">
      <div class="navbar navbar-default">
16 17 18 19 20 21 22
        <div class="navbar-collapse">
          <ul class="nav navbar-nav">
            <li><a id="a-actives" href="#"><i class="glyphicon glyphicon-eye-open"></i> {{translate('actives')}}</a></li>
            <li><a id="a-done" href="#/done"><i class="glyphicon glyphicon-eye-close"></i> {{translate('dones')}}</a></li>
            <li><a id="a-new" href="#/new"><i class="glyphicon glyphicon-plus-sign"></i> {{translate('create')}}</a></li>
          </ul>
        </div>
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
      </div>
      <div class="region region-sidebar-first">
        <section id="block-superfish-1" class="block block-superfish clearfix">
          <div ui-tree data-drag-enabled="false" id="tree-root">
            <div ng-show="data.length==0" style="text-align:center;">
              <span class="label label-warning" trspan="noDatas"></span>
            </div>
            <ol ui-tree-nodes="" ng-model="data">
              <li ng-repeat="node in data track by node.id" ui-tree-node ng-include="'nodes_renderer.html'" collapsed="true"></li>
            </ol>
          </div>
        </section>
      </div>
      <div class="hresizer hidden-xs" resizer="vertical" resizer-left="#left" resizer-right="#right"></div>
    </aside>

    <!-- Right(main) div -->
    <div id="right" class="col-lg-8 col-md-8 col-sm-7 col-xs-12 scrollable" ng-class="{'hidden-xs':showT}">
      <!-- Menu buttons -->
      <div class="navbar navbar-default" ng-class="{'hidden-xs':!showM}">
        <div class="navbar-collapse" ng-class="{'collapse':!showM}" id="formmenu">
          <ul class="nav navbar-nav">
            <li ng-if="type=='new'||currentNotification" ng-repeat="button in menu[type]" ng-include="'menubutton.html'"></li>
46 47 48 49 50 51 52 53
            <li class="dropdown visible-xs">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Menu <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li ng-repeat="link in links"><a href="{{link.target}}"><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}}"><i ng-if="menulink.icon" class="glyphicon glyphicon-{{menulink.icon}}"></i> {{translate(menulink.title)}}</a></li>
                <li ng-include="'languages.html'"></li>
              </ul>
            </li>
54 55 56 57 58
          </ul>
        </div>
      </div>
      <!-- Notification content -->
      <div class="panel panel-default" ng-hide="currentNotification===null">
59
        <div class="panel-heading">
60 61
          <h1 class="panel-title text-center">{{translate('view')}}</h1>
        </div>
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
        <table class="table">
          <tr>
            <th><span trspan="uid" /></th>
            <td>{{currentNotification.uid}}</td>
          </tr>
          <tr>
            <th><span trspan="reference" /></th>
            <td>{{currentNotification.reference}}</td>
          </tr>
          <tr ng-if="currentNotification.done">
            <th><span trspan="internalReference" /></th>
            <td>{{currentNotification.done}}</td>
          </tr>
          <tr ng-if="currentNotification.notifications">
            <th>Notifications</th>
            <td><pre ng-repeat="n in currentNotification.notifications">{{n}}</pre></td>
          </tr>
        </table> 
80 81 82
      </div>
      <!-- Create form -->
      <div class="panel panel-default" ng-if="showForm">
83 84 85
        <div class="panel-heading">
          <h1 class="panel-title text-center">{{translate('create')}}</h1>
        </div>
86
        <form>
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
        <table class="table">
          <tr>
            <th><span trspan="uid" /></th>
            <td><input type="text" class="form-control" ng-model="form.uid" /></td>
          </tr>
          <tr>
            <th><span trspan="date" /></th>
            <td><input type="text" class="form-control" ng-model="form.date" /></td>
          </tr>
          <tr>
            <th><span trspan="reference" /></th>
            <td><input type="text" class="form-control" ng-model="form.reference" /></td>
          </tr>
          <tr>
            <th><span trspan="condition" /></th>
            <td><input type="text" class="form-control" ng-model="form.condition"/></td>
          </tr>
          <tr>
            <th><span trspan="XMLcontent" /></th>
            <td><textarea rows=5 class="form-control" ng-model="form.xml"></textarea></td>
          </tr>
        </table>
109 110 111 112 113 114
        </form>
      </div>
    </div>
  </div>

  <script type="text/ng-template" id="nodes_renderer.html">
115
    <div ui-tree-handle class="tree-node tree-node-content panel-info" ng-class="{'bg-info':this.$modelValue===currentNotification.$modelValue,'tree-node-default':this.$modelValue!==currentNotification.$modelValue}">
116
      <span ng-if="node.value">
117
        <a id="a-{{node.value}}" class="btn btn-node btn-sm" ng-click="stoggle(this)">
118 119 120 121 122
          <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
        </a>
        <span id="s-{{node.value}}" ng-click="stoggle(this)">{{node.value}} <span class="badge">{{node.count}}</span></span>
      </span>
      <span ng-if="node.notification">
123
        <a class="btn btn-node btn-sm" ng-click="displayNotification(this)">
124 125 126 127 128 129 130 131 132 133 134 135
          <span class="glyphicon glyphicon-pencil"></span>
        </a>
        <span id="s-{{node.notification}}" ng-click="displayNotification(this)">{{node.reference}} <i ng-if="node.date">({{notifDate(node.date)}})</i></span>
      </span>
    </div>
    <ol ui-tree-nodes="" ng-model="node.nodes" ng-class="{hidden: collapsed}">
      <li ng-repeat="node in node.nodes track by node.id" ui-tree-node ng-include="'nodes_renderer.html'" collapsed="true"></li>
    </ol>
  </script>

  <TMPL_INCLUDE NAME="scripts.tpl">

136 137 138
<!-- //if:jsminified
  <script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/notifications.min.js"></script>
//else -->
139
  <script type="text/javascript" src="<TMPL_VAR NAME="STATIC_PREFIX">js/notifications.js"></script>
140
<!-- //endif -->
141 142

<TMPL_INCLUDE NAME="footer.tpl">