.row
.col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
button#writeNewsBtn(
- v-if="devs.includes(st.user.id)"
+ v-if="devTeam"
@click="showModalNews"
)
| {{ st.tr["Write news"] }}
:class="{margintop:idx>0}"
)
span.ndt {{ formatDatetime(n.added) }}
- .dev-buttons(v-if="devs.includes(st.user.id)")
+ .dev-buttons(v-if="devTeam")
button(@click="editNews(n)") {{ st.tr["Edit"] }}
button(@click="deleteNews(n)") {{ st.tr["Delete"] }}
button(@click="gotoPrevNext(n, 1)") {{ st.tr["Previous_n"] }}
<script>
import { store } from "@/store";
import { ajax } from "@/utils/ajax";
+import params from "@/parameters";
import { getDate, getTime } from "@/utils/datetime";
import { processModalClick } from "@/utils/modalClick";
export default {
name: "my-news",
data: function() {
return {
- devs: [1], //for now the only dev is me
st: store.state,
// timestamp of oldest showed news:
cursor: Number.MAX_SAFE_INTEGER,
infoMsg: ""
};
},
+ computed: {
+ devTeam: function() {
+ return params.devs.includes(this.st.user.id);
+ }
+ },
created: function() {
ajax(
"/news",
};
</script>
-<style lang="sass">
+<style lang="sass" scoped>
[type="checkbox"].modal+div .card
max-width: 767px
max-height: 100%
color: darkblue
padding: 0 5px 0 var(--universal-margin)
+.margintop
+ margin-top: 25px
+ border-top: 1px solid grey
+@media screen and (max-width: 767px)
+ .margintop
+ margin-top: 10px
+</style>
+
+<style lang="sass">
.news
padding-top: 10px
& > .dev-buttons
display: block
margin-top: 10px
content: " "
-
-.margintop
- margin-top: 25px
- border-top: 1px solid grey
-@media screen and (max-width: 767px)
- .margintop
- margin-top: 10px
</style>