Merge pull request #3073 from emanuelschuetze/fixes

Minor template fixes
This commit is contained in:
Norman Jäckel 2017-03-08 23:00:26 +01:00 committed by GitHub
commit 82e20ee5a7
3 changed files with 11 additions and 35 deletions

View File

@ -116,10 +116,9 @@ angular.module('OpenSlidesApp.core.pdf', [])
.factory('PdfMakeDocumentProvider', [
'gettextCatalog',
'Config',
'PDFLayout',
function(gettextCatalog, Config, PDFLayout) {
function(Config, PDFLayout) {
/**
* Provides the global document
* @constructor
@ -785,9 +784,10 @@ angular.module('OpenSlidesApp.core.pdf', [])
.factory('PdfCreate', [
'$timeout',
'gettextCatalog',
'FileSaver',
'Messaging',
function ($timeout, FileSaver, Messaging) {
function ($timeout, gettextCatalog, FileSaver, Messaging) {
var filenameMessageMap = {};
var b64toBlob = function(b64Data) {
var byteCharacters = atob(b64Data);
@ -804,17 +804,17 @@ angular.module('OpenSlidesApp.core.pdf', [])
switch (state) {
case 'info':
text = '<i class="fa fa-spinner fa-pulse fa-lg spacer-right"></i>' +
'<translate>Generating PDF file ' + filename + ' ...</translate>';
gettextCatalog.getString('Generating PDF file') + ' (' + filename + ') ...';
break;
case 'success':
text = '<i class="fa fa-check fa-lg spacer-right"></i>' +
'<translate>PDF successfully generated.</translate>';
gettextCatalog.getString('PDF successfully generated.');
timeout = 3000;
break;
case 'error':
text = '<i class="fa fa-exclamation-triangle fa-lg spacer-right"></i>' +
'<translate>Error while generating PDF file</translate> ' + filename + ':' +
'<span ng-if="pdf.errorMessage"><code>{{ pdf.errorMessage | translate }}</code></span>' ;
gettextCatalog.getString('Error while generating PDF file') +
' (' + filename + '): <code>' + error + '</code>';
break;
}
$timeout(function () {

View File

@ -1,24 +0,0 @@
<div id="pdf-status">
<div id="pdf-status-container">
<div ng-repeat="(filename, pdf) in pdfs" ng-class="pdf.state">
<span class="close fa fa-times fa-lg" ng-click="close(filename)"></span>
<span ng-if="pdf.state === 'generating'">
<i class="fa fa-spinner fa-pulse fa-lg spacer-right"></i>
<translate>Generating PDF file {{ filename }} ...</translate>
</span>
<span ng-if="pdf.state === 'finished'">
<i class="fa fa-check fa-lg spacer-right"></i>
<translate>PDF successfully generated.</translate>
</span>
<span ng-if="pdf.state === 'error'">
<i class="fa fa-exclamation-triangle fa-lg spacer-right"></i>
<translate>Error while generating PDF file</translate> {{ filename }}:
<span ng-if="pdf.errorMessage"><code>{{ pdf.errorMessage | translate }}</code></span>
</span>
</div>
</div>
</div>

View File

@ -475,7 +475,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
{
text: identifier,
style: 'tableofcontent',
width: 30
width: 70
},
{
text: motion.getTitle(),
@ -495,21 +495,21 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
// function to create the table of catergories (if any)
var createTOCategories = function() {
if (Category.getAll().length > 0) {
if (Category.getAll().length > 1) {
var heading = {
text: gettextCatalog.getString("Categories"),
style: "heading2"
};
var toc = [];
angular.forEach(Category.getAll(), function(cat) {
angular.forEach(Category.filter({orderBy: 'prefix'}) , function(cat) {
toc.push(
{
columns: [
{
text: cat.prefix,
style: 'tableofcontent',
width: 30
width: 50
},
{
text: cat.name,