MediaCMS frontend, initial commit

This commit is contained in:
styiannis
2020-12-16 13:48:37 +02:00
parent e29fa326ce
commit f34d500377
183 changed files with 72472 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
MediaCMS.api = {
media: "/media",
comments: '/comments',
search: "/search",
tags: '/tags',
categories: '/categories',
members: '/users',
liked: '/user/action/like',
history: '/user/action/watch',
actions: '/actions',
{% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER or IS_MEDIACMS_EDITOR %}manage_media: '/manage_media',{% endif %}
{% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER %}manage_users: '/manage_users',{% endif %}
{% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER or IS_MEDIACMS_EDITOR %}manage_comments: '/manage_comments',{% endif %}
};

View File

@@ -0,0 +1,37 @@
MediaCMS.url = {
home: "{{FRONTEND_HOST}}",
search: "{{FRONTEND_HOST}}/search",
latestMedia: "{{FRONTEND_HOST}}/latest",
featuredMedia: "{{FRONTEND_HOST}}/featured",
recommendedMedia: "{{FRONTEND_HOST}}/recommended",
members: "{{FRONTEND_HOST}}/members",
/* Error pages */
error404: "{{FRONTEND_HOST}}/error",
/* Taxonomies pages */
tags: "{{FRONTEND_HOST}}/tags",
categories: "{{FRONTEND_HOST}}/categories",
topics: "{{FRONTEND_HOST}}/topics",
languages: "{{FRONTEND_HOST}}/languages",
countries: "{{FRONTEND_HOST}}/countries",
/* User pages */
likedMedia: "{{FRONTEND_HOST}}/liked",
history: "{{FRONTEND_HOST}}/history",
/* Add/edit pages */
addMedia: "{{FRONTEND_HOST}}/upload",
/* User account pages */
editProfile: "{{user.edit_url}}",
{% if request.user.is_authenticated %}
signout: "{{FRONTEND_HOST}}/accounts/logout/",
editChannel: "{{user.default_channel_edit_url}}",
changePassword: "{{FRONTEND_HOST}}/accounts/password/change/",
/* Administration pages */
{% if IS_MEDIACMS_ADMIN %}admin: '/admin',{% endif %}
/* Management pages */
{% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER or IS_MEDIACMS_EDITOR %}manageMedia: "{{FRONTEND_HOST}}/manage/media",{% endif %}
{% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER %}manageUsers: "{{FRONTEND_HOST}}/manage/users",{% endif %}
{% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER or IS_MEDIACMS_EDITOR %}manageComments: "{{FRONTEND_HOST}}/manage/comments",{% endif %}
{% else %}
signin: "{{FRONTEND_HOST}}/accounts/login/",
register: "{{FRONTEND_HOST}}/accounts/signup/",
{% endif %}
};

View File

@@ -0,0 +1,27 @@
MediaCMS.user = {
name: {% if request.user.is_authenticated %}"{{request.user.username}}"{% else %}null{% endif %},
username: {% if request.user.is_authenticated %}"{{request.user.username}}"{% else %}null{% endif %},
thumbnail: {% if request.user.is_authenticated %}"{{request.user.thumbnail_url}}"{% else %}null{% endif %},
is: {
admin: {% if IS_MEDIACMS_ADMIN %}true{% else %}false{% endif %},
anonymous: {% if request.user.is_authenticated %}false{% else %}true{% endif %},
},
can: {
addMedia: {% if CAN_UPLOAD_MEDIA %}true{% else %}false{% endif %},
editMedia: {% if CAN_EDIT_MEDIA %}true{% else %}false{% endif %},
deleteMedia: {% if CAN_DELETE_MEDIA %}true{% else %}false{% endif %},
editSubtitle: {% if CAN_EDIT_MEDIA %}true{% else %}false{% endif %},
readComment: true,
addComment: true,
deleteComment: {% if CAN_DELETE_COMMENTS %}true{% else %}false{% endif %},
editProfile: {% if CAN_EDIT %}true{% else %}false{% endif %},
deleteProfile: {% if CAN_DELETE_PROFILE %}true{% else %}false{% endif %},
manageMedia: {% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER or IS_MEDIACMS_EDITOR %}true{% else %}false{% endif %},
manageUsers: {% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER %}true{% else %}false{% endif %},
manageComments: {% if IS_MEDIACMS_ADMIN or IS_MEDIACMS_MANAGER or IS_MEDIACMS_EDITOR %}true{% else %}false{% endif %},
},
pages: {
home: '/user/{{request.user.username}}',
about: '/user/{{request.user.username}}/about',
}
};

