Skip to content

Commit e7b4e0b

Browse files
committed
upd(packages): for older Delphi versions
1 parent a9abd1e commit e7b4e0b

17 files changed

+55
-5
lines changed

ideexpert/DMVC.Expert.ProjectGenerator.pas

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,16 @@ class function TDMVCProjectGenerator.RenderTemplate(const ATemplateName: string;
235235
LTemplate.OnGetValue :=
236236
procedure(const DataSource, Members: string; var Value: TValue; var Handled: Boolean)
237237
begin
238+
// Special handling for runtime variables (prefixed with "data_")
239+
// These are preserved as template variables for runtime processing
240+
if DataSource.StartsWith('data_') then
241+
begin
242+
// Remove "data_" prefix and output as template variable for runtime
243+
Value := '{{:' + DataSource.Substring(5) + '}}';
244+
Handled := True;
245+
Exit;
246+
end;
247+
238248
// Return empty/false for undefined variables (graceful degradation)
239249
// This allows {{if undefined_var}} to work as expected (evaluates to false)
240250
Value := TValue.Empty;

ideexpert/templates/views/index_complete_view.tpro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@
6666
<div class="info-box" style="margin-top: 20px; background: rgba(6, 182, 212, 0.1); border-left-color: #06b6d4;">
6767
<strong>📊 ViewData from Controller:</strong><br>
6868
<div style="margin-top: 10px; font-family: monospace; font-size: 0.9em;">
69-
<div style="margin: 5px 0;">📱 <strong>App Name:</strong> {{{{:app_name}}}}</div>
70-
<div style="margin: 5px 0;">📅 <strong>Date:</strong> {{{{:current_date}}}}</div>
71-
<div style="margin: 5px 0;">⏰ <strong>Time:</strong> {{{{:current_time}}}}</div>
72-
<div style="margin: 5px 0;">🚀 <strong>DMVC Version:</strong> {{{{:dmvc_version}}}}</div>
73-
<div style="margin: 5px 0;">💻 <strong>Compiler:</strong> {{{{:compiler_version}}}}</div>
69+
<div style="margin: 5px 0;">📱 <strong>App Name:</strong> {{raw}}{{:app_name}}{{endraw}}</div>
70+
<div style="margin: 5px 0;">📅 <strong>Date:</strong> {{raw}}{{:current_date}}{{endraw}}</div>
71+
<div style="margin: 5px 0;">⏰ <strong>Time:</strong> {{raw}}{{:current_time}}{{endraw}}</div>
72+
<div style="margin: 5px 0;">🚀 <strong>DMVC Version:</strong> {{raw}}{{:dmvc_version}}{{endraw}}</div>
73+
<div style="margin: 5px 0;">💻 <strong>Compiler:</strong> {{raw}}{{:compiler_version}}{{endraw}}</div>
7474
</div>
7575
</div>
7676

packages/d100/dmvcframeworkDT.dpk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dmvcframeworkDT;
22

33
{$R *.res}
4+
{$R '..\..\ideexpert\DMVC.Expert.Templates.res'}
45
{$R *.dres}
56
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
67
{$ALIGN 8}

packages/d100/dmvcframeworkDT.dproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
</BorlandProject>
192192
<ProjectFileVersion>12</ProjectFileVersion>
193193
</ProjectExtensions>
194+
<Target Name="PreBuildEvent" BeforeTargets="Build">
195+
<Message Text="Compiling template resources..." Importance="high"/>
196+
<Exec Command="brcc32 &quot;$(MSBuildProjectDirectory)\..\..\ideexpert\DMVC.Expert.Templates.rc&quot;" WorkingDirectory="$(MSBuildProjectDirectory)\..\..\ideexpert"/>
197+
</Target>
194198
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
195199
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
196200
</Project>

packages/d101/dmvcframeworkDT.dpk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dmvcframeworkDT;
22

33
{$R *.res}
4+
{$R '..\..\ideexpert\DMVC.Expert.Templates.res'}
45
{$R *.dres}
56
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
67
{$ALIGN 8}

packages/d101/dmvcframeworkDT.dproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
</BorlandProject>
192192
<ProjectFileVersion>12</ProjectFileVersion>
193193
</ProjectExtensions>
194+
<Target Name="PreBuildEvent" BeforeTargets="Build">
195+
<Message Text="Compiling template resources..." Importance="high"/>
196+
<Exec Command="brcc32 &quot;$(MSBuildProjectDirectory)\..\..\ideexpert\DMVC.Expert.Templates.rc&quot;" WorkingDirectory="$(MSBuildProjectDirectory)\..\..\ideexpert"/>
197+
</Target>
194198
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
195199
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
196200
</Project>

packages/d102/dmvcframeworkDT.dpk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dmvcframeworkDT;
22

33
{$R *.res}
4+
{$R '..\..\ideexpert\DMVC.Expert.Templates.res'}
45
{$R *.dres}
56
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
67
{$ALIGN 8}

packages/d102/dmvcframeworkDT.dproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
</BorlandProject>
192192
<ProjectFileVersion>12</ProjectFileVersion>
193193
</ProjectExtensions>
194+
<Target Name="PreBuildEvent" BeforeTargets="Build">
195+
<Message Text="Compiling template resources..." Importance="high"/>
196+
<Exec Command="brcc32 &quot;$(MSBuildProjectDirectory)\..\..\ideexpert\DMVC.Expert.Templates.rc&quot;" WorkingDirectory="$(MSBuildProjectDirectory)\..\..\ideexpert"/>
197+
</Target>
194198
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
195199
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
196200
</Project>

packages/d103/dmvcframeworkDT.dpk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package dmvcframeworkDT;
22

33
{$R *.res}
4+
{$R '..\..\ideexpert\DMVC.Expert.Templates.res'}
45
{$R *.dres}
56
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
67
{$ALIGN 8}

packages/d103/dmvcframeworkDT.dproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
</BorlandProject>
192192
<ProjectFileVersion>12</ProjectFileVersion>
193193
</ProjectExtensions>
194+
<Target Name="PreBuildEvent" BeforeTargets="Build">
195+
<Message Text="Compiling template resources..." Importance="high"/>
196+
<Exec Command="brcc32 &quot;$(MSBuildProjectDirectory)\..\..\ideexpert\DMVC.Expert.Templates.rc&quot;" WorkingDirectory="$(MSBuildProjectDirectory)\..\..\ideexpert"/>
197+
</Target>
194198
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
195199
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
196200
</Project>

0 commit comments

Comments
 (0)