Commit 0467022e authored by fv3rdugo's avatar fv3rdugo
Browse files

wip(notices): Add access to notices

- Included in  Admin tools menu
- In Available Machines
- Select notices appearance

Issue #1272
parent 8c7680dd
...@@ -861,6 +861,14 @@ any '/admin/user/(:id).(:type)' => sub { ...@@ -861,6 +861,14 @@ any '/admin/user/(:id).(:type)' => sub {
return $c->render(template => 'main/manage_user'); return $c->render(template => 'main/manage_user');
}; };
##add notices in view machine
any '/admin/notices' => sub {
my $c = shift;
$c->render(template => 'main/notices');
};
get '/list_ldap_attributes/(#cn)' => sub { get '/list_ldap_attributes/(#cn)' => sub {
my $c = shift; my $c = shift;
......
...@@ -28,6 +28,7 @@ navbar-dark bg-dark fixed-top navbar-expand-lg navbar-inverse"> ...@@ -28,6 +28,7 @@ navbar-dark bg-dark fixed-top navbar-expand-lg navbar-inverse">
% if ($_user->is_admin || $_user->can_grant || $_user->can_manage_users) { % if ($_user->is_admin || $_user->can_grant || $_user->can_manage_users) {
<a class="dropdown-item" href="/admin/users"><i class="fa fa-user" aria-hidden="true"></i>&nbsp;<%=l 'users' %></a> <a class="dropdown-item" href="/admin/users"><i class="fa fa-user" aria-hidden="true"></i>&nbsp;<%=l 'users' %></a>
<a class="dropdown-item" href="/admin/nodes"><i class="fa fa-server" aria-hidden="true"></i>&nbsp;<%=l 'nodes' %></a> <a class="dropdown-item" href="/admin/nodes"><i class="fa fa-server" aria-hidden="true"></i>&nbsp;<%=l 'nodes' %></a>
<a class="dropdown-item" href="/admin/notices"><i class="fa fa-info-circle" aria-hidden="true"></i>&nbsp;<%=l 'notices' %></a>
% } % }
<a class="dropdown-item" href="/admin/messages"><i class="fa fa-envelope" aria-hidden="true"></i>&nbsp;<%=l 'messages' %></a> <a class="dropdown-item" href="/admin/messages"><i class="fa fa-envelope" aria-hidden="true"></i>&nbsp;<%=l 'messages' %></a>
% if ($monitoring) { % if ($monitoring) {
......
<!DOCTYPE html>
<html ng-app="ravada.app">
%= include 'bootstrap/header'
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top" role="document">
<div id="wrapper">
<div ng-controller="messagesPage">
%= include 'bootstrap/navigation'
<div id="page-wrapper">
<div class="page-header">
<div class="card" id="admin-content">
<div class="card-header">
<h2 class="display-5"><%=l 'Notices' %></h2>
<div class="card-title"></div>
</div>
<div class="card-body">
<div class="col-lg-12">
<form class="form" action="/" accept-charset="ISO-8859-1" method="post">
<div class="form-group">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<strong><label for="description"><%=l 'This notices will be showed in Available Machines page' %></label></strong>
<br/>
<div>
<%=l 'Select notice appearance' %>:
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="notice_note" value="note" checked>
<label class="form-check-label" for="notice_note"><span class="badge badge-primary"><%=l 'Note' %></span></label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="notice_warning" value="warning">
<label class="form-check-label" for="warning"><span class="badge badge-danger"><%=l 'Warning' %></span></label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="tip" value="tip">
<label class="form-check-label" for="tip"><span class="badge badge-success">Tip</span></label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="inlineRadioOptions" id="notice_info" value="info">
<label class="form-check-label" for="info"><span class="badge badge-info">Info</span></label>
</div>
</div>
<textarea id="editor" name="description" style="width: 100%;" placeholder="Description"></textarea>
<script>
CKEDITOR.replace( 'editor', {height: 200} );
</script>
</div>
</div>
</div>
<div class="col-md-12">
<button type="reset" class="btn btn-outline-secondary" onclick = "location='/admin/notices'"><%=l 'Cancel' %></button>
<input type="submit" class="btn btn-primary" name="btn_description" value="<%=l 'Submit' %>">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
%= include 'bootstrap/scripts'
%= include $footer
<div id="overNotifications" class="notifications" ng-controller="notifCrtl">
<script type="text/ng-template" id="alert.html">
<div ng-transclude></div>
</script>
<div uib-alert ng-repeat="alert in alerts_ws"
ng-class="'alert-' + (alert.type || 'warning')"
ng-click="closeAlert($index)"
ng-mouseover="alert.showMessage = false"
ng-mouseleave="alert.showMessage = true"
ng-bind-html="alert.subject">
{{alert.subject}}
<div ng-if="alert.message" ng-init="alert.showMessage = true" ng-hide="alert.showMessage" ng-bind-html="alert.message">
{{alert.message}}
</div>
</div>
</div>
</body>
</html>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
align="right" ng-show="!only_public"><%=l 'Hide Private' %></a> align="right" ng-show="!only_public"><%=l 'Hide Private' %></a>
<a ng-click="toggle_only_public()" class="badge badge-primary text-white dropdown-toggle" <a ng-click="toggle_only_public()" class="badge badge-primary text-white dropdown-toggle"
align="right" ng-show="only_public"><%=l 'Show All' %></a> align="right" ng-show="only_public"><%=l 'Show All' %></a>
<a class="badge badge-info text-white dropdown-toggle" href="/admin/notices"><%=l 'Notices' %></a>
</div> </div>
% } % }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment