cyclid-ui 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +178 -0
  3. data/README.md +20 -0
  4. data/app/cyclid_ui.rb +124 -0
  5. data/app/cyclid_ui/config.rb +64 -0
  6. data/app/cyclid_ui/controllers/auth.rb +102 -0
  7. data/app/cyclid_ui/controllers/base.rb +41 -0
  8. data/app/cyclid_ui/controllers/health.rb +96 -0
  9. data/app/cyclid_ui/controllers/organization.rb +64 -0
  10. data/app/cyclid_ui/controllers/user.rb +40 -0
  11. data/app/cyclid_ui/helpers.rb +55 -0
  12. data/app/cyclid_ui/memcache.rb +45 -0
  13. data/app/cyclid_ui/models/user.rb +91 -0
  14. data/app/cyclid_ui/templates/footer.mustache +8 -0
  15. data/app/cyclid_ui/templates/job.mustache +21 -0
  16. data/app/cyclid_ui/templates/job_info.mustache +40 -0
  17. data/app/cyclid_ui/templates/layout.mustache +102 -0
  18. data/app/cyclid_ui/templates/login.mustache +78 -0
  19. data/app/cyclid_ui/templates/organization.mustache +150 -0
  20. data/app/cyclid_ui/templates/user.mustache +97 -0
  21. data/app/cyclid_ui/views/job.rb +25 -0
  22. data/app/cyclid_ui/views/layout.rb +52 -0
  23. data/app/cyclid_ui/views/login.rb +25 -0
  24. data/app/cyclid_ui/views/organization.rb +25 -0
  25. data/app/cyclid_ui/views/user.rb +25 -0
  26. data/bin/cyclid-ui-assets +17 -0
  27. data/lib/cyclid_ui/app.rb +4 -0
  28. data/public/images/LICENSE +3 -0
  29. data/public/images/cyclid-logo-large.png +0 -0
  30. data/public/images/favicon16.png +0 -0
  31. data/public/images/favicon32.png +0 -0
  32. data/public/images/favicon48.png +0 -0
  33. data/public/images/favicon64.png +0 -0
  34. data/public/images/favicon96.png +0 -0
  35. data/public/js/api.js +34 -0
  36. data/public/js/cyclid.js +32 -0
  37. data/public/js/job.js +215 -0
  38. data/public/js/organization.js +345 -0
  39. data/public/js/user.js +145 -0
  40. data/public/vendor/bootstrap/css/bootstrap-theme.css +587 -0
  41. data/public/vendor/bootstrap/css/bootstrap-theme.css.map +1 -0
  42. data/public/vendor/bootstrap/css/bootstrap-theme.min.css +6 -0
  43. data/public/vendor/bootstrap/css/bootstrap-theme.min.css.map +1 -0
  44. data/public/vendor/bootstrap/css/bootstrap.css +6760 -0
  45. data/public/vendor/bootstrap/css/bootstrap.css.map +1 -0
  46. data/public/vendor/bootstrap/css/bootstrap.min.css +6 -0
  47. data/public/vendor/bootstrap/css/bootstrap.min.css.map +1 -0
  48. data/public/vendor/bootstrap/css/custom.css +193 -0
  49. data/public/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
  50. data/public/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
  51. data/public/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
  52. data/public/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
  53. data/public/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
  54. data/public/vendor/bootstrap/js/bootstrap.js +2363 -0
  55. data/public/vendor/bootstrap/js/bootstrap.min.js +7 -0
  56. data/public/vendor/bootstrap/js/npm.js +13 -0
  57. data/public/vendor/font-awesome/HELP-US-OUT.txt +7 -0
  58. data/public/vendor/font-awesome/css/font-awesome.css +2199 -0
  59. data/public/vendor/font-awesome/css/font-awesome.min.css +4 -0
  60. data/public/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
  61. data/public/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  62. data/public/vendor/font-awesome/fonts/fontawesome-webfont.svg +685 -0
  63. data/public/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  64. data/public/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  65. data/public/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  66. data/public/vendor/font-awesome/less/animated.less +34 -0
  67. data/public/vendor/font-awesome/less/bordered-pulled.less +25 -0
  68. data/public/vendor/font-awesome/less/core.less +12 -0
  69. data/public/vendor/font-awesome/less/fixed-width.less +6 -0
  70. data/public/vendor/font-awesome/less/font-awesome.less +18 -0
  71. data/public/vendor/font-awesome/less/icons.less +733 -0
  72. data/public/vendor/font-awesome/less/larger.less +13 -0
  73. data/public/vendor/font-awesome/less/list.less +19 -0
  74. data/public/vendor/font-awesome/less/mixins.less +60 -0
  75. data/public/vendor/font-awesome/less/path.less +15 -0
  76. data/public/vendor/font-awesome/less/rotated-flipped.less +20 -0
  77. data/public/vendor/font-awesome/less/screen-reader.less +5 -0
  78. data/public/vendor/font-awesome/less/stacked.less +20 -0
  79. data/public/vendor/font-awesome/less/variables.less +744 -0
  80. data/public/vendor/font-awesome/scss/_animated.scss +34 -0
  81. data/public/vendor/font-awesome/scss/_bordered-pulled.scss +25 -0
  82. data/public/vendor/font-awesome/scss/_core.scss +12 -0
  83. data/public/vendor/font-awesome/scss/_fixed-width.scss +6 -0
  84. data/public/vendor/font-awesome/scss/_icons.scss +733 -0
  85. data/public/vendor/font-awesome/scss/_larger.scss +13 -0
  86. data/public/vendor/font-awesome/scss/_list.scss +19 -0
  87. data/public/vendor/font-awesome/scss/_mixins.scss +60 -0
  88. data/public/vendor/font-awesome/scss/_path.scss +15 -0
  89. data/public/vendor/font-awesome/scss/_rotated-flipped.scss +20 -0
  90. data/public/vendor/font-awesome/scss/_screen-reader.scss +5 -0
  91. data/public/vendor/font-awesome/scss/_stacked.scss +20 -0
  92. data/public/vendor/font-awesome/scss/_variables.scss +744 -0
  93. data/public/vendor/font-awesome/scss/font-awesome.scss +18 -0
  94. data/public/vendor/jquery-2.2.4.min.js +4 -0
  95. data/public/vendor/jquery.md5.js +269 -0
  96. data/public/vendor/js.cookie.js +151 -0
  97. data/public/vendor/mustache.min.js +1 -0
  98. metadata +322 -0
