diff options
Diffstat (limited to 'src/application/views/view_user.php')
| -rw-r--r-- | src/application/views/view_user.php | 29 | 
1 files changed, 20 insertions, 9 deletions
| diff --git a/src/application/views/view_user.php b/src/application/views/view_user.php index 23d2b71..79b57d2 100644 --- a/src/application/views/view_user.php +++ b/src/application/views/view_user.php @@ -26,13 +26,13 @@ $dateJoined = DateTime::createFromImmutable($user->created);  $dateJoined->setTime(0, 0, 0, 0);  ?> -<div class="clearfix"> +<div class="clearfix page-header margin-top-0">      <img class="pull-left margin-right" src="?_action=profilepicture&user=<?= htmlentities(urlencode($user->id)) ?>">      <span class="h1"><?= htmlentities($user->displayName) ?></span>      <?php if ($isOwnProfile): ?>          <span class="label label-primary">You</span>      <?php endif; ?><br> -    @<?= htmlentities($user->name) ?> • <span class="text-muted">Member since <span class="_date"><?= htmlentities($dateJoined->format("c")); ?></span> +    @<?= htmlentities($user->name) ?> • <span class="text-muted">Member since <span class="_date"><?= htmlentities($dateJoined->format("c")); ?></span></span>  </div>  <?php if ($canEdit): ?> @@ -97,18 +97,22 @@ if (($_formError = RequestUtils::getAndClearFormError()) !== null) {          <label>Profile picture:</label>  <?php  $_checkbox_disabled = empty($user->profilePicture); -$_checkbox_disabled_class = $_checkbox_disabled ? " disabled" : ""; +$_checkbox_disabled_class = $_checkbox_disabled ? " disabled text-muted" : "";  ?>          <div class="radio margin-top-0 <?= $_checkbox_disabled_class ?>">              <label>                  <input type="radio" name="pfp_action" id="pfp_action_1" value="keep"<?= !empty($user->profilePicture) ? ' checked' : ' disabled' ?>> -                Existing profile picture +                Keep current profile picture              </label>          </div>          <div class="radio">              <label>                  <input type="radio" name="pfp_action" id="pfp_action_2" value="remove"<?= empty($user->profilePicture) ? ' checked' : '' ?>> -                No profile picture +                <?php if (empty($user->profilePicture)): ?> +                    No profile picture +                <?php else: ?> +                    Remove profile picture +                <?php endif; ?>              </label>          </div>          <div class="radio"> @@ -141,12 +145,19 @@ $(function() {  });  <?php if ($canEdit): ?>  $(function() { -    $("#i_pfp").hide().prop("disabled", true).prop("required", false); +    function _hide() { +        $("#i_pfp").hide().prop("disabled", true).prop("required", false); +        $("#i_pfp + .file-input-group").hide().find("button").prop("disabled", true); +    } +    _hide(); +    setTimeout(_hide, 10);      $("[name='pfp_action']").on("change input check click", function() { -        if ($("#pfp_action_3").is(":checked")) +        if ($("#pfp_action_3").is(":checked")) {              $("#i_pfp").show().prop("disabled", false).prop("required", true); -        else -            $("#i_pfp").hide().prop("disabled", true).prop("required", false); +            $("#i_pfp + .file-input-group").show().find("button").prop("disabled", false); +        } else { +            _hide(); +        }      })  });  <?php endif; ?> |