mirror of
https://github.com/zulip/zulip.git
synced 2026-07-15 21:03:26 +08:00
activity: Provide a link from the app
For humbughq.com users only. Opens in a new tab. (imported from commit 509905ebfacb45a454e863e8309896ffd3c538be)
This commit is contained in:
parent
85507d6f26
commit
ec3bef300b
@ -148,6 +148,15 @@ var people_list = [
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if show_activity %}
|
||||
<li title="Activity">
|
||||
<a href="/activity" target="_blank">
|
||||
<i class="icon-eye-open"></i>
|
||||
<span class="hidden-phone"> Activity</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
<button type="button" class="visible-phone btn btn-small phone_new_message_button"
|
||||
id="left_bar_compose_stream_button_little"
|
||||
|
||||
@ -195,7 +195,8 @@ def home(request):
|
||||
'have_initial_messages':
|
||||
'true' if num_messages > 0 else 'false',
|
||||
'show_debug':
|
||||
settings.DEBUG and ('show_debug' in request.GET) },
|
||||
settings.DEBUG and ('show_debug' in request.GET),
|
||||
'show_activity': can_view_activity(request) },
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
@authenticated_api_view
|
||||
@ -1008,10 +1009,12 @@ class ActivityTable(object):
|
||||
def sorted_rows(self):
|
||||
return sorted(self.rows.iteritems(), key=lambda (k,r): r['age'])
|
||||
|
||||
def can_view_activity(request):
|
||||
return request.user.userprofile.realm.domain == 'humbughq.com'
|
||||
|
||||
@login_required(login_url = settings.HOME_NOT_LOGGED_IN)
|
||||
def get_activity(request):
|
||||
user_profile = request.user.userprofile
|
||||
if user_profile.realm.domain != "humbughq.com":
|
||||
if not can_view_activity(request):
|
||||
return HttpResponseRedirect(reverse('zephyr.views.login_page'))
|
||||
|
||||
web_queries = (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user