Skip to content

Commit

Permalink
Version 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jshah4517 committed May 12, 2022
1 parent b4ce78a commit 2613c9e
Show file tree
Hide file tree
Showing 65 changed files with 798 additions and 365 deletions.
46 changes: 46 additions & 0 deletions core/addons_sidebar.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% set route = Route.currentRouteName() %}

<div class="sp-sidebox">
<div class="sp-collapsible sp-flex">
<div class="sp-icon">
<i class="fas fa-puzzle-piece"></i>
</div>
<h3>{{ Lang.choice('core.addon', 2) }}</h3>
<div class="sp-chevron">
<i class="fas fa-chevron-down" aria-hidden="true"></i>
</div>
</div>

<ul>
<li {% if route starts with 'core.operator.marketplace' %}class="sp-active"{% endif %}>
<a href="{{ route('core.operator.marketplace.index') }}">{{ Lang.get('core.addons_marketplace') }}</a>
</li>

<h4>{{ Lang.get('general.general') }}</h4>

{% if auth_user().hasPermission('view.language') %}
<li {% if route starts with 'core.operator.language' %}class="sp-active"{% endif %}>
<a href="{{ route('core.operator.language.index') }}">{{ Lang.choice('general.language', 2) }}</a>
</li>
{% endif %}
<li {% if route starts with 'core.operator.plugin' %}class="sp-active"{% endif %}>
<a href="{{ route('core.operator.plugin.index') }}">{{ Lang.choice('core.plugins', 2) }}</a>
</li>
{% if auth_user().hasPermission('view.integration') %}
<li {% if route starts with 'core.operator.integration' or route starts with 'integration.' %}class="sp-active"{% endif %}>
<a href="{{ route('core.operator.integration.index') }}">{{ Lang.choice('core.third_party_integrations', 2) }}</a>
</li>
{% endif %}
<li {% if route starts with 'core.operator.widget' %}class="sp-active"{% endif %}>
<a href="{{ route('core.operator.widget.index') }}">{{ Lang.choice('core.widget', 2) }}</a>
</li>

{% if isModuleEnabled('Ticket') and auth_user().hasPermission('view.channel') %}
<h4>{{ Lang.choice('ticket.ticket', 2) }}</h4>

<li {% if route starts with 'ticket.operator.channel' or route starts with 'ticket.channel' %}class="sp-active"{% endif %} id="channelSettings">
<a href="{{ route('ticket.operator.channel.index') }}">{{ Lang.choice('ticket.channel', 2) }}</a>
</li>
{% endif %}
</ul>
</div>
2 changes: 1 addition & 1 deletion core/dashboard.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% if widgets|default is not empty %}
<div class="sp-mb-6 sm:sp-flex">
<div class="sm:sp-flex-grow">
<div class="sm:sp-grow">
<h1 class="sp-my-0" id="dashboardTitle">{{ Lang.get('core.dashboard') }}</h1>
</div>
<div class="sm:sp-flex-initial sm:sp-my-1/2">
Expand Down
2 changes: 2 additions & 0 deletions core/email.twig
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
{{ View.fireHook('operator.wrapper_end') }}
</div>

{{ View.fireHook('operator.footer') }}

{% include 'operator.' ~ template ~ '.footer_common' %}

<script type="text/javascript">
Expand Down
8 changes: 6 additions & 2 deletions core/feedback_fields.twig
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@
{{ View.fireHook('operator.wrapper_end') }}
</div>

{{ View.fireHook('operator.footer') }}

{% include 'operator.' ~ template ~ '.footer_common' %}

<!-- General -->
<script src="{{ asset_rev('resources/assets/operator/js/main.js') }}" type="text/javascript"></script>

<!-- Redactor -->
<!-- WYSIWYG Editor -->
<script src="{{ asset_rev('resources/assets/libs/editor.min.js') }}"></script>
<script src="{{ asset_rev('resources/assets/general/js/editor_config.js') }}"></script>

Expand All @@ -66,7 +68,9 @@
$(document).ready(function() {
// Disable all inputs.
$(':input').prop('disabled', true);
$R('textarea.redactor', 'enableReadOnly');
// Set wysiwyg editor to readonly.
$('textarea.tox-editor').editor().setMode('readonly');
});
</script>

Expand Down
4 changes: 2 additions & 2 deletions core/forms/email_template.twig
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<!-- Translatable.js dependencies: Selectize -->
<script type="text/javascript" src="{{ asset_rev('resources/assets/operator/js/translatable.js') }}"></script>

<!-- Redactor -->
<!-- WYSIWYG Editor -->
<script src="{{ asset_rev('resources/assets/libs/editor.min.js') }}"></script>
<script src="{{ asset_rev('resources/assets/general/js/editor_config.js') }}"></script>

Expand All @@ -111,7 +111,7 @@
}
};
// Do not initialise redactor on the dummy DOM element.
// Do not initialise editor on the dummy DOM element.
$('div.section-items textarea').sourcecode(opts);
</script>
{% endblock %}
52 changes: 0 additions & 52 deletions core/forms/language.twig

This file was deleted.

56 changes: 27 additions & 29 deletions core/forms/message.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,34 @@

{% block content %}

