diff --git a/README.md b/README.md deleted file mode 100644 index 017616e..0000000 --- a/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# SusMarket - -## Developers - -Rail_TH, No_KessPen - -## Stack: - -React-Typescript, scss, python, django, methodology БЭМ diff --git a/SusMarket/settings.py b/SusMarket/settings.py index f6ae668..6d4c163 100644 --- a/SusMarket/settings.py +++ b/SusMarket/settings.py @@ -61,6 +61,7 @@ REST_FRAMEWORK = { } CORS_ORIGIN_ALLOW_ALL = True +CORS_ALLOWED_ORIGINS = ['http://localhost:3000'] ROOT_URLCONF = 'SusMarket.urls' diff --git a/SusMarketBackend/migrations/0001_initial.py b/SusMarketBackend/migrations/0001_initial.py index 8578a0a..e18c302 100644 --- a/SusMarketBackend/migrations/0001_initial.py +++ b/SusMarketBackend/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1 on 2024-04-22 12:20 +# Generated by Django 4.1 on 2024-04-30 10:57 import django.core.validators from django.db import migrations, models @@ -18,7 +18,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.CharField(db_index=True, max_length=50, primary_key=True, serialize=False, unique=True, verbose_name='ID Категории')), ('title', models.CharField(max_length=50, verbose_name='Название Категории')), - ('image', models.ImageField(upload_to='', verbose_name='Картинка категории')), + ('image', models.ImageField(upload_to='icons/category/', verbose_name='Картинка категории')), ], options={ 'verbose_name': 'Категория', @@ -33,7 +33,7 @@ class Migration(migrations.Migration): ('description', models.TextField(max_length=300, verbose_name='Описание товара')), ('price', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(999)], verbose_name='Цена товара')), ('tags', models.TextField(max_length=300, verbose_name="Теги (Указывать через разделитель '|')")), - ('icons', models.ImageField(upload_to='', verbose_name='Иконка товара')), + ('icons', models.ImageField(upload_to='icons/product/', verbose_name='Иконка товара')), ('date', models.DateTimeField(auto_now=True, verbose_name='Дата создания товара')), ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SusMarketBackend.category')), ], @@ -61,7 +61,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='ID Отзыва')), ('commentary', models.TextField(max_length=300, verbose_name='Комментарий отзыва')), ('rate', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)], verbose_name='Оценка')), - ('icons', models.ImageField(null=True, upload_to='', verbose_name='Изображение отзыва')), + ('icons', models.ImageField(null=True, upload_to='icons/reviews/', verbose_name='Изображение отзыва')), ('date', models.DateTimeField(auto_now=True, verbose_name='Дата создания отзыва')), ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SusMarketBackend.product')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SusMarketBackend.user')), diff --git a/reactapp/build/asset-manifest.json b/reactapp/build/asset-manifest.json index f2b8bc8..7a07c60 100644 --- a/reactapp/build/asset-manifest.json +++ b/reactapp/build/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { - "main.css": "/static/css/main.00e9905e.css", - "main.js": "/static/js/main.ff00eb34.js", + "main.css": "/static/css/main.6f2d1059.css", + "main.js": "/static/js/main.d9d72c0f.js", "static/media/scam-image.png": "/static/media/scam-image.c6c14289dc251ba2d2b1.png", "static/media/info-page__railth-avatar.png": "/static/media/info-page__railth-avatar.cbf11c43b5ef243b38c0.png", "static/media/add.webp": "/static/media/add.cd69f1e2a8c91109db0f.webp", @@ -10,17 +10,26 @@ "static/media/info-page__no-kesspen-avatar.png": "/static/media/info-page__no-kesspen-avatar.baa74b50e31a8363436b.png", "static/media/review__product-image.webp": "/static/media/review__product-image.1228f982dc61729a63d0.webp", "static/media/product-image-1.webp": "/static/media/product-image-1.32f43bafaff978a8db25.webp", - "static/media/profile-avatar.png": "/static/media/profile-avatar.2d72410c1ed8f95ce0c2.png", + "static/media/catalog__books-icon.svg": "/static/media/catalog__books-icon.82ecf963ce9711f6ebe6.svg", "static/media/share-icon.svg": "/static/media/share-icon.078e541564f15a9740537cec6baba9ab.svg", + "static/media/catalog__toys-icon.svg": "/static/media/catalog__toys-icon.504b3ea190c2df18e505.svg", + "static/media/info-a__icon.svg": "/static/media/info-a__icon.94f109b43b4a6f590e78.svg", + "static/media/catalog__figures-icon.svg": "/static/media/catalog__figures-icon.381a82a829ff1946b236.svg", + "static/media/profile-a__icon.svg": "/static/media/profile-a__icon.abfd09e7735f6a979cfd.svg", + "static/media/geolocation-form__button-icon.svg": "/static/media/geolocation-form__button-icon.2549fdb5501f4e93d012.svg", + "static/media/catalog__food-icon.svg": "/static/media/catalog__food-icon.b5c9e648a238677e6336.svg", + "static/media/search-form__icon.svg": "/static/media/search-form__icon.c726c6b7cc206c12a9de.svg", + "static/media/profile-avatar.svg": "/static/media/profile-avatar.1823777d20902d836fddbbcbc324756f.svg", + "static/media/catalog__clothes-icon.svg": "/static/media/catalog__clothes-icon.1d42620240e5fb01ccfc.svg", "static/media/review-form__add-image-icon.svg": "/static/media/review-form__add-image-icon.16aa2699eed6b58147903dc5b785d709.svg", "static/media/rating__star-icon.svg": "/static/media/rating__star-icon.73718a24d04eb67f5873.svg", "static/media/rating__filled-star-icon.svg": "/static/media/rating__filled-star-icon.dc7d908d4d943b7f3b56.svg", "index.html": "/index.html", - "main.00e9905e.css.map": "/static/css/main.00e9905e.css.map", - "main.ff00eb34.js.map": "/static/js/main.ff00eb34.js.map" + "main.6f2d1059.css.map": "/static/css/main.6f2d1059.css.map", + "main.d9d72c0f.js.map": "/static/js/main.d9d72c0f.js.map" }, "entrypoints": [ - "static/css/main.00e9905e.css", - "static/js/main.ff00eb34.js" + "static/css/main.6f2d1059.css", + "static/js/main.d9d72c0f.js" ] } \ No newline at end of file diff --git a/reactapp/build/index.html b/reactapp/build/index.html index a6f6200..d55d1ec 100644 --- a/reactapp/build/index.html +++ b/reactapp/build/index.html @@ -1 +1 @@ -
e||125 a||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","var map = {\n\t\"./catalog__books-icon.svg\": 421,\n\t\"./catalog__clothes-icon.svg\": 770,\n\t\"./catalog__figures-icon.svg\": 240,\n\t\"./catalog__food-icon.svg\": 379,\n\t\"./catalog__toys-icon.svg\": 734,\n\t\"./geolocation-form__button-icon.svg\": 281,\n\t\"./info-a__icon.svg\": 966,\n\t\"./profile-a__icon.svg\": 373,\n\t\"./profile-avatar.svg\": 760,\n\t\"./rating__filled-star-icon.svg\": 297,\n\t\"./rating__star-icon.svg\": 106,\n\t\"./review-form__add-image-icon.svg\": 983,\n\t\"./search-form__icon.svg\": 160,\n\t\"./share-icon.svg\": 833\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 397;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","////////////////////////////////////////////////////////////////////////////////\n//#region Types and Constants\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Actions represent the type of change to a location value.\n */\nexport enum Action {\n /**\n * A POP indicates a change to an arbitrary index in the history stack, such\n * as a back or forward navigation. It does not describe the direction of the\n * navigation, only that the current index changed.\n *\n * Note: This is the default action for newly created history objects.\n */\n Pop = \"POP\",\n\n /**\n * A PUSH indicates a new entry being added to the history stack, such as when\n * a link is clicked and a new page loads. When this happens, all subsequent\n * entries in the stack are lost.\n */\n Push = \"PUSH\",\n\n /**\n * A REPLACE indicates the entry at the current index in the history stack\n * being replaced by a new one.\n */\n Replace = \"REPLACE\",\n}\n\n/**\n * The pathname, search, and hash values of a URL.\n */\nexport interface Path {\n /**\n * A URL pathname, beginning with a /.\n */\n pathname: string;\n\n /**\n * A URL search string, beginning with a ?.\n */\n search: string;\n\n /**\n * A URL fragment identifier, beginning with a #.\n */\n hash: string;\n}\n\n// TODO: (v7) Change the Location generic default from `any` to `unknown` and\n// remove Remix `useLocation` wrapper.\n\n/**\n * An entry in a history stack. A location contains information about the\n * URL path, as well as possibly some arbitrary state and a key.\n */\nexport interface Location
0===e||1===e?e:fr(a(e),t,r)}const gr=mr(.42,0,1,1),vr=mr(0,0,.58,1),yr=mr(.42,0,.58,1),br=e=>Array.isArray(e)&&"number"!==typeof e[0],xr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,wr=e=>t=>1-e(1-t),Sr=e=>1-Math.sin(Math.acos(e)),kr=wr(Sr),Cr=xr(Sr),_r=mr(.33,1.53,.69,.99),Er=wr(_r),Pr=xr(Er),Tr={linear:Cn,easeIn:gr,easeInOut:yr,easeOut:vr,circIn:Sr,circInOut:Cr,circOut:kr,backIn:Er,backInOut:Pr,backOut:_r,anticipate:e=>(e*=2)<1?.5*Er(e):.5*(2-Math.pow(2,-10*(e-1)))},jr=e=>{if(Array.isArray(e)){rr(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,a]=e;return mr(t,n,r,a)}return"string"===typeof e?(rr(void 0!==Tr[e],"Invalid easing type '".concat(e,"'")),Tr[e]):e},Nr=(e,t)=>n=>Boolean(Vt(n)&&Ft.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Rr=(e,t,n)=>r=>{if(!Vt(r))return r;const[a,o,i,s]=r.match(Mt);return{[e]:parseFloat(a),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},Lr={...Rt,transform:e=>Math.round((e=>Nt(0,255,e))(e))},Ar={test:Nr("rgb","red"),parse:Rr("red","green","blue"),transform:e=>{let{red:t,green:n,blue:r,alpha:a=1}=e;return"rgba("+Lr.transform(t)+", "+Lr.transform(n)+", "+Lr.transform(r)+", "+Ot(Lt.transform(a))+")"}};const Or={test:Nr("#"),parse:function(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}},transform:Ar.transform},Mr={test:Nr("hsl","hue"),parse:Rr("hue","saturation","lightness"),transform:e=>{let{hue:t,saturation:n,lightness:r,alpha:a=1}=e;return"hsla("+Math.round(t)+", "+Ut.transform(Ot(n))+", "+Ut.transform(Ot(r))+", "+Ot(Lt.transform(a))+")"}},Dr={test:e=>Ar.test(e)||Or.test(e)||Mr.test(e),parse:e=>Ar.test(e)?Ar.parse(e):Mr.test(e)?Mr.parse(e):Or.parse(e),transform:e=>Vt(e)?e:e.hasOwnProperty("red")?Ar.transform(e):Mr.transform(e)},Fr=(e,t,n)=>-n*e+n*t+e;function Vr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const zr=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},Br=[Or,Ar,Mr];function Ur(e){const t=(n=e,Br.find((e=>e.test(n))));var n;rr(Boolean(t),"'".concat(e,"' is not an animatable color. Use the equivalent color code instead."));let r=t.parse(e);return t===Mr&&(r=function(e){let{hue:t,saturation:n,lightness:r,alpha:a}=e;t/=360,n/=100,r/=100;let o=0,i=0,s=0;if(n){const e=r<.5?r*(1+n):r+n-r*n,a=2*r-e;o=Vr(a,e,t+1/3),i=Vr(a,e,t),s=Vr(a,e,t-1/3)}else o=i=s=r;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:a}}(r)),r}const Ir=(e,t)=>{const n=Ur(e),r=Ur(t),a={...n};return e=>(a.red=zr(n.red,r.red,e),a.green=zr(n.green,r.green,e),a.blue=zr(n.blue,r.blue,e),a.alpha=Fr(n.alpha,r.alpha,e),Ar.transform(a))};const Wr={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:Cn},Hr={regex:Dt,countKey:"Colors",token:"${c}",parse:Dr.parse},$r={regex:Mt,countKey:"Numbers",token:"${n}",parse:Rt.parse};function qr(e,t){let{regex:n,countKey:r,token:a,parse:o}=t;const i=e.tokenised.match(n);i&&(e["num"+r]=i.length,e.tokenised=e.tokenised.replace(n,a),e.values.push(...i.map(o)))}function Qr(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&qr(n,Wr),qr(n,Hr),qr(n,$r),n}function Kr(e){return Qr(e).values}function Gr(e){const{values:t,numColors:n,numVars:r,tokenised:a}=Qr(e),o=t.length;return e=>{let t=a;for(let a=0;a