TiddlyWiki5/core/ui/ControlPanel/Plugins/Add/Updates.tid

67 wiersze
1.8 KiB
Plaintext

title: $:/core/ui/ControlPanel/Plugins/Add/Updates
caption: <$importvariables filter="$:/core/ui/ControlPanel/Plugins/Add/Updates">{{$:/language/ControlPanel/Plugins/Updates/Caption}} (<<update-count>>)</$importvariables>
\define each-updateable-plugin(body)
<$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}sort[title]]" variable="assetInfo">
<$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}>
<$list filter="[<assetInfo>get[original-title]has[version]!version<libraryVersion>]" variable="ignore">
<$set name="installedVersion" value={{{ [<assetInfo>get[original-title]get[version]] }}}>
<$list filter="[<installedversion>!match<libraryVersion>]" variable="ignore">
$body$
</$list>
</$set>
</$list>
</$set>
</$list>
\end
\define update-all-actions()
<$macrocall $name="each-updateable-plugin" body="""
<<install-plugin-actions>>
"""/>
\end
\define update-count()
<$wikify name="count-filter" text=<<each-updateable-plugin "&#91;&#91;<$text text=<<assetInfo>>/>]]">>><$count filter=<<count-filter>>/></$wikify>
\end
<$button actions=<<update-all-actions>> class="tc-btn-invisible tc-install-plugin">
{{$:/core/images/download-button}} {{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}}
</$button>
<table class="tc-plugin-library-listing">
<tbody>
<tr>
<th>
Plugin
</th>
<th>
Installed
</th>
<th>
Available
</th>
<th>
Install
</th>
</tr>
<$macrocall $name="each-updateable-plugin" body="""<tr>
<td>
<strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>: <$view tiddler=<<assetInfo>> field="description"/>
<br>
<$text text={{{ [<assetInfo>get[original-title]] }}}/>
</td>
<td>
<$text text=<<installedVersion>>/>
</td>
<td>
<$text text=<<libraryVersion>>/>
</td>
<td>
<<install-plugin-button>>
</td>
</tr>
"""/>
</tbody>
</table>