From 545dfa719183b4a8f3ddca255f7ff1f87e477ea8 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 7 Dec 2016 10:26:28 +0800 Subject: [PATCH] FEATURE: Allow group owners to edit title. --- .../javascripts/discourse/templates/modal/edit-group.hbs | 3 +++ app/controllers/groups_controller.rb | 3 ++- config/locales/client.en.yml | 1 + spec/integration/groups_spec.rb | 4 +++- test/javascripts/acceptance/groups-test.js.es6 | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/modal/edit-group.hbs b/app/assets/javascripts/discourse/templates/modal/edit-group.hbs index 0a3ffabd92..60a762eb7e 100644 --- a/app/assets/javascripts/discourse/templates/modal/edit-group.hbs +++ b/app/assets/javascripts/discourse/templates/modal/edit-group.hbs @@ -1,5 +1,8 @@ {{#d-modal-body title="group.edit.title" class="edit-group groups"}}
+ + {{input type='text' name='title' value=model.title class='edit-group-title'}} + {{d-editor value=model.bio_raw class="edit-group-bio"}} diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index af7e39e4cc..6c449113ee 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -173,7 +173,8 @@ class GroupsController < ApplicationController :flair_url, :flair_bg_color, :flair_color, - :bio_raw + :bio_raw, + :title ) end diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 60c676becf..4255aaa32a 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1847,6 +1847,7 @@ en: group: edit: title: 'Edit Group' + title: 'Title' name: "Name" bio: "About Group" name_placeholder: "Group name, no spaces, same as username rule" diff --git a/spec/integration/groups_spec.rb b/spec/integration/groups_spec.rb index 4196216c19..c063e7d78d 100644 --- a/spec/integration/groups_spec.rb +++ b/spec/integration/groups_spec.rb @@ -47,7 +47,8 @@ describe "Groups" do flair_bg_color: 'FFF', flair_color: 'BBB', flair_url: 'fa-adjust', - bio_raw: 'testing' + bio_raw: 'testing', + title: 'awesome team' } } expect(response).to be_success @@ -58,6 +59,7 @@ describe "Groups" do expect(group.flair_color).to eq('BBB') expect(group.flair_url).to eq('fa-adjust') expect(group.bio_raw).to eq('testing') + expect(group.title).to eq('awesome team') end end diff --git a/test/javascripts/acceptance/groups-test.js.es6 b/test/javascripts/acceptance/groups-test.js.es6 index 1e947da618..bc6a6ee44a 100644 --- a/test/javascripts/acceptance/groups-test.js.es6 +++ b/test/javascripts/acceptance/groups-test.js.es6 @@ -49,5 +49,6 @@ test("Admin Browsing Groups", () => { andThen(() => { ok(find('.group-flair-inputs').length === 1, 'it should display avatar flair inputs'); ok(find('.edit-group-bio').length === 1, 'it should display group bio input'); + ok(find('.edit-group-title').length === 1, 'it should display group title input'); }); });