From fac332dc87ae8ae50a0c1502c5b1182470ee0779 Mon Sep 17 00:00:00 2001 From: jakobsn Date: Fri, 29 Nov 2019 16:43:21 +0100 Subject: [PATCH] buff css --- src/app/static/stylesheet.css | 19 ++++++++++++++++--- src/app/templates/index.html | 7 +++---- src/app/views/index.py | 3 ++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/app/static/stylesheet.css b/src/app/static/stylesheet.css index ab43feb..e3710c2 100644 --- a/src/app/static/stylesheet.css +++ b/src/app/static/stylesheet.css @@ -11,11 +11,17 @@ body { .projects { display: flex; /* or inline-flex */ - flex-direction: row; + flex-wrap: wrap; } .projects * { margin: auto; + min-width: 100px; + margin-top: 5px; +} + +.projects div { + border: 1px solid gray; } .categories { @@ -78,5 +84,12 @@ nav ul { } .user_projects_category { - border: 1px solid black; -} \ No newline at end of file + border: 1px solid gray; + padding: 5px; + background-color: lightslategray; + cursor: pointer; + margin: 2px; +} +.user_projects_category:hover { + background-color: lightskyblue; +} diff --git a/src/app/templates/index.html b/src/app/templates/index.html index a230682..5c02157 100644 --- a/src/app/templates/index.html +++ b/src/app/templates/index.html @@ -1,4 +1,4 @@ -$def with (nav, project_bulk_one, project_bulk_two, projects) +$def with (nav, project_bulk_one, project_bulk_two, projects, categories) Beelance2 @@ -30,16 +30,15 @@ $def with (nav, project_bulk_one, project_bulk_two, projects)
$for project in project_bulk_one: -

$project[3]

$project[4]

+

Title:    $project[3]

Description: $project[4]

Category:   $categories[project[1]-1][1]

$if projects == 'my':

Projects in progress

-
$for project in project_bulk_two: -

$project[3]

$project[4]

+

Title:    $project[3]

Description: $project[4]

Category:   $categories[project[1]-1][1]

\ No newline at end of file diff --git a/src/app/views/index.py b/src/app/views/index.py index 20f0cc6..d91b32e 100644 --- a/src/app/views/index.py +++ b/src/app/views/index.py @@ -17,6 +17,7 @@ class Index: session = web.ctx.session nav = get_nav_bar(session) data = web.input(projects=None) + categories = models.project.get_categories() project_bulk_one = [] project_bulk_two = [] if data.projects == 'my': @@ -30,4 +31,4 @@ class Index: project_bulk_one = models.project.get_projects_by_status_and_owner(str(session.userid), "finished") project_bulk_two = models.project.get_projects_by_participant_and_status(str(session.userid), "finished") - return render.index(nav, project_bulk_one, project_bulk_two, data.projects) + return render.index(nav, project_bulk_one, project_bulk_two, data.projects, categories)