Skip to content

Commit

Permalink
feat: update frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowtham1729 committed Jan 4, 2024
1 parent 0019298 commit 224bbba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions applications/backend/django_server/news/templates/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ <h5 class="modal-title" id="newsModalLabel">News Details</h5>
<div class="mt-auto d-flex flex-column">
<div class="mt-auto d-flex">
<span class="badge {% if item.sentiment < 0 %}bg-danger{% elif item.sentiment == 0 %}bg-secondary{% else %}bg-success{% endif %}">
Impact: {% if item.sentiment < 0 %}Negative{% elif item.sentiment == 0 %}Neutral{% else %}Positive{% endif %}
Outlook: {% if item.sentiment < 0 %}Negative{% elif item.sentiment == 0 %}Neutral{% else %}Positive{% endif %}
</span>
<span class="badge {% if item.sentiment < 0 %}bg-danger{% elif item.sentiment == 0 %}bg-secondary{% else %}bg-success{% endif %}">
Score: {% if item.sentiment < 0 %}{{item.sentiment}}/1{% elif item.sentiment == 0 %}{{item.sentiment}}/1{% else %}{{item.sentiment}}/1{% endif %}
Score: {% if item.sentiment < 0 %}{{item.sentiment}}{% elif item.sentiment == 0 %}{{item.sentiment}}{% else %}{{item.sentiment}}{% endif %}
</span>
{% if item.need_attention %}
<span class="badge bg-info">Read Recommendation</span>
Expand Down
4 changes: 2 additions & 2 deletions applications/backend/django_server/news/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@


def home(request):
three_days_ago = datetime.now().date() - timedelta(days=3)
ten_days_ago = datetime.now().date() - timedelta(days=10)
analysis = (
Analysis.objects.all()
.filter(date__gte=three_days_ago)
.filter(date__gte=ten_days_ago)
.order_by("-date", "-total_news", "symbol")
)
analysis_dict = {}
Expand Down

0 comments on commit 224bbba

Please sign in to comment.