@@ -0,0 +1,21 @@
1
+ <div class="container" id="job">
2
+ {{> job_info}}
3
+ </div>
4
+
5
+ <script type="text/javascript" src="/js/cyclid.js"></script>
6
+ <script type="text/javascript" src="/js/api.js"></script>
7
+ <script type="text/javascript" src="/js/job.js"></script>
8
+ <script>
9
+ var gblLinkbackURL = '{{linkback_url}}';
10
+ var gblUsername = '{{username}}';
11
+
12
+ // Retrieve the job data from the API & call either the success or failure handlers
13
+ var url = '{{job_url}}';
14
+ var job_id = {{job_id}};
15
+
16
+ // Inital get & display the job details, status & log
17
+ api_get(url, gblUsername, ji_update_all, ji_get_failed);
18
+
19
+ // Watch the job for status updates
20
+ addNamedInterval(`watcher${job_id}`, function() { ji_watch_job(url); }, 3000);
21
+ </script>
@@ -0,0 +1,40 @@
1
+ <div class="alert alert-danger alert-dismissible hidden" role="alert" id="ji_failure">
2
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
3
+ <div id="error_message"></div>
4
+ </div>
5
+
6
+ <div class="panel panel-default hidden" id="ji_details">
7
+ <div class="panel-heading">
8
+ <h3 class="panel-title"><span id="ji_header"></span></h3>
9
+ </div>
10
+
11
+ <div class="row">
12
+ <!-- standard job attributes -->
13
+ <div class="col-md-8">
14
+ <div class="col-md-6">
15
+ <div class="dl-horizontal text-muted">
16
+ <dt>Job</dt><dd id="ji_job_id"></dd>
17
+ <dt>Started</dt><dd id="ji_job_started"></dd>
18
+ <dt>Ended</dt><dd id="ji_job_ended"></dd>
19
+ </div>
20
+ </div>
21
+
22
+ <!-- additional job attributes -->
23
+ <div class="col-md-6">
24
+ <div class="dl-horizontal text-muted">
25
+ <dt>Duration</dt><dd id="ji_job_duration"></dd>
26
+ </div>
27
+ </div>
28
+ </div>
29
+
30
+ <!-- status -->
31
+ <div class="col-md-3 pull-right">
32
+ <h4><span id="ji_job_status"></span></h4>
33
+ <span id="ji_job_waiting"></span>
34
+ </div>
35
+ </div>
36
+ </div>
37
+
38
+ <div id="ji_log_outer" class="hidden">
39
+ <pre id="ji_log_inner" class="pre-scrollable job-log small"></pre>
40
+ </div>
@@ -0,0 +1,102 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
8
+ <title>
9
+ {{title}}
10
+ </title>
11
+
12
+ <!-- Favicons -->
13
+ <link href="/images/favicon16.png" rel="icon" sizes="16x16" type="image/png">
14
+ <link href="/images/favicon32.png" rel="icon" sizes="32x32" type="image/png">
15
+ <link href="/images/favicon48.png" rel="icon" sizes="48x48" type="image/png">
16
+ <link href="/images/favicon64.png" rel="icon" sizes="64x64" type="image/png">
17
+ <link href="/images/favicon96.png" rel="icon" sizes="96x96" type="image/png">
18
+
19
+ <!-- Bootstrap CSS -->
20
+ <link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
21
+ <link href="/vendor/bootstrap/css/custom.css" rel="stylesheet" type="text/css">
22
+
23
+ <!-- Font Awesome -->
24
+ <link href="/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
25
+
26
+ <!-- jQuery -->
27
+ <script src="/vendor/jquery-2.2.4.min.js"></script>
28
+ <!-- Bootstrap plugins -->
29
+ <script src="/vendor/bootstrap/js/bootstrap.min.js"></script>
30
+ <!-- Cookie handling -->
31
+ <script src="/vendor/js.cookie.js"></script>
32
+ </head>
33
+ <body>
34
+ <div id="wrap">
35
+
36
+ <nav class="navbar navbar-layout">
37
+ <div class="container-fluid">
38
+ <div class="navbar-header">
39
+ <a class="navbar-brand" href="/">Cyclid</a>
40
+ </div>
41
+
42
+ <div class="collapse navbar-collapse" id="layout-navbar">
43
+ <ul class="nav navbar-nav">
44
+ <li class="dropdown">
45
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Organizations&nbsp;<span class="caret"></span></a>
46
+ <ul class="dropdown-menu">
47
+ {{#organizations}}
48
+ <li><a href="/{{.}}">{{.}}</a></li>
49
+ {{/organizations}}
50
+ </ul>
51
+ </li>
52
+ </ul>
53
+
54
+ <ul class="nav navbar-nav navbar-right">
55
+ <li class="dropdown">
56
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{username}}&nbsp;<span class="caret"></span></a>
57
+ <ul class="dropdown-menu">
58
+ <li><a href="/user/{{username}}">Profile</a></li>
59
+ <li><a href="/logout">Logout</a></li>
60
+ </ul>
61
+ </li>
62
+ <li id="user_small_avatar"><img src="{{gravatar_url}}&s=50" style="width:50px;height:50px;padding:5px;"></li>
63
+ </ul>
64
+
65
+ </div>
66
+ </div>
67
+ </nav>
68
+
69
+ {{#breadcrumbs}}
70
+ <ol id="nav-breadcrumbs" class="breadcrumb breadcrumb-layout">
71
+ </ol>
72
+
73
+ <script type="text/javascript">
74
+ function lay_crumbs(crumbs) {
75
+ var crumbsLength = crumbs.length;
76
+ for (var i = 0; i < crumbsLength; i++) {
77
+ var name = crumbs[i].name;
78
+ var url = crumbs[i].url;
79
+ if (url) {
80
+ $('#nav-breadcrumbs').append(`<li><a href="${url}"}>${name}</a></li>`);
81
+ } else {
82
+ $('#nav-breadcrumbs').append(`<li class="active">${name}</li>`);
83
+ }
84
+ }
85
+ }
86
+
87
+ lay_crumbs({{{breadcrumbs}}});
88
+ </script>
89
+ {{/breadcrumbs}}
90
+
91
+ <div id="content">
92
+ {{{yield}}}
93
+ </div>
94
+
95
+ <div id="push"></div>
96
+
97
+ </div><!-- #wrap -->
98
+
99
+ <!-- insert the footer -->
100
+ {{> footer}}
101
+ </body>
102
+ </html>
@@ -0,0 +1,78 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
8
+ <title>
9
+ {{title}}
10
+ </title>
11
+
12
+ <!-- Favicons -->
13
+ <link href="/images/favicon16.png" rel="icon" sizes="16x16" type="image/png">
14
+ <link href="/images/favicon32.png" rel="icon" sizes="32x32" type="image/png">
15
+ <link href="/images/favicon48.png" rel="icon" sizes="48x48" type="image/png">
16
+ <link href="/images/favicon64.png" rel="icon" sizes="64x64" type="image/png">
17
+ <link href="/images/favicon96.png" rel="icon" sizes="96x96" type="image/png">
18
+
19
+ <!-- Bootstrap CSS -->
20
+ <link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
21
+ <link href="/vendor/bootstrap/css/custom.css" rel="stylesheet" type="text/css">
22
+ </head>
23
+ <body>
24
+ <div id="wrap">
25
+ <nav class="navbar navbar-layout">
26
+ <div class="container-fluid">
27
+ <div class="navbar-header">
28
+ <a class="navbar-brand" href="/login">Cyclid</a>
29
+ </div>
30
+ </div>
31
+ </nav>
32
+
33
+ <div class="container">
34
+ <div class="row">
35
+ <img class="center-block" src="images/cyclid-logo-large.png">
36
+ </div>
37
+ </div>
38
+
39
+ <div id="push"></div>
40
+
41
+ <div class="container">
42
+ <div class="row">
43
+ <div class="col-md-4 col-md-offset-4">
44
+ <form action="login" method="post">
45
+ <div class="form-group">
46
+ <label for="username">Username</label>
47
+ <input type="text" class="form-control" name="username" placeholder="Username">
48
+ </div>
49
+ <div class="form-group">
50
+ <label for="password">Password</label>
51
+ <input type="password" class="form-control" name="password" placeholder="Password">
52
+ </div>
53
+ <input type="submit" class="btn btn-default" value="Login">
54
+ </form>
55
+ </div>
56
+ </div>
57
+
58
+ <div class="row v-offset-10">
59
+ <div class="col-md-4 col-md-offset-4">
60
+ {{#message}}
61
+ <div class="alert alert-warning" role="alert">{{message}}</div>
62
+ {{/message}}
63
+ </div>
64
+ </div>
65
+ </div>
66
+
67
+ <div id="push"></div>
68
+
69
+ </div><!-- #wrap -->
70
+
71
+ {{> footer}}
72
+
73
+ <!-- jQuery -->
74
+ <script src="/vendor/jquery-2.2.4.min.js"></script>
75
+ <!-- Bootstrap plugins -->
76
+ <script src="/vendor/bootstrap/js/bootstrap.min.js"></script>
77
+ </body>
78
+ </html>
@@ -0,0 +1,150 @@
1
+ <div class="container" id="organizations">
2
+
3
+ <div class="alert alert-danger alert-dismissible hidden" role="alert" id="organization_failure">
4
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
5
+ <div id="error_message"></div>
6
+ </div>
7
+
8
+ <div class="row">
9
+ <div class="col-md-3">
10
+ <div class="panel panel-default">
11
+ <div class="panel-heading">
12
+ <h3 class="panel-title text-initial-caps">Search</h3>
13
+ </div>
14
+ <div class="panel-body form-horizontal form-group pad-5">
15
+ <small>
16
+ <form onsubmit="org_search_submit();return false;">
17
+ <div class="form-group">
18
+ <label for="search_name" class="col-sm-2 control-label">Name</label>
19
+ <div class="col-sm-10">
20
+ <input type="text" class="form-control form-control-slim" oninput="org_search_form_changed()" id="search_name" placeholder="Name">
21
+ </div>
22
+ </div>
23
+
24
+ <div class="form-group">
25
+ <label for="search_from" class="col-sm-2 control-label">From</label>
26
+ <div class="col-sm-10">
27
+ <input type="datetime-local" class="form-control form-control-slim" onchange="org_search_form_changed()" id="search_from">
28
+ </div>
29
+ </div>
30
+
31
+ <div class="form-group">
32
+ <label for="search_to" class="col-sm-2 control-label">To</label>
33
+ <div class="col-sm-10">
34
+ <input type="datetime-local" class="form-control form-control-slim" onchange="org_search_form_changed()" id="search_to">
35
+ </div>
36
+ </div>
37
+
38
+ <div class="form-group">
39
+ <label for="search_status" class="col-sm-2 control-label">Status</label>
40
+ <div class="col-sm-10">
41
+ <select class="form-control form-control-slim" onchange="org_search_form_changed()" id="search_status">
42
+ <option>Any</option>
43
+ <option value="0">New</option>
44
+ <option value="1">Waiting</option>
45
+ <option value="2">Started</option>
46
+ <option value="10">Succeeded</option>
47
+ <option value="11">Failed</option>
48
+ </select>
49
+ </div>
50
+ </div>
51
+ </form>
52
+ </small>
53
+ </div>
54
+
55
+ <div class="panel-footer">
56
+ <div class="text-right">
57
+ <button type="button" class="btn btn-default" disabled="disabled" onclick="org_search_form_reset()" id="search_btn_clear">Clear</button>
58
+ <button type="button" class="btn btn-success" disabled="disabled" onclick="org_search_submit()" id="search_btn_search">Search</button>
59
+ </div>
60
+ </div>
61
+
62
+ </div>
63
+ </div>
64
+
65
+ <div class="col-md-9">
66
+ <div class="row">
67
+ <div class="col-md-12" style="margin-bottom: 10px;margin-top: 10px;display: table;">
68
+ <span id="org-counter" class="small" style="display: table-cell;vertical-align: middle;"></span>
69
+ </div>
70
+ </div>
71
+
72
+ <div style="height: 65vh;overflow-y: auto;">
73
+ <table class="table table-hover table-condensed job-table" id="job-accordian">
74
+ <thead>
75
+ <th>ID</th>
76
+ <th>Name</th>
77
+ <th>Started</th>
78
+ <th>Duration</th>
79
+ <th>Status</th>
80
+ </thead>
81
+
82
+ <tfoot>
83
+ <tr>
84
+ <td colspan="5">
85
+ <div id="org-load-more" class="panel panel-default hidden">
86
+ <div class="panel-body text-center pad-2 clickable">
87
+ <strong>Load more</strong><br>
88
+ <i class="fa fa-angle-double-down" aria-hidden="true"></i>
89
+ </div>
90
+ </div>
91
+ </td>
92
+ </tr>
93
+ </tfoot>
94
+
95
+ <tbody></tbody>
96
+ </table>
97
+ </div>
98
+ </div>
99
+ </div>
100
+
101
+ {{=<% %>=}}
102
+ <script id="job-info" type="x-tmpl-mustache">
103
+ <tr id="row{{id}}" data-toggle="collapse" data-target="#collapse{{id}}" data-parent="#job-accordian" class="clickable">
104
+ <td id="id">{{id}}</td>
105
+ <td id="name">{{name}}</td>
106
+ <td id="started">{{started}}</td>
107
+ <td id="duration">{{duration}}</td>
108
+ <td id="status">{{{status}}}</td>
109
+ </tr>
110
+
111
+ <tr>
112
+ <td colspan="5" class="hidden-row">
113
+ <div id="collapse{{id}}" class="collapse">
114
+ </div>
115
+ </td>
116
+ </tr>
117
+ </script>
118
+ <%={{ }}=%>
119
+
120
+ <script id="job-info-inner" type="x-tmpl-html">
121
+ <div id="job-info-panel" class="panel-body">
122
+ {{> job_info}}
123
+ </div>
124
+ </script>
125
+ </div>
126
+
127
+ <script type="text/javascript" src="/vendor/mustache.min.js"></script>
128
+ <script type="text/javascript" src="/js/cyclid.js"></script>
129
+ <script type="text/javascript" src="/js/api.js"></script>
130
+ <script type="text/javascript" src="/js/job.js"></script>
131
+ <script type="text/javascript" src="/js/organization.js"></script>
132
+ <script type="text/javascript">
133
+ var gblUsername = '{{username}}';
134
+ var gblOrganizationURL = '{{organization_url}}';
135
+ var gblLinkbackURL = '{{linkback_url}}';
136
+ var gblOffset = 0,
137
+ gblTotal = 0;
138
+
139
+ $( window ).resize( function() {
140
+ $('#job-accordian').height('65vh');
141
+ });
142
+
143
+ $('#org-load-more').on('click', function () {
144
+ org_load_chunk(gblOffset);
145
+ });
146
+
147
+ // Find the number of jobs & load the initial set
148
+ var url = `${gblOrganizationURL}/jobs?stats_only=true`;
149
+ api_get(url, gblUsername, org_initialize_job_list, org_job_list_failed);
150
+ </script>
@@ -0,0 +1,97 @@
1
+ <div class="container" id="user">
2
+ <div class="alert alert-danger alert-dismissible hidden" role="alert" id="user_failure">
3
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
4
+ <div id="error_message"></div>
5
+ </div>
6
+
7
+ <div class="panel panel-default hidden" id="user_info">
8
+ <div class="panel-heading">
9
+ <h3 class="panel-title text-initial-caps" id="user_heading"></h3>
10
+ </div>
11
+
12
+ <div class="row">
13
+ <div class="col-md-2">
14
+ <div class="container pad-20" id="user_avatar">
15
+ <img src="{{gravatar_url}}&s=100" style="width:100px;height:100px;">
16
+ </div>
17
+ </div>
18
+
19
+ <div class="col-md-10">
20
+ <h3 id="user_name"></h3>
21
+
22
+ <div class="col-md-6">
23
+ <div class="dl-horizontal text-muted pad-20">
24
+ <dt>Email</dt><dd id="user_email"></dd>
25
+ <dt>Organizations</dt><dd id="user_org_list"></dd>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="col-md-6 pad-20">
30
+ <div class="row">
31
+ <div class="col-md-4 text-muted pad-5">
32
+ <button type="button" class="btn btn-default" style="width:100%;" data-toggle="modal" data-target="#user_password_modal">Change password</button>
33
+ </div>
34
+ <div class="col-md-8 text-muted pad-5">
35
+ <small>Change your password and reset your client token.</small>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+
41
+ </div>
42
+ </div>
43
+ </div>
44
+
45
+ <!-- change password modal -->
46
+ <div class="modal fade" id="user_password_modal" role="dialog" aria-labelledby="user_password_modal_label">
47
+ <div class="modal-dialog" role="document">
48
+ <div class="modal-content">
49
+ <div class="modal-header">
50
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
51
+ <h4 class="modal-title" id="user_password_modal_label">Change password</h4>
52
+ </div>
53
+
54
+ <div class="modal-body">
55
+ <div class="alert alert-danger alert-dismissible hidden" role="alert" id="user_password_failure">
56
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
57
+ <div id="user_password_error_message"></div>
58
+ </div>
59
+
60
+ <form id="user_password_form">
61
+ <div class="form-group">
62
+ <label for="user_password_password_1">New password</label>
63
+ <input type="password" class="form-control" placeholder="Password" id="user_password_password_1">
64
+ </div>
65
+ <div class="form-group">
66
+ <label for="user_password_password_2">Confirm password</label>
67
+ <input type="password" class="form-control" placeholder="Password" id="user_password_password_2">
68
+ </div>
69
+ <div class="checkbox">
70
+ <label>
71
+ <input type="checkbox" id="user_password_reset_signing">Reset client token
72
+ </label>
73
+ </div>
74
+ <div class="form-group">
75
+ <label for="user_password_secret">Client token</label>
76
+ <input type="text" class="form-control" placeholder="Token" id="user_password_secret" disabled>
77
+ </div>
78
+ </form>
79
+ </div>
80
+ <div class="modal-footer">
81
+ <button type="button" class="btn btn-default" data-dismiss="modal" id="user_password_cancel">Cancel</button>
82
+ <button type="submit" class="btn btn-default" data-dismiss="modal" id="user_password_ok">Change password</button>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ </div>
87
+
88
+ <script type="text/javascript" src="/vendor/jquery.md5.js"></script>
89
+ <script type="text/javascript" src="/js/api.js"></script>
90
+ <script type="text/javascript" src="/js/user.js"></script>
91
+ <script type="text/javascript">
92
+ var gblUsername = '{{username}}';
93
+ var gblAPIURL = '{{api_url}}';
94
+ var gblUserURL = '{{user_url}}';
95
+
96
+ api_get(gblUserURL, gblUsername, user_update_details, user_get_failed);
97
+ </script>