Host snippets with a git backend. Like Gists but OpenSource. https://gist.sigpipe.me/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

84 lines
5.5 KiB

{{template "base/head" .}}
<form class="form" action="{{.Link}}" method="post">
{{.CSRFTokenHTML}}
<div class="row">
<div class="col-lg-10 col-lg-offset-1">
<div class="content">
<div class="row">
<div class="col-lg-9">
<div class="description form-group {{if .Err_Description}}has-error{{end}}">
<label for="description" class="sr-only">{{.i18n.Tr "gitxt.description"}}</label>
<input type="text" name="description" id="description" class="form-control" value="{{.description}}" placeholder='{{.i18n.Tr "gitxt.description_placeholder"}}'>
</div>
</div>
<div class="col-lg-3">
<label for="expiry_hours">{{.i18n.Tr "gitxt_edit.expiry"}}</label>
<select id="expiry_hours" name="expiry_hours">
<option value="0" {{if eq .ExpiryHours 0}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.never"}}</option>
<option value="1" {{if eq .ExpiryHours 1}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.1h"}}</option>
<option value="4" {{if eq .ExpiryHours 4}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.4h"}}</option>
<option value="24" {{if eq .ExpiryHours 24}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.1d"}}</option>
<option value="48" {{if eq .ExpiryHours 48}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.2d"}}</option>
<option value="72" {{if eq .ExpiryHours 72}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.3d"}}</option>
<option value="96" {{if eq .ExpiryHours 96}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.4d"}}</option>
<option value="120" {{if eq .ExpiryHours 120}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.5d"}}</option>
<option value="144" {{if eq .ExpiryHours 144}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.6d"}}</option>
<option value="168" {{if eq .ExpiryHours 168}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.7d"}}</option>
<option value="730" {{if eq .ExpiryHours 730}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.1m"}}</option>
<option value="8760" {{if eq .ExpiryHours 8760}}selected{{end}} >{{.i18n.Tr "gitxt.expiry.1y"}}</option>
</select>
</div>
</div>
<div class="form placeholders">
<div class="form_INDEX gitxt_new_file" data-id="INDEX">
<div class="filename">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-file-code-o" aria-hidden="true"></i></div>
<input type="text" name="files_filename" id="file_INDEX_filename" class="form-control" value="" placeholder='{{$.i18n.Tr "gitxt.file_filename_placeholder"}}'>
<div class="input-group-addon btn btn-delete-file"><i class="fa fa-remove" aria-hidden="true"></i></div>
</div>
</div>
<div class="content form-group">
<textarea rows="15" type="text" name="files_content" id="file_NUMBER_content" class="form-control" placeholder='{{$.i18n.Tr "gitxt.file_content_placeholder"}}'></textarea>
</div>
</div>
</div>
<div class="files">
{{range $index, $value := .FilesContent}}
<div class="form_{{$index}} gitxt_new_file" data-id="{{$index}}">
<div class="filename">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-file-code-o" aria-hidden="true"></i></div>
<input type="text" name="files_filename" id="file_{{$index}}_filename" class="form-control" value="{{index $.FilesFilename $index}}" placeholder='{{$.i18n.Tr "gitxt.file_filename_placeholder"}}'>
<div class="input-group-addon btn btn-delete-file"><i class="fa fa-remove" aria-hidden="true"></i></div>
</div>
</div>
<div class="content form-group">
<textarea rows="15" type="text" name="files_content" id="file_{{$index}}_content" class="form-control" placeholder='{{$.i18n.Tr "gitxt.file_content_placeholder"}}'>{{index $.FilesContent $index}}</textarea>
</div>
</div>
{{end}}
</div>
<div class="gitxt_new_form_actions clear">
<div class="left">
<span id="add_new_form" class="btn btn-sm btn-default">{{.i18n.Tr "gitxt.add_new_file"}}</span>
</div>
<div class="right">
<button name="is_public" value="0" class="btn btn-sm btn-warning" type="submit">{{.i18n.Tr "gitxt.save_private"}}</button>
<button name="is_public" value="1" class="btn btn-sm btn-success" type="submit">{{.i18n.Tr "gitxt.save_public"}}</button>
</div>
</div>
</div>
</div>
</div>
</form>
{{template "base/footer" .}}