1
0
mirror of https://github.com/fazo96/markcloud.git synced 2025-01-10 11:04:21 +01:00
markcloud/client/templates.html
2014-10-09 16:14:20 +02:00

268 lines
9.1 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="ribbon">
<div class="github-fork-ribbon-wrapper right">
<div class="github-fork-ribbon">
<a href="http://github.com/fazo96/markcloud">Fork me on GitHub</a>
</div>
</div>
</template>
<template name="magicIcon">
{{#if currentUser}}
{{#if amIValid}}
<a id="icon" class="pull-right" href="{{pathFor 'profile' user=currentUser.username}}">
<small><i class="fa fa-chevron-right"></i></small>
</a>
{{else}}
<a class="pull-right" id="icon" href="{{pathFor 'profile' user=currentUser.username}}" data-toggle="tooltip" data-placement="left" title="Need email verification">
<small><i class="fa fa-envelope"></i></small>
</a>
{{/if}}
{{else}}
{{#if loggingIn}}
<a class="pull-right" href="/">
<small><i class="fa fa-cog fa-spin"></i></small></a>
{{else}}
{{#if notHome}}
<a class="pull-right" href="/">
<small><i class="fa fa-home"></i></small>
</a>
{{else}}
<a class="pull-right" href="{{pathFor 'signup'}}">
<small><i class="fa fa-user"></i></small>
</a>
{{/if}}
{{/if}}
{{/if}}
</template>
<template name="title">
<h1><a id="big-title" href="/">MarkCloud</a>{{> magicIcon}}</h1>
</template>
<template name="layout">
{{>ribbon}}
{{> yield region="outside"}}
<div class="container">
{{> title}} <hr> {{> yield}}
</div>
</template>
<template name="docLayout">
{{>ribbon}}
{{> yield region="outside"}}
<div class="container"> {{> yield}} </div>
</template>
<template name="home">
{{#markdown}}
### Share your markdown easily
Markcloud is a simple application that lets you share your markdown documents to the world. Just paste your markdown and get a _permanent link_ that lets you and everyone else view the result in a **modern responsive web page**.
### Free as in Free Software
No ads. [Open Source](http://github.com/fazo96/markcloud).
Made by [some guy in the internet](http://github.com/fazo96) that you probably should not trust, but hey:
### No Account needed
You can create a document _right now_. It will expire in 7 days.
This home page is written in markdown too!
{{/markdown}}
<div class="text-center"><a class="btn btn-success" id="new" href="{{pathFor 'new'}}">
<i class="fa fa-file-text"></i> New Document</a></div>
{{#markdown}}
### But with an account...
- Your documents **never expire!**
- You can **edit** and **delete** your documents
- You can **view** and **share** a list of all your documents
You will be able to delete your account and all your data whenever you want.
{{/markdown}}
<div class="text-center" id="btns">
<a class="btn btn-primary" id="twitter-login">
<i class="fa fa-twitter"></i> Log In With Twitter</a>
<br>or<br>
<a class="btn btn-primary" href="{{pathFor 'signup'}}">
<i class="fa fa-user"></i> Sign Up</a>
<a class="btn btn-success" href="{{pathFor 'signin'}}">
<i class="fa fa-sign-in"></i> Log In</a>
</div>
</template>
<template name="editor">
<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
<input type="checkbox" id="make-public" {{isPublic}}>
Make document visible on your profile
<textarea id="editor" class="form-control" rows="10" placeholder="Write your markdown :)" autofocus>{{text}}</textarea>
<p>Remember that this app is still in development so you should keep a backup
of your text somewhere else in case something goes wrong!</p>
<button id="upload" class="btn btn-primary">
<i class="fa fa-upload"></i> {{#if _id}}Update{{else}}Create{{/if}}</button>
</template>
<template name="doc">
{{#if showTitle}}<h1>{{title}}</h1><hr>{{/if}}
{{#if source}}
<textarea id="src" class="form-control" rows="{{rows}}" readonly>{{text}}</textarea>
{{else}}
<div id="doc">{{#markdown}}{{text}}{{/markdown}}</div>
{{/if}}
<hr>
<div class="text-center">
<!--{{> title}} <hr>-->
{{#unless currentUser}}
<p><a href="{{pathFor 'signin'}}">Log in</a> to edit and delete your documents<br></p>
{{/unless}}
{{#if valid}}
{{#if owned}}
<p>This document is <a id="owner-link" href="{{pathFor 'profile' user=currentUser.username}}">yours</a>.</p>
<p>You can link this document using a <a href="{{pathFor 'userDoc' user=currentUser.username _id=this._id}}">public</a> or <a href="{{pathFor 'doc'}}">anonymous</a> link.</p>
<p>Anonymous links don't reveal your profile.</p>
{{else}}
{{#if ownerName}}
<p>Document owned by <a href="{{pathFor 'profile' user=currentUser.username}}">{{ownerName}}</a></p>
{{else}}
{{#unless owner}}
<p>This anonymous document will <b>expire {{expirationDays}}</b></p>
{{/unless}}
{{/if}}
{{/if}}
<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="signup">
<div id="signup-container">
<h2>Sign Up</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">
<i class="fa fa-user"></i> Sign Up</button>
<hr>
<div class="text-center">Already have an account? <a href="{{pathFor 'signin'}}">Sign in!</a></div>
</div>
</template>
<template name="signin">
<div id="signin-container">
<h2>Sign In</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">
<i class="fa fa-sign-in"></i> Sign In</button>
<hr>
<div class="text-center">Need an account? <a href="{{pathFor 'signup'}}">Sign Up!</a></div>
</div>
</template>
<template name="profile">
{{#if isMe}}
<div class="text-center">
{{#if mail}}
<p>Hello <b>{{username}}</b> ({{mail}}). This is your profile.</p>
{{else}}
<p>Hello <b>{{profile.name}}</b> (@{{username}}). This is your profile.</p>
{{/if}}
{{#if noDocs}}
<p>You don't have any documents yet.</p>
{{/if}}
{{#unless amIValid}}
<p class="lead">You need to verify your email address. Click the link in the email you received.</p>
<button class="btn btn-primary" id="resend">
<i class="fa fa-envelope"></i> Resend</button>
{{/unless}}
</div>
<div class="text-center" id="profile-tools">
<a class="btn btn-primary" id="logout">
<i class="fa fa-sign-out"></i> Logout</a>
{{#if amIValid}}
<a class="btn btn-success" href="{{pathFor 'new'}}">
<i class="fa fa-file-text"></i> New Document</a>
{{/if}}
<a class="btn btn-danger" id="deleteme">
<i class="fa fa-exclamation-circle"></i> Delete Account</a>
</div>
{{else}}
<div class="text-center">
{{#if noDocs}}
<p>@{{username}} doesn't have any public documents.</p>
{{else}}
<p>These are @{{username}}'s public documents.</p>
{{/if}}
</div>
{{/if}}
{{#unless noDocs}}
<ul class="list-group">
{{#each documents}}
<a class="list-group-item" href="/d/{{_id}}">
{{title}}
{{#if public}}
<span class="label label-primary pull-right">Public</span>
{{/if}}
</a>
{{/each}}
</ul>
{{/unless}}
</template>
<template name="delete">
<p>If you want to delete your account enter your User Id ({{currentUser._id}})</p>
<input type="text" class="form-control" id="name" placeholder="enter your User Id.">
<button class="btn btn-danger" id="del-account">
<i class="fa fa-exclamation-circle"></i> Confirm</button>
</template>