Commit ff63bbf9 authored by svilayphiou's avatar svilayphiou

merging updates from branches Contour and Caveat

parent 6dc26f26
......@@ -3,6 +3,16 @@ import os
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
BACKUP_DIR = os.path.join(PROJECT_DIR, 'public')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'oy9@**&*m*wmw&3um_o!xr@e4jig9u+woz6^szs!a%mye5%qut'
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add one of postgresql_psycopg2, mysql, sqlite3, oracle
......@@ -33,5 +43,5 @@ MEDIA_ROOT = ''
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = '/home/osp/static-ethertoff-collected/'
STATIC_ROOT = ''
......@@ -31,6 +31,7 @@ ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'ethertoff',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
......@@ -39,7 +40,6 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'django.contrib.sites',
'etherpadlite',
'ethertoff',
#'south'
]
......
......@@ -38,6 +38,7 @@
<div id="staff-menu" class="private">
<span class="screen-only">{{ author.full_name_with_prefix }}</span>
<a class="button screen-only" href="{% url 'logout' %}{% if pad %}?next={% url 'pad-read' 'r' pad.display_slug %}{% endif %}">Log out</a>
<a class="button screen" href="{% url 'password_change' %}">Change password</a>
<a class="button screen-only" href="{% url 'pad-create' %}">Create</a>
<a class="button screen-only" href="{% url 'all' %}">List</a>
<a class="button screen-only" href="{% url 'publish' %}">Re-index</a>
......
......@@ -2,20 +2,22 @@
{% load i18n %}
{% block extra_styles %}
<link rel="stylesheet/less" href="{% url 'css-screen' %}" type="text/css" media="screen">
<link rel="stylesheet/less" href="{% url 'css-print' %}" type="text/css" media="print">
<link rel="stylesheet" href="{% url 'css-screen' %}" type="text/css" media="screen">
<link rel="stylesheet" href="{% url 'css-print' %}" type="text/css" media="print">
{% endblock %}
{% block title %}
<h1>{{ title }}</h1>
<h1>Create a new pad</h1>
{% endblock %}
{% block content %}
<form action="{% url 'pad-create' %}" method="post">
{% csrf_token %}
Pad name
<label>Pad name:</label>
{{ form.name }}
{{ form.group }}
<br />
<label></label>
<input class="submit" type="submit" value="{%trans "Create" %}" />
</form>
<legend></legend>
......
{% extends "base.html" %}
{% load wikify ethertoff_tags %}
{% block extra_styles %}
<link rel="stylesheet/less" href="{% url 'css-screen' %}" type="text/css" media="screen">
<link rel="stylesheet/less" href="{% url 'css-print' %}" type="text/css" media="print">
{% endblock %}
{% block head_meta %}
<meta property="og:type" content="article"/>
{% if meta %}
......
{% extends "base.html" %}
{% load wikify ethertoff_tags %}
{% load wikify ethertoff_tags static %}
{% block extra_styles %}
<link rel="stylesheet/less" href="{% url 'css-screen' %}" type="text/css" media="screen">
<link rel='stylesheet' href='{% static "js/slidy.css" %}' type='text/css' media='all' />
<link rel='stylesheet/less' href='{% url "css-slide" %}' type='text/css' media='all' />
<link rel="stylesheet" href="{% static 'js/slidy.css' %}" type='text/css' media="all" />
<link rel="stylesheet/less" href="{% url 'css-slide' %}" type='text/css' media="all" />
{% endblock %}
......
{% extends "base.html" %}
{% load ethertoff_tags %}
{% block extra_styles %}
<link rel="stylesheet/less" href="{% url 'css-screen' %}" type="text/css" media="screen">
<link rel="stylesheet/less" href="{% url 'css-print' %}" type="text/css" media="print">
{% endblock %}
{% block title %}
<header>
{% if meta.authors %}
......
......@@ -8,20 +8,26 @@
{% block content %}
{% if not user.is_authenticated %}
{% if form.errors %}
<p class="error">{% trans "Your username and password didn't match. Please try again." %}</p>
<p class="error">{% trans "Your username and password didn't match. Please try again." %}</p>
{% endif %}
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<div class="form-row">
{{ form.username.label_tag }}
{{ form.username }}
</div>
<div class="form-row">
{{ form.password.label_tag }}
{{ form.password }}
<input class="submit" type="submit" value="{% trans "Login" %}" />
</div>
<div class="form-row">
<label></label>
<input class="submit" type="submit" value="{% trans "Login" %}" />
</div>
<input type="hidden" name="next" value="{% if next %}{{ next }}{% else %}{% url 'home' %}{% endif %}" />
</form>
{% else %}
<p>You are already logged in—welcome!</p>
<p>You're logged in―welcome!</p>
{% endif %}
{% endblock %}
{% extends "base.html" %}
{% load i18n %}
{% block title %}
<h1>{% trans "Change your password" %}</h1>
{% endblock %}
{% block content %}
{% if user.is_authenticated %}
<form method="post" action="{% url 'password_change' %}">
{% csrf_token %}
<div class="form-row">
{{ form.old_password.label_tag }}
{{ form.old_password }}
{% for message in form.errors.old_password %}
<p class="error">{{ message }}</p>
{% endfor %}
</div>
<div class="form-row">
{{ form.new_password1.label_tag }}
{{ form.new_password1 }}
{% for message in form.errors.new_password1 %}
<p class="error">{{ message }}</p>
{% endfor %}
</div>
<div class="form-row">
{{ form.new_password2.label_tag }}
{{ form.new_password2 }}
{% for message in form.errors.new_password2 %}
<p class="error">{{ message }}</p>
{% endfor %}
</div>
<div class="form-row">
<label></label>
<input class="submit" type="submit" value="{% trans "Change password" %}" />
</div>
</form>
{% else %}
<p>You are already logged in—welcome!</p>
{% endif %}
{% endblock %}
......@@ -6,6 +6,7 @@ import dateutil.parser
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from django.utils.encoding import force_text
register = template.Library()
......@@ -47,7 +48,7 @@ def natural_join(val, cjn="and"):
"""
def to_string(object):
if isinstance(object, str) or isinstance(object, unicode):
if isinstance(object, str):
return object
try:
return object.__str__()
......@@ -68,7 +69,7 @@ def markdown_filter(value):
extensions = ["extra", ]
return mark_safe(markdown.markdown(force_text(value),
extensions))
extensions=extensions))
p_surrounds = re.compile(r'<p>(.*)</p>')
......
......@@ -29,7 +29,7 @@ app_name = "ethertoff"
urlpatterns = [
path('', views.home, name='home'),
path('admin/', admin.site.urls),
path('all/', TemplateView.as_view(template_name = 'all.html'), name='all'),
path('all/', views.all, name='all'), # TemplateView.as_view(template_name = 'all.html')
path('publish/', views.publish, name='publish'),
path('css-screen/', views.css, name='css-screen'),
path('css-print/', views.cssprint, name='css-print'),
......@@ -40,6 +40,7 @@ urlpatterns = [
{'template_name': 'login.html'}, name='login'),
path('accounts/logout', auth_views.LogoutView.as_view(),
{'template_name': 'logout.html'}, name='logout'),
path('accounts/password_change', auth_views.PasswordChangeView.as_view(), name="password_change"),
path('create/', views.padCreate, name='pad-create'),
re_path(r'(?P<mode>[r|s|p])/(?P<slug>[^/]+)$', views.pad_read, name='pad-read'),
#re_path(r'r/(?P<slug>[^/]+)$', views.pad, name='pad-read'),
......
This diff is collapsed.
Django==2.0.6
django-markdown==0.8.4
django-mysql==2.3.0
isodate==0.6.0
Markdown==2.6.11
mdx-figcaption==0.1
mysql-connector-python==8.0.11
mysqlclient==1.3.12
protobuf==3.6.0
py-mysql==1.0
pyetherpadlite==0.1
pyparsing==2.2.0
python-dateutil==2.7.3
pytz==2018.4
rdflib==4.2.2
six==1.11.0
South==1.0.2
Django>=2.0.6
django-markdown>=0.8.4
django-mysql>=2.3.0
isodate>=0.6.0
Markdown>=2.6.11
mysql-connector-python>=8.0.11
mysqlclient>=1.3.12
protobuf>=3.6.0
py-mysql>=1.0
#pyetherpadlite>=0.1
-e git+git://github.com/devjones/PyEtherpadLite.git#egg=PyEtherpadLite
https://github.com/aleray/markdown-figures/archive/master.zip
pyparsing>=2.2.0
python-dateutil>=2.7.3
pytz>=2018.4
rdflib>=4.2.2
six>=1.11.0
South>=1.0.2
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment