From 5fc7e867ba51263506b2e0dc57d79829607039a9 Mon Sep 17 00:00:00 2001 From: ardnaxelas Date: Sun, 8 Dec 2024 21:07:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20style..css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- citywalls2/controllers/streetController.js | 34 +----------- citywalls2/public/stylesheets/styles.css | 60 +++++++--------------- citywalls2/routes/main.js | 4 +- citywalls2/views/houses.ejs | 21 -------- 4 files changed, 22 insertions(+), 97 deletions(-) diff --git a/citywalls2/controllers/streetController.js b/citywalls2/controllers/streetController.js index 5cbee1d..f81bdcb 100644 --- a/citywalls2/controllers/streetController.js +++ b/citywalls2/controllers/streetController.js @@ -126,36 +126,4 @@ exports.housesByStreet = asyncHandler(async (req, res) => { houses, }); -}); - - - -// exports.streets = asyncHandler(async (req, res) => { -// console.log("Запрос на получение списка улиц..."); -// const cursor = await db.query('FOR street IN streets RETURN street'); -// const streets = await cursor.all(); -// console.log("Улицы:", streets); -// res.render('streets', { streets }); -// }); -// -// exports.houses = asyncHandler(async (req, res) => { -// const streetKey = req.params.key; -// const streetId = `streets/${streetKey}`; -// console.log(`Запрос на получение домов для streetId: ${streetId}`); -// -// const query = ` -// FOR house IN houses -// FILTER house._id IN ( -// FOR edge IN located_at -// FILTER edge._to == @streetId -// RETURN edge._from -// ) -// RETURN house -// `; -// const bindVars = { streetId }; -// const cursor = await db.query(query, bindVars); -// const houses = await cursor.all(); -// console.log(`Найдено домов: ${houses.length}`); -// console.log('Дома:', houses); -// res.render('houses', { houses, streetKey }); -// }); \ No newline at end of file +}); \ No newline at end of file diff --git a/citywalls2/public/stylesheets/styles.css b/citywalls2/public/stylesheets/styles.css index b5e08b8..70511d5 100644 --- a/citywalls2/public/stylesheets/styles.css +++ b/citywalls2/public/stylesheets/styles.css @@ -83,44 +83,22 @@ label { border: 1px solid #ccc; } - /*header, footer {*/ - /* background-color: #333;*/ - /* color: #fff;*/ - /* padding: 15px;*/ - /*}*/ - - /*header h1, footer p {*/ - /* margin: 0;*/ - /*}*/ - - /*nav a {*/ - /* color: #fff;*/ - /* margin-right: 15px;*/ - /* text-decoration: none;*/ - /*}*/ - - /*main {*/ - /* padding: 20px;*/ - /*}*/ - - /*button {*/ - /* padding: 10px 20px;*/ - /* font-size: 16px;*/ - /*}*/ - - /*table {*/ - /* width: 100%;*/ - /* border-collapse: collapse;*/ - /* margin-top: 20px;*/ - /*}*/ - - /*table th, table td {*/ - /* border: 1px solid #ccc;*/ - /* padding: 10px;*/ - /* text-align: left;*/ - /*}*/ - - /*table th {*/ - /* background-color: #f4f4f4;*/ - /*}*/ - \ No newline at end of file +table { + width: 100%; + border-collapse: collapse; + margin: 20px 0; +} +table, th, td { + border: 1px solid #ccc; +} +th, td { + padding: 10px; + text-align: center; +} +th { + background-color: #f4f4f4; +} +img { + max-width: 100px; + height: auto; +} \ No newline at end of file diff --git a/citywalls2/routes/main.js b/citywalls2/routes/main.js index 6d04e9f..63dcc31 100644 --- a/citywalls2/routes/main.js +++ b/citywalls2/routes/main.js @@ -16,11 +16,11 @@ router.get('/export', street_controller.export) // Маршрут для страницы фильтрации улиц router.get('/main/streets', street_controller.streets_filter) +router.get('/main/streets/filter', street_controller.streets) + // Маршрут для отображения домов конкретной улицы router.get('/main/streets/:streetName/houses', street_controller.housesByStreet); -router.get('/main/streets/filter', street_controller.streets) - // router.get('/streets/:key/houses', street_controller.houses) diff --git a/citywalls2/views/houses.ejs b/citywalls2/views/houses.ejs index 58b4939..cbf80b2 100644 --- a/citywalls2/views/houses.ejs +++ b/citywalls2/views/houses.ejs @@ -6,27 +6,6 @@ <%= title %> -

<%= title %>