Permalink
Browse files

sample_settings.py included + icons for actions

  • Loading branch information...
joelewis committed Dec 22, 2018
1 parent be91ef1 commit 762b8c1d8ba634da76ce2d069e4fd20f137fee61
@@ -7,9 +7,10 @@
7. [done] More formatting options like codeblocks, images, etc.
8. [done] Rich text editing toolbar should be customized.
9. [done] Register / Login flow APIs & Pages.
10. Encrypt/decrpyt sessions in URL.
10. [done] Encrypt/decrpyt sessions in URL.
11. [done] Publish action on draft page
12. [done] Favicon & Title
13. Proper error responses with HTTP codes
13. Exception handling and error reporting
14. Higher Order Components to inject shared behavior (createDraft, list, etc)
14. Higher Order Components to inject shared behavior (createDraft, list, etc)
15. [important] The PostView page should contain author information and link to author's other posts.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -93,11 +93,11 @@ class DraftList extends Component {
renderItem={item => (
<List.Item
actions={[
<Link to={item.editurl}>Edit</Link>,
<Link to={item.viewurl}>View</Link>,
<Link to={item.playurl}>Play</Link>,
<Link to={item.playurl}><Icon type="caret-right" style={{color: '#3eb995'}} /> Play</Link>,
<Link to={item.viewurl}><Icon type="eye" theme="twoTone" twoToneColor="#6f10e4" /> View</Link>,
<Link to={item.editurl}><Icon type="edit" theme="twoTone" twoToneColor="#0098ff" /> Edit</Link>,
<Popconfirm title="Are you sure you want to delete this piece?" onConfirm={this.deletePost.bind(this, item)} okText="Yes" cancelText="No">
<a>Delete</a>
<a><Icon type="delete" theme="twoTone" twoToneColor="#ff4d4f" /> Delete</a>
</Popconfirm>
]}
>
@@ -1,6 +1,6 @@
import React, {Component} from 'react';
import {createBrowserHistory} from 'history';
import {Menu} from 'antd';
import {Menu, Icon} from 'antd';
import {Link} from "react-router-dom";
import Model from '../models.js'
import $ from 'jquery';
@@ -54,9 +54,9 @@ class HomeMenu extends Component {
className="writango-menu-container"
onSelect={this.onSelect.bind(this)}
>
<Menu.Item key="posts" ><Link to={"/writes/@"+Model.session.user.username}>Posts</Link></Menu.Item>
<Menu.Item key="drafts"><Link to={"/writes/@"+Model.session.user.username+"/drafts"}>Drafts</Link></Menu.Item>
<Menu.Item key="write" onClick={this.createDraft.bind(this)}>Write</Menu.Item>
<Menu.Item key="posts" ><Link to={"/writes/@"+Model.session.user.username}><Icon type="global" style={{color: "#52c41a"}} />Posts</Link></Menu.Item>
<Menu.Item key="drafts"><Link to={"/writes/@"+Model.session.user.username+"/drafts"}><Icon type="save" theme="twoTone" twoToneColor="#eb2f96" />Drafts</Link></Menu.Item>
<Menu.Item key="write" onClick={this.createDraft.bind(this)}><Icon type="edit" theme="twoTone" />Write</Menu.Item>
{/* <Menu.Item key="3">nav 3</Menu.Item> */}
</Menu>
)
@@ -84,7 +84,7 @@ class Index extends Component{
<div onClick={() => { $(window).trigger('RefreshMenu') }} className="writango-logo"><Link style={{ textDecoration: 'none', color: '#555'}} to="/"> <span className="font-color-blue">W</span>RITANG<span className="font-color-blue">O</span></Link></div>
<Dropdown className="writango-menu-container" overlay={Model.session.user.anonymous ? AnonymousMenu : UserMenu} trigger={['click']}>
<a style={{float: "right"}} className="ant-dropdown-link" href="#">
{Model.session.user.anonymous ? "Hello, Mr. Anonymous!" : Model.session.user.email} <Icon type="down" />
<Icon type="user" /> {Model.session.user.anonymous ? "Hello, Guest!" : Model.session.user.email} <Icon type="down" />
</a>
</Dropdown>
<HomeMenu selectedKey={this.state.selectedKey} onSelect={this.onSelect.bind(this)}/>
@@ -98,11 +98,11 @@ class DraftList extends Component {
renderItem={item => (
<List.Item
actions={[
<Link to={item.playurl}>Play</Link>,
<Link to={item.viewurl}>View</Link>,
<Link style={{display: this.isOwner(item) ? 'block': 'none' }} to={item.editurl}>Edit</Link>,
<Link to={item.playurl}><Icon type="caret-right" style={{color: '#3eb995'}} /> Play</Link>,
<Link to={item.viewurl}><Icon type="eye" theme="twoTone" twoToneColor="#6f10e4" /> View</Link>,
<Link style={{display: this.isOwner(item) ? 'block': 'none' }} to={item.editurl}><Icon type="edit" theme="twoTone" twoToneColor="#0098ff" /> Edit</Link>,
<Popconfirm title="Are you sure you want to delete this piece?" onConfirm={this.deletePost.bind(this, item)} okText="Yes" cancelText="No">
<a style={{display: this.isOwner(item) ? 'block': 'none' }}>Delete</a>
<a style={{display: this.isOwner(item) ? 'block': 'none' }}><Icon type="delete" theme="twoTone" twoToneColor="#ff4d4f" /> Delete</a>
</Popconfirm>
]}
>
@@ -3,7 +3,7 @@ const webpack = require("webpack");
const MinifyPlugin = require("babel-minify-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

const STATIC_HOST = 'https://hexopress.sgp1.cdn.digitaloceanspaces.com';
const STATIC_HOST = 'https://hexopress.sgp1.cdn.digitaloceanspaces.com'; // configure your own static provider domain

module.exports = {
entry: "./src/index.js",
@@ -0,0 +1,145 @@
"""
Django settings for writango_project project.
Generated by 'django-admin startproject' using Django 1.11.16.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'SOME_SECRET_KEY'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
# 'django.contrib.staticfiles',
'writango'
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'writango_project.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'writango_project.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/writango/static/'

STATIC_ROOT = '/absolute/path/to/public/folder/'

# enter your static host provider url here e.g aws.s3.amazon.com/hexo
STATIC_HOST = '' # enter the static host provider host: aws | digital ocean spaces | etc

# LOGGING = {
# 'version': 1,
# 'disable_existing_loggers': False,
# 'handlers': {
# 'file': {
# 'level': 'DEBUG',
# 'class': 'logging.FileHandler',
# 'filename': BASE_DIR + '/path/to/django/debug.log',
# },
# },
# 'loggers': {
# 'django': {
# 'handlers': ['file'],
# 'level': 'DEBUG',
# 'propagate': True,
# },
# },
# }

0 comments on commit 762b8c1

Please sign in to comment.