Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
128725c38f |
11 changed files with 7 additions and 33 deletions
|
@ -53,7 +53,6 @@
|
||||||
<div class='post-container'></div>
|
<div class='post-container'></div>
|
||||||
|
|
||||||
<div class='after-mobile-controls'>
|
<div class='after-mobile-controls'>
|
||||||
<div class='description'></div>
|
|
||||||
<% if (ctx.canCreateComments) { %>
|
<% if (ctx.canCreateComments) { %>
|
||||||
<h2>Add comment</h2>
|
<h2>Add comment</h2>
|
||||||
<div class='comment-form-container'></div>
|
<div class='comment-form-container'></div>
|
||||||
|
|
|
@ -187,9 +187,6 @@ class PostMainController extends BasePostController {
|
||||||
if (e.detail.source !== undefined && e.detail.source !== null) {
|
if (e.detail.source !== undefined && e.detail.source !== null) {
|
||||||
post.source = e.detail.source;
|
post.source = e.detail.source;
|
||||||
}
|
}
|
||||||
if (e.detail.desc !== undefined && e.detail.desc !== null) {
|
|
||||||
post.desc = e.detail.desc;
|
|
||||||
}
|
|
||||||
post.save().then(
|
post.save().then(
|
||||||
() => {
|
() => {
|
||||||
this._view.sidebarControl.showSuccess("Post saved.");
|
this._view.sidebarControl.showSuccess("Post saved.");
|
||||||
|
|
|
@ -114,10 +114,6 @@ class Post extends events.EventTarget {
|
||||||
return this._notes;
|
return this._notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
get desc() {
|
|
||||||
return this._desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
get comments() {
|
get comments() {
|
||||||
return this._comments;
|
return this._comments;
|
||||||
}
|
}
|
||||||
|
@ -281,9 +277,6 @@ class Post extends events.EventTarget {
|
||||||
if (this._source !== this._orig._source) {
|
if (this._source !== this._orig._source) {
|
||||||
detail.source = this._source;
|
detail.source = this._source;
|
||||||
}
|
}
|
||||||
if (this._desc !== this._orig._desc) {
|
|
||||||
detail.desc = this._desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
let apiPromise = this._id
|
let apiPromise = this._id
|
||||||
? api.put(uri.formatApiLink("post", this.id), detail, files)
|
? api.put(uri.formatApiLink("post", this.id), detail, files)
|
||||||
|
|
|
@ -9,6 +9,7 @@ BUILD_INFO=latest
|
||||||
# Set to 127.0.0.1:8080 if you wish to reverse-proxy the docker's port,
|
# Set to 127.0.0.1:8080 if you wish to reverse-proxy the docker's port,
|
||||||
# otherwise the port specified here will be publicly accessible
|
# otherwise the port specified here will be publicly accessible
|
||||||
PORT=8080
|
PORT=8080
|
||||||
|
# EXPOSED_POSTGRES_PORT=34517
|
||||||
|
|
||||||
# How many waitress threads to start
|
# How many waitress threads to start
|
||||||
# 4 is the default amount of threads. If you experience performance
|
# 4 is the default amount of threads. If you experience performance
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
##
|
##
|
||||||
## Use this as a template to set up docker-compose, or as guide to set up other
|
## Use this as a template to set up docker-compose, or as guide to set up other
|
||||||
## orchestration services
|
## orchestration services
|
||||||
#version: '2'
|
version: '2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- "${MOUNT_DATA}:/data:ro"
|
- "${MOUNT_DATA}:/data:ro"
|
||||||
ports:
|
ports:
|
||||||
- "${PORT}:80"
|
- "${PORT:-3000}:80"
|
||||||
|
|
||||||
sql:
|
sql:
|
||||||
image: postgres:11-alpine
|
image: postgres:11-alpine
|
||||||
|
@ -48,7 +48,7 @@ services:
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER:
|
POSTGRES_USER:
|
||||||
POSTGRES_PASSWORD:
|
POSTGRES_PASSWORD:
|
||||||
# ports:
|
ports:
|
||||||
# - 5432:5432
|
- "${EXPOSED_POSTGRES_PORT:-34517}:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- "${MOUNT_SQL}:/var/lib/postgresql/data"
|
- "${MOUNT_SQL}:/var/lib/postgresql/data"
|
||||||
|
|
|
@ -103,7 +103,6 @@ privileges:
|
||||||
'posts:edit:content': power
|
'posts:edit:content': power
|
||||||
'posts:edit:flags': regular
|
'posts:edit:flags': regular
|
||||||
'posts:edit:notes': regular
|
'posts:edit:notes': regular
|
||||||
'posts:edit:desc': regular
|
|
||||||
'posts:edit:relations': regular
|
'posts:edit:relations': regular
|
||||||
'posts:edit:safety': power
|
'posts:edit:safety': power
|
||||||
'posts:edit:source': regular
|
'posts:edit:source': regular
|
||||||
|
|
|
@ -72,7 +72,6 @@ def create_post(
|
||||||
source = ctx.get_param_as_string("contentUrl", default="")
|
source = ctx.get_param_as_string("contentUrl", default="")
|
||||||
relations = ctx.get_param_as_int_list("relations", default=[])
|
relations = ctx.get_param_as_int_list("relations", default=[])
|
||||||
notes = ctx.get_param_as_list("notes", default=[])
|
notes = ctx.get_param_as_list("notes", default=[])
|
||||||
desc = ctx.get_param_as_string("desc", default="")
|
|
||||||
flags = ctx.get_param_as_string_list(
|
flags = ctx.get_param_as_string_list(
|
||||||
"flags", default=posts.get_default_flags(content)
|
"flags", default=posts.get_default_flags(content)
|
||||||
)
|
)
|
||||||
|
@ -86,7 +85,6 @@ def create_post(
|
||||||
posts.update_post_source(post, source)
|
posts.update_post_source(post, source)
|
||||||
posts.update_post_relations(post, relations)
|
posts.update_post_relations(post, relations)
|
||||||
posts.update_post_notes(post, notes)
|
posts.update_post_notes(post, notes)
|
||||||
posts.update_post_desc(post, desc)
|
|
||||||
posts.update_post_flags(post, flags)
|
posts.update_post_flags(post, flags)
|
||||||
if ctx.has_file("thumbnail"):
|
if ctx.has_file("thumbnail"):
|
||||||
posts.update_post_thumbnail(post, ctx.get_file("thumbnail"))
|
posts.update_post_thumbnail(post, ctx.get_file("thumbnail"))
|
||||||
|
@ -161,9 +159,6 @@ def update_post(ctx: rest.Context, params: Dict[str, str]) -> rest.Response:
|
||||||
if ctx.has_param("notes"):
|
if ctx.has_param("notes"):
|
||||||
auth.verify_privilege(ctx.user, "posts:edit:notes")
|
auth.verify_privilege(ctx.user, "posts:edit:notes")
|
||||||
posts.update_post_notes(post, ctx.get_param_as_list("notes"))
|
posts.update_post_notes(post, ctx.get_param_as_list("notes"))
|
||||||
if ctx.has_param("desc"):
|
|
||||||
auth.verify_privilege(ctx.user, "posts:edit:desc")
|
|
||||||
posts.update_post_desc(post, ctx.get_param_as_string("desc"))
|
|
||||||
if ctx.has_param("flags"):
|
if ctx.has_param("flags"):
|
||||||
auth.verify_privilege(ctx.user, "posts:edit:flags")
|
auth.verify_privilege(ctx.user, "posts:edit:flags")
|
||||||
posts.update_post_flags(post, ctx.get_param_as_string_list("flags"))
|
posts.update_post_flags(post, ctx.get_param_as_string_list("flags"))
|
||||||
|
|
|
@ -197,7 +197,6 @@ class PostSerializer(serialization.BaseSerializer):
|
||||||
"favoritedBy": self.serialize_favorited_by,
|
"favoritedBy": self.serialize_favorited_by,
|
||||||
"hasCustomThumbnail": self.serialize_has_custom_thumbnail,
|
"hasCustomThumbnail": self.serialize_has_custom_thumbnail,
|
||||||
"notes": self.serialize_notes,
|
"notes": self.serialize_notes,
|
||||||
"desc": self.serialize_desc,
|
|
||||||
"comments": self.serialize_comments,
|
"comments": self.serialize_comments,
|
||||||
"pools": self.serialize_pools,
|
"pools": self.serialize_pools,
|
||||||
}
|
}
|
||||||
|
@ -329,9 +328,6 @@ class PostSerializer(serialization.BaseSerializer):
|
||||||
key=lambda x: x["polygon"],
|
key=lambda x: x["polygon"],
|
||||||
)
|
)
|
||||||
|
|
||||||
def serialize_desc(self) -> Any:
|
|
||||||
return self.post.desc
|
|
||||||
|
|
||||||
def serialize_comments(self) -> Any:
|
def serialize_comments(self) -> Any:
|
||||||
return [
|
return [
|
||||||
comments.serialize_comment(comment, self.auth_user)
|
comments.serialize_comment(comment, self.auth_user)
|
||||||
|
@ -783,11 +779,6 @@ def update_post_notes(post: model.Post, notes: Any) -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def update_post_desc(post: model.Post, desc: str) -> None:
|
|
||||||
assert post
|
|
||||||
post.desc = desc
|
|
||||||
|
|
||||||
|
|
||||||
def update_post_flags(post: model.Post, flags: List[str]) -> None:
|
def update_post_flags(post: model.Post, flags: List[str]) -> None:
|
||||||
assert post
|
assert post
|
||||||
target_flags = []
|
target_flags = []
|
||||||
|
|
|
@ -29,7 +29,6 @@ def upgrade():
|
||||||
sa.Column("image_width", sa.Integer(), nullable=True),
|
sa.Column("image_width", sa.Integer(), nullable=True),
|
||||||
sa.Column("image_height", sa.Integer(), nullable=True),
|
sa.Column("image_height", sa.Integer(), nullable=True),
|
||||||
sa.Column("flags", sa.Integer(), nullable=False),
|
sa.Column("flags", sa.Integer(), nullable=False),
|
||||||
sa.Column("description", sa.UnicodeText, nullable=True, default=""),
|
|
||||||
sa.Column("auto_fav_count", sa.Integer(), nullable=False),
|
sa.Column("auto_fav_count", sa.Integer(), nullable=False),
|
||||||
sa.Column("auto_score", sa.Integer(), nullable=False),
|
sa.Column("auto_score", sa.Integer(), nullable=False),
|
||||||
sa.Column("auto_feature_count", sa.Integer(), nullable=False),
|
sa.Column("auto_feature_count", sa.Integer(), nullable=False),
|
||||||
|
|
|
@ -110,6 +110,7 @@ class PostNote(Base):
|
||||||
|
|
||||||
post = sa.orm.relationship("Post")
|
post = sa.orm.relationship("Post")
|
||||||
|
|
||||||
|
|
||||||
class PostRelation(Base):
|
class PostRelation(Base):
|
||||||
__tablename__ = "post_relation"
|
__tablename__ = "post_relation"
|
||||||
|
|
||||||
|
@ -221,7 +222,6 @@ class Post(Base):
|
||||||
canvas_width = sa.Column("image_width", sa.Integer)
|
canvas_width = sa.Column("image_width", sa.Integer)
|
||||||
canvas_height = sa.Column("image_height", sa.Integer)
|
canvas_height = sa.Column("image_height", sa.Integer)
|
||||||
mime_type = sa.Column("mime-type", sa.Unicode(32), nullable=False)
|
mime_type = sa.Column("mime-type", sa.Unicode(32), nullable=False)
|
||||||
desc = sa.Column("description", sa.UnicodeText, nullable=True, default="")
|
|
||||||
|
|
||||||
# foreign tables
|
# foreign tables
|
||||||
user = sa.orm.relationship("User")
|
user = sa.orm.relationship("User")
|
||||||
|
|
Loading…
Reference in a new issue