1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

[feature] ability for admins to create users or organizations

This commit is contained in:
Sylvain 2017-05-16 10:23:25 +02:00
parent c9b3dd0144
commit 54154b1713
6 changed files with 38 additions and 6 deletions

View File

@ -1 +1 @@
2.5.5
2.5.6-dev

View File

@ -1,5 +1,9 @@
# Changelog Fab Manager
## next release
- Ability for admins to create users as organizations
## v2.5.5 2017 May 15
- Fix a bug: New groups does not have their spaces prices initialized

View File

@ -535,6 +535,15 @@ Application.Controllers.controller "NewMemberController", ["$scope", "$state", "
$scope.user =
plan_interval: ''
## Callback when the admin check/unckeck the box telling that the new user is an organization.
## Disable or enable the organization fields in the form, accordingly
$scope.toggleOrganization = ->
if $scope.user.organization
$scope.user.profile = {} unless $scope.user.profile
$scope.user.profile.organization = {}
else
$scope.user.profile.organization = undefined
## Using the MembersController

View File

@ -9,7 +9,7 @@
</div>
<div class="col-md-8 b-l b-r">
<section class="heading-title">
<h1 translate>{{ 'add_a_member' }}</h1>
<h1 translate>{{ 'members_new.add_a_member' }}</h1>
</section>
</div>
@ -33,8 +33,23 @@
<form role="form" name="userForm" class="form-horizontal" novalidate action="{{ actionUrl }}" ng-upload="submited(content)" upload-options-enable-rails-csrf="true">
<section class="panel panel-default bg-light m-lg">
<div class="panel-body m-r">
<section class="panel panel-default bg-light m-lg">
<div class="panel-body m-r">
<div class="row m-t">
<div class="col-sm-6 col-sm-offset-5">
<div class="form-group checkbox-group">
<input type="checkbox"
name="organization"
id="organization"
ng-model="user.organization"
ng-change="toggleOrganization()"
value="false"/>
<label for="organization" translate>{{ 'members_new.user_is_an_organization' }}</label>
</div>
</div>
</div>
<ng-include src="'<%= asset_path 'shared/_member_form.html' %>'"></ng-include>
<ng-include src="'<%= asset_path 'admin/members/_form.html' %>'"></ng-include>

View File

@ -410,7 +410,9 @@ en:
members_new:
# add a member
add_a_member: "Add a member"
members_new:
add_a_member: "Add a member"
user_is_an_organization: "User is an organization"
members_edit:
# edit a member

View File

@ -410,7 +410,9 @@ fr:
members_new:
# ajouter un membre
add_a_member: "Ajouter un membre"
members_new:
add_a_member: "Ajouter un membre"
user_is_an_organization: "L'utilisateur est une structure"
members_edit:
# modifier un membre