[help-portal] don't show issues to guest

This commit is contained in:
Prateeksha Singh 2018-06-12 17:39:12 +05:30
parent 78a2d9785e
commit 8d58429b69
2 changed files with 8 additions and 3 deletions

View File

@ -11,7 +11,7 @@
value='{{ frappe.form_dict.q or ''}}'
{% if not frappe.form_dict.q%}placeholder="{{ _("What do you need help with?") }}"{% endif %}>
<input type='submit'
class='btn btn-sm btn-primary btn-search' value="{{ _("Search") }}">
class='btn btn-sm btn-default btn-search' value="{{ _("Search") }}">
</form>
</div>
@ -47,6 +47,7 @@
<hr>
</div>
{% if issues | len > 0 -%}
<div style="margin-bottom: 20px;">
<h2>{{ _("Your tickets") }}</h2>
{% for doc in issues %}
@ -55,8 +56,9 @@
<p><a href="/issues">{{ _("See all open tickets") }}</a></p>
</div>
<a href="/issues?new=1" class="btn btn-default btn-new btn-sm">
<a href="/issues?new=1" class="btn btn-primary btn-new btn-sm">
{{ _("Open a new ticket") }}
</a>
{%- endif %}
{% endblock %}

View File

@ -19,7 +19,10 @@ def get_context(context):
context.topics = topics_data[:3]
# Issues
context.issues = frappe.get_list("Issue", fields=["name", "status", "subject", "modified"])[:3]
if frappe.session.user != "Guest":
context.issues = frappe.get_list("Issue", fields=["name", "status", "subject", "modified"])[:3]
else:
context.issues = []
def get_forum_posts(s):
response = requests.get(s.forum_url + '/' + s.get_latest_query)