1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-05 05:25:27 +02:00

Add button component (twig) (#188)

* Add button component

* Replace old buttons with the new ones

* Update icons and border radius

* Update add page button

* Set size small to add page btn

* Update button indentation

* Cleanup

* icons and button component updated

* upd secondary colour, page button call

* Update small button padding right

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
This commit is contained in:
Tanya 2022-05-24 12:49:06 +08:00 committed by GitHub
parent f75401d0fb
commit f714225e20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 177 additions and 46 deletions

View file

@ -2,7 +2,7 @@
{% block body %}
<style>
.docs-header__button {
.docs-header__menu-add {
visibility: hidden;
}
</style>
@ -56,12 +56,13 @@
<div class="writing-editor">
<div id="editorjs"></div>
</div>
<div class="writing-buttons">
<span class="writing-header__save" name="js-submit-save">Save</span>
<div class="writing-buttons">
{% include 'components/button.twig' with {label: 'Save changes', name: 'js-submit-save', icon: 'check'} %}
{% if page._id is not empty %}
<span class="writing-buttons__remove" name="js-submit-remove">Remove</span>
{% include 'components/button.twig' with {label: 'Delete doc', name: 'js-submit-remove', icon: 'trash', style: 'warning'} %}
{% endif %}
</div>
</section>
{% endblock %}

View file

@ -18,12 +18,10 @@
{% endif %}
<time class="page__header-time">
Last edit {{ (page.body.time / 1000) | date("M d Y") }}
{% if isAuthorized == true %}
<a href="/page/edit/{{ page._id }}" class="page__header-button">
Edit
</a>
{% endif %}
</time>
{% if isAuthorized == true %}
{% include 'components/button.twig' with {label: 'Edit', icon: 'pencil', size: 'small', url: '/page/edit/' ~ page._id, class: 'page__header-button'} %}
{% endif %}
</header>
<h1 class="page__title">
{{ page.title }}