src/templates/people/conferences.html \
src/templates/people/call.html \
src/templates/people/calls.html \
- src/templates/people/group.html \
- src/templates/people/groups.html \
src/templates/people/index.html \
src/templates/people/passwd.html \
src/templates/people/sip.html \
templates_usersdir = $(templatesdir)/users
+templates_users_groups_DATA = \
+ src/templates/users/groups/index.html \
+ src/templates/users/groups/show.html
+
+templates_users_groupsdir = $(templates_usersdir)/groups
+
templates_users_modules_DATA = \
src/templates/users/modules/list.html
-{% extends "../base.html" %}
+{% extends "../../base.html" %}
{% block title %}{{ _("Groups") }}{% end block %}
-{% extends "../base.html" %}
+{% extends "../../base.html" %}
{% block title %}{{ group }}{% end block %}
<nav class="panel">
{% for g in account.groups %}
- <a class="panel-block" href="/groups/{{ g.gid }}">
+ <a class="panel-block" href="/users/groups/{{ g.gid }}">
<span class="panel-icon">
<i class="fas fa-users" aria-hidden="true"></i>
</span>
(r"/users/([a-z_][a-z0-9_-]{0,31})", users.ShowHandler),
(r"/users/([a-z_][a-z0-9_-]{0,31})\.jpg", users.AvatarHandler),
+ # User Groups
+ (r"/users/groups", users.GroupIndexHandler),
+ (r"/users/groups/([a-z_][a-z0-9_-]{0,31})", users.GroupShowHandler),
+
# RSS feed
(r"/news.rss", tornado.web.RedirectHandler, { "url" : "https://blog.ipfire.org/feed.xml" }),
(r"/", people.IndexHandler),
(r"/activate/([a-z_][a-z0-9_-]{0,31})/(\w+)", auth.ActivateHandler),
(r"/conferences", people.ConferencesHandler),
- (r"/groups", people.GroupsHandler),
- (r"/groups/([a-z_][a-z0-9_-]{0,31})", people.GroupHandler),
(r"/register", auth.RegisterHandler),
(r"/users/([a-z_][a-z0-9_-]{0,31})/calls/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})", people.CallHandler),
(r"/users/([a-z_][a-z0-9_-]{0,31})/calls(?:/(\d{4}-\d{2}-\d{2}))?", people.CallsHandler),
self.render("people/conferences.html", conferences=self.backend.talk.conferences)
-class GroupsHandler(auth.CacheMixin, base.BaseHandler):
- @tornado.web.authenticated
- def get(self):
- # Only staff can see other groups
- if not self.current_user.is_staff():
- raise tornado.web.HTTPError(403)
-
- self.render("people/groups.html")
-
-
-class GroupHandler(auth.CacheMixin, base.BaseHandler):
- @tornado.web.authenticated
- def get(self, gid):
- # Only staff can see other groups
- if not self.current_user.is_staff():
- raise tornado.web.HTTPError(403)
-
- # Fetch group
- group = self.backend.groups.get_by_gid(gid)
- if not group:
- raise tornado.web.HTTPError(404, "Could not find group %s" % gid)
-
- self.render("people/group.html", group=group)
-
-
class SubscribeHandler(auth.CacheMixin, base.BaseHandler):
@tornado.web.authenticated
def post(self):
return f.getvalue()
+class GroupIndexHandler(auth.CacheMixin, base.BaseHandler):
+ @tornado.web.authenticated
+ def get(self):
+ # Only staff can see other groups
+ if not self.current_user.is_staff():
+ raise tornado.web.HTTPError(403)
+
+ self.render("users/groups/index.html")
+
+
+class GroupShowHandler(auth.CacheMixin, base.BaseHandler):
+ @tornado.web.authenticated
+ def get(self, gid):
+ # Only staff can see other groups
+ if not self.current_user.is_staff():
+ raise tornado.web.HTTPError(403)
+
+ # Fetch group
+ group = self.backend.groups.get_by_gid(gid)
+ if not group:
+ raise tornado.web.HTTPError(404, "Could not find group %s" % gid)
+
+ self.render("users/groups/show.html", group=group)
+
+
class ListModule(ui_modules.UIModule):
def render(self, accounts, show_created_at=False):
return self.render_string("users/modules/list.html", accounts=accounts,