edit user: make the role changer checkboxes

[?]
Apr 1, 2021, 3:12 AM
2UUMMP6TVEOCEOUULFFOUIYUYBT6S5WHMTZJLNVTNKRUNFIOKMFQC

Dependencies

  • [2] SWXX2O4A Update boostrap to latest 4.3.1
  • [3] PZL3SZM3 Give every page a consistent title
  • [4] XJRJ4J7M Add user registration
  • [5] 2G63HKCH Fix some wellformedness issues
  • [6] JARRBLZD Bootstrapify the Hydra forms (except the project and jobset edit pages)
  • [7] SZYDW2DG hydra: added some user admin
  • [8] ZCO73ATU Add fontawesome as required by newer bootstrap
  • [9] 4AKMU4ZB Clean up user editing
  • [10] 3PNG7NIB Remove trailing whitespace
  • [11] LSZLZHJY Allow users to edit their own settings

Change contents

  • replacement in src/root/user.tt at line 5
    [3.4696][3.4612:4785]()
    <option value="[% role %]"
    [% checked = false %]
    [% FOREACH r IN user.userroles %]
    [% checked = r.role == role %]
    [% BREAK IF checked %]
    [% END %]
    [3.4696]
    [3.4785]
    [% checked = false %]
    [% FOREACH r IN user.userroles %]
    [% checked = r.role == role %]
    [% BREAK IF checked %]
    [% END %]
    <input
    type="checkbox"
    name="roles"
  • replacement in src/root/user.tt at line 14
    [3.4806][3.4440:4466]()
    selected="selected"
    [3.4806]
    [3.4821]
    checked="checked"
    [% END %]
    [% IF !mutable %]
    disabled="disabled"
  • replacement in src/root/user.tt at line 19
    [3.4835][3.4835:4860](),[3.4860][3.5033:5043](),[3.5033][3.5033:5043]()
    >[% role %]</option>
    [% END %]
    [3.4835]
    [3.5206]
    [% HTML.attributes(id => "role-${role}", value => role) %] />
    <label [% HTML.attributes(for => "role-${role}") %]> [% role %]</label><br />
    [% END %]
  • replacement in src/root/user.tt at line 79
    [2.738317][2.738317:738850]()
    <div class="form-group row">
    <label class="col-sm-3">Roles</label>
    <div class="col-sm-9">
    <select multiple="multiple" name="roles" class="form-control" [% IF !c.check_user_roles('admin') %]disabled="disabled"[% END %]>
    [% INCLUDE roleoption role="admin" %]
    [% INCLUDE roleoption role="create-projects" %]
    [% INCLUDE roleoption role="restart-jobs" %]
    [% INCLUDE roleoption role="bump-to-front" %]
    [% INCLUDE roleoption role="cancel-build" %]
    </select>
    [2.738317]
    [3.6785]
    [% mutable = c.check_user_roles('admin') %]
    <div class="form-group row card [% mutable ? "border-danger" : "border-light" %]">
    <div class="card-header">User Roles</div>
    <div class="card-body [% mutable ? "text-danger" : "" %]">
    [% IF mutable %]
    <h5 class="card-title">Take care, you're allowed to change [% HTML.escape(user.fullname || user.emailaddress || "this user") %]'s roles.</h5>
    [% ELSE %]
    <h5 class="card-title">[% HTML.escape(user.fullname || user.emailaddress || "this user") %]'s roles.</h5>
    [% END %]
    <p class="card-text">
    [% INCLUDE roleoption mutable=mutable role="admin" %]
    [% INCLUDE roleoption mutable=mutable role="create-projects" %]
    [% INCLUDE roleoption mutable=mutable role="restart-jobs" %]
    [% INCLUDE roleoption mutable=mutable role="bump-to-front" %]
    [% INCLUDE roleoption mutable=mutable role="cancel-build" %]
    </p>
  • edit in src/root/user.tt at line 130
    [3.5237][3.6269:6270](),[3.19356][3.6269:6270](),[3.37561][3.6269:6270](),[2.739910][3.6269:6270](),[3.6269][3.6269:6270]()