forked from AdminTL/gestion_personnage_TL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AdminTL#79] Doc Generator: Add editor admin page
- Add button to share document with writting permission to actual user - Add verification when connect to remote document, to keep the connection
- Loading branch information
Showing
10 changed files
with
210 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends "_base.html" %} | ||
|
||
{% block content %} | ||
|
||
<div ng-controller="editor_ctrl" ng-cloak> | ||
<h1>Gestionnaire de documentation</h1> | ||
<div ng-show="model_editor.is_ctrl_ready"> | ||
<h2>Générateur de documentation à partir de Google Drive Spreadsheet</h2> | ||
Cet outil permet d'ouvrir un fichier sur Google Drive Spreadsheet, d'itérer dans le document pour extraire les données, valider le formatage du document et générer la base de donnée du manuel du | ||
joueur. <br/> | ||
<div ng-show="model_editor.info.sh_config && model_editor.info.sh_config.file_key"> | ||
Identifiant du document : {{! model_editor.info.sh_config.file_key }} | ||
</div> | ||
<div ng-show="model_editor.info.sh_config && model_editor.info.sh_config.file_name"> | ||
Nom du document : {{! model_editor.info.sh_config.file_name }} | ||
</div> | ||
<div ng-show="model_editor.info.sh_config && model_editor.info.sh_config.file_url"> | ||
Lien du document : <a href="{{! model_editor.info.sh_config.file_url }}" style="text-decoration: underline">{{! model_editor.info.sh_config.file_url }}</a> | ||
</div> | ||
<div ng-show="!model_editor.info.sh_has_writer_perm"> | ||
Vous n'avez pas les permissions d'écriture. <a ng-click="send_writing_sh_permission()" class="btn btn-lg btn-danger" role="button">Recevoir les permissions d'écriture par courriel.</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% end %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{% extends "_base.html" %} | ||
|
||
{% block content %} | ||
|
||
Section Admin | ||
<h1>Accueil des administrateurs de Traître-Lame.</h1> | ||
Il n'y a pas de nouvelle à publier. | ||
|
||
{% end %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Formulaire de Traitre-Lame | ||
"use strict"; | ||
|
||
characterApp.controller("editor_ctrl", ["$scope", "$q", "$http", "$window", /*"$timeout",*/ function ($scope, $q, $http, $window) { | ||
$scope.model_editor = { | ||
is_ctrl_ready: false, | ||
info: {} | ||
}; | ||
|
||
// Get editor info | ||
$scope.update_editor = function (e) { | ||
$http({ | ||
method: "get", | ||
url: "/cmd/editor/get_info", | ||
headers: {"Content-Type": "application/json; charset=UTF-8"}, | ||
timeout: 5000 | ||
}).then(function (response/*, status, headers, config*/) { | ||
$scope.model_editor.info = response.data; | ||
$scope.model_editor.is_ctrl_ready = true; | ||
}); | ||
|
||
}; | ||
$scope.update_editor(); | ||
|
||
// Send request to receive writer permission | ||
$scope.send_writing_sh_permission = function (e) { | ||
$http({ | ||
method: "post", | ||
url: "/cmd/editor/add_sh_share", | ||
headers: {"Content-Type": "application/json; charset=UTF-8"}, | ||
timeout: 5000 | ||
}).then(function (response/*, status, headers, config*/) { | ||
$scope.model_editor.info.sh_has_writer_perm = true; | ||
}, function errorCallback(response) { | ||
console.error(response); | ||
}); | ||
} | ||
|
||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters