-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
320 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,76 @@ | ||
# Justpy Tutorial demo rating_test1 from docs/quasar_tutorial/QRating.md | ||
import justpy as jp | ||
|
||
|
||
def rating_test1(): | ||
wp = jp.QuasarPage(data={'rating': 2}) | ||
d = jp.Div(classes='q-pa-md', a=wp) | ||
rating_div = jp.Div(classes='q-gutter-y-md column', a=d) | ||
jp.QRating(size='1.5em', icon='thumb_up', a=rating_div, model=[wp, 'rating']) | ||
jp.QRating(size='2em', icon='favorite_border',color='red-7', a=rating_div, model=[wp, 'rating']) | ||
jp.QRating(size='2.5em', icon='create',color='purple-4', a=rating_div, model=[wp, 'rating']) | ||
jp.QRating(size='3em', icon='pets',color='brown-5', a=rating_div, model=[wp, 'rating']) | ||
jp.QRating(size='4.5em', icon='star_border',color='green-5', a=rating_div, model=[wp, 'rating']) | ||
jp.QRating(size='5em', icon='star_border',icon_selected='star',color='grey', a=rating_div, model=[wp, 'rating'], | ||
color_selected=['light-green-3', 'light-green-6', 'green', 'green-9', 'green-10']) | ||
jp.QRating(size='5em', icon='star_border',icon_selected='star',color='green-5', a=rating_div, model=[wp, 'rating']) | ||
jp.QRating(size='3.5em', max=4,color='red-5', a=rating_div, model=[wp, 'rating'], | ||
icon=['sentiment_very_dissatisfied', 'sentiment_dissatisfied', 'sentiment_satisfied', 'sentiment_very_satisfied']) | ||
wp = jp.QuasarPage(data={"rating": 2}) | ||
d = jp.Div(classes="q-pa-md", a=wp) | ||
rating_div = jp.Div(classes="q-gutter-y-md column", a=d) | ||
jp.QRating(size="1.5em", icon="thumb_up", a=rating_div, model=[wp, "rating"]) | ||
jp.QRating( | ||
size="2em", | ||
icon="favorite_border", | ||
color="red-7", | ||
a=rating_div, | ||
model=[wp, "rating"], | ||
) | ||
jp.QRating( | ||
size="2.5em", | ||
icon="create", | ||
color="purple-4", | ||
a=rating_div, | ||
model=[wp, "rating"], | ||
) | ||
jp.QRating( | ||
size="3em", icon="pets", color="brown-5", a=rating_div, model=[wp, "rating"] | ||
) | ||
jp.QRating( | ||
size="4.5em", | ||
icon="star_border", | ||
color="green-5", | ||
a=rating_div, | ||
model=[wp, "rating"], | ||
) | ||
jp.QRating( | ||
size="5em", | ||
icon="star_border", | ||
icon_selected="star", | ||
color="grey", | ||
a=rating_div, | ||
model=[wp, "rating"], | ||
color_selected=[ | ||
"light-green-3", | ||
"light-green-6", | ||
"green", | ||
"green-9", | ||
"green-10", | ||
], | ||
) | ||
jp.QRating( | ||
size="5em", | ||
icon="star_border", | ||
icon_selected="star", | ||
color="green-5", | ||
a=rating_div, | ||
model=[wp, "rating"], | ||
) | ||
jp.QRating( | ||
size="3.5em", | ||
max=4, | ||
color="red-5", | ||
a=rating_div, | ||
model=[wp, "rating"], | ||
icon=[ | ||
"sentiment_very_dissatisfied", | ||
"sentiment_dissatisfied", | ||
"sentiment_satisfied", | ||
"sentiment_very_satisfied", | ||
], | ||
) | ||
return wp | ||
|
||
|
||
# initialize the demo | ||
from examples.basedemo import Demo | ||
Demo ("rating_test1",rating_test1) | ||
from examples.basedemo import Demo | ||
|
||
Demo("rating_test1", rating_test1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
# Justpy Tutorial demo rating_test2 from docs/quasar_tutorial/QRating.md | ||
import justpy as jp | ||
|
||
|
||
def rating_test2(): | ||
wp = jp.QuasarPage() | ||
wp.tailwind = True | ||
num_stars = 3 | ||
r = jp.QRating(size='2em', max=num_stars, color='primary', classes='m-2 p-2', a=wp, value=2, debounce=0) | ||
for i in range(1,num_stars + 1,1): | ||
t = jp.QTooltip(text=f'{i} rating') | ||
r.add_scoped_slot(f'tip-{i}', t) | ||
r = jp.QRating( | ||
size="2em", | ||
max=num_stars, | ||
color="primary", | ||
classes="m-2 p-2", | ||
a=wp, | ||
value=2, | ||
debounce=0, | ||
) | ||
for i in range(1, num_stars + 1, 1): | ||
t = jp.QTooltip(text=f"{i} rating") | ||
r.add_scoped_slot(f"tip-{i}", t) | ||
return wp | ||
|
||
|
||
# initialize the demo | ||
from examples.basedemo import Demo | ||
Demo ("rating_test2",rating_test2) | ||
from examples.basedemo import Demo | ||
|
||
Demo("rating_test2", rating_test2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
# Justpy Tutorial demo bye_function1 from docs/tutorial/routes.md | ||
import justpy as jp | ||
|
||
|
||
def hello_function2(): | ||
wp = jp.WebPage() | ||
wp.add(jp.P(text='Hello there!', classes='text-5xl m-2')) | ||
wp.add(jp.P(text="Hello there!", classes="text-5xl m-2")) | ||
return wp | ||
|
||
|
||
def bye_function1(): | ||
wp = jp.WebPage() | ||
wp.add(jp.P(text='Goodbye!', classes='text-5xl m-2')) | ||
wp.add(jp.P(text="Goodbye!", classes="text-5xl m-2")) | ||
return wp | ||
|
||
jp.Route('/hello', hello_function2) | ||
|
||
jp.Route("/hello", hello_function2) | ||
|
||
# initialize the demo | ||
from examples.basedemo import Demo | ||
Demo ("bye_function1",bye_function1) | ||
from examples.basedemo import Demo | ||
|
||
Demo("bye_function1", bye_function1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
# Justpy Tutorial demo from docs/tutorial/routes.md | ||
import justpy as jp | ||
|
||
|
||
def hello_function1(): | ||
wp = jp.WebPage() | ||
wp.add(jp.P(text='Hello there!', classes='text-5xl m-2')) | ||
wp.add(jp.P(text="Hello there!", classes="text-5xl m-2")) | ||
return wp | ||
|
||
jp.Route('/hello', hello_function1) | ||
|
||
jp.Route("/hello", hello_function1) | ||
|
||
# initialize the demo | ||
from examples.basedemo import Demo | ||
Demo ("route1",None) | ||
from examples.basedemo import Demo | ||
|
||
Demo("route1", None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
# Justpy Tutorial demo from docs/tutorial/routes.md | ||
import justpy as jp | ||
|
||
@jp.SetRoute('/hello') | ||
|
||
@jp.SetRoute("/hello") | ||
def hello_function3(): | ||
wp = jp.WebPage() | ||
wp.add(jp.P(text='Hello there!', classes='text-5xl m-2')) | ||
wp.add(jp.P(text="Hello there!", classes="text-5xl m-2")) | ||
return wp | ||
|
||
@jp.SetRoute('/bye') | ||
|
||
@jp.SetRoute("/bye") | ||
def bye_function2(): | ||
wp = jp.WebPage() | ||
wp.add(jp.P(text='Goodbye!', classes='text-5xl m-2')) | ||
wp.add(jp.P(text="Goodbye!", classes="text-5xl m-2")) | ||
return wp | ||
|
||
|
||
# initialize the demo | ||
from examples.basedemo import Demo | ||
Demo ("route2",None) | ||
from examples.basedemo import Demo | ||
|
||
Demo("route2", None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
# Justpy Tutorial demo from docs/tutorial/routes.md | ||
import justpy as jp | ||
|
||
|
||
def greeting_function(request): | ||
wp = jp.WebPage() | ||
name=f"""{request.path_params["name"]}""" | ||
wp.add(jp.P(text=f'Hello there, {name}!', classes='text-5xl m-2')) | ||
name = f"""{request.path_params["name"]}""" | ||
wp.add(jp.P(text=f"Hello there, {name}!", classes="text-5xl m-2")) | ||
return wp | ||
jp.Route('/hello/{name}', greeting_function) | ||
|
||
|
||
jp.Route("/hello/{name}", greeting_function) | ||
|
||
# initialize the demo | ||
from examples.basedemo import Demo | ||
Demo ("route3",None) | ||
from examples.basedemo import Demo | ||
|
||
Demo("route3", None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.