29 lines
861 B
HTML
29 lines
861 B
HTML
let f ?bio request =
|
|
% begin match Dream.session "nick" request with
|
|
% | None ->
|
|
not logged in
|
|
% | Some nick ->
|
|
%begin match bio with
|
|
% | None ->
|
|
% let bio = match User.get_bio nick with
|
|
% | Ok bio -> bio
|
|
% | Error e -> e
|
|
%in
|
|
<%s Format.sprintf "Hello %s !" nick %>
|
|
<%s! Dream.form_tag ~action:"/profile" request %>
|
|
<div class="mb-3">
|
|
<label for="bio" class="form-label">Bio</label>
|
|
<textarea name="bio" type="text" class="form-control" id="bio" aria-describedby="bioHelp" value="<%s bio %>"></textarea>
|
|
<div id="bioHelp" class="form-text">Who are you?</div>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Save</button>
|
|
</form>
|
|
% | Some bio ->
|
|
% begin match User.update_bio bio nick with
|
|
% | Ok () ->
|
|
Bio updated !
|
|
% | Error e ->
|
|
<%s e %>
|
|
% end;
|
|
% end;
|
|
%end;
|