{% extends "admin/base.html" %}

{% block content %}

<nav aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="{{  url('dashboard') }}">{{_('Dashboard',2)}}</a></li>
    <li class="breadcrumb-item">{{_('Settings',2)}}</li>
    <li class="breadcrumb-item active" aria-current="page">{{_('PWA',2)}}</li>
  </ol>
</nav>

<!-- Content Row -->
<div class="row">
    <div class="col-md-8">
        <div class="card card-pwa-settings">
            <div class="card-header">
                <h6 class="m-0 font-weight-bold text-primary">
                    {{_("PWA Settings",2)}}
                </h6>
            </div>
            <div class="card-body">
                <form id="pwa-settings" enctype="multipart/form-data">
                    {{ csrf_token()|raw }}

                    <div class="form-group">
                        <label for="pwa_enabled">{{_("Enable PWA",2)}}</label>
                        <select class="form-control" id="pwa_enabled" name="pwa_enabled">
                            <option value="0" {% if SETTINGS.pwa_enabled == 0 %}selected{% endif %}>{{_("No",2)}}</option>
                            <option value="1" {% if SETTINGS.pwa_enabled == 1 %}selected{% endif %}>{{_("Yes",2)}}</option>
                        </select>
                    </div>
                    <hr />
                    <br />
                    <span class="enable-pwa-area" {% if SETTINGS.pwa_enabled == 0 %}style="display:none;"{% endif %}>
                        <!--
                        <div class="form-group">
                            <label for="pwa_default_room_slug">{{_("PWA Default Chat Room",2)}}</label>
                            <select class="form-control" id="pwa_default_room_slug" name="pwa_default_room_slug">
                                {% for chatroom in chatroom_list %}
                                    <option value="{{chatroom.slug}}"
                                        {% if chatroom.slug == SETTINGS.pwa_default_room_slug %}selected{% endif %}
                                    >{{chatroom.name}}</option>
                                {% endfor %}
                            </select>
                        </div>
                        -->
                        <div class="form-group">
                            <label for="pwa_background_color">{{_("PWA Background Color",2)}}</label>
                            <div class="input-group">
                                <input type="text" name="pwa_background_color" value="{{SETTINGS.pwa_background_color}}" class="form-control w-75 color-input">
                                <input type="color" value="{{SETTINGS.pwa_background_color}}" class="form-control color-picker">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="pwa_theme_color">{{_("PWA Theme Color",2)}}</label>
                            <div class="input-group">
                                <input type="text" name="pwa_theme_color" value="{{SETTINGS.pwa_theme_color}}" class="form-control w-75 color-input">
                                <input type="color" value="{{SETTINGS.pwa_theme_color}}" class="form-control color-picker">
                            </div>
                        </div>
                        <div class="row">
                            <div class="form-group col-8">
                                <label for="small_logo">{{_("PWA Icon",2)}}</label>
                                <input type="file" class="form-control-file upload-setting-image" id="pwa_icon" name="pwa_icon" value="{{SETTINGS.pwa_icon}}">
                                <small><b>{{_("Optimim Size",2)}} -</b> Width:192px & Height:192px </small>
                            </div>
                            <div class="col-4 d-flex align-self-center justify-content-center">
                                <div class="setting-image-preview" style="height:192px; width:192px">
                                    {% if SETTINGS.pwa_icon %}
                                        <img class="img-fluid" height="100%" src="{{MEDIA_URL}}/settings/{{SETTINGS.pwa_icon}}"  alt="">
                                    {% endif %}
                                </div>
                            </div>
                        </div>


                    </span>
                    <button type="button" class="btn btn-primary update-settings" value="pwa-settings">{{_("Update",2)}}</button>
                </form>
            </div>
        </div>
    </div>
</div>

{% endblock %}
