Add field to set new profile pic url. Support retrieving only.

This commit is contained in:
James Royal 2015-08-14 23:33:16 -05:00
commit 7a7c92191d
3 changed files with 19 additions and 5 deletions

View file

@ -37,6 +37,15 @@ DOCUMENTATION :: END
</div>
<p class="help-block">Replace all occurances of the username with this name.</p>
</div>
<div class="form-group">
<label for="profile_url">Profile Picture URL</label>
<div class="row">
<div class="col-xs-6">
<input type="text" class="form-control" id="profile_url" name="profile_url" value="${data['thumb']}">
</div>
</div>
<p class="help-block">Change the users profile picture in plexpy. You should save the URL if you would like to go back as this replaces the existing one.</p>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="do_notify" name="do_notify" value="1" ${data['do_notify']}> Enable notifications
@ -63,6 +72,7 @@ DOCUMENTATION :: END
// Set new friendly name
$("#save_user_name").click(function() {
var friendly_name = $("#friendly_name").val();
var thumb = $("#profile_url").val();
var do_notify = 0;
var keep_history = 0;
if ($("#do_notify").is(":checked")) {
@ -75,7 +85,7 @@ DOCUMENTATION :: END
% if data['user_id']:
$.ajax({
url: 'edit_user',
data: {user_id: '${data['user_id']}', friendly_name: friendly_name, do_notify: do_notify, keep_history: keep_history},
data: {user_id: '${data['user_id']}', friendly_name: friendly_name, do_notify: do_notify, keep_history: keep_history, thumb: thumb},
cache: false,
async: true,
success: function(data) {
@ -88,7 +98,7 @@ DOCUMENTATION :: END
% else:
$.ajax({
url: 'edit_user',
data: {user: '${data['user']}', friendly_name: friendly_name, do_notify: do_notify, keep_history: keep_history},
data: {user: '${data['user']}', friendly_name: friendly_name, do_notify: do_notify, keep_history: keep_history, thumb: thumb},
cache: false,
async: true,
success: function(data) {