Skip to content

Commit

Permalink
Start: Fixed image file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Jan 14, 2019
1 parent f86f5e9 commit 3f51e25
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Mod/Start/StartPage/StartPage.html
Expand Up @@ -52,25 +52,25 @@ <h2>T_NOTES</h2>
<h2>T_GENERALDOCUMENTATION</h2>

<h3>
<img src="images/userhub.png" />
<img src="IMAGE_SRC_USERHUB" />
<a href="https://www.freecadweb.org/wiki/User_hub">T_USERHUB</a>
</h3>
<p>T_DESCR_USERHUB</p>

<h3>
<img src="images/poweruserhub.png" />
<img src="IMAGE_SRC_POWERHUB" />
<a href="https://www.freecadweb.org/wiki/Power_users_hub">T_POWERHUB</a>
</h3>
<p>T_DESCR_POWERHUB</p>

<h3>
<img src="images/developerhub.png" />
<img src="IMAGE_SRC_DEVHUB" />
<a href="https://www.freecadweb.org/wiki/Developer_hub">T_DEVHUB</a>
</h3>
<p>T_DESCR_DEVHUB</p>

<h3>
<img src="images/manual.png" />
<img src="IMAGE_SRC_MANUAL" />
<a href="https://www.freecadweb.org/wiki/Manual:Introduction">T_MANUAL</a>
</h3>
<p>T_DESCR_MANUAL</p>
Expand Down
14 changes: 10 additions & 4 deletions src/Mod/Start/StartPage/StartPage.py
Expand Up @@ -215,7 +215,7 @@ def buildCard(filename,method,arg=None):
if size:
result += '<a href="'+method+arg+'" title="'+infostring+'">'
result += '<li class="icon">'
result += '<img src="'+image+'">'
result += '<img src="file:///'+image+'">'
result += '<div class="caption">'
result += '<h4>'+basename+'</h4>'
result += '<p>'+size+'</p>'
Expand Down Expand Up @@ -312,9 +312,9 @@ def handle():
SECTION_RECENTFILES += '<a href="LoadNew.py" title="'+encode(TranslationTexts.T_CREATENEW)+'">'
SECTION_RECENTFILES += '<li class="icon">'
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start").GetBool("NewFileGradient",False):
SECTION_RECENTFILES += '<img src="'+encode(iconbank["createimg"])+'">'
SECTION_RECENTFILES += '<img src="file:///'+encode(iconbank["createimg"])+'">'
else:
SECTION_RECENTFILES += '<img src="images/new_file_thumbnail.svg">'
SECTION_RECENTFILES += '<img src="file:///'+os.path.join(resources_dir, "images/new_file_thumbnail.svg")+'">'
SECTION_RECENTFILES += '<div class="caption">'
SECTION_RECENTFILES += '<h4>'+encode(TranslationTexts.T_CREATENEW)+'</h4>'
SECTION_RECENTFILES += '</div>'
Expand Down Expand Up @@ -353,6 +353,12 @@ def handle():
SECTION_CUSTOM += "</ul>"
HTML = HTML.replace("SECTION_CUSTOM",SECTION_CUSTOM)

# build IMAGE_SRC paths
HTML = HTML.replace("IMAGE_SRC_USERHUB",'file:///'+os.path.join(resources_dir, 'images/userhub.png'))
HTML = HTML.replace("IMAGE_SRC_POWERHUB",'file:///'+os.path.join(resources_dir, 'images/poweruserhub.png'))
HTML = HTML.replace("IMAGE_SRC_DEVHUB",'file:///'+os.path.join(resources_dir, 'images/developerhub.png'))
HTML = HTML.replace("IMAGE_SRC_MANUAL",'file:///'+os.path.join(resources_dir, 'images/manual.png'))

# build UL_WORKBENCHES

wblist = []
Expand Down Expand Up @@ -391,7 +397,7 @@ def handle():
img="images/freecad.png"
iconbank[wb] = img
UL_WORKBENCHES += '<li>'
UL_WORKBENCHES += '<img src="'+iconbank[wb]+'">&nbsp;'
UL_WORKBENCHES += '<img src="file:///'+iconbank[wb]+'">&nbsp;'
UL_WORKBENCHES += '<a href="https://www.freecadweb.org/wiki/'+wn+'_Workbench">'+wn.replace("ReverseEngineering","ReverseEng")+'</a>'
UL_WORKBENCHES += '</li>'
UL_WORKBENCHES += '</ul>'
Expand Down

0 comments on commit 3f51e25

Please sign in to comment.