Skip to content

Commit

Permalink
Merge pull request #49 from hadpro24/develop
Browse files Browse the repository at this point in the history
Develop : Add reverse to example directory and remove image to readme
  • Loading branch information
hadpro24 authored Jul 26, 2021
2 parents 1c409d0 + 626fcc7 commit 7e5deb1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ Quit the server with CONTROL-C.

</div>

Open <a href="http://127.0.0.1:8000" target="_blank">`http://127.0.0.1:8000`</a> in your navigator
![Screenshot](https://github.com/hadpro24/nimba-framework/blob/main/result.png?raw=true)
Open <a href="http://127.0.0.1:8000" target="_blank">`http://127.0.0.1:8000`</a>

continue directly with <a href="https://docs.nimbasolution.com/tutorial">tutorial</a>
Continue with documentation <a href="https://docs.nimbasolution.com/tutorial">tutorial</a>

## Licence

Expand Down
8 changes: 2 additions & 6 deletions examples/awesome_app/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
},
]

@router('/')
def home(request):
return render('awesome_app/home.html')

@router('/films')
@router('/', name='home')
def home(request):
search = request.GET.get('search', '')
films_filter = [
Expand All @@ -61,7 +57,7 @@ def home(request):
}
return render('awesome_app/list_films.html', contexts)

@router('/films/<int:id>', methods=['GET', 'POST'])
@router('/films/<int:id>', methods=['GET', 'POST'], name='film')
def film_detail(request, id):
film = {
'data': film for film in films if film['id'] == id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<div class="contenair">
<div class="data-film">
<div class="info">
<a href="/films">Back to list</a>
<a href="{{ reverse('home') }}">Back to list</a>
<h1>{{ film.title }}</h1>
<p>
{{ film.description }}
Expand Down
2 changes: 1 addition & 1 deletion examples/awesome_app/templates/awesome_app/list_films.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>List films</h1>
<h3>{{ film.title }}</h3>
<h5><strong><em>Year of production : </em></strong>{{ film.released }}</h5>
<div class="button-two">
<a type="button" class="button-favoir-and-details" href="/films/{{ film.id }}">Details</a>
<a type="button" class="button-favoir-and-details" href="{{ reverse('film', id=film.id) }}">Details</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 7e5deb1

Please sign in to comment.