summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-09-06 23:19:58 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-09-06 23:19:58 +0900
commitc6b0bf42a112f0d9afa8920d6497cc76205ecaf4 (patch)
tree3d067ff9d9a2ef79b9f11a557f732d5d120b314a /src/web
parentwip (diff)
downloadsharkey-c6b0bf42a112f0d9afa8920d6497cc76205ecaf4.tar.gz
sharkey-c6b0bf42a112f0d9afa8920d6497cc76205ecaf4.tar.bz2
sharkey-c6b0bf42a112f0d9afa8920d6497cc76205ecaf4.zip
wip
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/tags/post-menu.tag23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/web/app/common/tags/post-menu.tag b/src/web/app/common/tags/post-menu.tag
index 33895212bc..be4468a214 100644
--- a/src/web/app/common/tags/post-menu.tag
+++ b/src/web/app/common/tags/post-menu.tag
@@ -2,6 +2,18 @@
<div class="backdrop" ref="backdrop" onclick={ close }></div>
<div class="popover { compact: opts.compact }" ref="popover">
<button if={ post.user_id === I.id } onclick={ pin }>%i18n:common.tags.mk-post-menu.pin%</button>
+ <div if={ I.is_pro && !post.is_category_verified }>
+ <select ref="categorySelect">
+ <option value="">%i18n:common.tags.mk-post-menu.select%</option>
+ <option value="music">%i18n:common.post_categories.music%</option>
+ <option value="game">%i18n:common.post_categories.game%</option>
+ <option value="anime">%i18n:common.post_categories.anime%</option>
+ <option value="it">%i18n:common.post_categories.it%</option>
+ <option value="gadgets">%i18n:common.post_categories.gadgets%</option>
+ <option value="photography">%i18n:common.post_categories.photography%</option>
+ </select>
+ <button onclick={ categorize }>%i18n:common.tags.mk-post-menu.categorize%</button>
+ </div>
</div>
<style>
$border-color = rgba(27, 31, 35, 0.15)
@@ -111,6 +123,17 @@
});
};
+ this.categorize = () => {
+ const category = this.refs.categorySelect.options[this.refs.categorySelect.selectedIndex].value;
+ this.api('posts/categorize', {
+ post_id: this.post.id,
+ category: category
+ }).then(() => {
+ if (this.opts.cb) this.opts.cb('categorized', '%i18n:common.tags.mk-post-menu.categorized%');
+ this.unmount();
+ });
+ };
+
this.close = () => {
this.refs.backdrop.style.pointerEvents = 'none';
anime({