// @import "bootstrap/pagination.less";
// @import "bootstrap/pager.less";
// @import "bootstrap/labels.less";
-// @import "bootstrap/badges.less";
+@import "bootstrap/badges.less";
// @import "bootstrap/jumbotron.less";
// @import "bootstrap/thumbnails.less";
@import "bootstrap/alerts.less";
font-size: 80%;
color: @comment-property-text-color;
}
+ .score {
+ cursor: pointer;
+ }
+ .moderate-reasons {
+ font-size: 80%;
+ color: @comment-property-text-color;
+ border: 1px solid @border-color-inactive;
+ padding: 2px 4px;
+ margin-top: 4px;
+ background: @article-background;
+
+ }
}
footer {
.signature {
#$c->app->log->debug(dumper($params));
my $user = $c->stash('user');
- if ($user->{is_admin}) {
- my $mod_reasons = $c->model('moderations')->reasons;
- $c->stash(moderate_reasons => $mod_reasons);
- }
+ my $mod_reasons = $c->model('moderations')->reasons;
+ $c->stash(moderate_reasons => $mod_reasons);
$c->render(story => $story,
discussion => $discuss,
return {
moderateReason: 0,
moderateMessage: '',
+ displayMetamodForm: 0,
};
},
props: {
comment: Object,
- fold: Boolean,
- hide: Boolean,
- hiddenBox: Boolean,
- hiddenCount: Number,
displayForce: Boolean,
- enableReply: Boolean,
- enableModerate: Boolean,
- showSignature: Boolean,
- showScore: Boolean,
},
methods: {
- // showReplyForm
+ showMetamodForm: function () {
+ this.displayMetamodForm = !this.displayMetamodForm;
+ },
showReplyForm: function (reply) {
reply.showForm = 1;
},
},
},
computed: {
+ signedPoints: function () {
+ if (this.comment.points < 0) {
+ return "-" + this.comment.points;
+ } else if (this.comment.points > 0) {
+ return "+" + this.comment.points;
+ } else {
+ return "";
+ }
+ },
+ reasonText: function () {
+ if (this.comment.reason != 0) {
+ return ":" + vm.modReasons[this.comment.reason];
+ } else {
+ return;
+ }
+ },
fold: function () {
return this.comment.points < vm.userConfig.fold_threshold && !this.displayForce
},
return count[0];
},
enableModerate: function () {
- return vm.user.moderator && !vm.archived;
+ return vm.user.admin || (vm.user.moderator && !vm.archived);
},
enableReply: function () {
return !vm.archived;
showConfig: 0,
user: user,
configMessage: "",
+ modReasons: params.modReasons,
urls: {
commentPost: "/api/v1/comment",
configSave: "/api/v1/user",
<header>
<h1 :title-orig="comment.subject_orig" v-on:click="showItem()">
<span class="subject" v-text="comment.subject">[% comment.subject %]</span>
- <span class="score" v-show="showScore">(スコア:<span v-text="comment.points">[% comment.points %]</span>)</span>
</h1>
<div class="property">
+ <span class="score badge" v-show="comment.lastmod != 0 && comment.point == 0"
+ v-on:click="showMetamodForm">±0</span>
+ <span class="score badge" v-show="showScore && comment.points != 0" v-on:click="showMetamodForm">
+ <span v-text="signedPoints">
+ [%- IF !vuejs -%]
+ [% IF comment.points > 0 %]+[% comment.points %][% END -%]
+ [% IF comment.points < 0 %]-[% comment.points %][% END -%]
+ [%- END -%]
+ </span>
+ <span v-text="reasonText">[% comment.reason %]</span>
+ </span>
<span class="author">by <span v-text="comment.author">[% comment.author %]</span></span>
<span class="date">on <span v-text="comment.date">[% comment.date %]</span></span>
<span class="cid">(#<span v-text="comment.cid">[% comment.cid %]</span>)</span>
+ [%- IF user.is_admin -%]
<span class="ipid"><span v-text="comment.ipid">[% comment.ipid %]</span></span>
<span class="subnetid"><span v-text="comment.subnetid">[% comment.subnetid %]</span></span>
+ [%- END -%]
</div>
+ [%- IF vuejs -%]
+ <div class="moderate-reasons" v-if="displayMetamodForm">
+ モデレーション履歴:
+ <ol></ol>
+ </div>
+ [%- END -%]
</header>
<div class="body contents-text" v-html="comment.comment">[% comment.comment %]</div>
<footer>
<script type="text/x-template" id="comment-template">
- [%- INCLUDE common/comment comment={} -%]
+ [%- INCLUDE common/comment comment={} vuejs=1-%]
</script>
<script type="text/x-template" id="comment-form-template">
user: user,
article: article,
discussion: discussion,
+ modReasons: {
+ [%- FOREACH item IN moderate_reasons -%]
+ [% item.key %] : "[% item.value.name %]",
+ [%- END -%]
+ },
});
</script>
nickname: "[% user.nickname %]",
login: [% user.is_login %],
uid: [% user.uid %],
- [% IF user.is_admin %]moderator: 1,[% END %]
+ [% IF user.is_admin %]moderator: 1, admin: 1,[% END %]
};
var siteInfo = { topic_icon_base_url: "[% Site.topic_icon_base_url %]", };
</script>