forked from Plume-org/Plume
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit blogs, and add blog icons and banners (Plume-org#460)
Also adds a parameter to `md_to_html` to only render inline elements (so that we don't have titles or images in blog descriptions). And moves the delete button for the blog on the edition page. I still have to update the SQLite migration once others PRs with migrations will be merged. Also, there will be a problem when you edit a blog while not owning its banner or icon: when validating they will be reset to their default values… I don't see a good solution to this until we have a better way to handle uploads with Rocket (the same is probably happening for articles btw). And the icon/banner are not federated yet, I don't know if I should add it to this PR or if it can come after? ![image](https://user-images.githubusercontent.com/16254623/53894510-7d853300-4030-11e9-8a2c-f5c0b0c7f512.png) ![image](https://user-images.githubusercontent.com/16254623/53894539-8b3ab880-4030-11e9-8113-685a27be8d7c.png) Fixes Plume-org#453 Fixes Plume-org#454
- Loading branch information
Showing
41 changed files
with
1,371 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- This file should undo anything in `up.sql` | ||
ALTER TABLE blogs DROP COLUMN summary_html; | ||
ALTER TABLE blogs DROP COLUMN icon_id; | ||
ALTER TABLE blogs DROP COLUMN banner_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- Your SQL goes here | ||
ALTER TABLE blogs ADD COLUMN summary_html TEXT NOT NULL DEFAULT ''; | ||
ALTER TABLE blogs ADD COLUMN icon_id INTEGER REFERENCES medias(id) ON DELETE SET NULL DEFAULT NULL; | ||
ALTER TABLE blogs ADD COLUMN banner_id INTEGER REFERENCES medias(id) ON DELETE SET NULL DEFAULT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
-- This file should undo anything in `up.sql | ||
|
||
CREATE TABLE blogs2 ( | ||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
actor_id VARCHAR NOT NULL, | ||
title VARCHAR NOT NULL, | ||
summary TEXT NOT NULL DEFAULT '', | ||
outbox_url VARCHAR NOT NULL UNIQUE, | ||
inbox_url VARCHAR NOT NULL UNIQUE, | ||
instance_id INTEGER REFERENCES instances(id) ON DELETE CASCADE NOT NULL, | ||
creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
ap_url text not null default '' UNIQUE, | ||
private_key TEXT, | ||
public_key TEXT NOT NULL DEFAULT '', | ||
fqn TEXT NOT NULL DEFAULT '', | ||
CONSTRAINT blog_unique UNIQUE (actor_id, instance_id) | ||
); | ||
INSERT INTO blogs2 SELECT | ||
id, | ||
actor_id, | ||
title, | ||
summary, | ||
outbox_url, | ||
inbox_url, | ||
instance_id, | ||
creation_date, | ||
ap_url, | ||
private_key, | ||
public_key, | ||
fqn | ||
FROM blogs; | ||
DROP TABLE blogs; | ||
ALTER TABLE blogs2 RENAME TO blogs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- Your SQL goes here | ||
ALTER TABLE blogs ADD COLUMN summary_html TEXT NOT NULL DEFAULT ''; | ||
ALTER TABLE blogs ADD COLUMN icon_id INTEGER REFERENCES medias(id) ON DELETE SET NULL DEFAULT NULL; | ||
ALTER TABLE blogs ADD COLUMN banner_id INTEGER REFERENCES medias(id) ON DELETE SET NULL DEFAULT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.