Compare commits
11 Commits
main
...
Lang_funct
Author | SHA1 | Date | |
---|---|---|---|
|
157a5a1939 | ||
|
a46ec03369 | ||
|
3485957da4 | ||
|
2d0d36af7e | ||
262b8003f4 | |||
|
d8a271adb4 | ||
|
cf7c57228a | ||
|
4cb505276f | ||
|
c5295f0fee | ||
|
fd9dc5d545 | ||
|
c18c2d0f32 |
87
.env
Normal file
87
.env
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
APP_NAME="AKNAPROFF"
|
||||||
|
APP_ENV="live"
|
||||||
|
APP_KEY=base64:dvbkNw1BmEGND2DRWIauV7ub306TMEiPws0A9yOhiMU=
|
||||||
|
APP_DEBUG=true
|
||||||
|
APP_URL=https://uniquesoft.es
|
||||||
|
APP_LOCALE="en"
|
||||||
|
|
||||||
|
LOG_CHANNEL=stack
|
||||||
|
|
||||||
|
DB_CONNECTION=mysql
|
||||||
|
DB_HOST=127.0.0.1
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_DATABASE=
|
||||||
|
DB_USERNAME=
|
||||||
|
DB_PASSWORD=
|
||||||
|
|
||||||
|
BROADCAST_DRIVER=log
|
||||||
|
CACHE_DRIVER=file
|
||||||
|
QUEUE_CONNECTION=sync
|
||||||
|
SESSION_DRIVER=file
|
||||||
|
SESSION_LIFETIME=120
|
||||||
|
|
||||||
|
REDIS_HOST=127.0.0.1
|
||||||
|
REDIS_PASSWORD=null
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
MAIL_MAILER=smtp
|
||||||
|
MAIL_HOST="smtp.mailtrap.io"
|
||||||
|
MAIL_PORT="2525"
|
||||||
|
MAIL_USERNAME="hello@example.com"
|
||||||
|
MAIL_PASSWORD="12345"
|
||||||
|
MAIL_ENCRYPTION="TLS/SSL"
|
||||||
|
MAIL_FROM_ADDRESS="hello@example.com"
|
||||||
|
MAIL_FROM_NAME="Example"
|
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID=
|
||||||
|
AWS_SECRET_ACCESS_KEY=
|
||||||
|
AWS_DEFAULT_REGION=us-east-1
|
||||||
|
AWS_BUCKET=
|
||||||
|
|
||||||
|
PUSHER_APP_ID=
|
||||||
|
PUSHER_APP_KEY=
|
||||||
|
PUSHER_APP_SECRET=
|
||||||
|
PUSHER_APP_CLUSTER=mt1
|
||||||
|
|
||||||
|
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||||
|
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||||
|
|
||||||
|
ENVATO_PURCHASE_CODE="780fc1cd-62c9-4b1f-8798-7f4f6f7048ef"
|
||||||
|
SUPERADMIN_EMAILS=admin@admin.com
|
||||||
|
ENABLE_REGISTRATION="0"
|
||||||
|
|
||||||
|
CURRENCY_NAME="Euro"
|
||||||
|
CURRENCY_SYMBOL="€"
|
||||||
|
CURRENCY_CODE="EUR"
|
||||||
|
|
||||||
|
APP_TIMEZONE="Europe/Helsinki"
|
||||||
|
|
||||||
|
ENABLE_SAAS_MODULE="0"
|
||||||
|
|
||||||
|
PAYPAL_MODE="sandbox"
|
||||||
|
#PayPal Setting & API Credentials - sandbox
|
||||||
|
PAYPAL_SANDBOX_API_USERNAME=
|
||||||
|
PAYPAL_SANDBOX_API_PASSWORD=
|
||||||
|
PAYPAL_SANDBOX_API_SECRET=
|
||||||
|
PAYPAL_SANDBOX_API_CERTIFICATE=
|
||||||
|
|
||||||
|
#PayPal Setting & API Credentials - live
|
||||||
|
PAYPAL_LIVE_API_USERNAME=
|
||||||
|
PAYPAL_LIVE_API_PASSWORD=
|
||||||
|
PAYPAL_LIVE_API_SECRET=
|
||||||
|
PAYPAL_LIVE_API_CERTIFICATE=
|
||||||
|
|
||||||
|
#Stripe Payment Api & Credentials
|
||||||
|
STRIPE_PUB_KEY=
|
||||||
|
STRIPE_SECRET_KEY=
|
||||||
|
|
||||||
|
APP_DATE_FORMAT="d.m.Y"
|
||||||
|
APP_TIME_FORMAT="24"
|
||||||
|
|
||||||
|
DEBUGBAR_ENABLED=false
|
||||||
|
ENABLE_OFFLINE_PAYMENT="0"
|
||||||
|
|
||||||
|
ACELLE_MAIL_NAME=""
|
||||||
|
ACELLE_MAIL_API=""
|
||||||
|
|
||||||
|
APP_TITLE="Vormid"
|
@ -16,6 +16,11 @@ use ZipArchive;
|
|||||||
|
|
||||||
class FormController extends Controller
|
class FormController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*
|
*
|
||||||
@ -191,7 +196,7 @@ class FormController extends Controller
|
|||||||
public function update($id)
|
public function update($id)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$input = request()->only('name', 'description', 'slug');
|
$input = request()->only('name', 'name_ru', 'name_est', 'description', 'description_ru', 'description_est', 'slug');
|
||||||
$form_data = [
|
$form_data = [
|
||||||
'form' => request()->input('form'),
|
'form' => request()->input('form'),
|
||||||
'emailConfig' => request()->input('email_config'),
|
'emailConfig' => request()->input('email_config'),
|
||||||
@ -202,14 +207,20 @@ class FormController extends Controller
|
|||||||
'contains_page_break' => request()->input('contains_page_break'),
|
'contains_page_break' => request()->input('contains_page_break'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// dd($form_data);
|
||||||
|
|
||||||
$is_template = request()->input('is_template');
|
$is_template = request()->input('is_template');
|
||||||
$input['schema'] = $form_data;
|
$input['schema'] = $form_data;
|
||||||
|
|
||||||
$form = Form::find($id);
|
$form = Form::find($id);
|
||||||
|
|
||||||
$form->name = $input['name'];
|
$form->name = $input['name'];
|
||||||
|
$form->name_ru = $input['name_ru'];
|
||||||
|
$form->name_est = $input['name_est'];
|
||||||
$form->slug = $input['slug'];
|
$form->slug = $input['slug'];
|
||||||
$form->description = $input['description'];
|
$form->description = $input['description'];
|
||||||
|
$form->description_ru = $input['description_ru'];
|
||||||
|
$form->description_est = $input['description_est'];
|
||||||
$form->schema = $input['schema'];
|
$form->schema = $input['schema'];
|
||||||
$form->is_template = $is_template;
|
$form->is_template = $is_template;
|
||||||
$form->mailchimp_details = request()->input('mailchimp_details');
|
$form->mailchimp_details = request()->input('mailchimp_details');
|
||||||
|
@ -183,7 +183,7 @@ class HomeController extends Controller
|
|||||||
if (request()->ajax()) {
|
if (request()->ajax()) {
|
||||||
$user_id = request()->user()->id;
|
$user_id = request()->user()->id;
|
||||||
|
|
||||||
$forms = Form::select('name', 'description', 'id', 'slug', 'is_global_template')
|
$forms = Form::select('name', 'name_est', 'name_ru', 'description', 'description_ru', 'description_est', 'id', 'slug', 'is_global_template')
|
||||||
->where(function ($query) use ($user_id) {
|
->where(function ($query) use ($user_id) {
|
||||||
$query->where('is_template', 1)
|
$query->where('is_template', 1)
|
||||||
->where('created_by', $user_id)
|
->where('created_by', $user_id)
|
||||||
@ -278,7 +278,7 @@ class HomeController extends Controller
|
|||||||
$forms = UserForm::join('forms', 'user_forms.form_id', '=', 'forms.id')
|
$forms = UserForm::join('forms', 'user_forms.form_id', '=', 'forms.id')
|
||||||
->leftJoin('users', 'forms.created_by', '=', 'users.id')
|
->leftJoin('users', 'forms.created_by', '=', 'users.id')
|
||||||
->where('user_forms.assigned_to', \Auth::id())
|
->where('user_forms.assigned_to', \Auth::id())
|
||||||
->select('user_forms.permissions as permissions', 'forms.name as name', 'forms.description as description', 'forms.id as form_id', 'forms.created_at as created_at', 'forms.slug as slug', 'users.name as created_by');
|
->select('user_forms.permissions as permissions', 'forms.name as name', 'forms.name_ru as name_ru', 'forms.name_est as name_est', 'forms.description as description', 'forms.description_ru as description_ru', 'forms.description_est as description_est', 'forms.id as form_id', 'forms.created_at as created_at', 'forms.slug as slug', 'users.name as created_by');
|
||||||
|
|
||||||
return DataTables::of($forms)
|
return DataTables::of($forms)
|
||||||
->addColumn(
|
->addColumn(
|
||||||
|
31
app/Http/Controllers/LocaleController.php
Normal file
31
app/Http/Controllers/LocaleController.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\UserSetting;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
|
class LocaleController extends Controller
|
||||||
|
{
|
||||||
|
public function __invoke($locale) {
|
||||||
|
if (! in_array($locale, ['en', 'ru', 'est'])) {
|
||||||
|
abort(400);
|
||||||
|
}
|
||||||
|
|
||||||
|
Session::put('locale', $locale);
|
||||||
|
|
||||||
|
app()->setLocale($locale);
|
||||||
|
|
||||||
|
$userSetting = UserSetting::where('user_id', auth()->user()->id)->first();
|
||||||
|
|
||||||
|
if (!empty($userSetting)) {
|
||||||
|
$userSetting->update([
|
||||||
|
'language' => $locale
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
|||||||
use App\UserSetting;
|
use App\UserSetting;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
class ManageSettingsController extends Controller
|
class ManageSettingsController extends Controller
|
||||||
{
|
{
|
||||||
@ -57,6 +58,14 @@ class ManageSettingsController extends Controller
|
|||||||
|
|
||||||
$setting = UserSetting::where('user_id', $input['user_id'])->first();
|
$setting = UserSetting::where('user_id', $input['user_id'])->first();
|
||||||
|
|
||||||
|
if (! in_array($request->language, ['en', 'ru', 'est'])) {
|
||||||
|
abort(400);
|
||||||
|
}
|
||||||
|
|
||||||
|
Session::put('locale', $request->language);
|
||||||
|
|
||||||
|
app()->setLocale($request->language);
|
||||||
|
|
||||||
if (empty($setting)) {
|
if (empty($setting)) {
|
||||||
UserSetting::create($input);
|
UserSetting::create($input);
|
||||||
} else {
|
} else {
|
||||||
|
@ -64,5 +64,6 @@ class Kernel extends HttpKernel
|
|||||||
'bootstrap' => \App\Http\Middleware\Callbacks::class,
|
'bootstrap' => \App\Http\Middleware\Callbacks::class,
|
||||||
'setDefaultConfig' => \App\Http\Middleware\SetDefaultConfigForUser::class,
|
'setDefaultConfig' => \App\Http\Middleware\SetDefaultConfigForUser::class,
|
||||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||||
|
'locale' => \App\Http\Middleware\LocaleMiddleware::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
37
app/Http/Middleware/LocaleMiddleware.php
Normal file
37
app/Http/Middleware/LocaleMiddleware.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use App\UserSetting;
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
|
||||||
|
class LocaleMiddleware
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle an incoming request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param \Closure $next
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle($request, Closure $next)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (empty(Session::get('locale'))) {
|
||||||
|
$userSetting = UserSetting::where('user_id', auth()->user()->id)->first();
|
||||||
|
|
||||||
|
$locale = 'en';
|
||||||
|
if (!empty($userSetting)) {
|
||||||
|
if (!in_array($userSetting->language, ['en', 'ru', 'est'])) {
|
||||||
|
$locale = $userSetting->language;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Session::put('locale', $locale);
|
||||||
|
app()->setLocale($locale);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('forms', function (Blueprint $table) {
|
||||||
|
$table->string('name_ru')->after('name')->nullable();
|
||||||
|
$table->string('name_est')->after('name_ru')->nullable();
|
||||||
|
$table->string('description_ru')->after('description')->nullable();
|
||||||
|
$table->string('description_est')->after('description_ru')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('forms', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
@ -81,8 +81,8 @@ return [
|
|||||||
'click_to_add_tags' => 'Click to add the tags',
|
'click_to_add_tags' => 'Click to add the tags',
|
||||||
'body' => 'Body',
|
'body' => 'Body',
|
||||||
'email_body' => 'Email Body',
|
'email_body' => 'Email Body',
|
||||||
'auto_response_settings' => 'Auto Response Settings',
|
'auto_restonse_settings' => 'Auto Restonse Settings',
|
||||||
'enable_auto_response' => 'Enable Auto Response?',
|
'enable_auto_restonse' => 'Enable Auto Restonse?',
|
||||||
'smtp_settings' => 'SMTP Settings',
|
'smtp_settings' => 'SMTP Settings',
|
||||||
'use_system_smtp' => 'Use System SMTP?',
|
'use_system_smtp' => 'Use System SMTP?',
|
||||||
'host' => 'Host',
|
'host' => 'Host',
|
||||||
@ -425,7 +425,7 @@ return [
|
|||||||
'tour_step_2_intro' => '<b class="text-success">Step 2:</b></br> Drop the element here & click it to configure.',
|
'tour_step_2_intro' => '<b class="text-success">Step 2:</b></br> Drop the element here & click it to configure.',
|
||||||
'tour_step_3_intro' => '<b class="text-success">Step 3:</b></br> Form & Element configuration will appear here.',
|
'tour_step_3_intro' => '<b class="text-success">Step 3:</b></br> Form & Element configuration will appear here.',
|
||||||
'tour_step_4_intro' => '<b class="text-success">Step 4:</b></br> Add conditions to show/hide element based on other element values.',
|
'tour_step_4_intro' => '<b class="text-success">Step 4:</b></br> Add conditions to show/hide element based on other element values.',
|
||||||
'tour_step_5_intro' => '<b class="text-success">Step 5:</b></br> Configure receiving of submission email & auto-respond email to the user.',
|
'tour_step_5_intro' => '<b class="text-success">Step 5:</b></br> Configure receiving of submission email & auto-restond email to the user.',
|
||||||
'tour_step_6_intro' => '<b class="text-success">Step 6:</b></br> Configure form reCaptcha, design, notifications, scheduling, submission reference number & others.',
|
'tour_step_6_intro' => '<b class="text-success">Step 6:</b></br> Configure form reCaptcha, design, notifications, scheduling, submission reference number & others.',
|
||||||
'tour_step_7_intro' => '<b class="text-success">Step 7:</b></br> Integrate mailchimp.',
|
'tour_step_7_intro' => '<b class="text-success">Step 7:</b></br> Integrate mailchimp.',
|
||||||
'tour_step_8_intro' => '<b class="text-success">Step 8:</b></br> Add additional Js/css in the form.',
|
'tour_step_8_intro' => '<b class="text-success">Step 8:</b></br> Add additional Js/css in the form.',
|
||||||
@ -451,7 +451,7 @@ return [
|
|||||||
'field_name_should_nt_have_space' => 'Field name should not have space',
|
'field_name_should_nt_have_space' => 'Field name should not have space',
|
||||||
'duplicate_field_name_choose_unique' => 'Duplicate field name, choose unique name',
|
'duplicate_field_name_choose_unique' => 'Duplicate field name, choose unique name',
|
||||||
'field_dont_have_name_property' => ":input field don't have name property",
|
'field_dont_have_name_property' => ":input field don't have name property",
|
||||||
'field_contain_space' => ':input field contain whitespace in name',
|
'field_contain_space' => ':input field contain whitestace in name',
|
||||||
'field_contain_duplicate_field_name' => ':input field contain duplicate name',
|
'field_contain_duplicate_field_name' => ':input field contain duplicate name',
|
||||||
'key' => 'Key',
|
'key' => 'Key',
|
||||||
'add_form_custom_attribute' => 'Add form custom attribute',
|
'add_form_custom_attribute' => 'Add form custom attribute',
|
||||||
@ -677,4 +677,16 @@ return [
|
|||||||
'error_msg_for_not_allowed_value' => 'Error message for not allowed value',
|
'error_msg_for_not_allowed_value' => 'Error message for not allowed value',
|
||||||
'enter_allowed_value_per_line' => 'Enter one allowed value per line.',
|
'enter_allowed_value_per_line' => 'Enter one allowed value per line.',
|
||||||
'values_allowed_tooltip' => 'Values provided here will only be allowed while submitting the form, keep it empty to allow all values',
|
'values_allowed_tooltip' => 'Values provided here will only be allowed while submitting the form, keep it empty to allow all values',
|
||||||
|
'field_label_est' => 'Field Label in est',
|
||||||
|
'field_label_ru' => 'Field Label in Ru',
|
||||||
|
'content_est' => 'Content in est',
|
||||||
|
'content_ru' => 'Content in Ru',
|
||||||
|
'placeholder_est' => 'Placeholder in est',
|
||||||
|
'placeholder_ru' => 'Placeholder in Ru',
|
||||||
|
'options_est' => 'Options in est',
|
||||||
|
'options_ru' => 'Options in Ru',
|
||||||
|
'form_name_est' => 'Form Name est',
|
||||||
|
'form_name_ru' => 'Form Name ru',
|
||||||
|
'form_description_est' => 'Form Description est',
|
||||||
|
'form_description_ru' => 'Form Description ru',
|
||||||
];
|
];
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "uniquesoft.es",
|
"name": "Aknaproff",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,26 @@
|
|||||||
v-model="element.label">
|
v-model="element.label">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group"
|
||||||
|
v-if="!_.includes(['heading', 'hr', 'html_text'], element.type)">
|
||||||
|
<label>
|
||||||
|
{{trans('messages.field_label_est')}}
|
||||||
|
<span class="error">*</span>
|
||||||
|
</label>
|
||||||
|
<input type="text" class="form-control form-control-sm"
|
||||||
|
v-model="element.label_est">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group"
|
||||||
|
v-if="!_.includes(['heading', 'hr', 'html_text'], element.type)">
|
||||||
|
<label>
|
||||||
|
{{trans('messages.field_label_ru')}}
|
||||||
|
<span class="error">*</span>
|
||||||
|
</label>
|
||||||
|
<input type="text" class="form-control form-control-sm"
|
||||||
|
v-model="element.label_ru">
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>
|
<label>
|
||||||
{{trans('messages.field_name')}}
|
{{trans('messages.field_name')}}
|
||||||
@ -88,7 +108,6 @@
|
|||||||
:element="element">
|
:element="element">
|
||||||
</pdf-uploader>
|
</pdf-uploader>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- countdown -->
|
<!-- countdown -->
|
||||||
<div v-if="_.includes(['countdown'], element.type)">
|
<div v-if="_.includes(['countdown'], element.type)">
|
||||||
<div class="mb-1">
|
<div class="mb-1">
|
||||||
@ -276,6 +295,20 @@
|
|||||||
v-model="element.placeholder">
|
v-model="element.placeholder">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group"
|
||||||
|
v-if="_.includes(['text', 'textarea', 'text_editor'], element.type)">
|
||||||
|
<label>{{trans('messages.placeholder_est')}}</label>
|
||||||
|
<input type="text" class="form-control form-control-sm"
|
||||||
|
v-model="element.placeholder_est">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group"
|
||||||
|
v-if="_.includes(['text', 'textarea', 'text_editor'], element.type)">
|
||||||
|
<label>{{trans('messages.placeholder_ru')}}</label>
|
||||||
|
<input type="text" class="form-control form-control-sm"
|
||||||
|
v-model="element.placeholder_ru">
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group"
|
<div class="form-group"
|
||||||
v-if="!_.includes(['heading', 'terms_and_condition', 'hr', 'html_text', 'rating', 'youtube', 'iframe', 'pdf', 'countdown'], element.type)">
|
v-if="!_.includes(['heading', 'terms_and_condition', 'hr', 'html_text', 'rating', 'youtube', 'iframe', 'pdf', 'countdown'], element.type)">
|
||||||
<label>{{trans('messages.help_text')}}</label>
|
<label>{{trans('messages.help_text')}}</label>
|
||||||
@ -622,6 +655,26 @@
|
|||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group"
|
||||||
|
v-if="_.includes(['radio', 'checkbox', 'dropdown'], element.type)">
|
||||||
|
<label>{{trans('messages.options_est')}}</label>
|
||||||
|
<textarea class="form-control form-control-sm"
|
||||||
|
v-model="element.options_est"></textarea>
|
||||||
|
<small class="form-text">
|
||||||
|
{{trans('messages.enter_one_option_per_line')}}
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group"
|
||||||
|
v-if="_.includes(['radio', 'checkbox', 'dropdown'], element.type)">
|
||||||
|
<label>{{trans('messages.options_ru')}}</label>
|
||||||
|
<textarea class="form-control form-control-sm"
|
||||||
|
v-model="element.options_ru"></textarea>
|
||||||
|
<small class="form-text">
|
||||||
|
{{trans('messages.enter_one_option_per_line')}}
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row mb-1"
|
<div class="row mb-1"
|
||||||
v-if="_.includes(['radio', 'checkbox'], element.type)">
|
v-if="_.includes(['radio', 'checkbox'], element.type)">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@ -686,6 +739,20 @@
|
|||||||
v-model="element.content"></textarea>
|
v-model="element.content"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group"
|
||||||
|
v-if="_.includes(['heading'], element.type)">
|
||||||
|
<label>{{trans('messages.content_est')}}</label>
|
||||||
|
<textarea class="form-control form-control-sm"
|
||||||
|
v-model="element.content_est"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group"
|
||||||
|
v-if="_.includes(['heading'], element.type)">
|
||||||
|
<label>{{trans('messages.content_ru')}}</label>
|
||||||
|
<textarea class="form-control form-control-sm"
|
||||||
|
v-model="element.content_ru"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group"
|
<div class="form-group"
|
||||||
v-if="_.includes(['heading'], element.type)">
|
v-if="_.includes(['heading'], element.type)">
|
||||||
<label for="heading_text_color">
|
<label for="heading_text_color">
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">
|
<span :style="{'color': settings.color.label}">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input :type="element.subtype" class="form-control"
|
<input :type="element.subtype" class="form-control"
|
||||||
:name="element.name"
|
:name="element.name"
|
||||||
:placeholder="element.placeholder"
|
:placeholder="form_trans_label(element, 'placeholder')"
|
||||||
:class="[element.size, element.custom_class, element.conditional_class]"
|
:class="[element.size, element.custom_class, element.conditional_class]"
|
||||||
:required="element.required && applyValidations"
|
:required="element.required && applyValidations"
|
||||||
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
|
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">
|
<span :style="{'color': settings.color.label}">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">
|
<span :style="{'color': settings.color.label}">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
@ -155,7 +155,7 @@
|
|||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">
|
<span :style="{'color': settings.color.label}">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
@ -175,7 +175,7 @@
|
|||||||
:name="element.name"
|
:name="element.name"
|
||||||
:id="element.name"
|
:id="element.name"
|
||||||
:cols="element.columns"
|
:cols="element.columns"
|
||||||
:placeholder="element.placeholder"
|
:placeholder="form_trans_label(element, 'placeholder')"
|
||||||
:class="[element.custom_class, element.conditional_class]"
|
:class="[element.custom_class, element.conditional_class]"
|
||||||
:required="element.required && applyValidations"
|
:required="element.required && applyValidations"
|
||||||
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
|
v-bind="getDynamicallyGeneratedAttributeObj(element.validations, element.custom_attributes)"
|
||||||
@ -204,7 +204,7 @@
|
|||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }} </span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
||||||
@ -213,7 +213,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div :class="[spreadColumnForElement(element)]"
|
<div :class="[spreadColumnForElement(element)]"
|
||||||
v-for="(option, index) in element.options.split('\n')">
|
v-for="(option, index) in form_trans_label(element, 'options').split('\n')">
|
||||||
<div class="custom-control" :class="[element.type == 'radio' ? 'custom-radio' : 'custom-checkbox']">
|
<div class="custom-control" :class="[element.type == 'radio' ? 'custom-radio' : 'custom-checkbox']">
|
||||||
<input class="custom-control-input"
|
<input class="custom-control-input"
|
||||||
:type="element.type"
|
:type="element.type"
|
||||||
@ -248,7 +248,7 @@
|
|||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
||||||
@ -270,7 +270,7 @@
|
|||||||
@change="$emit('apply_conditions')"
|
@change="$emit('apply_conditions')"
|
||||||
:data-msg-required="element.required_error_msg"
|
:data-msg-required="element.required_error_msg"
|
||||||
>
|
>
|
||||||
<option v-for="option in element.options.split('\n')"
|
<option v-for="option in form_trans_label(element, 'options').split('\n')"
|
||||||
:selected="_.includes(_.get(submitted_data, element.name, ''), option)"
|
:selected="_.includes(_.get(submitted_data, element.name, ''), option)"
|
||||||
>
|
>
|
||||||
{{ option }}
|
{{ option }}
|
||||||
@ -297,7 +297,7 @@
|
|||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<div
|
<div
|
||||||
v-html="'<' + element.tag + ' style=color:' + element.text_color + '>' + element.content + '</' + element.tag + '>'"
|
v-html="'<' + element.tag + ' style=color:' + element.text_color + '>' + form_trans_label(element, 'content') + '</' + element.tag + '>'"
|
||||||
:class="[element.custom_class]">
|
:class="[element.custom_class]">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -308,7 +308,7 @@
|
|||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
||||||
@ -336,7 +336,7 @@
|
|||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
||||||
@ -375,9 +375,9 @@
|
|||||||
>
|
>
|
||||||
<label class="custom-control-label" for="terms_and_condition">
|
<label class="custom-control-label" for="terms_and_condition">
|
||||||
<a :href="element.link" target="_blank" v-if="element.link">
|
<a :href="element.link" target="_blank" v-if="element.link">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</a>
|
</a>
|
||||||
<span v-else>{{ element.label }}</span>
|
<span v-else>{{ form_trans_label(element, 'label') }}</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
||||||
@ -412,7 +412,7 @@
|
|||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
<i class="fas fa-sort handle pointer font_icon_size float-left mr-3" :class="[display_handler]"
|
||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<span :style="{'color': settings.color.label}">{{ element.label }}</span>
|
<span :style="{'color': settings.color.label}">{{ form_trans_label(element, 'label') }}</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
v-if="!_.isUndefined(element.popover_help_text) && element.popover_help_text.enable"
|
||||||
@ -451,7 +451,7 @@
|
|||||||
>
|
>
|
||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
@ -476,7 +476,7 @@
|
|||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
<i class="fas fa-info-circle cursor-pointer modal_trigger"
|
||||||
@ -535,7 +535,7 @@
|
|||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
</label>
|
</label>
|
||||||
@ -563,7 +563,7 @@
|
|||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
</label>
|
</label>
|
||||||
@ -588,7 +588,7 @@
|
|||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
</label>
|
</label>
|
||||||
@ -617,7 +617,7 @@
|
|||||||
:title="trans('messages.drag_element_using_icon')"></i>
|
:title="trans('messages.drag_element_using_icon')"></i>
|
||||||
<label :for="element.name">
|
<label :for="element.name">
|
||||||
<span :style="{'color': settings.color.label}" class="ml-2">
|
<span :style="{'color': settings.color.label}" class="ml-2">
|
||||||
{{ element.label }}
|
{{ form_trans_label(element, 'label') }}
|
||||||
</span>
|
</span>
|
||||||
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
<span :style="{'color': settings.color.required_asterisk_color}" v-if="element.required">*</span>
|
||||||
</label>
|
</label>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -508,6 +508,21 @@ export default {
|
|||||||
initialize_countdowntimer(element);
|
initialize_countdowntimer(element);
|
||||||
}, 2000); //initialize after 2 sec
|
}, 2000); //initialize after 2 sec
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
form_trans_label (data, key) {
|
||||||
|
const currLang = document.documentElement.lang
|
||||||
|
if (currLang === 'ru') {
|
||||||
|
if (data[`${key}_ru`] == '' || data[`${key}_ru`] === undefined || data[`${key}_ru`] === null) {
|
||||||
|
return data[key];
|
||||||
|
}
|
||||||
|
return data[`${key}_ru`]
|
||||||
|
} else if (currLang === 'est') {
|
||||||
|
if (data[`${key}_est`] == '' || data[`${key}_est`] === undefined || data[`${key}_est`] === null) {
|
||||||
|
return data[key];
|
||||||
|
}
|
||||||
|
return data[`${key}_est`]
|
||||||
|
}
|
||||||
|
return data[key];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
$additional_js = $form->schema['additional_js_css']['js'];
|
$additional_js = $form->schema['additional_js_css']['js'];
|
||||||
$page_color = $form->schema['settings']['color']['page_color'] ?? '#f4f6f9';
|
$page_color = $form->schema['settings']['color']['page_color'] ?? '#f4f6f9';
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<div class="@if(!empty($iframe_enabled) && $iframe_enabled) container-fluid @else container @endif">
|
<div class="@if(!empty($iframe_enabled) && $iframe_enabled) container-fluid @else container @endif">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
|
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#printSection, #printSection * {
|
#printSection,
|
||||||
|
#printSection * {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +41,7 @@
|
|||||||
$date_format = config('constants.APP_DATE_FORMAT');
|
$date_format = config('constants.APP_DATE_FORMAT');
|
||||||
if (config('constants.APP_TIME_FORMAT') == '12') {
|
if (config('constants.APP_TIME_FORMAT') == '12') {
|
||||||
$date_format .= ' h:i A';
|
$date_format .= ' h:i A';
|
||||||
} else if (config('constants.APP_TIME_FORMAT') == '24') {
|
} elseif (config('constants.APP_TIME_FORMAT') == '24') {
|
||||||
$date_format .= ' H:i';
|
$date_format .= ' H:i';
|
||||||
} else {
|
} else {
|
||||||
$date_format = 'm/d/Y h:i A';
|
$date_format = 'm/d/Y h:i A';
|
||||||
@ -48,16 +49,18 @@
|
|||||||
@endphp
|
@endphp
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
{{$form->name}}
|
{{ $form->name }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="{{ @route('form-data.show', ['id' => $form->id]) }}" class="form row mt-3 mx-2 mb-0">
|
<form action="{{ @route('form-data.show', ['id' => $form->id]) }}" class="form row mt-3 mx-2 mb-0">
|
||||||
<div class="form-group mb-0 col-1">
|
<div class="form-group mb-0 col-1">
|
||||||
<input type="date" class="form-control" name="start_date" value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
|
<input type="date" class="form-control" name="start_date"
|
||||||
|
value="{{ request()->get('start_date') ?? \Carbon\Carbon::now()->subDays(7)->toDateString() }}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-0 col-1">
|
<div class="form-group mb-0 col-1">
|
||||||
<input type="date" class="form-control" name="end_date" value="{{ request()->get('end_date') ?? \Carbon\Carbon::now()->toDateString() }}">
|
<input type="date" class="form-control" name="end_date"
|
||||||
|
value="{{ request()->get('end_date') ?? \Carbon\Carbon::now()->toDateString() }}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mb-0 col-2 d-flex">
|
<div class="form-group mb-0 col-2 d-flex">
|
||||||
@ -67,13 +70,16 @@
|
|||||||
|
|
||||||
@php
|
@php
|
||||||
$is_enabled_sub_ref_no = false;
|
$is_enabled_sub_ref_no = false;
|
||||||
if(isset($form->schema['settings']['form_submision_ref']['is_enabled']) && $form->schema['settings']['form_submision_ref']['is_enabled']) {
|
if (
|
||||||
|
isset($form->schema['settings']['form_submision_ref']['is_enabled']) &&
|
||||||
|
$form->schema['settings']['form_submision_ref']['is_enabled']
|
||||||
|
) {
|
||||||
$is_enabled_sub_ref_no = true;
|
$is_enabled_sub_ref_no = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@endphp
|
@endphp
|
||||||
<div class="tab-content card-body table-responsive" role="tabpanel">
|
<div class="tab-content card-body table-responsive" role="tabpanel">
|
||||||
@if(!empty($form->schema))
|
@if (!empty($form->schema))
|
||||||
@php
|
@php
|
||||||
$schema = $form->schema['form'];
|
$schema = $form->schema['form'];
|
||||||
$col_visible = $form['schema']['settings']['form_data']['col_visible'];
|
$col_visible = $form['schema']['settings']['form_data']['col_visible'];
|
||||||
@ -82,18 +88,23 @@
|
|||||||
<table class="table" id="submitted_data_table" style="width: 100%;">
|
<table class="table" id="submitted_data_table" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
@if (auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||||
<th>@lang('messages.action')</th>
|
<th>@lang('messages.action')</th>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if($is_enabled_sub_ref_no)
|
@if ($is_enabled_sub_ref_no)
|
||||||
<th>@lang('messages.submission_numbering')</th>
|
<th>@lang('messages.submission_numbering')</th>
|
||||||
@endif
|
@endif
|
||||||
<th>@lang('messages.username')</th>
|
<th>@lang('messages.username')</th>
|
||||||
@foreach($schema as $element)
|
@foreach ($schema as $element)
|
||||||
@if(in_array($element['name'], $col_visible))
|
@if (in_array($element['name'], $col_visible))
|
||||||
<th>
|
<th>
|
||||||
{{$element['label']}}
|
{{-- $element['label'] --}}
|
||||||
|
@if (in_array(session()->get('locale'), ['ru', 'est']) && isset($element['label_' . session()->get('locale')]))
|
||||||
|
{{ $element['label_' . session()->get('locale')] }}
|
||||||
|
@else
|
||||||
|
{{ $element['label'] }}
|
||||||
|
@endif
|
||||||
</th>
|
</th>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@ -102,22 +113,23 @@
|
|||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach($data as $k => $row)
|
@foreach ($data as $k => $row)
|
||||||
<tr>
|
<tr>
|
||||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
@if (auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value, \App\Enums\User\RoleEnum::ADMIN->value], 'web'))
|
||||||
<td>
|
<td>
|
||||||
@if(in_array('view', $btn_enabled))
|
@if (in_array('view', $btn_enabled))
|
||||||
<button type="button" class="btn btn-info btn-sm view_form_data m-1"
|
<button type="button"
|
||||||
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id])}}"
|
class="btn btn-info btn-sm view_form_data m-1"
|
||||||
|
data-href="{{ action([\App\Http\Controllers\FormDataController::class, 'viewData'], [$row->id]) }}"
|
||||||
data-toggle="modal">
|
data-toggle="modal">
|
||||||
<i class="fa fa-eye" aria-hidden="true"></i>
|
<i class="fa fa-eye" aria-hidden="true"></i>
|
||||||
@lang('messages.view')
|
@lang('messages.view')
|
||||||
</button>
|
</button>
|
||||||
@endif
|
@endif
|
||||||
@if(in_array('delete', $btn_enabled))
|
@if (in_array('delete', $btn_enabled))
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="btn btn-danger btn-sm delete_form_data m-1"
|
class="btn btn-danger btn-sm delete_form_data m-1"
|
||||||
data-href="{{action([\App\Http\Controllers\FormDataController::class, 'destroy'], [$row->id])}}">
|
data-href="{{ action([\App\Http\Controllers\FormDataController::class, 'destroy'], [$row->id]) }}">
|
||||||
<i class="fa fa-trash" aria-hidden="true"></i>
|
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||||
@lang('messages.delete')
|
@lang('messages.delete')
|
||||||
</button>
|
</button>
|
||||||
@ -126,52 +138,53 @@
|
|||||||
$form_id = !empty($form->slug) ? $form->slug : $form->id;
|
$form_id = !empty($form->slug) ? $form->slug : $form->id;
|
||||||
@endphp
|
@endphp
|
||||||
<a class="btn btn-dark btn-sm m-1"
|
<a class="btn btn-dark btn-sm m-1"
|
||||||
href="{{action([\App\Http\Controllers\FormDataController::class, 'getEditformData'], ['slug' => $form_id,'id' => $row->id])}}">
|
href="{{ action([\App\Http\Controllers\FormDataController::class, 'getEditformData'], ['slug' => $form_id, 'id' => $row->id]) }}">
|
||||||
<i class="far fa-edit" aria-hidden="true"></i>
|
<i class="far fa-edit" aria-hidden="true"></i>
|
||||||
@lang('messages.edit')
|
@lang('messages.edit')
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if($is_enabled_sub_ref_no)
|
@if ($is_enabled_sub_ref_no)
|
||||||
<td>
|
<td>
|
||||||
{{$row['submission_ref']}}
|
{{ $row['submission_ref'] }}
|
||||||
</td>
|
</td>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<td>{{ $row->submittedBy?->name }}</td>
|
<td>{{ $row->submittedBy?->name }}</td>
|
||||||
|
|
||||||
@foreach($schema as $row_element)
|
@foreach ($schema as $row_element)
|
||||||
@if(in_array($row_element['name'], $col_visible))
|
@if (in_array($row_element['name'], $col_visible))
|
||||||
<td>
|
<td>
|
||||||
@isset($row->data[$row_element['name']])
|
@isset($row->data[$row_element['name']])
|
||||||
@if($row_element['type'] == 'file_upload')
|
@if ($row_element['type'] == 'file_upload')
|
||||||
|
@include('form_data.file_view', [
|
||||||
@include('form_data.file_view', ['form_upload' => $row->data[$row_element['name']]])
|
'form_upload' =>
|
||||||
|
$row->data[$row_element['name']],
|
||||||
|
])
|
||||||
@elseif($row_element['type'] == 'signature')
|
@elseif($row_element['type'] == 'signature')
|
||||||
@if(!empty($row->data[$row_element['name']]))
|
@if (!empty($row->data[$row_element['name']]))
|
||||||
<a target="_blank"
|
<a target="_blank"
|
||||||
href="{{$row->data[$row_element['name']]}}"
|
href="{{ $row->data[$row_element['name']] }}"
|
||||||
download="Signature">
|
download="Signature">
|
||||||
<img src="{{$row->data[$row_element['name']]}}"
|
<img src="{{ $row->data[$row_element['name']] }}"
|
||||||
class="signature">
|
class="signature">
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@elseif(is_array($row->data[$row_element['name']]) && $row_element['type'] != 'file_upload')
|
@elseif(is_array($row->data[$row_element['name']]) && $row_element['type'] != 'file_upload')
|
||||||
{{implode(', ', $row->data[$row_element['name']])}}
|
{{ implode(', ', $row->data[$row_element['name']]) }}
|
||||||
@else
|
@else
|
||||||
{!! nl2br($row->data[$row_element['name']]) !!}
|
{!! nl2br($row->data[$row_element['name']]) !!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@endisset
|
@endisset
|
||||||
</td>
|
</td>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
<td>
|
<td>
|
||||||
{{\Carbon\Carbon::createFromTimestamp(strtotime($row->updated_at))->format($date_format)}}
|
{{ \Carbon\Carbon::createFromTimestamp(strtotime($row->updated_at))->format($date_format) }}
|
||||||
<br/>
|
<br />
|
||||||
<small>
|
<small>
|
||||||
{{$row->updated_at->diffForHumans()}}
|
{{ $row->updated_at->diffForHumans() }}
|
||||||
</small>
|
</small>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -189,7 +202,7 @@
|
|||||||
@endsection
|
@endsection
|
||||||
@section('footer')
|
@section('footer')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
$('#submitted_data_table').DataTable({
|
$('#submitted_data_table').DataTable({
|
||||||
scrollY: "600px",
|
scrollY: "600px",
|
||||||
scrollX: true,
|
scrollX: true,
|
||||||
@ -200,20 +213,20 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// view form data
|
// view form data
|
||||||
$(document).on('click', '.view_form_data', function () {
|
$(document).on('click', '.view_form_data', function() {
|
||||||
var url = $(this).data("href");
|
var url = $(this).data("href");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
url: url,
|
url: url,
|
||||||
success: function (result) {
|
success: function(result) {
|
||||||
$("#modal_div").html(result).modal("show");
|
$("#modal_div").html(result).modal("show");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//delete form data
|
//delete form data
|
||||||
$(document).on('click', '.delete_form_data', function () {
|
$(document).on('click', '.delete_form_data', function() {
|
||||||
var url = $(this).data("href");
|
var url = $(this).data("href");
|
||||||
var result = confirm('Are You Sure?');
|
var result = confirm('Are You Sure?');
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
@ -221,10 +234,10 @@
|
|||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (result) {
|
success: function(result) {
|
||||||
if (result.success == true) {
|
if (result.success == true) {
|
||||||
toastr.success(result.msg);
|
toastr.success(result.msg);
|
||||||
setTimeout(function () {
|
setTimeout(function() {
|
||||||
location.reload();
|
location.reload();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
@ -236,17 +249,17 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
//print form data on btn click
|
//print form data on btn click
|
||||||
$(document).on('click', '.formDataPrintBtn', function () {
|
$(document).on('click', '.formDataPrintBtn', function() {
|
||||||
printElement(document.getElementById("print_form_data"));
|
printElement(document.getElementById("print_form_data"));
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#modal_div").on('shown.bs.modal', function () {
|
$("#modal_div").on('shown.bs.modal', function() {
|
||||||
if ($("form#add_comment_form").length) {
|
if ($("form#add_comment_form").length) {
|
||||||
$("form#add_comment_form").validate();
|
$("form#add_comment_form").validate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('submit', 'form#add_comment_form', function (e) {
|
$(document).on('submit', 'form#add_comment_form', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var data = $("form#add_comment_form").serialize();
|
var data = $("form#add_comment_form").serialize();
|
||||||
var url = $("form#add_comment_form").attr('action');
|
var url = $("form#add_comment_form").attr('action');
|
||||||
@ -257,7 +270,7 @@
|
|||||||
url: url,
|
url: url,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: data,
|
data: data,
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
ladda.stop();
|
ladda.stop();
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
$("#comment").val('');
|
$("#comment").val('');
|
||||||
@ -270,7 +283,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.delete-comment', function (e) {
|
$(document).on('click', '.delete-comment', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var element = $(this);
|
var element = $(this);
|
||||||
var comment_id = $(this).data('comment_id');
|
var comment_id = $(this).data('comment_id');
|
||||||
@ -280,7 +293,7 @@
|
|||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
url: '/form-data-comment/' + comment_id + '?form_data_id=' + form_data_id,
|
url: '/form-data-comment/' + comment_id + '?form_data_id=' + form_data_id,
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
toastr.success(response.msg);
|
toastr.success(response.msg);
|
||||||
element.closest('.direct-chat-msg').remove();
|
element.closest('.direct-chat-msg').remove();
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
<div class="modal-content" id="print_form_data">
|
<div class="modal-content" id="print_form_data">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="exampleModalLabel">
|
<h5 class="modal-title" id="exampleModalLabel">
|
||||||
{{ucFirst($form_data->form->name)}}
|
{{ ucFirst($form_data->form->name) }}
|
||||||
@if(!empty($form_data->submittedBy))
|
@if (!empty($form_data->submittedBy))
|
||||||
<small>
|
<small>
|
||||||
(
|
(
|
||||||
<b>@lang('messages.submitted_by'): </b>
|
<b>@lang('messages.submitted_by'): </b>
|
||||||
{{$form_data->submittedBy->name}}
|
{{ $form_data->submittedBy->name }}
|
||||||
)
|
)
|
||||||
</small>
|
</small>
|
||||||
@endif
|
@endif
|
||||||
@ -23,9 +23,11 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@if(isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) && $form_data->form->schema['settings']['form_submision_ref']['is_enabled'] && !empty($form_data->submission_ref))
|
@if (isset($form_data->form->schema['settings']['form_submision_ref']['is_enabled']) &&
|
||||||
|
$form_data->form->schema['settings']['form_submision_ref']['is_enabled'] &&
|
||||||
|
!empty($form_data->submission_ref))
|
||||||
<b>@lang('messages.submission_numbering'):</b>
|
<b>@lang('messages.submission_numbering'):</b>
|
||||||
{{$form_data->submission_ref}}
|
{{ $form_data->submission_ref }}
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -37,27 +39,32 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach($form_data->form->schema['form'] as $element)
|
@foreach ($form_data->form->schema['form'] as $element)
|
||||||
@isset($form_data->data[$element['name']])
|
@isset($form_data->data[$element['name']])
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<strong>{{$element['label']}}</strong>
|
<strong>
|
||||||
|
@if (in_array(session()->get('locale'), ['ru', 'est']) && isset($element['label_' . session()->get('locale')]))
|
||||||
|
{{ $element['label_' . session()->get('locale')] }}
|
||||||
|
@else
|
||||||
|
{{ $element['label'] }}
|
||||||
|
@endif
|
||||||
|
</strong>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if($element['type'] == 'file_upload')
|
@if ($element['type'] == 'file_upload')
|
||||||
|
@include('form_data.file_view', [
|
||||||
@include('form_data.file_view', ['form_upload' => $form_data->data[$element['name']]])
|
'form_upload' => $form_data->data[$element['name']],
|
||||||
|
])
|
||||||
@elseif($element['type'] == 'signature')
|
@elseif($element['type'] == 'signature')
|
||||||
@if(!empty($form_data->data[$element['name']]))
|
@if (!empty($form_data->data[$element['name']]))
|
||||||
<a target="_blank" href="{{$form_data->data[$element['name']]}}"
|
<a target="_blank" href="{{ $form_data->data[$element['name']] }}"
|
||||||
download="Signature">
|
download="Signature">
|
||||||
<img src="{{$form_data->data[$element['name']]}}" class="signature">
|
<img src="{{ $form_data->data[$element['name']] }}" class="signature">
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
|
@elseif(is_array($form_data->data[$element['name']]) && $element['type'] != 'file_upload')
|
||||||
|
{{ implode(', ', $form_data->data[$element['name']]) }}
|
||||||
{{implode(', ', $form_data->data[$element['name']])}}
|
|
||||||
|
|
||||||
@else
|
@else
|
||||||
{!! nl2br($form_data->data[$element['name']]) !!}
|
{!! nl2br($form_data->data[$element['name']]) !!}
|
||||||
@endif
|
@endif
|
||||||
@ -69,10 +76,12 @@
|
|||||||
</table>
|
</table>
|
||||||
<div class="no-print mt-4">
|
<div class="no-print mt-4">
|
||||||
<hr>
|
<hr>
|
||||||
<form id="add_comment_form" action="{{action([\App\Http\Controllers\FormDataCommentController::class, 'store'])}}" method="POST">
|
<form id="add_comment_form"
|
||||||
|
action="{{ action([\App\Http\Controllers\FormDataCommentController::class, 'store']) }}"
|
||||||
|
method="POST">
|
||||||
{{ csrf_field() }}
|
{{ csrf_field() }}
|
||||||
<!-- hiden fields -->
|
<!-- hiden fields -->
|
||||||
<input type="hidden" name="form_data_id" id="form_data_id" value="{{$form_data->id}}">
|
<input type="hidden" name="form_data_id" id="form_data_id" value="{{ $form_data->id }}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="comment">
|
<label for="comment">
|
||||||
@lang('messages.comment'):
|
@lang('messages.comment'):
|
||||||
@ -104,7 +113,8 @@
|
|||||||
<i class="fas fa-print"></i>
|
<i class="fas fa-print"></i>
|
||||||
@lang('messages.print')
|
@lang('messages.print')
|
||||||
</button>
|
</button>
|
||||||
<a class="btn float-right btn-primary btn-sm m-1" target="_blank" href="{{action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id])}}">
|
<a class="btn float-right btn-primary btn-sm m-1" target="_blank"
|
||||||
|
href="{{ action([\App\Http\Controllers\FormDataController::class, 'downloadPdf'], [$form_data->id]) }}">
|
||||||
<i class="far fa-file-pdf" aria-hidden="true"></i>
|
<i class="far fa-file-pdf" aria-hidden="true"></i>
|
||||||
@lang('messages.download_pdf')
|
@lang('messages.download_pdf')
|
||||||
</a>
|
</a>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
@include('layouts/partials/status')
|
@include('layouts/partials/status')
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
||||||
<div class="row mb-5">
|
<div class="row mb-5">
|
||||||
<div class="col-12 col-sm-6 col-md-3">
|
<div class="col-12 col-sm-6 col-md-3">
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
@ -16,20 +16,19 @@
|
|||||||
|
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<span class="info-box-text">@lang('messages.forms')</span>
|
<span class="info-box-text">@lang('messages.forms')</span>
|
||||||
<span class="info-box-number">{{$form_count}}</span>
|
<span class="info-box-number">{{ $form_count }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
|
@if (!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
|
||||||
<div class="col-12 col-sm-6 col-md-3">
|
<div class="col-12 col-sm-6 col-md-3">
|
||||||
<div class="info-box">
|
<div class="info-box">
|
||||||
<span class="info-box-icon bg-danger elevation-1"><i
|
<span class="info-box-icon bg-danger elevation-1"><i class="fas fa-align-justify"></i></span>
|
||||||
class="fas fa-align-justify"></i></span>
|
|
||||||
|
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<span class="info-box-text">@lang('messages.templates')</span>
|
<span class="info-box-text">@lang('messages.templates')</span>
|
||||||
<span class="info-box-number">{{$template_count}}</span>
|
<span class="info-box-number">{{ $template_count }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -41,14 +40,13 @@
|
|||||||
|
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<span class="info-box-text">@lang('messages.submissions')</span>
|
<span class="info-box-text">@lang('messages.submissions')</span>
|
||||||
<span class="info-box-number">{{$submission_count}}</span>
|
<span class="info-box-number">{{ $submission_count }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 col-sm-6 col-md-3">
|
<div class="col-12 col-sm-6 col-md-3">
|
||||||
<button type="button"
|
<button type="button" data-href="{{ action([\App\Http\Controllers\FormController::class, 'create']) }}"
|
||||||
data-href="{{action([\App\Http\Controllers\FormController::class, 'create'])}}"
|
|
||||||
class="btn btn-primary float-right col-md-9 createForm mt-3">
|
class="btn btn-primary float-right col-md-9 createForm mt-3">
|
||||||
<i class="fas fa-plus" aria-hidden="true"></i> @lang('messages.new_form')</button>
|
<i class="fas fa-plus" aria-hidden="true"></i> @lang('messages.new_form')</button>
|
||||||
</div>
|
</div>
|
||||||
@ -59,11 +57,9 @@
|
|||||||
<div class="card card-primary card-outline card-outline-tabs">
|
<div class="card card-primary card-outline card-outline-tabs">
|
||||||
<div class="card-header p-0 border-bottom-0">
|
<div class="card-header p-0 border-bottom-0">
|
||||||
<ul class="nav nav-tabs
|
<ul class="nav nav-tabs
|
||||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form) nav-justified @endif"
|
||||||
nav-justified
|
|
||||||
@endif"
|
|
||||||
id="custom-tabs-four-tab" role="tablist">
|
id="custom-tabs-four-tab" role="tablist">
|
||||||
@if(auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value]) || auth()->user()->can_create_form)
|
@if (auth()->user()->hasRole([\App\Enums\User\RoleEnum::SUPERVISOR->value]) || auth()->user()->can_create_form)
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" id="custome-tabs-all-forms" data-toggle="pill"
|
<a class="nav-link active" id="custome-tabs-all-forms" data-toggle="pill"
|
||||||
href="#custome-tabs-forms" role="tab" aria-controls="custome-tabs-forms"
|
href="#custome-tabs-forms" role="tab" aria-controls="custome-tabs-forms"
|
||||||
@ -71,37 +67,32 @@
|
|||||||
<i class="fas fa-file-alt" aria-hidden="true"></i> @lang('messages.all_forms')
|
<i class="fas fa-file-alt" aria-hidden="true"></i> @lang('messages.all_forms')
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
|
@if (!auth()->user()->hasRole(\App\Enums\User\RoleEnum::ADMIN->value))
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" id="custome-tabs-all-templates" data-toggle="pill"
|
<a class="nav-link" id="custome-tabs-all-templates" data-toggle="pill"
|
||||||
href="#custome-tabs-templates" role="tab"
|
href="#custome-tabs-templates" role="tab"
|
||||||
aria-controls="custome-tabs-templates">
|
aria-controls="custome-tabs-templates">
|
||||||
<i class="fas fa-align-justify"
|
<i class="fas fa-align-justify" aria-hidden="true"></i> @lang('messages.all_templates')
|
||||||
aria-hidden="true"></i> @lang('messages.all_templates')
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link
|
<a class="nav-link
|
||||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
|
@if (!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form) active @endif
|
||||||
active
|
"
|
||||||
@endif
|
id="custome-tabs-shared-forms" data-toggle="pill"
|
||||||
" id="custome-tabs-shared-forms" data-toggle="pill"
|
|
||||||
href="#custome-tabs-shared-forms-assigned" role="tab"
|
href="#custome-tabs-shared-forms-assigned" role="tab"
|
||||||
aria-controls="custome-tabs-shared-forms-assigned"
|
aria-controls="custome-tabs-shared-forms-assigned"
|
||||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form)
|
@if (!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) && !auth()->user()->can_create_form) aria-selected="true" @endif>
|
||||||
aria-selected="true"
|
<i class="fas fa-file-alt" aria-hidden="true"></i> @lang('messages.assigned_forms')
|
||||||
@endif>
|
|
||||||
<i class="fas fa-file-alt"
|
|
||||||
aria-hidden="true"></i> @lang('messages.assigned_forms')
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="tab-content" id="custom-tabs-four-tabContent">
|
<div class="tab-content" id="custom-tabs-four-tabContent">
|
||||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || auth()->user()->can_create_form)
|
||||||
<div class="tab-pane fade active show" id="custome-tabs-forms" role="tabpanel"
|
<div class="tab-pane fade active show" id="custome-tabs-forms" role="tabpanel"
|
||||||
aria-labelledby="custome-tabs-all-forms">
|
aria-labelledby="custome-tabs-all-forms">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
@ -127,11 +118,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>@lang('messages.description')</th>
|
<th>@lang('messages.description')</th>
|
||||||
<th>@lang('messages.name')</th>
|
<th>@lang('messages.name')</th>
|
||||||
@if(auth()->user()->can('superadmin'))
|
@if (auth()->user()->can('superadmin'))
|
||||||
<th>
|
<th>
|
||||||
@lang('messages.is_global_template')
|
@lang('messages.is_global_template')
|
||||||
<i class="fas fa-info-circle"
|
<i class="fas fa-info-circle" data-toggle="tooltip"
|
||||||
data-toggle="tooltip"
|
|
||||||
title="@lang('messages.is_global_template_tooltip')"></i>
|
title="@lang('messages.is_global_template_tooltip')"></i>
|
||||||
</th>
|
</th>
|
||||||
@endif
|
@endif
|
||||||
@ -144,14 +134,14 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<div class="tab-pane fade
|
<div class="tab-pane fade
|
||||||
@if(!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || !auth()->user()->can_create_form)
|
@if (!auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) || !auth()->user()->can_create_form) active show @endif
|
||||||
active show
|
"
|
||||||
@endif
|
id="custome-tabs-shared-forms-assigned" role="tabpanel"
|
||||||
" id="custome-tabs-shared-forms-assigned" role="tabpanel"
|
|
||||||
aria-labelledby="custome-tabs-shared-forms">
|
aria-labelledby="custome-tabs-shared-forms">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table" id="assigned_form_table" style="width: 100%;">
|
<table class="table" id="assigned_form_table" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>@lang('messages.description')</th>
|
<th>@lang('messages.description')</th>
|
||||||
<th>@lang('messages.name')</th>
|
<th>@lang('messages.name')</th>
|
||||||
@ -177,7 +167,21 @@
|
|||||||
|
|
||||||
@section('footer')
|
@section('footer')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
|
var lang = `{{ session()->get('locale') }}`
|
||||||
|
var titleColName = 'name';
|
||||||
|
if (lang === 'est') {
|
||||||
|
titleColName = 'name_est'
|
||||||
|
} else if (lang === 'ru') {
|
||||||
|
titleColName = 'name_ru'
|
||||||
|
}
|
||||||
|
|
||||||
|
var descColName = 'description';
|
||||||
|
if (lang === 'est') {
|
||||||
|
descColName = 'description_est'
|
||||||
|
} else if (lang === 'ru') {
|
||||||
|
descColName = 'description_ru'
|
||||||
|
}
|
||||||
|
|
||||||
// form dataTable
|
// form dataTable
|
||||||
var form_table = $('#form_table').DataTable({
|
var form_table = $('#form_table').DataTable({
|
||||||
@ -187,20 +191,62 @@
|
|||||||
buttons: [],
|
buttons: [],
|
||||||
dom: 'lfrtip',
|
dom: 'lfrtip',
|
||||||
fixedHeader: false,
|
fixedHeader: false,
|
||||||
aaSorting: [[2, 'desc']],
|
aaSorting: [
|
||||||
"columnDefs": [
|
[1, 'desc']
|
||||||
{"width": "22%", "targets": 0},
|
|
||||||
{"width": "40%", "targets": 1},
|
|
||||||
{"width": "15%", "targets": 2},
|
|
||||||
{"width": "3%", "targets": 3},
|
|
||||||
{"width": "20%", "targets": 4}
|
|
||||||
],
|
],
|
||||||
columns: [
|
"columnDefs": [{
|
||||||
{data: 'name', name: 'name'},
|
"width": "22%",
|
||||||
{data: 'description', name: 'description'},
|
"targets": 0
|
||||||
{data: 'created_at', name: 'created_at'},
|
},
|
||||||
{data: 'data_count', name: 'data_count', searchable: false},
|
{
|
||||||
{data: 'action', name: 'action', sortable: false}
|
"width": "40%",
|
||||||
|
"targets": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"width": "15%",
|
||||||
|
"targets": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"width": "3%",
|
||||||
|
"targets": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"width": "20%",
|
||||||
|
"targets": 4
|
||||||
|
}
|
||||||
|
],
|
||||||
|
columns: [{
|
||||||
|
data: descColName,
|
||||||
|
name: descColName,
|
||||||
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
|
if (td.innerHTML.length === 0) {
|
||||||
|
td.innerHTML = rowData.name
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: titleColName,
|
||||||
|
name: titleColName,
|
||||||
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
|
if (td.innerHTML.length === 0) {
|
||||||
|
td.innerHTML = rowData.name
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'created_at',
|
||||||
|
name: 'created_at'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'data_count',
|
||||||
|
name: 'data_count',
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'action',
|
||||||
|
name: 'action',
|
||||||
|
sortable: false
|
||||||
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -212,22 +258,41 @@
|
|||||||
buttons: [],
|
buttons: [],
|
||||||
dom: 'lfrtip',
|
dom: 'lfrtip',
|
||||||
fixedHeader: false,
|
fixedHeader: false,
|
||||||
columns: [
|
columns: [{
|
||||||
{data: 'name', name: 'name'},
|
data: descColName,
|
||||||
{data: 'description', name: 'description'},
|
name: descColName,
|
||||||
@if(auth()->user()->can('superadmin'))
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
{
|
if (td.innerHTML.length === 0) {
|
||||||
data: 'is_global_template', name: 'is_global_template', sortable: false, searchable: false
|
td.innerHTML = rowData.name
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
@endif
|
|
||||||
{
|
{
|
||||||
data: 'action', name: 'action', sortable: false
|
data: titleColName,
|
||||||
|
name: titleColName,
|
||||||
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
|
if (td.innerHTML.length === 0) {
|
||||||
|
td.innerHTML = rowData.name
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
@if (auth()->user()->can('superadmin'))
|
||||||
|
{
|
||||||
|
data: 'is_global_template',
|
||||||
|
name: 'is_global_template',
|
||||||
|
sortable: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
@endif {
|
||||||
|
data: 'action',
|
||||||
|
name: 'action',
|
||||||
|
sortable: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
//delete form
|
//delete form
|
||||||
$(document).on('click', '.delete_form', function () {
|
$(document).on('click', '.delete_form', function() {
|
||||||
var url = $(this).data("href");
|
var url = $(this).data("href");
|
||||||
var result = confirm('Are You Sure?');
|
var result = confirm('Are You Sure?');
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
@ -235,7 +300,7 @@
|
|||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (result) {
|
success: function(result) {
|
||||||
if (result.success == true) {
|
if (result.success == true) {
|
||||||
toastr.success(result.msg);
|
toastr.success(result.msg);
|
||||||
form_table.ajax.reload();
|
form_table.ajax.reload();
|
||||||
@ -248,7 +313,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
//delete template
|
//delete template
|
||||||
$(document).on('click', '.delete_template', function () {
|
$(document).on('click', '.delete_template', function() {
|
||||||
var url = $(this).data("href");
|
var url = $(this).data("href");
|
||||||
var result = confirm('Are You Sure?');
|
var result = confirm('Are You Sure?');
|
||||||
if (result == true) {
|
if (result == true) {
|
||||||
@ -256,7 +321,7 @@
|
|||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (result) {
|
success: function(result) {
|
||||||
if (result.success == true) {
|
if (result.success == true) {
|
||||||
toastr.success(result.msg);
|
toastr.success(result.msg);
|
||||||
template_table.ajax.reload();
|
template_table.ajax.reload();
|
||||||
@ -269,39 +334,39 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// create form
|
// create form
|
||||||
$(document).on('click', '.createForm', function () {
|
$(document).on('click', '.createForm', function() {
|
||||||
var url = $(this).data('href');
|
var url = $(this).data('href');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
$("#modal_div").html(response).modal("show");
|
$("#modal_div").html(response).modal("show");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// create widget
|
// create widget
|
||||||
$(document).on('click', '.generate_widget', function () {
|
$(document).on('click', '.generate_widget', function() {
|
||||||
var url = $(this).data('href');
|
var url = $(this).data('href');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
$("#modal_div").html(response).modal("show");
|
$("#modal_div").html(response).modal("show");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//copy form
|
//copy form
|
||||||
$(document).on('click', '.copy_form', function () {
|
$(document).on('click', '.copy_form', function() {
|
||||||
var url = $(this).data('href');
|
var url = $(this).data('href');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
$("#modal_div").html(response).modal("show");
|
$("#modal_div").html(response).modal("show");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -315,49 +380,81 @@
|
|||||||
buttons: [],
|
buttons: [],
|
||||||
dom: 'lfrtip',
|
dom: 'lfrtip',
|
||||||
fixedHeader: false,
|
fixedHeader: false,
|
||||||
aaSorting: [[0, 'desc']],
|
aaSorting: [
|
||||||
"columnDefs": [
|
[0, 'desc']
|
||||||
{"width": "25%", "targets": 0},
|
|
||||||
{"width": "40%", "targets": 1},
|
|
||||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
|
||||||
{
|
|
||||||
"width": "15%", "targets": 2
|
|
||||||
},
|
|
||||||
@endif
|
|
||||||
{
|
|
||||||
"width": "20%",
|
|
||||||
"targets": @php echo auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value) ? 3 : 2 @endphp }
|
|
||||||
],
|
],
|
||||||
columns: [
|
"columnDefs": [{
|
||||||
{data: 'name', name: 'forms.name'},
|
"width": "25%",
|
||||||
{data: 'description', name: 'forms.description'},
|
"targets": 0
|
||||||
@if(auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
|
||||||
{
|
|
||||||
data: 'created_by', name: 'forms.created_by'
|
|
||||||
},
|
},
|
||||||
@endif
|
|
||||||
{
|
{
|
||||||
data: 'action', name: 'action', sortable: false
|
"width": "40%",
|
||||||
|
"targets": 1
|
||||||
|
},
|
||||||
|
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||||
|
{
|
||||||
|
"width": "15%",
|
||||||
|
"targets": 2
|
||||||
|
},
|
||||||
|
@endif {
|
||||||
|
"width": "20%",
|
||||||
|
"targets": @php
|
||||||
|
echo auth()
|
||||||
|
->user()
|
||||||
|
->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value)
|
||||||
|
? 3
|
||||||
|
: 2;
|
||||||
|
@endphp
|
||||||
|
}
|
||||||
|
],
|
||||||
|
columns: [{
|
||||||
|
data: descColName,
|
||||||
|
name: 'forms.' + descColName,
|
||||||
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
|
if (td.innerHTML.length === 0) {
|
||||||
|
td.innerHTML = rowData.description
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: titleColName,
|
||||||
|
name: 'forms.' + titleColName,
|
||||||
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
|
if (td.innerHTML.length === 0) {
|
||||||
|
td.innerHTML = rowData.name
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
@if (auth()->user()->hasRole(\App\Enums\User\RoleEnum::SUPERVISOR->value))
|
||||||
|
{
|
||||||
|
data: 'created_by',
|
||||||
|
name: 'forms.created_by'
|
||||||
|
},
|
||||||
|
@endif {
|
||||||
|
data: 'action',
|
||||||
|
name: 'action',
|
||||||
|
sortable: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//form collaborate
|
//form collaborate
|
||||||
$(document).on('click', '.collab_btn', function () {
|
$(document).on('click', '.collab_btn', function() {
|
||||||
var url = $(this).data('href');
|
var url = $(this).data('href');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: url,
|
url: url,
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
$("#collab_modal").html(response).modal("show");
|
$("#collab_modal").html(response).modal("show");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#collab_modal").on('shown.bs.modal', function () {
|
$("#collab_modal").on('shown.bs.modal', function() {
|
||||||
if ($("#form_design").length) {
|
if ($("#form_design").length) {
|
||||||
$(document).on('change', '#form_design', function () {
|
$(document).on('change', '#form_design', function() {
|
||||||
if ($("#form_design").is(":checked")) {
|
if ($("#form_design").is(":checked")) {
|
||||||
$("#form_view").attr('checked', true);
|
$("#form_view").attr('checked', true);
|
||||||
} else {
|
} else {
|
||||||
@ -367,7 +464,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('submit', 'form#collaborate_form', function (e) {
|
$(document).on('submit', 'form#collaborate_form', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var data = $("form#collaborate_form").serialize();
|
var data = $("form#collaborate_form").serialize();
|
||||||
var url = $("form#collaborate_form").attr('action');
|
var url = $("form#collaborate_form").attr('action');
|
||||||
@ -378,7 +475,7 @@
|
|||||||
url: url,
|
url: url,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: data,
|
data: data,
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
ladda.stop();
|
ladda.stop();
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
$("#collab_modal").modal('hide');
|
$("#collab_modal").modal('hide');
|
||||||
@ -390,7 +487,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('a[data-toggle="pill"]').on('shown.bs.tab', function (e) {
|
$('a[data-toggle="pill"]').on('shown.bs.tab', function(e) {
|
||||||
var target = $(e.target).attr('href');
|
var target = $(e.target).attr('href');
|
||||||
if (target == '#custome-tabs-forms') {
|
if (target == '#custome-tabs-forms') {
|
||||||
if (typeof form_table != 'undefined') {
|
if (typeof form_table != 'undefined') {
|
||||||
@ -407,17 +504,17 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@if(auth()->user()->can('superadmin'))
|
@if (auth()->user()->can('superadmin'))
|
||||||
$(document).on('click', '.toggle_global_template', function () {
|
$(document).on('click', '.toggle_global_template', function() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "{{route('toggle.global.template')}}",
|
url: "{{ route('toggle.global.template') }}",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {
|
data: {
|
||||||
is_checked: $(this).is(":checked") ? 1 : 0,
|
is_checked: $(this).is(":checked") ? 1 : 0,
|
||||||
form_id: $(this).data("form_id"),
|
form_id: $(this).data("form_id"),
|
||||||
},
|
},
|
||||||
success: function (response) {
|
success: function(response) {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
template_table.ajax.reload();
|
template_table.ajax.reload();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
<html lang="{{ str_replace('_', '-', session()->get('locale', 'en')) }}">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
@ -19,6 +19,33 @@
|
|||||||
<!-- Right Side Of Navbar -->
|
<!-- Right Side Of Navbar -->
|
||||||
<ul class="navbar-nav ml-auto">
|
<ul class="navbar-nav ml-auto">
|
||||||
<!-- Authentication Links -->
|
<!-- Authentication Links -->
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a id="superadminDropdown" href="#" data-toggle="dropdown" aria-haspopup="true"
|
||||||
|
aria-expanded="false" class="nav-link dropdown-toggle">
|
||||||
|
{{str(session()->get('locale'))->upper()}}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ul aria-labelledby="superadminDropdown" class="dropdown-menu border-0 shadow">
|
||||||
|
<li>
|
||||||
|
<a href="{{route('locale', 'en')}}"
|
||||||
|
class="dropdown-item @if (session()->get('locale') == 'en') active @endif">
|
||||||
|
English
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{route('locale', 'ru')}}"
|
||||||
|
class="dropdown-item @if (session()->get('locale') == 'ru') active @endif">
|
||||||
|
Русский
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{route('locale', 'est')}}"
|
||||||
|
class="dropdown-item @if (session()->get('locale') == 'est') active @endif">
|
||||||
|
Eesti keel
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
@guest
|
@guest
|
||||||
<li class="nav-item d-none d-sm-inline-block">
|
<li class="nav-item d-none d-sm-inline-block">
|
||||||
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
|
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
|
||||||
|
@ -4,6 +4,7 @@ use App\Http\Controllers\FormController;
|
|||||||
use App\Http\Controllers\FormDataCommentController;
|
use App\Http\Controllers\FormDataCommentController;
|
||||||
use App\Http\Controllers\FormDataController;
|
use App\Http\Controllers\FormDataController;
|
||||||
use App\Http\Controllers\HomeController;
|
use App\Http\Controllers\HomeController;
|
||||||
|
use App\Http\Controllers\LocaleController;
|
||||||
use App\Http\Controllers\ManageProfileController;
|
use App\Http\Controllers\ManageProfileController;
|
||||||
use App\Http\Controllers\ManageSettingsController;
|
use App\Http\Controllers\ManageSettingsController;
|
||||||
use App\Http\Controllers\RegistrationController;
|
use App\Http\Controllers\RegistrationController;
|
||||||
@ -33,13 +34,15 @@ Route::get('/', function () {
|
|||||||
return view('welcome');
|
return view('welcome');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('locale/{locale}', LocaleController::class)->name('locale');
|
||||||
|
|
||||||
Route::middleware(['IsInstalled'])->group(function () {
|
Route::middleware(['IsInstalled'])->group(function () {
|
||||||
Auth::routes(['register' => env('ENABLE_REGISTRATION', false)]);
|
Auth::routes(['register' => env('ENABLE_REGISTRATION', false)]);
|
||||||
|
|
||||||
Route::post('registration', [RegistrationController::class, 'store']);
|
Route::post('registration', [RegistrationController::class, 'store']);
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::middleware(['IsInstalled', 'auth', 'bootstrap', 'setDefaultConfig'])->group(function () {
|
Route::middleware(['IsInstalled', 'auth', 'bootstrap', 'setDefaultConfig', 'locale',])->group(function () {
|
||||||
Route::get('/home', [HomeController::class, 'index'])->name('home');
|
Route::get('/home', [HomeController::class, 'index'])->name('home');
|
||||||
Route::get('/home-template', [HomeController::class, 'getTemplate']);
|
Route::get('/home-template', [HomeController::class, 'getTemplate']);
|
||||||
Route::get('/home-assigned-forms', [HomeController::class, 'getAssignedForms']);
|
Route::get('/home-assigned-forms', [HomeController::class, 'getAssignedForms']);
|
||||||
|
Loading…
Reference in New Issue
Block a user