use new notification for channel subscribe feedback

This commit is contained in:
simon 2021-12-05 20:26:39 +07:00
parent 5b47c9cde7
commit c7d69b4fa1
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 9 additions and 16 deletions

View File

@ -8,19 +8,15 @@
<div id="notifications" data="channel"></div> <div id="notifications" data="channel"></div>
<div class="info-box info-box-2"> <div class="info-box info-box-2">
<div class="icon-text"> <div class="icon-text">
{% if running == "subscribing" %} <img id="add-icon" onclick="showForm()" src="{% static 'img/icon-add.svg' %}" alt="add-icon">
<p>Subscribing in progress, refresh.</p> <p>Subscribe to Channels</p>
{% else %} <div class="show-form">
<img id="add-icon" onclick="showForm()" src="{% static 'img/icon-add.svg' %}" alt="add-icon"> <form id="hidden-form" action="/channel/" method="post">
<p>Subscribe to Channels</p> {% csrf_token %}
<div class="show-form"> {{ subscribe_form }}
<form id="hidden-form" action="/channel/" method="post"> <button type="submit">Subscribe</button>
{% csrf_token %} </form>
{{ subscribe_form }} </div>
<button type="submit">Subscribe</button>
</form>
</div>
{% endif %}
</div> </div>
<div class="search-form icon-text"> <div class="search-form icon-text">
<div class="search-icon"> <div class="search-icon">

View File

@ -489,7 +489,6 @@ class ChannelView(View):
"title": "Channels", "title": "Channels",
"colors": view_config["colors"], "colors": view_config["colors"],
"view_style": view_config["view_style"], "view_style": view_config["view_style"],
"running": view_config["running"],
} }
return render(request, "home/channel.html", context) return render(request, "home/channel.html", context)
@ -499,7 +498,6 @@ class ChannelView(View):
config_handler = AppConfig(user_id) config_handler = AppConfig(user_id)
view_key = f"{user_id}:view:channel" view_key = f"{user_id}:view:channel"
view_style = RedisArchivist().get_message(view_key)["status"] view_style = RedisArchivist().get_message(view_key)["status"]
running = RedisArchivist().get_message("progress:subscribe")["status"]
if not view_style: if not view_style:
view_style = config_handler.config["default_view"]["channel"] view_style = config_handler.config["default_view"]["channel"]
@ -511,7 +509,6 @@ class ChannelView(View):
"view_style": view_style, "view_style": view_style,
"show_subed_only": show_subed_only, "show_subed_only": show_subed_only,
"colors": config_handler.colors, "colors": config_handler.colors,
"running": running,
} }
return view_config return view_config