<div>
{% for message in messages %}
<div class="sp-message sp-message-{{ message.id }}">
<div class="sp-flex">
<div class="sp-flex-initial sp-hidden sp-mr-4 md:sp-block">
<img src="{{ message.user.avatar_url }}" class="sp-avatar sp-max-w-xs md:sp-max-w-md" />
</div>
<div class="sp-flex-grow">
<div class="sp-message-header">
{% if message.user_id == auth_user().id %}
<span class="sp-float-right">
<button class="as-link delete-confirm" data-route="{{ route('core.operator.message.destroy', message.id) }}" data-id="{{ message.id }}">
<i class="fas fa-times"></i>
</button>
</span>
{% endif %}

<div class="sp-name sp-text-lg {% if message.user_id == auth_user().id %}sp-text-red-600{% else %}sp-text-green-600{% endif %}">
{{ message.user.formatted_name }}
</div>
<div class="sp-description">{{ timeago(message.created_at) }}</div>
{% for message in messages %}
<div class="sp-message sp-message-{{ message.id }}">
<div class="sp-flex">
<div class="sp-flex-initial sp-hidden sp-mr-4 md:sp-block">
<img src="{{ message.user.avatar_url }}" class="sp-avatar sp-max-w-xs md:sp-max-w-md" />
</div>
<div class="sp-grow">
<div class="sp-message-header">
{% if message.user_id == auth_user().id %}
<span class="sp-float-right">
<button class="as-link delete-confirm" data-route="{{ route('core.operator.message.destroy', message.id) }}" data-id="{{ message.id }}">
<i class="fas fa-times"></i>
</button>
</span>
{% endif %}

<div class="sp-name sp-text-lg {% if message.user_id == auth_user().id %}sp-text-red-600{% else %}sp-text-green-600{% endif %}">
{{ message.user.formatted_name }}
</div>
<div class="sp-description">{{ timeago(message.created_at) }}</div>
</div>
</div>
<div class="sp-message-text">
{{ message.purified_message|raw }}
</div>
</div>
{% endfor %}
</div>
<div class="sp-message-text">
{{ message.purified_message|raw }}
</div>
</div>
{% endfor %}

<h2>{{ Lang.get('general.reply') }}</h2>

Expand All @@ -53,7 +51,7 @@

<div class="sp-form-row">
<div class="sp-input-container">
{{ form_redactor('message') }}
{{ form_editor('message') }}
</div>
</div>

Expand All @@ -69,13 +67,13 @@
{{ jsValidator|raw }}
{% endif %}

<!-- Redactor -->
<!-- WYSIWYG Editor -->
<script src="{{ asset_rev('resources/assets/libs/editor.min.js') }}"></script>
<script src="{{ asset_rev('resources/assets/general/js/editor_config.js') }}"></script>

<script type="text/javascript">
$(document).ready(function() {
$('textarea').redactor();
$('textarea').editor();
// Open links (not anchors) in a new window/tab. Needs rel="noopener" due to
// https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
Expand Down
9 changes: 8 additions & 1 deletion core/integration.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends parent_template %}

{% block sidebar %}
{% include 'operator.' ~ template ~ '.settings_sidebar' %}
{% include 'operator.' ~ template ~ '.core.addons_sidebar' %}
{% endblock %}

{% block title %}
Expand Down Expand Up @@ -60,6 +60,13 @@
{column_number : 1, filter_container_id: "filter_status", filter_reset_button_text: ''},
{column_number : 2, column_data_type: "text", filter_container_id: "filter_description", filter_type: "text", filter_delay: 500, filter_reset_button_text: ''},
]);
// Search by name if in request.
{% if Request.has('name') %}
yadcf.exFilterColumn(oTable, [
[0, "{{ Request.get('name') }}"],
]);
{% endif %}
});
</script>
{% endblock %}
15 changes: 11 additions & 4 deletions core/language.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends parent_template %}

{% block sidebar %}
{% include 'operator.' ~ template ~ '.settings_sidebar' %}
{% include 'operator.' ~ template ~ '.core.addons_sidebar' %}
{% endblock %}

{% block title %}
Expand Down Expand Up @@ -31,8 +31,8 @@
<div id="filter_name"></div>
</div>
<div class="sp-table-row">
<label>{{ Lang.get('general.enabled') }}:</label>
<div id="filter_enabled"></div>
<label>{{ Lang.choice('general.status', 1) }}:</label>
<div id="filter_status"></div>
</div>
</div>
</div>
Expand All @@ -53,8 +53,15 @@
*/
oTable.yadcf([
{column_number : 0, column_data_type: "text", filter_container_id: "filter_name", filter_type: "text", filter_delay: 500, filter_reset_button_text: ''},
{column_number : 1, filter_container_id: "filter_enabled", filter_reset_button_text: ''}
{column_number : 1, filter_container_id: "filter_status", filter_reset_button_text: ''},
]);
// Search by name if in request.
{% if Request.has('name') %}
yadcf.exFilterColumn(oTable, [
[0, "{{ Request.get('name') }}"],
]);
{% endif %}
});
</script>
{% endblock %}
Loading

0 comments on commit 2613c9e

Please sign in to comment.