Cristina Cochior
6 years ago
16 changed files with 140 additions and 9 deletions
Binary file not shown.
@ -0,0 +1 @@ |
|||||
|
{"name": "as", "email": "asd", "friend": "Y", "content": "asd"} |
@ -0,0 +1,38 @@ |
|||||
|
import json |
||||
|
|
||||
|
|
||||
|
# # to iterate through existing json file and find the correct json file |
||||
|
# def find_json(id): |
||||
|
# get path/to/file |
||||
|
|
||||
|
# return file |
||||
|
|
||||
|
# # |
||||
|
# def save_json(id, name, email, friend, content): |
||||
|
# file |
||||
|
# data = {"id": "path/to/file", "name":,"email":,"friend":,"content":} |
||||
|
|
||||
|
# with open('file.json', 'w') as f: |
||||
|
# json.dump(data, f) |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
# def jaction(original, id, name, email, friend, content): |
||||
|
# f = find_json_file(id) |
||||
|
# data = make_dict(f) |
||||
|
|
||||
|
# updated = update_dict(data, name, email, friend, content) |
||||
|
# save_json_file(f, updated) |
||||
|
|
||||
|
# # to find the file with the correct id |
||||
|
# def find_json_file(): |
||||
|
# f = open('file.json', 'w') |
||||
|
# iterate files to find id |
||||
|
# return f |
||||
|
|
||||
|
# # saving the json file |
||||
|
# def save_json_file(name, email, friend, content): |
||||
|
# dict= request.args.get( |
||||
|
# write(file, json.dump(data)) |
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@ |
|||||
|
{"name": "Canonimouse", "email": "yes@mail.com", "friend": "Y", "content": "The contestants are embracing."} |
Binary file not shown.
@ -1 +0,0 @@ |
|||||
{"friend": "NY", "name": "mazouni", "email": "pasdechance", "content": "toute la nuit je pense"} |
|
@ -0,0 +1 @@ |
|||||
|
{"name": "Cristina Cochior", "email": "clcochior@gmail.com", "friend": "Y", "content": "Sure"} |
@ -0,0 +1 @@ |
|||||
|
{"name": "Anonymousse", "email": "bettermail@mail.com", "friend": "Y", "content": "A beach in an Arab-speaking place."} |
@ -0,0 +1 @@ |
|||||
|
{"name": "Mysterious", "email": "sound@mail.com", "friend": "Y", "content": "This is a sound file, but I am in a public setting and cannot listen back to it."} |
@ -0,0 +1,64 @@ |
|||||
|
|
||||
|
{% extends "layout.html" %} |
||||
|
{% block content %} |
||||
|
<div class="all"> |
||||
|
<h1>These are all the files</h1> |
||||
|
<!-- {{ listingfiles }} <br> |
||||
|
{{ jsonfiles }} <br> |
||||
|
{{ listingdirectories }} --> |
||||
|
<div class="col-lg-3 col-md-4 col-xs-6 thumb"> |
||||
|
{% for filename in listingfiles %} |
||||
|
|
||||
|
{% if filename.lower().endswith(('.png', '.jpg', '.jpeg')) %} |
||||
|
<img class="img-responsive" src=" ../{{ filename }}"> |
||||
|
{% for jsonfile in jsonfiles %} |
||||
|
{% if filename[0:9] == jsonfile[0:9] %} |
||||
|
<div class="descrip"> |
||||
|
{{ jsonfile }} |
||||
|
<p>{{listofdicts[0]["name"]}}<br> |
||||
|
{{listofdicts[0]["email"]}}<br> |
||||
|
{{listofdicts[0]["friend"]}}<br> |
||||
|
{{listofdicts[0]["content"]}}</p> |
||||
|
</div> |
||||
|
{% endif %} |
||||
|
{% endfor %} |
||||
|
|
||||
|
{% elif filename.lower().endswith(('.mp4')) %} |
||||
|
<video width="320" height="240" controls><source src="../{{filename}}" type="video/mp4"> |
||||
|
Your browser does not support the video tag. |
||||
|
</video> |
||||
|
{% for jsonfile in jsonfiles %} |
||||
|
{% if filename[0:9] == jsonfile[0:9] %} |
||||
|
<div class="descrip"> |
||||
|
{{ jsonfile }} |
||||
|
<p>{{listofdicts[1]["name"]}}<br> |
||||
|
{{listofdicts[1]["email"]}}<br> |
||||
|
{{listofdicts[1]["friend"]}}<br> |
||||
|
{{listofdicts[1]["content"]}}</p> |
||||
|
</div> |
||||
|
{% endif %} |
||||
|
{% endfor %} |
||||
|
|
||||
|
{% elif filename.lower().endswith(('.mp3')) %} |
||||
|
<audio controls><source src="../{{filename}}" type="audio/mpeg"> |
||||
|
Your browser does not support the audio tag. |
||||
|
</audio> |
||||
|
{% for jsonfile in jsonfiles %} |
||||
|
{% if filename[0:9] == jsonfile[0:9] %} |
||||
|
<div class="descrip"> |
||||
|
{{ jsonfile }} |
||||
|
<p>{{listofdicts[2]["name"]}}<br> |
||||
|
{{listofdicts[2]["email"]}}<br> |
||||
|
{{listofdicts[2]["friend"]}}<br> |
||||
|
{{listofdicts[2]["content"]}}</p> |
||||
|
</div> |
||||
|
{% endif %} |
||||
|
{% endfor %} |
||||
|
{% endif %} |
||||
|
|
||||
|
{% endfor %} |
||||
|
</div> |
||||
|
</div> |
||||
|
{% endblock %} |
||||
|
|
||||
|
|
Loading…
Reference in new issue