From e75890052e6e7bc340d40c1c66992f4b10e03279 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 19 Mar 2018 21:25:41 -0700 Subject: (old) code --- fatcat/schema.py | 68 ++++++++++++++ webface/index.html | 262 +++++++++++++++++++++++++++++++++++++++++++++++++++++ webface/notes.txt | 8 ++ 3 files changed, 338 insertions(+) create mode 100644 fatcat/schema.py create mode 100644 webface/index.html create mode 100644 webface/notes.txt diff --git a/fatcat/schema.py b/fatcat/schema.py new file mode 100644 index 00000000..cdc98ccf --- /dev/null +++ b/fatcat/schema.py @@ -0,0 +1,68 @@ + +from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey + +metadata = MetaData() + +# TODO: http://docs.sqlalchemy.org/en/latest/orm/extensions/declarative/mixins.html + +work_id = Table('work_id', metadata, + Column('id', Integer, primary_key=True, autoincrement=False), + Column('revision', ForeignKey('work_revision.id')), + ) + +work_revision = Table('work_revision', metadata, + Column('id', Integer, primary_key=True, autoincrement=True), + Column('previous', ForeignKey('work_revision.id'), nullable=True), + Column('state', enum('normal', 'redirect', 'removed')), + Column('redirect_id', ForeignKey('work_id.id'), nullable=True)), + Column('edit_id'), ForeignKey('edit.id')), + + Column('title', String), + Column('work_type', ForeignKey()), + Column('date', String), + Column('journal', String), + Column('doi', String), + ) + +creator_id = Table('creator_id', metadata, + Column('id', Integer, primary_key=True, autoincrement=False), + Column('revision', ForeignKey('creator_revision.id')), + ) + +creator_revision = Table('creator_revision', metadata, + Column('id', Integer, primary_key=True, autoincrement=True), + Column('previous', ForeignKey('creator_revision.id'), optional=True), + Column('state', enum('normal', 'redirect', 'removed')), + Column('redirect_id', ForeignKey('creator_id.id'), optional=True)), + Column('edit_id'), ForeignKey('edit.id')), + + Column('name', String), + Column('sortname', String), + ) + +authorship = Table('authorship', metadata, + Column('id', Integer, primary_key=True, autoincrement=True), + Column('work_rev', ForeignKey('work_revision.id'), nullable=False), + Column('creator_id', ForeignKey('creator_id.id'), nullable=False), + ) + +edit = Table('edit', metadata, + Column('id', Integer, primary_key=True, autoincrement=True), + Column('edit_group', ForeignKey('edit_group.id')), + Column('editor', ForeignKey('editor.id')), + ) + +edit_group = Table('edit_group', metadata, + Column('id', Integer, primary_key=True, autoincrement=True), + ) + +editor = Table('editor', metadata, + Column('id', Integer, primary_key=True, autoincrement=True), + Column('username', String), + ) + +changelog = Table('changelog', metadata, + Column('id', Integer, primary_key=True, autoincrement=True), + Column('edit_id', ForeignKey('edit.id')), + Column('timestamp', Integer), + ) diff --git a/webface/index.html b/webface/index.html new file mode 100644 index 00000000..6e269e38 --- /dev/null +++ b/webface/index.html @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + +
+ +
+

Adding a New Thing

+ +
+ +

The Basics

+ +
+ + +
+ +
+ + +
+ + + + + +
+ +
+ + +
+
+ + +
+ + +
+ + +
+ + +
+ + +

Primary Release / Edition

+ + + + + + + + + + + + + +

Anything Else?

+ + + + +
Create Work
+
+ +
+
+ + + + + + diff --git a/webface/notes.txt b/webface/notes.txt new file mode 100644 index 00000000..8ed47d0b --- /dev/null +++ b/webface/notes.txt @@ -0,0 +1,8 @@ + +tachyons is nice for simple css-only stuff, but let's use "Semantic UI" because +it has a bunch of javascript form stuff. + + + + + -- cgit v1.2.3