Skip to content

Commit

Permalink
Move post adding button to the right side of editor
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Dec 13, 2024
1 parent 449454a commit e236240
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 29 deletions.
37 changes: 20 additions & 17 deletions resources/js/components/forum/form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,27 @@
</vue-markdown>
</div>

<div v-if="showStickyCheckbox" class="form-group">
<div class="custom-control custom-checkbox">
<label class="custom-control-label" for="is-sticky">
<input v-model="topic.is_sticky" type="checkbox" class="custom-control-input" id="is-sticky">
Przyklejony wątek
</label>
<div class="d-flex justify-content-between">
<div>
<div v-if="showStickyCheckbox" class="form-group">
<div class="custom-control custom-checkbox">
<label class="custom-control-label" for="is-sticky">
<input v-model="topic.is_sticky" type="checkbox" class="custom-control-input" id="is-sticky">
Przyklejony wątek
</label>
</div>
</div>
</div>
<div>
<vue-button :disabled="isProcessing" title="Kliknij, aby zapisać (Ctrl+Enter)" class="btn btn-primary btn-sm neon-primary-button" @click="save">
<template v-if="post.id">Zapisz</template>
<template v-else>Dodaj post</template>
</vue-button>
{{ ' ' }}
<button v-if="post.id" @click="cancel" title="Anuluj (Esc)" class="btn btn-sm btn-danger ms-2">
Anuluj
</button>
</div>
</div>

<div class="mt-2">
<vue-button :disabled="isProcessing" title="Kliknij, aby zapisać (Ctrl+Enter)" class="btn btn-primary btn-sm neon-primary-button" @click="save">
<template v-if="post.id">Zapisz</template>
<template v-else>Dodaj post</template>
</vue-button>
{{ ' ' }}
<button v-if="post.id" @click="cancel" title="Anuluj (Esc)" class="btn btn-sm btn-danger me-2">
Anuluj
</button>
</div>
</form>
</template>
Expand Down
19 changes: 7 additions & 12 deletions resources/views/forum/topic.twig
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,17 @@
></vue-form>
{% endif %}

<template v-if="is_mode_tree">
<div class="d-flex justify-content-end">
<template v-if="is_mode_tree && treeTopicPostsRemaining.length > 0">
<div class="mb-4" style="margin-top:-24px;">
<label for="tree-post-ordering" class="text-muted">
Kolejność postów
</label>
</div>
<div class="d-flex justify-content-end align-items-center mb-4">
{{ icon('treeTopicPostOrder') }}
<select
id="tree-post-ordering"
:value="treeTopicPostOrdering"
@change="changeTreeTopicPostOrdering"
class="form-control ms-1"
class="form-control"
style="width:initial;">
<option value="orderByMostLikes">Najwyżej oceniane</option>
<option value="orderByCreationDateNewest">Najnowsze</option>
Expand Down Expand Up @@ -207,13 +205,10 @@

<section class="page-change-category d-flex my-3">
{% if user_forums is defined %}
<div class="ms-auto">
{{ form_select('forum', user_forums, forum.slug, {'id': 'js-forum-list', 'class': 'form-control d-inline w-auto', 'data-url': route('forum.home')}) }}

<a class="btn" href="javascript:" id="js-reload" rel="nofollow">
{{ icon('forumChangeCategory') }}
</a>
</div>
{{ form_select('forum', user_forums, forum.slug, {'id': 'js-forum-list', 'class': 'form-control d-inline w-auto', 'data-url': route('forum.home')}) }}
<a class="btn" href="javascript:" id="js-reload" rel="nofollow">
{{ icon('forumChangeCategory') }}
</a>
{% endif %}
</section>

Expand Down

0 comments on commit e236240

Please sign in to comment.