From de57f294672cfd07f3c8885d4bda77a0331bea02 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 6 Feb 2014 13:06:19 -0500 Subject: [PATCH] More templates for the group page --- .../javascripts/discourse/routes/application_routes.js | 4 +++- .../javascripts/discourse/routes/group_index_route.js | 6 ++++++ app/assets/javascripts/discourse/routes/group_route.js | 4 ++-- .../discourse/templates/group.js.handlebars | 10 ++++++++++ .../discourse/templates/group/index.js.handlebars | 2 ++ .../discourse/templates/group/members.js.handlebars | 2 ++ app/controllers/groups_controller.rb | 3 +++ config/routes.rb | 4 +++- 8 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 app/assets/javascripts/discourse/routes/group_index_route.js create mode 100644 app/assets/javascripts/discourse/templates/group.js.handlebars create mode 100644 app/assets/javascripts/discourse/templates/group/index.js.handlebars create mode 100644 app/assets/javascripts/discourse/templates/group/members.js.handlebars diff --git a/app/assets/javascripts/discourse/routes/application_routes.js b/app/assets/javascripts/discourse/routes/application_routes.js index 1fb86acd7..6eeca7e36 100644 --- a/app/assets/javascripts/discourse/routes/application_routes.js +++ b/app/assets/javascripts/discourse/routes/application_routes.js @@ -64,7 +64,9 @@ Discourse.Route.buildRoutes(function() { this.route(homepage, { path: '/' }); }); - this.resource('group', { path: '/groups/:groupname' }); + this.resource('group', { path: '/groups/:groupname' }, function() { + this.route('members'); + }); // User routes this.resource('user', { path: '/users/:username' }, function() { diff --git a/app/assets/javascripts/discourse/routes/group_index_route.js b/app/assets/javascripts/discourse/routes/group_index_route.js new file mode 100644 index 000000000..fb119b9bd --- /dev/null +++ b/app/assets/javascripts/discourse/routes/group_index_route.js @@ -0,0 +1,6 @@ +Discourse.GroupIndexRoute = Discourse.Route.extend({ + + model: function() { + console.log('group index'); + } +}); diff --git a/app/assets/javascripts/discourse/routes/group_route.js b/app/assets/javascripts/discourse/routes/group_route.js index 18315a938..ffaa40923 100644 --- a/app/assets/javascripts/discourse/routes/group_route.js +++ b/app/assets/javascripts/discourse/routes/group_route.js @@ -1,7 +1,7 @@ Discourse.GroupRoute = Discourse.Route.extend({ model: function() { - console.log('load it'); - } + return Discourse.AdminGroup.create(); + }, }); diff --git a/app/assets/javascripts/discourse/templates/group.js.handlebars b/app/assets/javascripts/discourse/templates/group.js.handlebars new file mode 100644 index 000000000..ab50f0e5a --- /dev/null +++ b/app/assets/javascripts/discourse/templates/group.js.handlebars @@ -0,0 +1,10 @@ +
+
+ +
+ + {{outlet}} +
diff --git a/app/assets/javascripts/discourse/templates/group/index.js.handlebars b/app/assets/javascripts/discourse/templates/group/index.js.handlebars new file mode 100644 index 000000000..3b22bbe9c --- /dev/null +++ b/app/assets/javascripts/discourse/templates/group/index.js.handlebars @@ -0,0 +1,2 @@ +GROUP INDEX + diff --git a/app/assets/javascripts/discourse/templates/group/members.js.handlebars b/app/assets/javascripts/discourse/templates/group/members.js.handlebars new file mode 100644 index 000000000..781f879cf --- /dev/null +++ b/app/assets/javascripts/discourse/templates/group/members.js.handlebars @@ -0,0 +1,2 @@ +LIST GROUP MEMBERS + diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 550c28248..5a13a76ef 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -3,4 +3,7 @@ class GroupsController < ApplicationController def show end + def members + end + end diff --git a/config/routes.rb b/config/routes.rb index 1f984a6fc..3092ffecf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -163,7 +163,9 @@ Discourse::Application.routes.draw do get "posts/by_number/:topic_id/:post_number" => "posts#by_number" get "posts/:id/reply-history" => "posts#reply_history" - resources :groups + resources :groups do + get 'members' + end resources :posts do put "bookmark"