- DocsLibrary.git
- views
- content
- moongate
- record.tt
This file ( 3kB ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
<!-- BEGIN [% component.name %] -->
[%# PROCESS dumper.tt dump = entry %]
[% INCLUDE alerts.tt # success & error messages %]
[% # set some variables according to next route:
IF vars.next_route.match('edit');
method = 'get';
label = 'Edit';
disable_input = 1;
ELSE; # search / create / update
method = 'post';
label = 'Submit';
disable_input = 0;
END;
# PROCESS dumper.tt dump = vars.hx_request.current_url;
# PROCESS dumper.tt dump = vars.next_route;
# PROCESS dumper.tt dump = disable_input;
%]
<div class="">
<form hx-[% method %]="[% vars.hx_request.current_url _ vars.next_route %]"
enctype="multipart/form-data" hx-target="#hx-container"
id="[% vars.next_route.remove('/\d') %]">
<div class="my-3">
<!-- description -->
<div class="input-group flex-nowrap">
<span class="input-group-text col-md-2" id="description">Description</span>
<input type="text" class="form-control"
[% IF entry.description %]value="[% entry.description %]"
[% 'disabled' IF disable_input %]
[% ELSE %]required="true"[% END %]
aria-label="description" name="description" placeholder="">
</div>
<div class="input-group flex-nowrap">
<span class="input-group-text col-md-2" id="keywords">Comment</span>
<input type="text" class="form-control"
[% IF entry.comment %]value="[% entry.comment %]"
[% 'disabled' IF disable_input %]
[% ELSE %]required="true"[% END %]
aria-label="comment" name="comment" placeholder="">
</div>
<div class="input-group flex-nowrap">
<span class="input-group-text col-md-2" id="date">Date</span>
<input type="text" id="datepicker" class="form-control"
[% IF entry.date %]value="[% entry.date %]"
[% 'disabled' IF disable_input %]
[% ELSE %]required="true"[% END %]
name="date" placeholder="Select a date" />
<span class="input-group-text"><i class="bi bi-calendar"></i></span>
</div>
<div class="input-group flex-nowrap">
<span class="input-group-text col-md-2" id="date">File</span>
[% IF vars.next_route.match('update');
IF params.replace_file %]
<input type="file" class="form-control" name="filename" id="formFile" />
[% ELSE %]
<input type="text" class="form-control" name="filename"
value="[% entry.filename %]" readonly="readonly" id="filename" />
<span class="input-group-text">
<a hx-get="[% uri_for_section.moongate.edit %]/[% entry.id
%]?replace_file=1" hx-target="#hx-container">
<i class="bi bi-arrow-repeat"></i>
</a>
</span>
[% END %]
[% ELSIF entry.size # display only, with a href (use .size in case no file) %]
<span class="form-control disabled">
[% IF entry.filename %]
<a href="[% uri_for_section.moongate.download %]/[% entry.filename %]"
target="_blank">[% entry.filename | uri %]</a>
[% END %]
</span>
[% ELSE # new entry %]
<input type="file" class="form-control" name="filename" id="formFile" />
[% END %]
</div>
<div class="my-3">
<button type="submit" class="btn btn-outline-primary">[% label %]</button>
<button type="reset" class="btn btn-outline-secondary">Clear</button>
</div>
</form>
</div>
<div id="hx-container" class="container"></div>
<!-- END [% component.name %] -->