View File

@@ -0,0 +1,19 @@
<script type="text/javascript">
var MediaCMS = {
{% if media %}mediaId: "{{media}}", {% endif %}
{% if user %}profileId: "{{user.username}}", {% endif %}
};
{% include "config/core/api.html" %}
{% include "config/core/url.html" %}
{% include "config/core/user.html" %}
{% include "config/installation/contents.html" %}
{% include "config/installation/features.html" %}
{% include "config/installation/pages.html" %}
{% include "config/installation/site.html" %}
window.MediaCMS = MediaCMS;
</script>

View File

@@ -0,0 +1,26 @@
MediaCMS.contents = {
sidebar: {
navMenuItems: [{
text: "About",
link: "/about",
icon: 'contact_support',
},
{
text: "Terms",
link: "/tos",
icon: 'insert_drive_file',
},
{
text: "Contact",
link: "/contact",
icon: 'alternate_email',
}
],
belowNavMenu: null,
footer: 'Powered by <a href="//mediacms.io" title="mediacms.io" target="_blank">mediacms.io</a>',
},
uploader: {
belowUploadArea: "{{PRE_UPLOAD_MEDIA_MESSAGE}}",
postUploadMessage: "{{POST_UPLOAD_AUTHOR_MESSAGE_UNLISTED_NO_COMMENTARY}}",
},
};

View File

@@ -0,0 +1,28 @@
MediaCMS.features = {
embeddedVideo: {
initialDimensions: { // In pixels.
width: 560,
height: 315,
},
},
headerBar:{
hideLogin: {% if CAN_LOGIN %}false{% else %}true{% endif %},
hideRegister: {% if CAN_REGISTER %}false{% else %}true{% endif %},
},
media:{
actions:{
share: {% if CAN_SHARE_MEDIA %}true{% else %}false{% endif %},
report: {% if CAN_REPORT_MEDIA %}true{% else %}false{% endif %},
like: {% if CAN_LIKE_MEDIA %}true{% else %}false{% endif %},
dislike: {% if CAN_DISLIKE_MEDIA %}true{% else %}false{% endif %},
download: true,
comment: true,
},
shareOptions: [ 'embed', 'fb', 'tw', 'whatsapp', 'telegram', 'reddit', 'tumblr', 'vk', 'pinterest', 'mix', 'linkedin', 'email' ],
},
mediaItem:{
hideDate: false,
hideViews: false,
hideAuthor: false,
},
};

View File

@@ -0,0 +1,22 @@
MediaCMS.pages = {
home: {
sections:{
latest:{
title: 'Latest',
},
},
},
media: {
categoriesWithTitle: false,
htmlInDescription: false,
hideViews: false,
related:{
initialSize: 15,
},
},
profile:{
htmlInDescription: false,
includeHistory: false,
includeLikedMedia: false,
},
};

View File

@@ -0,0 +1,52 @@
MediaCMS.site = {
id: 'mediacms',
title: "{{PORTAL_NAME}}",
url: '{{FRONTEND_HOST}}/',
api: '{{FRONTEND_HOST}}/api/v1',
theme: {
mode: 'light', // Valid values: 'light', 'dark'.
switch: {
position: 'header', // Valid values: 'header', 'sidebar'.
},
},
logo:{
lightMode:{
img: "{{FRONTEND_HOST}}/static/images/logo_light.png",
svg: "{{FRONTEND_HOST}}/static/images/logo_light.svg",
},
darkMode:{
img: "{{FRONTEND_HOST}}/static/images/logo_dark.png",
svg: "{{FRONTEND_HOST}}/static/images/logo_dark.svg",
},
},
pages: {
latest:{
title: 'Recent uploads',
},
featured:{
title: 'Featured',
},
recommended:{
title: 'Recommended',
},
members:{
title: 'Members',
},
},
userPages: {
liked: {
title: 'Liked media',
},
history: {
title: 'History',
},
},
taxonomies: {
tags: {
title: 'Tags',
},
categories: {
title: 'Categories',
},
},
};