add camera modal for task
This commit is contained in:
@@ -314,7 +314,14 @@
|
||||
</svg>
|
||||
<span class="d-none" style="font-size: 12px">پیام صوتی</span>
|
||||
</button>
|
||||
<button class="upload-file" id="upload-doc" type="submit">
|
||||
<button class="upload-file d-none d-md-block" id="upload-doc" type="button">
|
||||
<svg id="svgFileUpload" width="16" height="18" viewBox="0 0 16 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.1643 9.60644L7.07781 15.9186C6.41012 16.611 5.50455 17 4.5603 17C3.61605 17 2.71047 16.611 2.04279 15.9186C1.3751 15.2261 1 14.287 1 13.3077C1 12.3285 1.3751 11.3893 2.04279 10.6969L10.6982 1.72061C10.9187 1.49207 11.1804 1.31081 11.4684 1.18716C11.7564 1.06352 12.0651 0.999924 12.3768 1C12.6886 1.00008 12.9972 1.06383 13.2852 1.18761C13.5731 1.31139 13.8348 1.49278 14.0551 1.72143C14.2755 1.95007 14.4503 2.22149 14.5695 2.52019C14.6887 2.81889 14.7501 3.13902 14.75 3.46229C14.7499 3.78557 14.6885 4.10566 14.5691 4.4043C14.4497 4.70294 14.2748 4.97428 14.0544 5.20282L5.39261 14.1857M5.39261 14.1857L5.39973 14.1775M5.39261 14.1857C5.1679 14.4091 4.86756 14.5311 4.5563 14.5271C4.24504 14.523 3.94779 14.3922 3.72862 14.163C3.50944 13.9337 3.38589 13.6244 3.38459 13.3016C3.38328 12.9787 3.50434 12.6683 3.72165 12.4372L9.90071 6.02906" stroke="white" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<span class="d-none">بارگذاری تصاویر و مدارک</span>
|
||||
@* <div id="progressBar" style="display: none">0</div> *@
|
||||
</button>
|
||||
<button class="upload-file d-block d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasBottom" aria-controls="offcanvasBottom">
|
||||
<svg id="svgFileUpload" width="16" height="18" viewBox="0 0 16 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.1643 9.60644L7.07781 15.9186C6.41012 16.611 5.50455 17 4.5603 17C3.61605 17 2.71047 16.611 2.04279 15.9186C1.3751 15.2261 1 14.287 1 13.3077C1 12.3285 1.3751 11.3893 2.04279 10.6969L10.6982 1.72061C10.9187 1.49207 11.1804 1.31081 11.4684 1.18716C11.7564 1.06352 12.0651 0.999924 12.3768 1C12.6886 1.00008 12.9972 1.06383 13.2852 1.18761C13.5731 1.31139 13.8348 1.49278 14.0551 1.72143C14.2755 1.95007 14.4503 2.22149 14.5695 2.52019C14.6887 2.81889 14.7501 3.13902 14.75 3.46229C14.7499 3.78557 14.6885 4.10566 14.5691 4.4043C14.4497 4.70294 14.2748 4.97428 14.0544 5.20282L5.39261 14.1857M5.39261 14.1857L5.39973 14.1775M5.39261 14.1857C5.1679 14.4091 4.86756 14.5311 4.5563 14.5271C4.24504 14.523 3.94779 14.3922 3.72862 14.163C3.50944 13.9337 3.38589 13.6244 3.38459 13.3016C3.38328 12.9787 3.50434 12.6683 3.72165 12.4372L9.90071 6.02906" stroke="white" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
|
||||
@@ -424,6 +424,11 @@
|
||||
<!-- مودال -->
|
||||
|
||||
|
||||
<!-- offcanvas -->
|
||||
<div class="offcanvas offcanvas-bottom" tabindex="-1" id="offcanvasBottom" aria-labelledby="offcanvasBottomLabel">
|
||||
<partial name="_Partials/CreateAttachmentsModal" />
|
||||
</div>
|
||||
|
||||
|
||||
@section Script {
|
||||
<script src="~/assetsclient/js/site.js?ver=@adminVersion"></script>
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
@{
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
}
|
||||
|
||||
<script src="~/AssetsClient/js/jquery-ui.js"></script>
|
||||
<link href="~/AssetsClient/css/select2.css?ver=@adminVersion" rel="stylesheet" />
|
||||
<link href="~/assetsadminnew/tasks/css/_partials/createattachmentsmodal.css?ver=@adminVersion" rel="stylesheet" />
|
||||
|
||||
|
||||
<div class="offcanvas-header justify-content-center">
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
<h5 class="offcanvas-title" id="offcanvasBottomLabel">انتخاب</h5>
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="text-center">
|
||||
<button class="bg-transparent" type="button" id="cameraBtn">
|
||||
<img src="~/assetsadminnew/tasks/images/camera.svg" />
|
||||
<div class="tilte-label">باز کردن دوربین</div>
|
||||
</button>
|
||||
<input type="file" id="cameraInput" accept="image/*" capture="environment" style="display: none;" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="text-center">
|
||||
<button class="bg-transparent" type="button" id="upload-doc1">
|
||||
<img src="~/assetsadminnew/tasks/images/folder.svg" />
|
||||
<div class="tilte-label">باز کردن فایل</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-100 text-end">
|
||||
<button type="button" class="btn-cancel w-100" data-bs-dismiss="offcanvas" aria-label="Close">انصراف</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#cameraBtn').on('click', function () {
|
||||
$('#cameraInput').click();
|
||||
});
|
||||
|
||||
$('#cameraInput').on('change', function (e) {
|
||||
const file = e.target.files[0];
|
||||
if (!file) return;
|
||||
|
||||
if (file.size > 50 * 1024 * 1024) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 50 مگابایت را انتخاب کنید.', 3500);
|
||||
$(this).val('');
|
||||
return;
|
||||
}
|
||||
|
||||
const nextInput = getNextAvailableFileInput();
|
||||
|
||||
if (!nextInput) {
|
||||
showAlertMessage('.alert-msg', 'شما نمیتوانید بیش از ۶ فایل آپلود کنید.', 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
const dataTransfer = new DataTransfer();
|
||||
dataTransfer.items.add(file);
|
||||
nextInput.element.files = dataTransfer.files;
|
||||
|
||||
uploadFile(file, nextInput.id, nextInput.boxClass);
|
||||
|
||||
const offcanvas = bootstrap.Offcanvas.getInstance(document.querySelector('.offcanvas'));
|
||||
if (offcanvas) {
|
||||
offcanvas.hide();
|
||||
}
|
||||
|
||||
$(this).val('');
|
||||
});
|
||||
|
||||
function getNextAvailableFileInput() {
|
||||
let files = [
|
||||
document.getElementById("Command_Document1"),
|
||||
document.getElementById("Command_Document2"),
|
||||
document.getElementById("Command_Document3"),
|
||||
document.getElementById("Command_Document4"),
|
||||
document.getElementById("Command_Document5"),
|
||||
document.getElementById("Command_Document6")
|
||||
];
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
if (files[i].files.length === 0) {
|
||||
return {
|
||||
element: files[i],
|
||||
id: i + 1,
|
||||
boxClass: '.inBox' + (i + 1)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,55 @@
|
||||
.offcanvas-backdrop {
|
||||
z-index: 999999999;
|
||||
}
|
||||
|
||||
#offcanvasBottom {
|
||||
z-index: 99999999999999;
|
||||
border-radius: 22px 20px 0 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.alert-msg {
|
||||
z-index: 99999999940;
|
||||
}
|
||||
|
||||
.validTime {
|
||||
color: #4d7c0f !important;
|
||||
}
|
||||
|
||||
.invalidTime {
|
||||
color: #b91c1c !important;
|
||||
}
|
||||
|
||||
.form-check, .form-switch {
|
||||
overflow: hidden;
|
||||
padding-right: 0;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.tilte-label {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #292929;
|
||||
}
|
||||
|
||||
.offcanvas-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #292929;
|
||||
}
|
||||
|
||||
.offcanvas-header .btn-close {
|
||||
margin: 0 0 0 15px;
|
||||
border: 2px solid #33363F;
|
||||
border-radius: 50%;
|
||||
right: 13px;
|
||||
padding: 5px;
|
||||
background-size: 10px;
|
||||
z-index: 25;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
border-radius: 7px;
|
||||
}
|
||||
.modal-content {
|
||||
height: 720px;
|
||||
/*height: 720px;*/
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<svg width="97" height="97" viewBox="0 0 97 97" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M39.5182 84.875H57.4811C70.0955 84.875 76.4025 84.875 80.9332 81.9028C82.8943 80.6159 84.5784 78.9624 85.8891 77.037C88.9163 72.5887 88.9164 66.3961 88.9164 54.0112C88.9164 41.6267 88.9163 35.4341 85.8891 30.9858C84.5784 29.0602 82.8943 27.4067 80.9332 26.12C78.0216 24.2101 74.3773 23.5275 68.7969 23.2835C66.1339 23.2835 63.8414 21.3023 63.3193 18.7386C62.5356 14.8931 59.0965 12.125 55.1026 12.125H41.8968C37.9026 12.125 34.4636 14.8931 33.6802 18.7386C33.158 21.3023 30.8653 23.2835 28.2024 23.2835C22.6222 23.5275 18.9775 24.2101 16.0663 26.12C14.1049 27.4067 12.4208 29.0602 11.1103 30.9858C8.08301 35.4341 8.08301 41.6267 8.08301 54.0112C8.08301 66.3961 8.08301 72.5887 11.1103 77.037C12.4208 78.9624 14.1049 80.6159 16.0663 81.9028C20.597 84.875 26.904 84.875 39.5182 84.875Z" fill="#9FE7E7"/>
|
||||
<path d="M70.9558 37.4766C69.0958 37.4766 67.5879 38.9571 67.5879 40.7832C67.5879 42.6096 69.0958 44.0901 70.9558 44.0901H75.4465C77.3069 44.0901 78.8148 42.6096 78.8148 40.7832C78.8148 38.9571 77.3069 37.4766 75.4465 37.4766H70.9558Z" fill="#41D1D1"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.5026 37.4766C39.2018 37.4766 31.6621 44.879 31.6621 54.0108C31.6621 63.1421 39.2018 70.5448 48.5026 70.5448C57.8029 70.5448 65.3426 63.1421 65.3426 54.0108C65.3426 44.879 57.8029 37.4766 48.5026 37.4766ZM48.5026 44.0901C42.9219 44.0901 38.3982 48.5319 38.3982 54.0108C38.3982 59.4897 42.9219 63.931 48.5026 63.931C54.0829 63.931 58.6068 59.4897 58.6068 54.0108C58.6068 48.5319 54.0829 44.0901 48.5026 44.0901Z" fill="#41D1D1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="102" height="102" viewBox="0 0 102 102" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17 47.6C17 42.8396 17 40.4593 17.9265 38.6411C18.7414 37.0417 20.0417 35.7414 21.6411 34.9265C23.4593 34 25.8396 34 30.6 34H36.1301C38.4715 34 39.6423 34 40.7271 34.2919C41.6884 34.5505 42.5969 34.9759 43.4108 35.5488C44.3296 36.1954 45.0789 37.0948 46.5779 38.8935L53.125 46.75H62.9C67.6604 46.75 70.0408 46.75 71.859 47.6765C73.4583 48.4912 74.7588 49.7917 75.5735 51.391C76.5 53.2092 76.5 55.5896 76.5 60.35V71.4C76.5 76.1604 76.5 78.5409 75.5735 80.359C74.7588 81.9583 73.4583 83.2588 71.859 84.0735C70.0408 85 67.6604 85 62.9 85H30.6C25.8396 85 23.4593 85 21.6411 84.0735C20.0417 83.2588 18.7414 81.9583 17.9265 80.359C17 78.5409 17 76.1604 17 71.4V47.6Z" fill="#9FE7E7"/>
|
||||
<path d="M29.75 34.85C29.75 30.0896 29.75 27.7093 30.6765 25.8911C31.4914 24.2917 32.7917 22.9914 34.3911 22.1765C36.2093 21.25 38.5896 21.25 43.35 21.25H48.8801C51.2214 21.25 52.3923 21.25 53.4773 21.5419C54.4382 21.8005 55.3469 22.2259 56.1608 22.7988C57.0796 23.4454 57.8289 24.3448 59.3279 26.1435L65.875 34H75.65C80.4104 34 82.7908 34 84.609 34.9265C86.2083 35.7414 87.5088 37.0417 88.3235 38.6411C89.25 40.4593 89.25 42.8396 89.25 47.6V58.65C89.25 63.4104 89.25 65.7909 88.3235 67.609C87.5088 69.2083 86.2083 70.5088 84.609 71.3235C82.7908 72.25 80.4104 72.25 75.65 72.25H43.35C38.5896 72.25 36.2093 72.25 34.3911 71.3235C32.7917 70.5088 31.4914 69.2083 30.6765 67.609C29.75 65.7909 29.75 63.4104 29.75 58.65V34.85Z" fill="#41D1D1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -823,7 +823,7 @@ $('#EndTaskTime').on("keyup",
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).on('click', '#upload-doc', function (event) {
|
||||
$(document).on('click', '#upload-doc, #upload-doc1', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
let files = [
|
||||
@@ -859,6 +859,11 @@ function attachFileChangeHandler(fileInput, id, boxClass) {
|
||||
if (fileInputFile) {
|
||||
uploadFile(fileInputFile, id, boxClass);
|
||||
}
|
||||
|
||||
const offcanvas = bootstrap.Offcanvas.getInstance(document.querySelector('.offcanvas'));
|
||||
if (offcanvas) {
|
||||
offcanvas.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1632,13 +1637,34 @@ $(document).on('click', '.TaskTitleSearch', function () {
|
||||
|
||||
|
||||
function searchSubjectTask() {
|
||||
var input, filter, tbody, tr, i, td, containerResult;
|
||||
input = document.getElementById("Command_Title");
|
||||
filter = input.value.toUpperCase();
|
||||
/* var taskTitleValue = document.getElementById("taskTitle").value;
|
||||
containerResult = document.getElementById("TaskTitle");
|
||||
tbody = document.getElementById("searchTitleResult");
|
||||
tr = tbody.getElementsByClassName("li-subject");
|
||||
tr = tbody.getElementsByClassName("li-subject");*/
|
||||
// Get the input value
|
||||
const input = document.getElementById('taskTitle');
|
||||
const filter = input.value.toLowerCase(); // Convert to lowercase for case insensitive matching
|
||||
list = document.getElementById('searchTitleResult');
|
||||
const items = list.getElementsByClassName('li-subject'); // Get all li elements in the list
|
||||
|
||||
var hasVisibleResults = false;
|
||||
// Loop through all list items and display those that match the filter
|
||||
Array.from(items).forEach(item => {
|
||||
const itemText = item.textContent.toLowerCase(); // Get the text of the item
|
||||
if (itemText.includes(filter) && filter !== '') {
|
||||
item.style.display = ''; // Show item
|
||||
} else {
|
||||
item.style.display = 'none'; // Hide item
|
||||
}
|
||||
});
|
||||
|
||||
/* var input, filter, tbody, tr, i, td, containerResult;
|
||||
input = document.getElementById("Command_Title");
|
||||
filter = input.value.toUpperCase();*/
|
||||
|
||||
|
||||
|
||||
|
||||
/* var hasVisibleResults = false;
|
||||
|
||||
for (i = 0; i < tr.length; i++) {
|
||||
td = tr[i];
|
||||
@@ -1650,12 +1676,12 @@ function searchSubjectTask() {
|
||||
}
|
||||
}
|
||||
|
||||
containerResult = document.getElementById("TaskTitle");
|
||||
|
||||
if (hasVisibleResults) {
|
||||
containerResult.style.display = "block";
|
||||
} else {
|
||||
containerResult.style.display = "none";
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user