1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

refactor to use text-setting

This commit is contained in:
Sylvain 2020-05-27 11:30:50 +02:00
parent 78bd037694
commit fc13263a89
4 changed files with 18 additions and 40 deletions

View File

@ -58,8 +58,6 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope'
$scope.allSettings = settingsPromise;
// various configurable settings
$scope.twitterSetting = { name: 'twitter_name', value: settingsPromise.twitter_name };
$scope.linkName = { name: 'link_name', value: settingsPromise.link_name };
$scope.aboutTitleSetting = { name: 'about_title', value: settingsPromise.about_title };
$scope.aboutBodySetting = { name: 'about_body', value: settingsPromise.about_body };
$scope.privacyDpoSetting = { name: 'privacy_dpo', value: settingsPromise.privacy_dpo };
@ -77,7 +75,6 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope'
$scope.windowEnd = { name: 'booking_window_end', value: settingsPromise.booking_window_end };
$scope.mainColorSetting = { name: 'main_color', value: settingsPromise.main_color };
$scope.secondColorSetting = { name: 'secondary_color', value: settingsPromise.secondary_color };
$scope.fablabName = { name: 'fablab_name', value: settingsPromise.fablab_name };
$scope.nameGenre = { name: 'name_genre', value: settingsPromise.name_genre };
$scope.machinesSortBy = { name: 'machines_sort_by', value: settingsPromise.machines_sort_by };
$scope.cguFile = cguFile.custom_asset;

View File

@ -4,16 +4,11 @@
</div>
<div class="panel-body">
<div class="col-md-4">
<form role="form" novalidate>
<label for="linkName" class="control-label m-r" translate>{{ 'app.admin.settings.link_to_about' }}</label>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-link"></i></div>
<input type="text" id="linkName" ng-model="linkName.value" class="form-control" placeholder="{{ 'app.admin.settings.link_to_about' | translate }}"/>
</div>
</div>
<button name="button" class="btn btn-warning" ng-click="save(linkName)" translate>{{ 'app.shared.buttons.save' }}</button>
</form>
<text-setting name="link_name"
settings="allSettings"
label="app.admin.settings.link_to_about"
fa-icon="fa-link">
</text-setting>
</div>
</div>
</div>

View File

@ -5,16 +5,11 @@
<div class="panel-body">
<div class="row m-t-lg">
<div class="col-md-4">
<form role="form" novalidate>
<label for="fablabName" class="control-label m-r" translate>{{ 'app.admin.settings.fablab_title' }}</label>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-font"></i></div>
<input type="text" id="fablabName" ng-model="fablabName.value" class="form-control" placeholder="{{ 'app.admin.settings.fablab_name' | translate }}"/>
</div>
</div>
<button name="button" class="btn btn-warning" ng-click="save(fablabName)" translate>{{ 'app.shared.buttons.save' }}</button>
</form>
<text-setting name="fablab_name"
settings="allSettings"
label="app.admin.settings.fablab_title"
fa-icon="fa-font">
</text-setting>
</div>
<div class="col-md-4 col-md-offset-1">
@ -23,17 +18,17 @@
<div class="form-group">
<label for="nameGenreMale">
<input type="radio" name="nameGenre" id="nameGenreMale" ng-model="nameGenre.value" ng-value="'male'" />
{{ 'app.admin.settings.male' | translate }} <span style="font-weight: normal">{{ 'app.admin.settings.eg' | translate }} <cite>{{ 'app.admin.settings.the_team' | translate }} <strong translate>{{ 'app.admin.settings.male_preposition' }}</strong> {{fablabName.value}}</cite></span>
{{ 'app.admin.settings.male' | translate }} <span style="font-weight: normal">{{ 'app.admin.settings.eg' | translate }} <cite>{{ 'app.admin.settings.the_team' | translate }} <strong translate>{{ 'app.admin.settings.male_preposition' }}</strong> {{allSettings.fablab_name}}</cite></span>
</label>
<br/>
<label for="nameGenreFemale">
<input type="radio" name="nameGenre" id="nameGenreFemale" ng-model="nameGenre.value" ng-value="'female'" />
{{ 'app.admin.settings.female' | translate }} <span style="font-weight: normal">{{ 'app.admin.settings.eg' | translate }} <cite>{{ 'app.admin.settings.the_team' | translate }} <strong translate>{{ 'app.admin.settings.female_preposition' }}</strong> {{fablabName.value}}</cite></span>
{{ 'app.admin.settings.female' | translate }} <span style="font-weight: normal">{{ 'app.admin.settings.eg' | translate }} <cite>{{ 'app.admin.settings.the_team' | translate }} <strong translate>{{ 'app.admin.settings.female_preposition' }}</strong> {{allSettings.fablab_name}}</cite></span>
</label>
<br/>
<label for="nameGenreNeutral">
<input type="radio" name="nameGenre" id="nameGenreNeutral" ng-model="nameGenre.value" ng-value="'neutral'" />
{{ 'app.admin.settings.neutral' | translate }} <span style="font-weight: normal">{{ 'app.admin.settings.eg' | translate }} <cite>{{ 'app.admin.settings.the_team' | translate }} <strong translate>{{ 'app.admin.settings.neutral_preposition' }}</strong> {{fablabName.value}}</cite></span>
{{ 'app.admin.settings.neutral' | translate }} <span style="font-weight: normal">{{ 'app.admin.settings.eg' | translate }} <cite>{{ 'app.admin.settings.the_team' | translate }} <strong translate>{{ 'app.admin.settings.neutral_preposition' }}</strong> {{allSettings.fablab_name}}</cite></span>
</label>
</div>
<button name="button" class="btn btn-warning" ng-click="save(nameGenre)" translate>{{ 'app.shared.buttons.save' }}</button>

View File

@ -20,20 +20,11 @@
<button name="button" class="btn btn-warning" ng-click="save(homeBlogpostSetting)" translate>{{ 'app.shared.buttons.save' }}</button>
</div>
<div class="col-md-6">
<h4 translate>{{ 'app.admin.settings.twitter_stream' }}</h4>
<form role="form" class="form-inline" name="twitterForm" novalidate>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-twitter"></i>
</div>
<input type="text" ng-model="twitterSetting.value" class="form-control" placeholder="{{ 'app.admin.settings.name_of_the_twitter_account' | translate }}"/>
</div>
</div>
<div class="form-group">
<button name="button" class="btn btn-warning" ng-click="save(twitterSetting)" translate>{{ 'app.shared.buttons.save' }}</button>
</div>
</form>
<text-setting name="twitter_name"
settings="allSettings"
label="app.admin.settings.twitter_stream"
fa-icon="fa-twitter">
</text-setting>
</div>
</div>
<div class="row m-t-lg home-page-style">