add objective collection to timeline
This commit is contained in:
parent
1a51d00cd4
commit
ba865ef84a
3 changed files with 113 additions and 0 deletions
43
journal/migrations/0006_auto_20230114_2139.py
Normal file
43
journal/migrations/0006_auto_20230114_2139.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
# Generated by Django 3.2.16 on 2023-01-14 13:39
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
("journal", "0005_auto_20230114_1134"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name="featuredcollection",
|
||||
old_name="collection",
|
||||
new_name="target",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="featuredcollection",
|
||||
name="id",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="featuredcollection",
|
||||
name="piece_ptr",
|
||||
field=models.OneToOneField(
|
||||
auto_created=True,
|
||||
default=0,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
parent_link=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
to="journal.piece",
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name="featuredcollection",
|
||||
unique_together={("owner", "target")},
|
||||
),
|
||||
]
|
27
social/migrations/0003_alter_localactivity_template.py
Normal file
27
social/migrations/0003_alter_localactivity_template.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Generated by Django 3.2.16 on 2023-01-14 13:02
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("social", "0002_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="localactivity",
|
||||
name="template",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("mark_item", "Markitem"),
|
||||
("review_item", "Reviewitem"),
|
||||
("create_collection", "Createcollection"),
|
||||
("like_collection", "Likecollection"),
|
||||
("feature_collection", "Featurecollection"),
|
||||
],
|
||||
max_length=50,
|
||||
),
|
||||
),
|
||||
]
|
43
social/templates/activity/feature_collection.html
Normal file
43
social/templates/activity/feature_collection.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load l10n %}
|
||||
{% load admin_url %}
|
||||
{% load mastodon %}
|
||||
{% load oauth_token %}
|
||||
{% load truncate %}
|
||||
{% load thumb %}
|
||||
{% load prettydate %}
|
||||
{% load user_actions %}
|
||||
|
||||
{% like_piece_action activity.action_object as action %}
|
||||
<div class="entity-list__entity-img-wrapper">
|
||||
<a href="{{ activity.action_object.url }}">
|
||||
<img src="{{ activity.action_object.cover|thumb:'normal' }}" alt="" class="entity-list__entity-img" style="min-width:80px;max-width:80px">
|
||||
</a>
|
||||
{% if not action.take %}
|
||||
<a class="entity-list__entity-action-icon" hx-post="{{ action.url }}">➕</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="entity-list__entity-text">
|
||||
<div class="collection-item-position-edit">
|
||||
<span class="entity-marks__mark-time">
|
||||
{% if activity.action_object.metadata.shared_link %}
|
||||
<a href="{{ activity.action_object.metadata.shared_link }}" action_object="_blank">
|
||||
<img src="{% static 'img/fediverse.svg' %}" style="filter: invert(93%) sepia(1%) saturate(53%) hue-rotate(314deg) brightness(95%) contrast(80%); vertical-align:text-top; max-width:14px; margin-right:6px;" />
|
||||
<span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
{% else %}
|
||||
<a><span class="entity-marks__mark-time">{{ activity.action_object.created_time|prettydate }}</span></a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
<span class="entity-list__entity-info" style="top:0px;">
|
||||
<a href="{% url 'journal:user_profile' activity.owner.mastodon_username %}">{{ activity.owner.display_name }}</a> {% trans '设置了目标' %}
|
||||
</span>
|
||||
<div class="entity-list__entity-title">
|
||||
<a href="{{ activity.action_object.target.url }}" class="entity-list__entity-link" style="font-weight:bold;">{{ activity.action_object.target.title }}
|
||||
</a>
|
||||
</div>
|
||||
<p>
|
||||
<progress value="{{ activity.action_object.progress }}" max="100"></progress>
|
||||
</p>
|
||||
</div>
|
Loading…
Add table
Reference in a new issue