Skip to content

Commit 6c99588

Browse files
committed
New dialogs: system preferences and notification settings
1 parent f9ac124 commit 6c99588

File tree

4 files changed

+83
-4
lines changed

4 files changed

+83
-4
lines changed

assets/static/js/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $('#confirmAction').find('.modal-content form').on('submit', function(event) {
3636
return false
3737
});
3838

39-
$('#changePassword, #userForm, #projectForm').on('hide.bs.modal', function (event) {
39+
$('#changePassword, #userForm, #projectForm, #systemSettings').on('hide.bs.modal', function (event) {
4040
$('.has-error', this).removeClass('has-error').find('input,textarea').tooltip('destroy');
4141
$('.alert').hide();
4242
$("[role='tooltip']", this).tooltip('destroy');
@@ -136,7 +136,7 @@ $('#updateUserForm').on('show.bs.modal', function (event) {
136136
});
137137
});
138138

139-
$('#changePassword form, #projectForm form, #addUserForm form, #updateUserForm form, #resetPasswordForm form').bootstrap3Validate(function(e, data) {
139+
$('#changePassword form, #projectForm form, #addUserForm form, #updateUserForm form, #resetPasswordForm form, #systemSettings form, #changeNotificationsSettings form').bootstrap3Validate(function(e, data) {
140140

141141
e.preventDefault();
142142

assets/templates_src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ <h4 class="modal-title">-</h4>
9494
</div>
9595
<div class="form-group">
9696
<label for="message-text" class="control-label">GitHub secret (if used)</label>
97-
<input type="text" id="github_secret" name="github_secret" class="form-control">
97+
<input type="password" id="github_secret" name="github_secret" class="form-control">
9898
</div>
9999
</div>
100100
<div class="modal-footer">

assets/templates_src/internal/layout/header.html

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<li class="dropdown">
1313
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% verbatim %}{{ CurrentUser.Name }} {% endverbatim %} <span class="caret"></span></a>
1414
<ul class="dropdown-menu" role="menu">
15-
<li><a href="#">Change notifications settings</a></li>
15+
<li><a href="#" data-toggle="modal" data-target="#changeNotificationsSettings">Change notifications settings</a></li>
1616
<li class="divider"></li>
1717
<li><a href="#" data-toggle="modal" data-target="#changePassword">Change password</a></li>
1818
</ul>
@@ -52,3 +52,75 @@ <h4 class="modal-title">Change password</h4>
5252
</form>
5353
</div>
5454
</div>
55+
56+
<div class="modal fade" id="changeNotificationsSettings" tabindex="-1" role="dialog">
57+
<div class="modal-dialog" role="document">
58+
<form method="post" action="/notifications/update-method/">
59+
<div class="modal-content">
60+
<div class="modal-header">
61+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
62+
<h4 class="modal-title">Change notifications settings</h4>
63+
</div>
64+
<div class="modal-body">
65+
<div class="input-group">
66+
<div class="input-group-btn">
67+
<select class="btn btn-default dropdown-toggle" style="height: 34px" name="method">
68+
<option value="none">none</option>
69+
<option value="none">email</option>
70+
<option value="none">telegram</option>
71+
</select>
72+
</div>
73+
<input type="text" name="identifier" class="form-control">
74+
</div>
75+
</div>
76+
<div class="modal-footer">
77+
<button type="button" class="btn btn-default" data-dismiss="modal">close</button>
78+
<button type="submit" class="btn btn-primary">change</button>
79+
</div>
80+
</div>
81+
</form>
82+
</div>
83+
</div>
84+
85+
{% verbatim %}
86+
{% if CurrentUser.IsSuperuser %}
87+
<div class="modal fade" id="systemSettings" tabindex="-1" role="dialog">
88+
<div class="modal-dialog" role="document">
89+
<form method="post" action="/system/update-settings/">
90+
<div class="modal-content">
91+
<div class="modal-header">
92+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
93+
<h4 class="modal-title">System settings</h4>
94+
</div>
95+
<div class="modal-body">
96+
<div class="form-group">
97+
<label for="message-text" class="control-label">app host:</label>
98+
<input type="text" name="app_host" data-title="Field is required" class="form-control" required>
99+
</div>
100+
<div class="form-group">
101+
<label for="message-text" class="control-label">smtp address:</label>
102+
<input type="text" name="smtp_address" placeholder="host:port" class="form-control">
103+
</div>
104+
<div class="form-group">
105+
<label for="message-text" class="control-label">smtp username:</label>
106+
<input type="text" name="smtp_username" class="form-control">
107+
</div>
108+
<div class="form-group">
109+
<label for="message-text" class="control-label">smtp password:</label>
110+
<input type="password" name="smtp_password" class="form-control">
111+
</div>
112+
<div class="form-group">
113+
<label for="message-text" class="control-label">telegram token:</label>
114+
<input type="text" name="telegram_token" class="form-control">
115+
</div>
116+
</div>
117+
<div class="modal-footer">
118+
<button type="button" class="btn btn-default" data-dismiss="modal">close</button>
119+
<button type="submit" class="btn btn-primary">save</button>
120+
</div>
121+
</div>
122+
</form>
123+
</div>
124+
</div>
125+
{% endif %}
126+
{% endverbatim %}

assets/templates_src/internal/layout/menu.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
<li{% if page == "users"%} class="active" {% endif %}>
99
<a href="/users/"><i class="fa fa-users"></i> <span>Users</span></a>
1010
</li>
11+
{% verbatim %}
12+
{% if CurrentUser.IsSuperuser %}
13+
<li>
14+
<a href="#" data-toggle="modal" data-target="#systemSettings"><i class="fa fa-cogs"></i> <span>Settings</span></a>
15+
</li>
16+
{% endif %}
17+
{% endverbatim %}
1118
</ul>
1219
</section>
1320
</aside>

0 commit comments

Comments
 (0)