update:add ci cd files ==> do not edit those file

This commit is contained in:
mahyargdz
2024-10-10 21:49:00 +03:30
parent 6fe34708a2
commit 8cf0492c87
464 changed files with 79533 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
const mongoose = require('mongoose')
const BlogCategorySchema = mongoose.Schema({
locale: {
fa: {
title: String,
description: String
},
en: {
title: String,
description: String
}
}
})
module.exports = mongoose.model('BlogCategory', BlogCategorySchema)
+48
View File
@@ -0,0 +1,48 @@
const mongoose = require('mongoose')
const paginate = require('mongoose-paginate-v2')
function cover(img) {
if (img) return '/uploads/images/blog/' + img
}
function thumb(img) {
return '/uploads/images/blog/thumb/' + img
}
function video(vi) {
if (vi) return '/uploads/videos/blog/' + vi
}
const BlogPostSchema = mongoose.Schema({
locale: {
fa: {
title: String,
description: String,
short_description: String,
last_section_image_title: String,
last_section_image_description: String,
last_section_title: String,
last_section_description: String
},
en: {
title: String,
description: String,
short_description: String,
last_section_image_title: String,
last_section_image_description: String,
last_section_title: String,
last_section_description: String
}
},
cover: {type: String, get: cover},
thumb: {type: String, get: thumb},
video : {type: String, get: video},
last_section_image: {type: String, get: cover},
category: {type: mongoose.ObjectId, ref: 'BlogCategory'},
published: {type: Boolean, default: true}
})
BlogPostSchema.plugin(paginate)
module.exports = mongoose.model('BlogPost', BlogPostSchema)
+27
View File
@@ -0,0 +1,27 @@
const mongoose = require('mongoose')
function file(file) {
return '/uploads/catalogs/file/' + file
}
function cover(img) {
return '/uploads/catalogs/cover/' + img
}
const CatalogSchema = mongoose.Schema({
locale: {
fa: {
title: String
},
en: {
title: String
}
},
file: {type: String, get: file},
cover: {type: String, get: cover},
showInFa: {type: Boolean, default: false},
showInEn: {type: Boolean, default: false}
})
module.exports = mongoose.model('Catalog', CatalogSchema)
+17
View File
@@ -0,0 +1,17 @@
const mongoose = require('mongoose')
const contactUsSchema = mongoose.Schema({
name: String,
email: String,
subject: String,
message: String,
locale: {
type: String,
enum: ['fa', 'en'],
default: 'en'
},
read: {type: Boolean, default: false}
})
module.exports = mongoose.model('ContactUs', contactUsSchema)
+23
View File
@@ -0,0 +1,23 @@
const mongoose = require('mongoose')
function image(img) {
if (img) return '/uploads/images/customer/' + img
}
const CustomerCommentSchema = mongoose.Schema({
locale: {
fa: {
name: String,
position: String,
comment: String
},
en: {
name: String,
position: String,
comment: String
}
},
image: {type: String, get: image}
})
module.exports = mongoose.model('CustomerComment', CustomerCommentSchema)
+23
View File
@@ -0,0 +1,23 @@
const mongoose = require('mongoose')
function image(img) {
return '/uploads/images/gallery/' + img
}
const GallerySchema = mongoose.Schema({
image: {type: String, get: image},
thumb: {type: String, get: image},
category: {type: mongoose.ObjectId, ref: 'GalleryCategory'},
noCategory: {type: Boolean, default: false},
locale: {
fa: {
caption: String
},
en: {
caption: String
}
}
})
module.exports = mongoose.model('Gallery', GallerySchema)
+25
View File
@@ -0,0 +1,25 @@
const mongoose = require('mongoose')
function image(img) {
return '/uploads/images/galleryCover/' + img
}
function image2(img) {
return '/uploads/images/galleryCover/thumb/' + img
}
const GalleryCategorySchema = mongoose.Schema({
cover: {type: String, get: image},
thumb: {type: String, get: image2},
locale: {
fa: {
title: String,
description: String
},
en: {
title: String,
description: String
}
},
index : {type : Number , default : 1}
})
module.exports = mongoose.model('GalleryCategory', GalleryCategorySchema)
+65
View File
@@ -0,0 +1,65 @@
const mongoose = require('mongoose')
function image(img) {
if (img) return '/uploads/images/projects/' + img
}
const ProjectImagesSchema = mongoose.Schema({
image: {type: String, get: image},
thumb: {type: String, get: image}
})
const ProjectSchema = mongoose.Schema({
locale: {
fa: {
title: String,
short_description: String,
description: String,
//
client: String,
size: String,
area: String,
//
s3_title: String,
s3_description: String,
//
s5_title: String,
s5_description: String,
//
s6_title: String,
s6_description: String
},
en: {
title: String,
short_description: String,
description: String,
//
client: String,
size: String,
area: String,
//
s3_title: String,
s3_description: String,
//
s5_title: String,
s5_description: String,
//
s6_title: String,
s6_description: String
}
},
category: {type: mongoose.ObjectId, ref: 'ProjectCategory'},
tag: {type: mongoose.ObjectId},
cover: {type: String, get: image},
thumb: {type: String, get: image},
s2_image: {type: String, get: image},
s4_image: {type: String, get: image},
s5_image: {type: String, get: image},
s6_image: {type: String, get: image},
project_date: String,
images: [ProjectImagesSchema],
has_details: {type: Boolean, default: false},
importWithCode : {type: Boolean, default: false}
})
module.exports = mongoose.model('Project', ProjectSchema)
+27
View File
@@ -0,0 +1,27 @@
const mongoose = require('mongoose')
const CategoryTagSchema = mongoose.Schema({
locale: {
fa: {
name: String
},
en: {
name: String
}
}
})
const ProjectCategorySchema = mongoose.Schema({
locale: {
fa: {
name: String
},
en: {
name: String
}
},
tags: [CategoryTagSchema]
})
module.exports = mongoose.model('ProjectCategory', ProjectCategorySchema)
+16
View File
@@ -0,0 +1,16 @@
const mongoose = require('mongoose')
function file(file) {
if (file) return '/uploads/images/setting/' + file
}
const SiteSettingSchema = mongoose.Schema({
aboutUS: {type: String, get: file, default: 'undefined'},
activity: {type: String, get: file, default: ''},
projects: {type: String, get: file, default: ''},
gallery: {type: String, get: file, default: ''},
catalog: {type: String, get: file, default: ''},
blogs: {type: String, get: file, default: ''},
})
module.exports = mongoose.model('SiteSetting', SiteSettingSchema)
+25
View File
@@ -0,0 +1,25 @@
const mongoose = require('mongoose')
function file(file) {
if (file) return '/uploads/images/slider/' + file
}
const SlideSchema = mongoose.Schema({
// locale: {
// fa: {
// name: String,
// position: String,
// comment: String
// },
// en: {
// name: String,
// position: String,
// comment: String
// }
// },
isImage: Boolean,
image: {type: String, get: file},
video: {type: String, get: file}
})
module.exports = mongoose.model('Slide', SlideSchema)
+24
View File
@@ -0,0 +1,24 @@
const mongoose = require('mongoose')
function image(img) {
return '/uploads/images/team/' + img
}
const TeamSchema = mongoose.Schema({
locale: {
fa: {
first_name: String,
last_name: String,
position: String
},
en: {
first_name: String,
last_name: String,
position: String
}
},
image: {type: String, get: image},
index: Number
})
module.exports = mongoose.model('Team', TeamSchema)
+11
View File
@@ -0,0 +1,11 @@
const mongoose = require('mongoose')
const UserSchema = mongoose.Schema({
username: String,
password: String,
scope: {type: Array, default: ['user']},
token: String,
})
module.exports = mongoose.model('User', UserSchema)