#dialog.text-center {{ st.tr[infoMsg] }}
.row
.col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
- button(
+ button#writeNews(
v-if="devs.includes(st.user.id)"
@click="showModalNews"
)
| {{ st.tr["Write news"] }}
- .news(v-for="n in sortedNewsList")
- h4 {{ formatDatetime(n.added) }}
- p(v-html="parseHtml(n.content)")
+ .news(v-for="n,idx in sortedNewsList" :class="{margintop:idx>0}")
+ span.ndt {{ formatDatetime(n.added) }}
div(v-if="devs.includes(st.user.id)")
button(@click="editNews(n)") {{ st.tr["Edit"] }}
button(@click="deleteNews(n)") {{ st.tr["Delete"] }}
+ p(v-html="parseHtml(n.content)")
button(v-if="hasMore" @click="loadMore()")
| {{ st.tr["Load more"] }}
</template>
methods: {
formatDatetime: function(dt) {
const dtObj = new Date(dt);
- return getDate(dtObj) + " " + getTime(dtObj);
+ const timePart = getTime(dtObj);
+ // Show minutes but not seconds:
+ return getDate(dtObj) + " " + timePart.substr(0,timePart.lastIndexOf(":"));
},
parseHtml: function(txt) {
return !txt.match(/<[/a-zA-Z]+>/)
max-width: 767px
max-height: 100%
textarea#newsContent
+ margin: 0
width: 100%
min-height: 200px
max-height: 100%
#dialog
padding: 5px
color: blue
+button#writeNews
+ margin-top: 0
+ margin-bottom: 0
+span.ndt
+ color: darkblue
+ padding: 0 5px 0 var(--universal-margin)
+.margintop
+ margin-top: 25px
+ border-top: 1px solid grey
+.news
+ padding-top: 10px
+ & > div
+ display: inline-block
+@media screen and (max-width: 767px)
+ .margintop
+ margin-top: 10px
</style>