FEATURE: Allow group owners to edit title.

This commit is contained in:
Guo Xiang Tan 2016-12-07 10:26:28 +08:00
parent 8c7a0b7684
commit 545dfa7191
5 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,8 @@
{{#d-modal-body title="group.edit.title" class="edit-group groups"}} {{#d-modal-body title="group.edit.title" class="edit-group groups"}}
<form class="form-horizontal"> <form class="form-horizontal">
<label for='title'>{{i18n 'group.title'}}</label>
{{input type='text' name='title' value=model.title class='edit-group-title'}}
<label for='bio'>{{i18n 'group.bio'}}</label> <label for='bio'>{{i18n 'group.bio'}}</label>
{{d-editor value=model.bio_raw class="edit-group-bio"}} {{d-editor value=model.bio_raw class="edit-group-bio"}}

View File

@ -173,7 +173,8 @@ class GroupsController < ApplicationController
:flair_url, :flair_url,
:flair_bg_color, :flair_bg_color,
:flair_color, :flair_color,
:bio_raw :bio_raw,
:title
) )
end end

View File

@ -1847,6 +1847,7 @@ en:
group: group:
edit: edit:
title: 'Edit Group' title: 'Edit Group'
title: 'Title'
name: "Name" name: "Name"
bio: "About Group" bio: "About Group"
name_placeholder: "Group name, no spaces, same as username rule" name_placeholder: "Group name, no spaces, same as username rule"

View File

@ -47,7 +47,8 @@ describe "Groups" do
flair_bg_color: 'FFF', flair_bg_color: 'FFF',
flair_color: 'BBB', flair_color: 'BBB',
flair_url: 'fa-adjust', flair_url: 'fa-adjust',
bio_raw: 'testing' bio_raw: 'testing',
title: 'awesome team'
} } } }
expect(response).to be_success expect(response).to be_success
@ -58,6 +59,7 @@ describe "Groups" do
expect(group.flair_color).to eq('BBB') expect(group.flair_color).to eq('BBB')
expect(group.flair_url).to eq('fa-adjust') expect(group.flair_url).to eq('fa-adjust')
expect(group.bio_raw).to eq('testing') expect(group.bio_raw).to eq('testing')
expect(group.title).to eq('awesome team')
end end
end end

View File

@ -49,5 +49,6 @@ test("Admin Browsing Groups", () => {
andThen(() => { andThen(() => {
ok(find('.group-flair-inputs').length === 1, 'it should display avatar flair inputs'); 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-bio').length === 1, 'it should display group bio input');
ok(find('.edit-group-title').length === 1, 'it should display group title input');
}); });
}); });