commento/frontend/dashboard.html

400 lines
18 KiB
HTML
Raw Normal View History

2018-06-04 00:06:17 +08:00
<html>
<head>
<script src="[[[.CdnPrefix]]]/js/jquery.js"></script>
<script src="[[[.CdnPrefix]]]/js/vue.js"></script>
<script src="[[[.CdnPrefix]]]/js/highlight.js"></script>
<script src="[[[.CdnPrefix]]]/js/chartist.js"></script>
<script src="[[[.CdnPrefix]]]/js/dashboard.js"></script>
<link rel="icon" href="[[[.CdnPrefix]]]/images/120x120.png">
<link rel="stylesheet" href="[[[.CdnPrefix]]]/css/chartist.css">
<link rel="stylesheet" href="[[[.CdnPrefix]]]/css/dashboard.css">
2018-06-04 00:06:17 +08:00
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700|Source+Sans+Pro:200,300,400,700" rel="stylesheet">
<title>Commento: Dashboard</title>
</head>
<div id="navbar" class="navbar">
<a href="[[[.Origin]]]/" class="navbar-item navbar-logo-text"><img src="[[[.CdnPrefix]]]/images/logo.svg" class="navbar-logo">Commento</a>
<div class="navbar-item">
<a href="[[[.Origin]]]/logout" class="navbar-item">Logout</a>
<div class="float-right"><b><div id="owner-name"></div></b></div>
2018-06-04 00:06:17 +08:00
</div>
</div>
<script>
window.onload = function() {
window.commento.selfGet(function() {
window.commento.vueConstruct(function() {
window.commento.navbarFill();
window.commento.domainRefresh();
2018-06-04 00:06:17 +08:00
$(document).ready(function(){
$("ul.tabs li").click(function(){
var tab_id = $(this).attr("data-tab");
$("ul.tabs li").removeClass("current");
$(".content").removeClass("current");
$(this).addClass("current");
$("#"+tab_id).addClass("current");
});
});
});
});
};
</script>
<div class="global-error" id="global-error"></div>
<div class="global-ok" id="global-ok"></div>
<div id="dashboard" class="dashboard-container">
<div class="pane-left">
<div class="tree" v-if="domains.length == 0 || domains[0].show == false">
2018-07-04 20:51:31 +08:00
<img class="tree-svg" src="[[[.CdnPrefix]]]/images/tree.svg">
2018-06-04 00:06:17 +08:00
It's so quiet in here.
</div>
<div class="pane-setting" v-for="domain in domains" v-on:click="window.commento.domainSelect(domain.domain)" id="{{domain.hex}}" v-bind:class="{selected: domain.selected}" v-if="domain.show">
2018-06-04 00:06:17 +08:00
<div class="pane-setting-inside">
<div class="setting-title">{{domain.name}}</div>
<div class="setting-subtitle">{{domain.domain}}</div>
</div>
</div>
<div class="pane-setting" id="domain-add" onclick="document.location.hash='#new-domain-modal'">
2018-06-04 00:06:17 +08:00
<div class="pane-setting-inside super-setting">
<div class="super-setting-title">+</div>
<div class="super-setting-text">New Domain</div>
</div>
</div>
</div>
<div class="pane-middle">
<div v-if="showSettings" class="pane-setting" v-for="setting in settings" v-on:click="window.commento.settingSelect(setting.id)" id="{{setting.id}}" v-bind:class="{selected: setting.selected}">
2018-06-04 00:06:17 +08:00
<div class="pane-setting-inside">
<div class="setting-title">{{setting.text}}</div>
<div class="setting-subtitle">{{setting.meaning}}</div>
</div>
</div>
<div class="select-a-domain" v-if="!showSettings">
Select a website on the left.
</div>
</div>
<div class="pane-right">
<!-- Installation -->
<div id="installation-view" class="view hidden">
<div class="view-inside">
<div class="large-view">
<div class="tabs-container">
<div class="tab">
<ul class="tabs">
<li class="tab-link original current" data-tab="install-tab-1">Universal Snippet</li>
</ul>
<div id="install-tab-1" class="content original current">
<div class="import-text">
Copy the following piece of HTML code and paste it where you'd like Commento to load.
</div>
<pre><code id="code-div" class="html"></code></pre>
<div class="import-text">
2018-06-04 00:06:17 +08:00
And that's it. All your settings, themes, and comments would be automagically loaded. Commento is mobile-responsive too, as it simply fills the container it is put in.
</div>
<br>
<div class="import-text">
Read the Commento documentation <a href="https://docs.commento.io/configuration/">on configuration</a>.
</div>
2018-06-04 00:06:17 +08:00
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Stats -->
<div id="statistics-view" class="view hidden">
<div class="view-inside">
<div class="mid-view center">
<div class="center center-title">
Analytics
</div>
<div class="stat">
<div class="number">
<div class="digits gray-digits">{{domains[cd].viewsLast30Days.zeros}}</div>
<div class="digits">{{domains[cd].viewsLast30Days.num}}</div>
<div class="digits dark-gray-digits">{{domains[cd].viewsLast30Days.units}}</div>
</div>
<div class="text">
views in the last 30 days
</div>
<div class="graph" id="views-graph"></div>
</div>
<div class="stat">
<div class="number">
<div class="digits gray-digits">{{domains[cd].commentsLast30Days.zeros}}</div>
<div class="digits">{{domains[cd].commentsLast30Days.num}}</div>
<div class="digits dark-gray-digits">{{domains[cd].commentsLast30Days.units}}</div>
</div>
<div class="text">
comments in the last 30 days
</div>
<div class="graph" id="comments-graph"></div>
</div>
</div>
</div>
</div>
<!-- moderation -->
<div id="moderation-view" class="view hidden">
<div class="view-inside">
<div class="small-view mid-view">
<div class="tabs-container">
<div class="tab">
<ul class="tabs">
<li class="tab-link original current" data-tab="mod-tab-1">Moderator List</li>
</ul>
<div id="mod-tab-1" class="content original current">
<div class="pitch">
Moderators have the power to approve and delete comments. To make someone a moderator, add their email address down below. Once added, shiny new buttons will appear on each comment for that person on each page when they log in.<br><br>
You're still the only administrator and you're the only person who can add and remove moderators. Moderators do not have access to this dashboard. Their access is restricted to pages on your website.
2018-06-04 00:06:17 +08:00
</div>
<div class="commento-email-container">
<div class="commento-email">
<input class="commento-input" type="text" id="new-mod" placeholder="Email">
<button id="new-mod-button" class="commento-email-button" onclick="window.commento.moderatorNewHandler()">Add moderator</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
<div class="mod-emails-container">
<div class="content">
<div class="mod-email" v-for="email in domains[cd].moderators" v-if="domains[cd].moderators.length > 0">
<div class="email">{{email.email}}</div>
<div class="delete" v-on:click="window.commento.moderatorDeleteHandler(email.email)">Delete</div>
2018-06-04 00:06:17 +08:00
<div class="date">added {{email.timeAgo}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Configure Domain -->
2018-06-04 00:06:17 +08:00
<div id="general-view" class="view hidden">
<div class="view-inside">
<div class="small-mid-view">
<div class="center center-title">
Configure Domain
2018-06-04 00:06:17 +08:00
</div>
<div class="box">
<div class="row">
<div class="label">Website Name</div>
<input class="input gray-input" id="cur-domain-name" type="text" :placeholder="domains[cd].origName" v-model="domains[cd].name">
</div>
<div class="row no-border round-check">
<input type="checkbox" class="switch" v-model="domains[cd].autoSpamFilter" id="spam-filtering">
<label for="spam-filtering">Automatic spam filtering</label>
<div class="pitch">
2018-06-05 16:31:29 +08:00
Commento uses Akismet's advanced spam detection to automatically identify and remove spam comments. We strongly recommended you have this enabled.
2018-06-04 00:06:17 +08:00
</div>
</div>
<div class="row no-border round-check">
<input type="checkbox" class="switch" v-model="domains[cd].requireModeration" id="require-moderation">
<label for="require-moderation">Require all comments to be approved manually</label>
<div class="pitch">
Enabling this would require a moderator to approve every comment. Moderators can manually delete comments even if this is not enabled.
</div>
</div>
<div class="row no-border round-check">
<input type="checkbox" class="switch" v-model="domains[cd].allowAnonymous" id="allow-anonymous">
<label for="allow-anonymous">Allow anonymous comments</label>
2018-06-04 00:06:17 +08:00
<div class="pitch">
Enabling this would allow your readers to comment anonymously. Disabling would require the to authenticate themselves (using their Google account, for example).
2018-06-04 00:06:17 +08:00
</div>
</div>
<div class="row no-border round-check indent" v-if="domains[cd].allowAnonymous">
<input type="checkbox" class="switch" v-model="domains[cd].moderateAllAnonymous" id="moderate-all-anonymous">
<label for="moderate-all-anonymous">Require anonymous comments to be approved manually</label>
<div class="pitch">
Enabling this would require a moderator to approve anonymous comments. This is recommended as a lot of spam is often from anonymous comments.
</div>
</div>
2018-06-04 00:06:17 +08:00
<div id="new-domain-error" class="modal-error-box"></div>
</div>
<div class="center">
<button id="save-general-button" onclick="window.commento.generalSaveHandler()" class="button">Save Changes</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
</div>
</div>
<!-- Import Comments -->
<div id="import-view" class="view hidden">
<div class="view-inside">
<div class="large-view">
<div class="tabs-container">
<div class="tab">
<ul class="tabs">
<li class="tab-link original current" data-tab="install-tab-1">Disqus</li>
</ul>
<div id="install-tab-1" class="content original current">
<div class="import-text">
If you're currently using Disqus and want to import all your comments into Commento, you can do so:
<ul>
<li>
Go to <a href="http://disqus.com/admin/discussions/export/">the admin export section</a> in Disqus and click on <b>Export Comments</b>. This should start the process of exporting your comments.
</li>
<li>
After a while, you'll receive an email from Disqus with a link to a compressed archive of all comments and associated data. Copy and paste that link here and start the import process:
<br><br>
<div class="commento-email-container">
<div class="commento-email">
2018-06-14 16:58:11 +08:00
<input class="commento-input" type="text" id="disqus-url" placeholder="https://media.disqus.com/uploads/...">
<button id="disqus-import-button" class="commento-email-button" onclick="window.commento.importDisqus()">Import</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
<div class="subtext-container">
<div class="subtext">
<div>Note: it is strongly recommended you do this only once. Multiple imports for the same domain may have unintended effects.</div>
</div>
</div>
</li>
<li>
We'll automatically download this file, extract it, parse it and import comments into Commento. The URL information will be preserved. By using this service, you grant Commento the permission to download and process your Disqus information.
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Danger Zone -->
<div id="danger-view" class="view hidden">
<div class="view-inside">
<div class="mid-view">
<div class="tabs-container">
<div class="tab">
<ul class="tabs">
<li class="tab-link original current" data-tab="danger-tab-1">Freeze Comments</li>
<li class="tab-link current" data-tab="danger-tab-2">Delete Domain</li>
</ul>
<div id="danger-tab-1" class="content original current">
<div class="box" v-if="domains[cd].state == 'frozen'">
<div class="box-subtitle">
If you desire to re-allow comments again on your website, you can do so. You can, of course, freeze the site again in the future.
</div>
<button onclick="document.location.hash='#unfreeze-domain-modal'" class="button green-button">Unfreeze Domain</button>
2018-06-04 00:06:17 +08:00
</div>
<div class="box" v-if="domains[cd].state != 'frozen'">
<div class="box-subtitle">
If you desire to temporarily freeze new comments (domain-wide), thereby making it read-only, you can do so. You can choose to unfreeze later; this is temporary.
</div>
<button id="orange-button" onclick="document.location.hash='#freeze-domain-modal'" class="button orange-button">Freeze Domain</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
</div>
<div id="danger-tab-2" class="content">
<div class="box">
<div class="box-subtitle">
Want to completely remove Commento from your website? This will permanently delete all comments and there is literally no way to retrieve your data once you do this.
</div>
<button id="big-red-button" class="button big-red-button" onclick="document.location.hash='#delete-domain-modal'">Delete Domain</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="freeze-domain-modal" class="modal-window">
<div class="inside">
<a href="#modal-close" title="Close" class="modal-close"></a>
<div class="modal-title">Freeze Domain</div>
<div class="modal-subtitle">
Are you absolutely sure you want to freeze your domain, thereby making it read-only? You can choose to unfreeze later; this is temporary.
</div>
<div class="modal-contents">
<button id="orange-button" class="button orange-button" onclick="window.commento.domainFreezeHandler()">Freeze Domain</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
</div>
<div id="unfreeze-domain-modal" class="modal-window">
<div class="inside">
<a href="#modal-close" title="Close" class="modal-close"></a>
<div class="modal-title">Unfreeze Domain</div>
<div class="modal-subtitle">
Are you absolutely sure you want to unfreeze your domain? This will re-allow new comments. You can choose to freeze again in the future.
</div>
<div class="modal-contents">
<button id="blue-button" class="button green-button" onclick="window.commento.domainUnfreezeHandler()">Unfreeze Domain</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
</div>
<div id="delete-domain-modal" class="modal-window">
<div class="inside">
<a href="#modal-close" title="Close" class="modal-close"></a>
<div class="modal-title">Delete Domain</div>
<div class="modal-subtitle">
Are you absolutely sure? This will permanently delete all comments and there is literally no way to retrieve your data once you do this.
</div>
<div class="modal-contents">
<button id="big-red-button" class="button big-red-button" onclick="window.commento.domainDeleteHandler()">Delete Domain</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
</div>
<div id="new-domain-modal" class="modal-window">
<div class="inside">
<a href="#modal-close" title="Close" class="modal-close"></a>
<div class="modal-title">Add a New Domain</div>
<div class="modal-contents">
<div class="box">
<div class="box-subtitle">
Remember to double-check the domain, as only connections from this domain will be accepted. You <b>cannot</b> change this in the future. You can change the name, however.
</div>
<div class="row">
<div class="label">Website Name</div>
2018-09-23 14:30:59 +08:00
<input class="input gray-input" id="new-domain-name" type="text" placeholder="My Blog">
2018-06-04 00:06:17 +08:00
</div>
<div class="row">
<div class="label">Website Domain</div>
<input class="input gray-input" id="new-domain-domain" type="text" placeholder="https://blog.billie.com">
</div>
</div>
<div id="new-domain-error" class="modal-error-box"></div>
<div class="center">
<button id="add-site-button" onclick="window.commento.domainNewHandler()" class="button">Add Domain</button>
2018-06-04 00:06:17 +08:00
</div>
</div>
</div>
</div>
</html>