manus-tracker

tracker for scientific manuscripts
git clone git://src.adamsgaard.dk/manus-tracker # fast
git clone https://src.adamsgaard.dk/manus-tracker.git # slow
Log | Files | Refs | README Back to index

manuscript.html (6760B)


      1 {{define "content"}}{{$m := .M}}{{$id := .M.ID}}
      2 <header class="ms-header">
      3   <h1 class="page__title">{{$id}}</h1>
      4   {{with $m.Get "title"}}<p class="ms-header__subtitle">{{.}}</p>{{end}}
      5   <form class="inline" method="post" action="/m/{{$id}}/fields">
      6     <label>stage
      7       <select name="stage" data-autosubmit>
      8         {{$cur := $m.Get "stage"}}{{range .Stages}}<option{{if eq . $cur}} selected{{end}}>{{.}}</option>{{end}}
      9       </select>
     10     </label>
     11     <noscript><button>set</button></noscript>
     12   </form>
     13   {{range .Flags}}<span class="badge badge--warn">{{.}}</span> {{end}}
     14   {{if or (gt (len .Lineage) 1) .Children}}
     15   <nav class="lineage">revisions:
     16     {{range .Lineage}}<a class="lineage__item{{if eq .ID $id}} lineage__item--current{{end}}" href="/m/{{.ID}}">{{.ID}}</a>{{end}}
     17     {{range .Children}}<a class="lineage__item" href="/m/{{.ID}}">{{.ID}}</a>{{end}}
     18   </nav>
     19   {{end}}
     20 </header>
     21 
     22 <div class="layout">
     23 <section class="layout__main">
     24   <section class="panel" id="tasks">
     25     <h2 class="panel__title">Tasks</h2>
     26     <form class="task-add" method="post" action="/m/{{$id}}/tasks">
     27       <input class="task-add__title" name="title" placeholder="New task" required>
     28       <input class="task-add__due" name="due" type="date" aria-label="due date">
     29       <button>Add</button>
     30     </form>
     31     {{range .Tasks}}{{$v := .}}
     32     <article class="task task--{{.Eff}}" id="t{{.Ref.N}}">
     33       <header class="task__header">
     34         <span class="task__ref">#{{.Ref.N}}</span>
     35         {{template "status" (dict "V" . "Back" "" "Statuses" $.Statuses)}}
     36         <span class="task__title">{{.T.Title}}</span>
     37         {{with .T.Due}}<span class="task__due">due {{.}}</span>{{end}}
     38       </header>
     39       {{if or .T.Rels .Inverse}}
     40       <ul class="task__rels">
     41         {{range .T.Rels}}<li>{{.Kind}} <a href="/m/{{.To.MS}}#t{{.To.N}}">{{.To}}</a>
     42           <form class="inline" method="post" action="/m/{{$id}}/tasks/{{$v.Ref.N}}/rels">
     43             <input type="hidden" name="kind" value="{{.Kind}}"><input type="hidden" name="to" value="{{.To}}">
     44             <button class="link" name="del" value="1" title="remove relation">remove</button>
     45           </form></li>{{end}}
     46         {{range .Inverse}}<li>{{.Kind}} <a href="/m/{{.To.MS}}#t{{.To.N}}">{{.To}}</a></li>{{end}}
     47       </ul>
     48       {{end}}
     49       <details class="task__details"{{if .T.Comments}} open{{end}}>
     50         <summary>{{len .T.Comments}} comments{{with .T.Source}} · source {{.}}{{end}} · created {{.T.Created}}{{with .T.Closed}} · closed {{.}}{{end}}</summary>
     51         {{range .T.Comments}}
     52         <div class="comment"><time class="comment__time">{{.At}}</time>{{range lines .Text}}<p class="comment__line">{{.}}</p>{{end}}</div>
     53         {{end}}
     54         <form class="comment-add" method="post" action="/m/{{$id}}/tasks/{{.Ref.N}}/comments">
     55           <textarea name="text" rows="2" placeholder="Comment" required></textarea>
     56           <button>Comment</button>
     57         </form>
     58         <form class="rel-add" method="post" action="/m/{{$id}}/tasks/{{.Ref.N}}/rels">
     59           this task
     60           <select name="kind">{{range $.RelKinds}}<option>{{.}}</option>{{end}}</select>
     61           <input name="to" placeholder="#3 or other-ms#2" required>
     62           <button>Relate</button>
     63         </form>
     64       </details>
     65     </article>
     66     {{else}}<p class="muted">No tasks yet.</p>
     67     {{end}}
     68   </section>
     69 
     70   {{with .Doc}}
     71   <section class="panel">
     72     <h2 class="panel__title">Document preview</h2>
     73     <pre class="preview">{{.}}</pre>
     74   </section>
     75   {{end}}
     76 
     77   {{with .Report.Figures}}
     78   <section class="panel">
     79     <h2 class="panel__title">Figures ({{len .}})</h2>
     80     <div class="figures">
     81       {{range .}}
     82       <a class="figures__item" href="/m/{{$id}}/file/{{.Path}}">
     83         <img class="figures__img" loading="lazy" alt="{{.Name}}" src="/m/{{$id}}/{{if eq (ext .Preview) ".pdf"}}thumb{{else}}file{{end}}/{{.Preview}}">
     84         <span class="figures__name">{{base .Name}}</span>
     85       </a>
     86       {{end}}
     87     </div>
     88   </section>
     89   {{end}}
     90 </section>
     91 
     92 <aside class="layout__side">
     93   <section class="panel">
     94     <h2 class="panel__title">Details</h2>
     95     <form class="fields" method="post" action="/m/{{$id}}/fields">
     96       {{range .Fields}}
     97       <label class="fields__row"><span class="fields__key">{{index . 0}}</span>
     98         {{if eq (index . 0) "stage"}}<span>{{index . 1}}</span>{{else}}<input class="fields__input" name="{{index . 0}}" value="{{index . 1}}">{{end}}</label>
     99       {{end}}
    100       <button>Save</button>
    101     </form>
    102   </section>
    103 
    104   {{with .Report.PDF}}
    105   <section class="panel">
    106     <h2 class="panel__title">PDF</h2>
    107     {{if .Missing}}<p class="muted">{{.Path}} not built</p>{{else}}
    108     <a href="/m/{{$id}}/file/{{.Path}}"><img class="pdf-thumb" alt="first page" src="/m/{{$id}}/thumb/{{.Path}}"></a>
    109     <p>{{.Path}} · {{.ModTime.Format "2006-01-02 15:04"}}{{if .Stale}} · <span class="badge badge--warn">older than sources</span>{{end}}</p>
    110     {{end}}
    111   </section>
    112   {{end}}
    113 
    114   {{with .Report.Git}}
    115   <section class="panel">
    116     <h2 class="panel__title">Git</h2>
    117     <p>{{.Branch}} · {{.Dirty}} uncommitted · {{.Ahead}} unpushed</p>
    118     {{with .Remote}}<p class="muted small">{{.}}</p>{{end}}
    119     <ul class="commits">{{range .Commits}}<li><code>{{.Hash}}</code> <span class="muted">{{.Date}}</span> {{.Subject}}</li>{{end}}</ul>
    120   </section>
    121   {{end}}
    122 
    123   {{with .Report.Targets}}
    124   <section class="panel">
    125     <h2 class="panel__title">Make targets</h2>
    126     <p>{{range .}}<code>{{.}}</code> {{end}}</p>
    127   </section>
    128   {{end}}
    129 
    130   {{with .Report.Bib}}
    131   <section class="panel">
    132     <h2 class="panel__title">References</h2>
    133     <p>{{.Cited}} cited · {{len .Missing}} missing · {{len .Unused}} unused · {{len .NoDOI}} without DOI</p>
    134     {{with .Missing}}<p>missing: {{range .}}<code>{{.}}</code> {{end}}</p>{{end}}
    135     {{with .Unused}}<details><summary>unused in local bib</summary><p>{{range .}}<code>{{.}}</code> {{end}}</p></details>{{end}}
    136     {{with .NoDOI}}<details><summary>articles without DOI</summary><p>{{range .}}<code>{{.}}</code> {{end}}</p></details>{{end}}
    137     {{range .Errors}}<p class="flash flash--error">{{.}}</p>{{end}}
    138     <p class="muted small">{{range .Files}}{{base .}} {{end}}</p>
    139   </section>
    140   {{end}}
    141 
    142   {{with .Report.TeX.Todos}}
    143   <section class="panel">
    144     <h2 class="panel__title">TODOs in source</h2>
    145     <ul class="todos">{{range .}}<li><span class="muted">{{.File}}:{{.Line}}</span> {{.Text}}</li>{{end}}</ul>
    146     <p class="muted small">Import with <code>manus todos {{$id}} -a</code></p>
    147   </section>
    148   {{end}}
    149 
    150   {{with .Report.Conflicts}}
    151   <section class="panel">
    152     <h2 class="panel__title">Conflict and copy files</h2>
    153     <ul>{{range .}}<li><code>{{.}}</code></li>{{end}}</ul>
    154   </section>
    155   {{end}}
    156 </aside>
    157 </div>
    158 {{end}}