Compare commits

..

19 Commits

Author SHA1 Message Date
vabene1111
4dfda4439c re added standard filter to recipe api 2020-11-04 16:53:49 +01:00
vabene1111
591d185b9d improved random recipe queryset function 2020-11-04 15:09:35 +01:00
vabene1111
8d582548bd Merge pull request #213 from tourn/random-recipes2
Show random recipes in meal planner
2020-11-04 15:06:50 +01:00
vabene1111
209924e5b3 Merge pull request #191 from vabene1111/dependabot/pip/psycopg2-binary-2.8.6
Bump psycopg2-binary from 2.8.5 to 2.8.6
2020-11-04 15:01:52 +01:00
dependabot[bot]
7e3e2aadaf Bump psycopg2-binary from 2.8.5 to 2.8.6
Bumps [psycopg2-binary](https://github.com/psycopg/psycopg2) from 2.8.5 to 2.8.6.
- [Release notes](https://github.com/psycopg/psycopg2/releases)
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-04 14:01:23 +00:00
vabene1111
0930e615f0 Merge pull request #192 from vabene1111/dependabot/pip/simplejson-3.17.2
Bump simplejson from 3.17.0 to 3.17.2
2020-11-04 15:00:59 +01:00
vabene1111
21c759b127 Merge pull request #193 from vabene1111/dependabot/pip/whitenoise-5.2.0
Bump whitenoise from 5.1.0 to 5.2.0
2020-11-04 15:00:46 +01:00
vabene1111
7d1a83440d Merge pull request #195 from vabene1111/dependabot/pip/bleach-3.2.1
Bump bleach from 3.1.5 to 3.2.1
2020-11-04 15:00:37 +01:00
vabene1111
2d75b303fd Merge pull request #210 from vabene1111/dependabot/pip/python-dotenv-0.15.0
Bump python-dotenv from 0.13.0 to 0.15.0
2020-11-04 15:00:26 +01:00
vabene1111
a1b15d46b8 fixed note only meal plan entries not working 2020-11-04 14:58:31 +01:00
tourn
69a6edee99 Show random recipes in meal planner 2020-11-03 16:46:31 +01:00
vabene1111
0ac23b4e3a Merge pull request #211 from Tmaxxrox97/develop
Username field consistency
2020-10-29 17:00:27 +01:00
Tmaxxrox97
085e777ee0 Changed Username field label from "Name" to "Username" 2020-10-29 09:52:05 -05:00
Tmaxxrox97
c31df3f7a6 Merge pull request #1 from vabene1111/develop
Update repo
2020-10-29 07:58:32 -05:00
dependabot[bot]
98e2c0acaf Bump python-dotenv from 0.13.0 to 0.15.0
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.13.0 to 0.15.0.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v0.13.0...v0.15.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-29 06:36:05 +00:00
vabene1111
1509b8243b Update docker-publish-release.yml 2020-10-24 17:19:23 +02:00
dependabot[bot]
24ced66c69 Bump bleach from 3.1.5 to 3.2.1
Bumps [bleach](https://github.com/mozilla/bleach) from 3.1.5 to 3.2.1.
- [Release notes](https://github.com/mozilla/bleach/releases)
- [Changelog](https://github.com/mozilla/bleach/blob/master/CHANGES)
- [Commits](https://github.com/mozilla/bleach/compare/v3.1.5...v3.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-30 06:25:32 +00:00
dependabot[bot]
6c1982cccb Bump simplejson from 3.17.0 to 3.17.2
Bumps [simplejson](https://github.com/simplejson/simplejson) from 3.17.0 to 3.17.2.
- [Release notes](https://github.com/simplejson/simplejson/releases)
- [Changelog](https://github.com/simplejson/simplejson/blob/master/CHANGES.txt)
- [Commits](https://github.com/simplejson/simplejson/compare/v3.17.0...v3.17.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-30 06:25:31 +00:00
dependabot[bot]
3bae7283d1 Bump whitenoise from 5.1.0 to 5.2.0
Bumps [whitenoise](https://github.com/evansd/whitenoise) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/evansd/whitenoise/releases)
- [Changelog](https://github.com/evansd/whitenoise/blob/master/docs/changelog.rst)
- [Commits](https://github.com/evansd/whitenoise/compare/v5.1.0...v5.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-30 06:25:31 +00:00
6 changed files with 35 additions and 12 deletions

View File

@@ -11,7 +11,7 @@ jobs:
name: Build image job
steps:
- name: Checkout master
uses: actions/checkout@master#
uses: actions/checkout@master
- name: Get version number
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

View File

@@ -285,6 +285,6 @@ class InviteLinkForm(forms.ModelForm):
class UserCreateForm(forms.Form):
name = forms.CharField()
name = forms.CharField(label='Username')
password = forms.CharField(widget=forms.TextInput(attrs={'autocomplete': 'new-password', 'type': 'password'}))
password_confirm = forms.CharField(widget=forms.TextInput(attrs={'autocomplete': 'new-password', 'type': 'password'}))

View File

@@ -7,6 +7,7 @@ from django.contrib import auth
from django.contrib.auth.models import User, Group
from django.utils.translation import gettext as _
from django.db import models
from django_random_queryset import RandomManager
from recipes.settings import COMMENT_PREF_DEFAULT
@@ -198,6 +199,8 @@ class Recipe(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
objects = RandomManager()
def __str__(self):
return self.name

View File

@@ -103,8 +103,15 @@
<div class="card-body">
<div class="row">
<div class="col-md-12">
<input type="text" class="form-control" v-model="recipe_query" @keyup="getRecipes"
placeholder="{% trans 'Search Recipe' %}" style="margin-bottom: 8px">
<div class="input-group mb-3">
<input type="text" class="form-control" v-model="recipe_query" @keyup="getRecipes"
placeholder="{% trans 'Search Recipe' %}">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" @click="getRandomRecipes">
<i class="fas fa-dice"></i>
</button>
</div>
</div>
</div>
</div>
<draggable class="list-group" :list="recipes"
@@ -445,10 +452,16 @@
this.updateUserNames()
},
getRandomRecipes: function () {
this.$set(this, 'recipe_query', '');
this.getRecipes();
},
getRecipes: function () {
let url = "{% url 'api:recipe-list' %}?limit=5"
if (this.recipe_query !== '') {
url += '&query=' + this.recipe_query;
} else {
url += '&random=True'
}
this.$http.get(url).then((response) => {
@@ -581,6 +594,7 @@
id: Math.round(Math.random() * 1000) + 10000,
title: this.new_note_title,
note: this.new_note_text,
recipe_multiplier: 1,
is_new: true,
}

View File

@@ -205,11 +205,16 @@ class RecipeViewSet(viewsets.ModelViewSet, StandardFilterMixin):
permission_classes = [CustomIsShare | CustomIsGuest] # TODO split read and write permission for meal plan guest
def get_queryset(self):
queryset = super().get_queryset()
internal = self.request.query_params.get('internal', None)
if internal:
self.queryset = self.queryset.filter(internal=True)
queryset = queryset.filter(internal=True)
random = self.request.query_params.get('random', False)
if random:
queryset = queryset.random(5)
return super(RecipeViewSet, self).get_queryset()
return queryset
# TODO write extensive tests for permissions

View File

@@ -1,4 +1,4 @@
bleach==3.1.5
bleach==3.2.1
bleach-whitelist==0.0.11
Django==3.1.1
django-annoying==0.10.6
@@ -14,15 +14,16 @@ gunicorn==20.0.4
lxml==4.5.1
Markdown==3.2.2
Pillow==7.1.2
psycopg2-binary==2.8.5
python-dotenv==0.13.0
psycopg2-binary==2.8.6
python-dotenv==0.15.0
requests==2.23.0
simplejson==3.17.0
simplejson==3.17.2
six==1.15.0
webdavclient3==3.14.4
whitenoise==5.1.0
whitenoise==5.2.0
icalendar==4.0.6
pyyaml==5.3.1
uritemplate==3.0.1
beautifulsoup4==4.9.2
microdata==0.7.1
microdata==0.7.1
django-random-queryset==0.1.3