Fix for Issue #4424

Model Admin : 'Show Specification for' toggle link breaks if Title contains spaces.
Uses className for element ID on ImportSpec template.
This commit is contained in:
Nick 2015-08-11 14:56:13 +10:00
parent 1438a53900
commit c4c4d79c26
2 changed files with 4 additions and 4 deletions

View File

@ -366,7 +366,7 @@ abstract class ModelAdmin extends LeftAndMain {
$specRelations->push(new ArrayData(array('Name' => $name, 'Description' => $desc)));
}
$specHTML = $this->customise(array(
'attrModelName' => str_replace(' ', '',$modelName),
'ClassName' => str_replace('\\', '_', $className),
'ModelName' => Convert::raw2att($modelName),
'Fields' => $specFields,
'Relations' => $specRelations,

View File

@ -1,6 +1,6 @@
<div class="importSpec" id="SpecFor{$attrModelName}">
<a href="#SpecDetailsFor{$attrModelName}" class="detailsLink"><% sprintf(_t('ModelAdmin_ImportSpec_ss.IMPORTSPECLINK', 'Show Specification for %s'),$ModelName) %></a>
<div class="details" id="SpecDetailsFor{$attrModelName}">
<div class="importSpec" id="SpecFor{$ClassName}">
<a href="#SpecDetailsFor{$ClassName}" class="detailsLink"><% sprintf(_t('ModelAdmin_ImportSpec_ss.IMPORTSPECLINK', 'Show Specification for %s'),$ModelName) %></a>
<div class="details" id="SpecDetailsFor{$ClassName}">
<h4><% sprintf(_t('ModelAdmin_ImportSpec_ss.IMPORTSPECTITLE', 'Specification for %s'),$ModelName) %></h4>
<h5><% _t('ModelAdmin_ImportSpec_ss.IMPORTSPECFIELDS', 'Database columns') %></h5>
<% loop $Fields %>