fix
This commit is contained in:
parent
9bd97fa6fa
commit
068dc58479
1 changed files with 1 additions and 51 deletions
|
@ -1,27 +1,4 @@
|
|||
<div class="hidden xl:block xl:col-start-10 xl:col-end-13 flex flex-col flex-shrink-0 py-4">
|
||||
<!-- <div v-cloak class="flex flex-col rounded-md border border-gray-300 overflow-hidden mb-4">
|
||||
{% if v %}
|
||||
<button @click="store.vote(1)" class="group flex justify-between w-full px-4 py-3 bg-gradient-to-t hover:from-yellow-500 hover:to-yellow-600 border-b border-gray-300 rounded-t-md text-shadow-t shadow-inset-t-white-10 text-base font-medium text-gray-300 active:text-yellow-500 active:shadow-inner active:outline-none" v-bind:class="[[ store.voteType === 1 ? 'from-yellow-600 to-yellow-500' : 'from-gray-700 to-gray-700']]">
|
||||
<span>
|
||||
🕋 Halal
|
||||
</span>
|
||||
<span class="leading-none ml-3 px-2 py-1 border rounded text-sm font-bold group-hover:bg-yellow-700 group-hover:border-yellow-700" style="border-top-color: rgba(0, 0, 0, 0.07);" v-bind:class="[[ store.voteType === 1 ? 'bg-yellow-700 border-yellow-700' : 'border-gray-800 bg-gray-800']]">
|
||||
[[ store.voteType === 1 ? store.ups + 1 : store.ups ]]
|
||||
</span>
|
||||
</button>
|
||||
{% if environ.get('DISABLE_DOWNVOTES') != '1' %}
|
||||
<button v-cloak @click="store.vote(-1)" class="group flex justify-between w-full px-4 py-3 bg-gradient-to-t hover:from-red-700 hover:to-red-800 rounded-b-md text-shadow-t shadow-inset-t-white-10 text-base font-medium text-gray-300 active:text-red-500 active:shadow-inner active:outline-none" v-bind:class="[[ store.voteType === -1 ? 'from-red-800 to-red-700' : 'from-gray-800 to-gray-700']]">
|
||||
<span>
|
||||
🐷 Haram
|
||||
</span>
|
||||
<span class="leading-none ml-3 px-2 py-1 border rounded text-sm font-bold group-hover:bg-red-800 group-hover:border-red-800" style="border-top-color: rgba(0, 0, 0, 0.07);" v-bind:class="[[ store.voteType === -1 ? 'bg-red-800 border-red-800' : 'border-gray-800 bg-gray-800']]">
|
||||
[[ store.voteType === -1 ? store.downs + 1 : store.downs ]]
|
||||
</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<hr class="mt-6 mb-5 h-0.5 border-b border-gray-300 shadow-inset-t-white-05"/> -->
|
||||
<div>
|
||||
<h2 class="ml-2 font-bold text-lg font-heading leading-normal mb-2">
|
||||
Awards
|
||||
|
@ -135,30 +112,3 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% block scripts %}
|
||||
|
||||
<script type="module">
|
||||
import { createApp, reactive } from 'https://unpkg.com/petite-vue?module'
|
||||
const store = reactive({
|
||||
ups: {{ ups }},
|
||||
downs: {{ downs }},
|
||||
voteType: {{ voted }},
|
||||
count: {{ score }},
|
||||
vote(type) {
|
||||
this.voteType = this.voteType === type ? 0 : type;
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", "/vote/post/" + {{ p.id }} + "/" + this.voteType, true);
|
||||
const form = new FormData()
|
||||
form.append("formkey", formkey());
|
||||
xhr.withCredentials=true;
|
||||
xhr.send(form);
|
||||
}
|
||||
})
|
||||
createApp({
|
||||
store,
|
||||
$delimiters: ['[[', ']]']
|
||||
}).mount()
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue