a little more responsive

This commit is contained in:
vabene1111 2018-02-09 17:04:54 +01:00
parent e745f1cda2
commit 8c6019756f
7 changed files with 60 additions and 16 deletions

View File

@ -6,7 +6,12 @@ from .models import *
class RecipeTable(tables.Table):
id = tables.LinkColumn('edit_recipe', args=[A('id')])
name = tables.TemplateColumn("<a href='#' onClick='openRecipe({{record.id}})'>{{record.name}}</a>")
name = tables.TemplateColumn(
"<a href='#' onClick='openRecipe({{record.id}})'>{{record.name}}</a>")
category = tables.Column(
attrs={'td': {'class': 'd-none d-lg-table-cell'}, 'th': {'class': 'd-none d-lg-table-cell'}})
all_tags = tables.Column(
attrs={'td': {'class': 'd-none d-lg-table-cell'}, 'th': {'class': 'd-none d-lg-table-cell'}})
class Meta:
model = Recipe

View File

@ -17,6 +17,9 @@
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<style>
@media (max-width:1025px) { .container { width: 95% !important; margin-left: 20px !important; margin-right: 20px !important;max-width: 1200px !important;} }
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">

View File

@ -4,8 +4,8 @@
<div class="row">
<div class="table-responsive">
{% block table %}
<table {% if table.attrs %}
{{ table.attrs.as_html }}{% else %}class="table table-bordered table-lg"{% endif %}>
<table style='font-size: 24px' {% if table.attrs %}
{{ table.attrs.as_html }}{% else %}class="table table-bordered table-xl"{% endif %}>
{% block table.thead %}
{% if table.show_header %}
<thead>

View File

@ -6,19 +6,25 @@
{% block title %}{% trans "Cookbook" %}{% endblock %}
{% block content %}
{% if filter %}
<div class="card">
<div class="card-header">
{% trans "Search" %}
</div>
<div class="card-body">
<form action="" method="get">
{{ filter.form|crispy }}
<input class="btn btn-primary" type="submit"/>
</form>
</div>
<div class="row">
<div class="col md-12">
{% if filter %}
<div class="card">
<div class="card-header">
{% trans "Search" %}
</div>
<div class="card-body">
<form action="" method="get">
{{ filter.form|crispy }}
<input class="btn btn-primary" type="submit"/>
</form>
</div>
</div>
{% endif %}
</div>
{% endif %}
</div>
<br/>
{% if recipes %}
@ -93,7 +99,7 @@
xhttp.send();
}
function afterClick(){
function afterClick() {
$('#modal_recipe').modal('hide');
return true;
}

View File

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<form>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
placeholder="Enter email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
{% endblock %}

View File

@ -5,6 +5,8 @@ from cookbook.views import api
urlpatterns = [
path('', views.index, name='index'),
path('test', views.test, name='test'),
path('new/recipe', new.recipe, name='new_recipe'),
path('new/category', new.category, name='new_category'),
path('new/keyword', new.keyword, name='new_keyword'),

View File

@ -18,3 +18,7 @@ def index(request):
return render(request, 'index.html', {'recipes': table, 'filter': f})
else:
return render(request, 'index.html')
def test(request):
return render(request, 'test.html')