diff --git a/src/blog/static/css/blog.css b/src/blog/static/css/blog.css index e6580be2d..4e214f6a3 100644 --- a/src/blog/static/css/blog.css +++ b/src/blog/static/css/blog.css @@ -2,7 +2,7 @@ #blog-area, #clipping-area, #posts-area{ - max-width: 600px; + max-width: 100%; margin: 0 auto; } .post{ @@ -31,7 +31,7 @@ /* Post Detail Page */ #post, #post-area{ - max-width: 600px; + max-width: 100%; margin: 1.5em auto; } #post{ diff --git a/src/config/settings.py b/src/config/settings.py index 5fddec815..0c4ec83aa 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -154,6 +154,7 @@ def debug(_): PAGE_SIZE = 20 MODAL_PAGE_SIZE = 40 +OBJECT_MODAL_PAGE_SIZE = 16 REST_FRAMEWORK = { "DEFAULT_RENDERER_CLASSES": [ diff --git a/src/core/admin.py b/src/core/admin.py index 98e072db5..761d3ff0c 100644 --- a/src/core/admin.py +++ b/src/core/admin.py @@ -131,7 +131,7 @@ class MarkerAdmin(BaseMarkerObjectAdmin): ] def image_preview(self, obj): - return format_html(obj.as_html_thumbnail(), "") + return format_html(obj.as_html(height=64, width=64, thumbnail=True), "") @admin.action(description="Generate spritesheets for selected GIF objects") @@ -215,7 +215,7 @@ class ObjectAdmin(BaseMarkerObjectAdmin): actions = [generate_spritesheets, "populate_dimensions"] def image_preview(self, obj): - return format_html(obj.as_html_thumbnail(), "") + return format_html(obj.as_html(height=64, width=64), "") def has_spritesheet(self, obj): return bool(obj.spritesheet_file and obj.spritesheet_metadata) @@ -294,13 +294,13 @@ def exhibits_count(self, obj): exhibits_count.short_description = "Exhibits Count" def marker_preview(self, obj): - return format_html(obj.marker.as_html_thumbnail(), "") + return format_html(obj.marker.as_html(height=64, width=64, thumbnail=True), "") marker_preview.short_description = "Marker" marker_preview.allow_tags = True def augmented_preview(self, obj): - return format_html(obj.augmented.as_html_thumbnail(), "") + return format_html(obj.augmented.as_html(height=64, width=64), "") augmented_preview.short_description = "Augmented Object" augmented_preview.allow_tags = True @@ -391,4 +391,4 @@ def _owner(self, obj): return format_html(HTML_LINK, link, obj.owner.user.username) def preview(self, obj): - return format_html(obj.as_html_thumbnail().replace(obj.title, ""), "") + return format_html(obj.as_html(), "") diff --git a/src/core/jinja2/core/components/action-menu.jinja2 b/src/core/jinja2/core/components/action-menu.jinja2 new file mode 100644 index 000000000..c608eb873 --- /dev/null +++ b/src/core/jinja2/core/components/action-menu.jinja2 @@ -0,0 +1,43 @@ +{# Three-dot action menu component. + Variables: + - element: the model instance + - element_type: string like "marker", "object", "artwork", "sound", "ar-exhibit", "mr-exhibit" + - can_edit: boolean + - can_delete: boolean + - has_preview: boolean (only markers and artworks) + - edit_reason: string explaining why edit is disabled (optional) + - delete_reason: string explaining why delete is disabled (optional) +#} +
+ +
+ {% if element_type == "ar-exhibit" or element_type == "mr-exhibit" %} + {% set edit_url = url('edit-' ~ element_type) ~ '?id=' ~ element.id %} + {% else %} + {% set edit_url = url('edit-' ~ element_type) ~ '?id=' ~ element.id %} + {% endif %} + + {{ _("Edit") }} + + {% if has_preview %} + {% if element_type == "marker" %} + {% set preview_url = url('marker-preview') ~ '?id=' ~ element.id %} + {% elif element_type == "artwork" %} + {% set preview_url = url('artwork-preview') ~ '?id=' ~ element.id %} + {% endif %} + {{ _("Preview") }} + {% endif %} + {% set delete_url = url('delete-content') ~ '?content_type=' ~ element_type ~ '&id=' ~ element.id %} + + {{ _("Delete") }} + +
+
diff --git a/src/core/jinja2/core/components/item-list.jinja2 b/src/core/jinja2/core/components/item-list.jinja2 index 17c1b3b51..26d2e09a1 100644 --- a/src/core/jinja2/core/components/item-list.jinja2 +++ b/src/core/jinja2/core/components/item-list.jinja2 @@ -6,7 +6,27 @@ {% for element in repository_list %}
- {{ element.as_html_thumbnail(editable=editable) | safe }} + {% if element_type == "marker" %} + {% with marker=element %} + {% include "core/templates/marker_thumbnail.jinja2" %} + {% endwith %} + {% elif element_type == "object" %} + {% with object=element %} + {% include "core/templates/object_thumbnail.jinja2" %} + {% endwith %} + {% elif element_type == "sound" %} + {% with sound=element %} + {% include "core/templates/sound_thumbnail.jinja2" %} + {% endwith %} + {% elif element_type == "artwork" %} + {% with artwork=element %} + {% include "core/templates/artwork_thumbnail.jinja2" %} + {% endwith %} + {% elif element_type == "ar-exhibit" or element_type == "mr-exhibit" %} + {% with exhibit=element %} + {% include "core/templates/exhibit_thumbnail.jinja2" %} + {% endwith %} + {% endif %}
{% endfor %} diff --git a/src/core/jinja2/core/exhibit_create_ar.jinja2 b/src/core/jinja2/core/exhibit_create_ar.jinja2 index fc3b0a3c1..e3714269c 100644 --- a/src/core/jinja2/core/exhibit_create_ar.jinja2 +++ b/src/core/jinja2/core/exhibit_create_ar.jinja2 @@ -3,6 +3,7 @@
{# FIXME: maybe this can be improved #} + {% if artworks %} - {% with repository_list = artworks, element_type="artwork", htmx="false", selected=selected_artworks %} {% include "core/components/item-list.jinja2" %} {% endwith %} @@ -103,7 +103,7 @@ selected_artworks.split(",").forEach(function(id){ artworks[id] = id - $("#artwork-"+id).css("border-bottom","3px solid #a6a6a6"); + $("#artwork-"+id).css("border-bottom","3px solid #05f7ae"); }); } @@ -126,7 +126,7 @@ else console.error("Unknown item type: " + item_type); }else{ - $(this).css("border-bottom","3px solid #a6a6a6"); + $(this).css("border-bottom","3px solid #05f7ae"); if (item_type === "artwork") artworks[item_id] = item_id; else diff --git a/src/core/jinja2/core/exhibit_create_mr.jinja2 b/src/core/jinja2/core/exhibit_create_mr.jinja2 index 50c1bdcff..a2a2bbf00 100644 --- a/src/core/jinja2/core/exhibit_create_mr.jinja2 +++ b/src/core/jinja2/core/exhibit_create_mr.jinja2 @@ -3,6 +3,7 @@
{# FIXME: maybe this can be improved #} +
- - {% with repository_list = objects, element_type="object", htmx="false" %} {% include "core/components/item-list.jinja2" %} @@ -73,14 +68,8 @@ onclick="validateSubmit()">{{ _("Okay") }}
- - {% with repository_list = sounds, element_type="sound", htmx="false" %} {% include "core/components/item-list.jinja2" %} @@ -214,12 +203,12 @@ selected_objects.split(",").forEach(function(id){ augmenteds[id] = id - $("#object-"+id).css("border-bottom","3px solid #a6a6a6"); + $("#object-"+id).css("border-bottom","3px solid #05f7ae"); }); selected_sounds.split(",").forEach(function(id){ sounds[id] = id - $("#sound-"+id).css("border-bottom","3px solid #a6a6a6"); + $("#sound-"+id).css("border-bottom","3px solid #05f7ae"); }); } @@ -245,7 +234,7 @@ else console.error("Unknown item type: " + item_type); }else{ - $(this).css("border-bottom","3px solid #a6a6a6"); + $(this).css("border-bottom","3px solid #05f7ae"); if (item_type === "object") augmenteds[item_id] = item_id; else if (item_type === "sound") diff --git a/src/core/jinja2/core/exhibit_select.jinja2 b/src/core/jinja2/core/exhibit_select.jinja2 index db5a722c2..08e3ae148 100644 --- a/src/core/jinja2/core/exhibit_select.jinja2 +++ b/src/core/jinja2/core/exhibit_select.jinja2 @@ -1,4 +1,4 @@ -{% extends '/core/arviewer.jinja2' %} +{% extends '/core/focused_layout.jinja2' %} {% block content %} {# FIXME: maybe this can be improved #} diff --git a/src/core/jinja2/core/arviewer.jinja2 b/src/core/jinja2/core/focused_layout.jinja2 similarity index 77% rename from src/core/jinja2/core/arviewer.jinja2 rename to src/core/jinja2/core/focused_layout.jinja2 index 482241eeb..d791da639 100644 --- a/src/core/jinja2/core/arviewer.jinja2 +++ b/src/core/jinja2/core/focused_layout.jinja2 @@ -23,13 +23,6 @@ {% block extra_css %}{% endblock %} {% block extra_js %}{% endblock %} - - - - - {# #} {% if content is defined %}
diff --git a/src/core/jinja2/core/header.jinja2 b/src/core/jinja2/core/header.jinja2 index 9c98c9909..be396b196 100644 --- a/src/core/jinja2/core/header.jinja2 +++ b/src/core/jinja2/core/header.jinja2 @@ -7,10 +7,20 @@
{% if request.user.is_authenticated %} -
-

- {{ _("Welcome, ") }}{{ request.user.username }} -

+
+ {{ _("Welcome,") }} + +
+ {{ _("My Creations") }} + {{ _("Edit profile") }} +
+ {{ csrf_input }} + +
+
{% else %}
+ diff --git a/src/core/jinja2/core/home.jinja2 b/src/core/jinja2/core/home.jinja2 index bb0ec45f9..3598369d8 100644 --- a/src/core/jinja2/core/home.jinja2 +++ b/src/core/jinja2/core/home.jinja2 @@ -12,6 +12,15 @@ {# #} + @@ -33,18 +42,58 @@ {% include "core/header.jinja2" %} {% include "core/useful_links.jinja2" %} {% block content %} -
-
-

{{ _("Welcome to Jandig") }}

-
- {{ _("An Open Source Augmented Reality art community.") }} -
-

{{ _("To see the Artworks you need to grant camera access to the app.") }}

-
- {{ _("Go to camera") }} +
+
+
+

{{ _("Welcome to Jandig") }}

+
+ {{ _("Uma comunidade de código aberto de arte em Realidade Estendida, que viabiliza a produção de exposições e obras unindo arte e tecnologia.") }} +
+
+
+
+

{{ _("No vídeo abaixo, apresentamos o que é a Jandig, o conceito da plataforma e suas possibilidades.") }}

+
+ +
+
+
+

+ {{ _("Se você se identificou com a Jandig e acredita que a plataforma é útil para você criar seu projeto com realidade aumentada (seja ele uma exposição, cartaz, adesivo, mural, livro ou o que mais sua imaginação puder criar), deixamos para você um passo a passo de como utilizá-la. Ele explica o processo para subir seu conteúdo ou remixar o conteúdo já existente na plataforma.") }} +

+
+
-
-
+

+ {{ _("Para acompanhar o passo a passo e colocar em prática,") }} + {{ _("faça seu cadastro") }} + {{ _("antes de começar a assistir. Depois, volte aqui e dê play no vídeo. + Se você preferir, também pode acessar o") }} + {{ _("passo a passo por texto.") }} + {{ _("Além disso, no site da Jandig, na área de") }} + {{ _("Ajuda") }}, + {{ _("há outros tutoriais que podem ser úteis. Não deixe de consultá-los se sentir que é necessário.") }} +

+

+ {{ _("Esperamos ver suas obras e exposições na Jandig! Se você criar algo, não deixe de compartilhar conosco. Temos um") }} + {{ _("canal no Telegram") }} + {{ _("voltado para a comunidade, onde é possível tirar dúvidas e compartilhar suas criações e experiências.") }} +

+
+ {% endblock %} {% include "core/footer.jinja2" %} diff --git a/src/core/jinja2/core/home_v2.jinja2 b/src/core/jinja2/core/home_v2.jinja2 deleted file mode 100644 index a27c7915c..000000000 --- a/src/core/jinja2/core/home_v2.jinja2 +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - {# #} - - - - - Jandig ARte - - - - - {% block extra_css %}{% endblock %} - - - - {% include "core/header.jinja2" %} - {% include "core/useful_links.jinja2" %} - {% block content %} -
-
-
-

{{ _("Welcome to Jandig") }}

-
- {{ _("Uma comunidade de código aberto de arte em Realidade Estendida, que viabiliza a produção de exposições e obras unindo arte e tecnologia.") }} -
-
-
-
-

{{ _("No vídeo abaixo, apresentamos o que é a Jandig, o conceito da plataforma e suas possibilidades.") }}

-
- -
-
-
-

- {{ _("Se você se identificou com a Jandig e acredita que a plataforma é útil para você criar seu projeto com realidade aumentada (seja ele uma exposição, cartaz, adesivo, mural, livro ou o que mais sua imaginação puder criar), deixamos para você um passo a passo de como utilizá-la. Ele explica o processo para subir seu conteúdo ou remixar o conteúdo já existente na plataforma.") }} -

-
- -
-

- {{ _("Para acompanhar o passo a passo e colocar em prática,") }} - {{ _("faça seu cadastro") }} - {{ _("antes de começar a assistir. Depois, volte aqui e dê play no vídeo. - Se você preferir, também pode acessar o") }} - {{ _("passo a passo por texto.") }} - {{ _("Além disso, no site da Jandig, na área de") }} - {{ _("Ajuda") }}, - {{ _("há outros tutoriais que podem ser úteis. Não deixe de consultá-los se sentir que é necessário.") }} -

-

- {{ _("Esperamos ver suas obras e exposições na Jandig! Se você criar algo, não deixe de compartilhar conosco. Temos um") }} - {{ _("canal no Telegram") }} - {{ _("voltado para a comunidade, onde é possível tirar dúvidas e compartilhar suas criações e experiências.") }} -

-
-
- {% endblock %} - {% include "core/footer.jinja2" %} - - diff --git a/src/core/jinja2/core/templates/artwork_modal.jinja2 b/src/core/jinja2/core/templates/artwork_modal.jinja2 index 712a4c137..1696cd4c3 100644 --- a/src/core/jinja2/core/templates/artwork_modal.jinja2 +++ b/src/core/jinja2/core/templates/artwork_modal.jinja2 @@ -3,9 +3,11 @@ -

{{ artwork.title }}

-

{{ artwork.description }}

+ {% if artwork.description %} +

{{ artwork.description }}

+ {% endif %}

{{ "{} {}{} {}".format(_("Created by") , artwork.author.user.username,_(", in"), artwork.created.strftime("%d/%m/%Y")) }}

{{ artwork.used_in_html_string() | safe }}

diff --git a/src/core/jinja2/core/templates/artwork_thumbnail.jinja2 b/src/core/jinja2/core/templates/artwork_thumbnail.jinja2 index e9ef6e1a3..6dbab5aff 100644 --- a/src/core/jinja2/core/templates/artwork_thumbnail.jinja2 +++ b/src/core/jinja2/core/templates/artwork_thumbnail.jinja2 @@ -1,33 +1,49 @@ -
-
- -
-
diff --git a/src/core/jinja2/core/templates/exhibit_thumbnail.jinja2 b/src/core/jinja2/core/templates/exhibit_thumbnail.jinja2 index 17c495884..b4bf903a1 100644 --- a/src/core/jinja2/core/templates/exhibit_thumbnail.jinja2 +++ b/src/core/jinja2/core/templates/exhibit_thumbnail.jinja2 @@ -1,36 +1,33 @@ -
- -

{{ exhibit.name }}

-
-
-
-

- Created by {{ exhibit.owner.user.username }} -

-

{{ exhibit.creation_date }}

-
- {% if exhibit.type == "AR" %} -

- {{ exhibit.artworks_count }} Artwork(s) -

- {% elif exhibit.type == "MR" %} -

- {{ exhibit.augmenteds_count }} Object(s) -

-

- {{ exhibit.sounds_count }} Sound(s) -

- {% endif %} -
- See this Exhibition -
- {% if editable %}edit{% endif %} - {% if deletable %} - delete - {% endif %} -
+ +

{{ exhibit.name }}

+
+
+
+

+ {{ _("Created by ") }}{{ exhibit.owner.user.username }} +

+

{{ exhibit.date }}

+
+ {% if exhibit.exhibit_type == "AR" %} +

+ {{ exhibit.artworks_count }} {{ _("Artwork(s)") }} +

+ {% elif exhibit.exhibit_type == "MR" %} +

+ {{ exhibit.augmenteds_count }} {{ _("Object(s)") }} +

+

+ {{ exhibit.sounds_count }} {{ _("Sound(s)") }} +

+ {% endif %}
+ {{ _("See this Exhibition") }} + {% if editable %} + {% set can_edit = true %} + {% set can_delete = true %} + {% with element=exhibit, element_type=exhibit.content_type(), has_preview=false, can_edit=can_edit, can_delete=can_delete, edit_reason="", delete_reason="" %} + {% include "core/components/action-menu.jinja2" %} + {% endwith %} + {% endif %}
diff --git a/src/core/jinja2/core/templates/marker_modal.jinja2 b/src/core/jinja2/core/templates/marker_modal.jinja2 index 70ae34319..a842da128 100644 --- a/src/core/jinja2/core/templates/marker_modal.jinja2 +++ b/src/core/jinja2/core/templates/marker_modal.jinja2 @@ -11,14 +11,13 @@ < {% endif %} +

{{ marker.title }}

-

{{ marker.title }}

{{ "{} {}".format(_("Author:") ,marker.author)}}

{{ "{} {}{} {}".format(_("Uploaded by") , marker.owner.user.username,_(", in"), marker.created.strftime("%d/%m/%Y")) }}

{{ marker.used_in_html_string() | safe }}

{{ marker.as_html() | safe }} -

Download file:

{{ "{} ({})".format(_("Download File") , marker.file_size | filesizeformat)}}

diff --git a/src/core/jinja2/core/templates/marker_thumbnail.jinja2 b/src/core/jinja2/core/templates/marker_thumbnail.jinja2 index fee5ccecb..245bf0de6 100644 --- a/src/core/jinja2/core/templates/marker_thumbnail.jinja2 +++ b/src/core/jinja2/core/templates/marker_thumbnail.jinja2 @@ -1,23 +1,15 @@ -
- -
- {% if deletable %} - delete - {% endif %} - {# Disabled by now #} - {# {% if editable %} - edit - {% endif %} #} - {% if previewable %}preview{% endif %} -
-
+{{ marker.title }} + +{% if editable %} + {% set can_edit = not marker.is_used_by_other_user() %} + {% set can_delete = not marker.in_use %} + {% set edit_reason = _("This marker is used by other users and cannot be edited.") %} + {% set delete_reason = _("This marker is used in artworks and cannot be deleted.") %} + {% with element=marker, element_type="marker", has_preview=true, can_edit=can_edit, can_delete=can_delete, edit_reason=edit_reason, delete_reason=delete_reason %} + {% include "core/components/action-menu.jinja2" %} + {% endwith %} +{% endif %} diff --git a/src/core/jinja2/core/templates/object_modal.jinja2 b/src/core/jinja2/core/templates/object_modal.jinja2 index 9f79ca241..6950b562c 100644 --- a/src/core/jinja2/core/templates/object_modal.jinja2 +++ b/src/core/jinja2/core/templates/object_modal.jinja2 @@ -11,13 +11,67 @@ < {% endif %} +

{{ ar_object.title }}

-

{{ ar_object.title }}

{{ "{} {}".format(_("Author:") ,ar_object.author)}}

{{ "{} {}{} {}".format(_("Uploaded by") , ar_object.owner.user.username,_(", in"), ar_object.created.strftime("%d/%m/%Y")) }}

{{ ar_object.used_in_html_string() | safe }}

- {{ ar_object.as_html() | safe }} + {% if ar_object.is_3d %} +
+
+ 3D Controls: Left click + drag to rotate, Right click + drag to pan, Scroll to zoom +
+ + {% else %} + {{ ar_object.as_html() | safe }} + {% endif %} {% if ar_object.sound %}

{{ _("Sound:") }}

@@ -33,7 +87,6 @@ {% endif %}

-

Download file:

{{ "{} ({})".format(_("Download File") , ar_object.file_size | filesizeformat)}}

diff --git a/src/core/jinja2/core/templates/object_thumbnail.jinja2 b/src/core/jinja2/core/templates/object_thumbnail.jinja2 index 3d2a29ffa..f34656d40 100644 --- a/src/core/jinja2/core/templates/object_thumbnail.jinja2 +++ b/src/core/jinja2/core/templates/object_thumbnail.jinja2 @@ -1,17 +1,41 @@ -
- - {% if editable %}edit{% endif %} - {% if deletable %} - delete +{{ object.title }} +{% if object.is_video %} + +{% elif object.is_3d %} + {% if object.thumbnail %} + + {% else %} + + {% endif %} + {% else %} + + {% endif %} + {% if editable %} + {% set can_edit = not object.is_used_by_other_user() %} + {% set can_delete = not object.in_use %} + {% set edit_reason = _("This object is used by other users and cannot be edited.") %} + {% set delete_reason = _("This object is used in artworks and cannot be deleted.") %} + {% with element=object, element_type="object", has_preview=false, can_edit=can_edit, can_delete=can_delete, edit_reason=edit_reason, delete_reason=delete_reason %} + {% include "core/components/action-menu.jinja2" %} + {% endwith %} {% endif %} -
diff --git a/src/core/jinja2/core/templates/sound_modal.jinja2 b/src/core/jinja2/core/templates/sound_modal.jinja2 index 5c3a9b7f4..4616f4c08 100644 --- a/src/core/jinja2/core/templates/sound_modal.jinja2 +++ b/src/core/jinja2/core/templates/sound_modal.jinja2 @@ -11,14 +11,13 @@ < {% endif %} +

{{ sound.title }}

-

{{ sound.title }}

{{ "{} {}".format(_("Author:") ,sound.author)}}

{{ "{} {}{} {}".format(_("Uploaded by") , sound.owner.user.username,_(", in"), sound.created.strftime("%d/%m/%Y")) }}

{{ sound.used_in_html_string() | safe }}

{{ sound.as_html() | safe }} -

Download file:

{{ "{} ({})".format(_("Download File") , sound.file_size | filesizeformat)}}

diff --git a/src/core/jinja2/core/templates/sound_thumbnail.jinja2 b/src/core/jinja2/core/templates/sound_thumbnail.jinja2 new file mode 100644 index 000000000..023ca0f62 --- /dev/null +++ b/src/core/jinja2/core/templates/sound_thumbnail.jinja2 @@ -0,0 +1,15 @@ +{{ sound.title }} + +{% if editable %} + {% set can_edit = not sound.is_used_by_other_user() %} + {% set can_delete = not sound.in_use %} + {% set edit_reason = _("This sound is used by other users and cannot be edited.") %} + {% set delete_reason = _("This sound is in use and cannot be deleted.") %} + {% with element=sound, element_type="sound", has_preview=false, can_edit=can_edit, can_delete=can_delete, edit_reason=edit_reason, delete_reason=delete_reason %} + {% include "core/components/action-menu.jinja2" %} + {% endwith %} +{% endif %} diff --git a/src/core/jinja2/core/upload-artwork.jinja2 b/src/core/jinja2/core/upload-artwork.jinja2 index c124fc91d..47a0b405d 100644 --- a/src/core/jinja2/core/upload-artwork.jinja2 +++ b/src/core/jinja2/core/upload-artwork.jinja2 @@ -2,6 +2,7 @@ {% block content %}
+ {# FIXME: maybe this can be improved #} @@ -51,14 +52,8 @@ {{ form.visible_fields()[5].errors }} #}