mirror of
https://github.com/fazo96/markcloud.git
synced 2025-03-19 21:28:39 +01:00
161 lines
5.2 KiB
HTML
161 lines
5.2 KiB
HTML
<head>
|
|
<title>MarkCloud</title>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
</head>
|
|
|
|
<template name="layout">
|
|
{{> yield region="outside"}}
|
|
<div class="container">
|
|
<h1>MarkCloud</h1>
|
|
<hr>
|
|
{{> notifications}}
|
|
{{> yield}}
|
|
</div>
|
|
</template>
|
|
|
|
<template name="home">
|
|
{{#if currentUser}}<p>Logged in as <b>{{username}} ({{mail}})</b></p>{{/if}}
|
|
<p>This is a demo app. Click <a href="new">here</a> to create a new document.</p>
|
|
<p>After submitting the document you will be redirected to its permanent link</p>
|
|
<p>There are <b>{{ndocs}}</b> documents in the database</p>
|
|
<p>This demo was built by <a href="http://github.com/fazo96">Enrico
|
|
Fasoli (fazo96)</a> in 45 minutes, it's now evolving to a full app.</p>
|
|
<p>It's open source, you can find the code
|
|
<a href="http://github.com/fazo96/markcloud">here</a></p>
|
|
</template>
|
|
|
|
<template name="new">
|
|
<p>Write your document in <a href="https://help.github.com/articles/github-flavored-markdown/">GitHub Flavored Markdown</a> then submit it with the button. You will be redirected to its permanent link</p>
|
|
<input type="text" id="title" class="form-control" placeholder="Title" value="{{title}}">
|
|
<input type="checkbox" id="show-title" {{showTitleChecked}}>
|
|
Show title in document
|
|
<textarea id="editor" class="form-control" rows="10" placeholder="Write your markdown :)" autofocus>{{text}}</textarea>
|
|
<button id="upload" class="btn btn-primary">
|
|
<i class="fa fa-upload"></i> {{#if _id}}Update{{else}}Create{{/if}}</button>
|
|
</template>
|
|
|
|
<template name="docLayout">
|
|
{{> yield region="outside"}}
|
|
<div class="container">{{> yield}}</div>
|
|
</template>
|
|
|
|
<template name="doc">
|
|
{{#if valid}}
|
|
{{#if showTitle}}<h1>{{title}}</h1><hr>{{/if}}
|
|
<div class="notification-area">
|
|
{{> notifications}}
|
|
</div>
|
|
{{#if source}}
|
|
<textarea id="src" class="form-control" rows="{{rows}}" readonly>{{text}}</textarea>
|
|
{{else}}
|
|
<div id="doc">{{#markdown}}{{text}}{{/markdown}}</div>
|
|
{{/if}}
|
|
{{else}}
|
|
<div class="text-center">
|
|
<h1>404</h1>
|
|
<div class="notification-area">
|
|
{{> notifications}}
|
|
</div>
|
|
<p>This document is invalid, expired, never existed or was deleted.</p>
|
|
</div>
|
|
{{/if}}
|
|
<hr>
|
|
<div class="text-center">
|
|
{{#unless currentUser}}
|
|
<p><a href="/login">Log in</a> to edit and delete your documents<br></p>
|
|
{{/unless}}
|
|
{{#if owned}}
|
|
<p>This document is <b>yours</b>.</p>
|
|
{{else}}
|
|
{{#unless owner}}
|
|
<p>This anonymous document will <b>expire {{expirationDays}}</b></p>
|
|
{{/unless}}
|
|
{{/if}}
|
|
{{#if valid}}
|
|
<div class="btn-group" id="tools">
|
|
{{#if currentUser}}{{#if owned}}
|
|
<button id="edit-doc" class="btn btn-primary">
|
|
<i class="fa fa-edit"></i> Edit</button>
|
|
{{/if}}{{/if}}
|
|
{{#if source}}
|
|
<button id="src-doc" class="btn btn-success">
|
|
<i class="fa fa-book"></i> View Document</button>
|
|
{{else}}
|
|
<button id="src-doc" class="btn btn-success">
|
|
<i class="fa fa-code"></i> View Source</button>
|
|
{{/if}}
|
|
{{#if currentUser}}{{#if owned}}
|
|
<button id="del-doc" class="btn btn-danger">
|
|
<i class="fa fa-trash"></i> Delete</button>
|
|
{{/if}}{{/if}}
|
|
</div>
|
|
<br>
|
|
{{/if}}Powered by <a href="/">MarkCloud</a>
|
|
</div>
|
|
</template>
|
|
|
|
<template name="loading">
|
|
<div id="loading" class="text-center">
|
|
<i class="fa fa-cog fa-spin fa-3x"></i>
|
|
</div>
|
|
</template>
|
|
|
|
<template name="spinner">
|
|
<div id="spinner">
|
|
<i class="fa fa-2x fa-cog fa-spin"></i>
|
|
</div>
|
|
</template>
|
|
|
|
<template name="404">
|
|
<div class="text-center">
|
|
<h1>404</h1>
|
|
<p>This page does not exist.</p>
|
|
</div>
|
|
</template>
|
|
|
|
<template name="notifications">
|
|
{{#if notification}}
|
|
<div class="center-block text-center">
|
|
<div class="alert alert-{{notification.type}} error">
|
|
<p align="center">{{notification.msg}}</p>
|
|
<button type="button" class="close close-error">×</button>
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
</template>
|
|
|
|
<template name="signup">
|
|
<div id="signup-container">
|
|
<h2>Sign Up<a href="/"><i class="fa fa-home pull-right"></i></a></h2>
|
|
<p>You will be able to log in using your email or your username.</p>
|
|
<input type="text" class="form-control" id="mail" placeholder="E-Mail Address">
|
|
<input type="text" class="form-control" id="name" placeholder="Username">
|
|
<input type="password" class="form-control" placeholder="Password" id="pw">
|
|
<input type="password" class="form-control" placeholder="Repeat Password" id="rpw">
|
|
<button class="btn btn-primary" id="signup">Sign Up</button>
|
|
<hr>
|
|
<div class="text-center">Already have an account? <a href="/login">Sign in!</a></div>
|
|
</div>
|
|
</template>
|
|
|
|
<template name="signin">
|
|
<div id="signin-container">
|
|
<h2>Sign In<a href="/"><i class="fa fa-home pull-right"></i></a></h2>
|
|
<input type="text" class="form-control" id="mail" placeholder="E-Mail Address or Username">
|
|
<input type="password" class="form-control" placeholder="Password" id="pw">
|
|
<button class="btn btn-primary" id="signin">Sign In</button>
|
|
<hr>
|
|
<div class="text-center">Need an account? <a href="/signup">Sign Up!</a></div>
|
|
</div>
|
|
</template>
|
|
|
|
<template name="list">
|
|
<ul class="list-group">
|
|
{{#each documents}}
|
|
<a class="list-group-item" href="/d/{{_id}}">{{title}}</a>
|
|
{{/each}}
|
|
</ul>
|
|
</template>
|