Skip to content

Commit

Permalink
differentiate urls from branches version and release versions (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
boogheta committed Sep 8, 2023
1 parent f70f79d commit 112c61a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hyphe_frontend/app/views/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2>
<div class="pusher"></div>
</div>
<md-list class="credits-list-footer">
<md-list-item ng-if="version" ng-href="https://github.com/medialab/hyphe/tree/{{version}}" target="_blank" aria-label="médialab website">
<md-list-item ng-if="version" ng-href="{{version_url}}" target="_blank" aria-label="médialab website">
<span layout-padding >
Hyphe {{version}}
</span>
Expand Down
5 changes: 5 additions & 0 deletions hyphe_frontend/app/views/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ angular.module('hyphe.helpController', ['ngSanitize'])
$scope.currentPage = 'help'

$scope.version = null
$scope.version_url = null

$scope.corpusName = corpus.getName(config.get('extraTitle') || '')
$scope.corpusId = corpus.getId()
$scope.headerCustomColor = config.get('headerCustomColor') || '#328dc7';
Expand All @@ -43,6 +45,9 @@ angular.module('hyphe.helpController', ['ngSanitize'])

$http({url: "conf/VERSION"}).then(function(res){
$scope.version = res.data.replace(/[\n\r]/, '').replace(/^(\d)/, 'v$1')
if (!/^v\d/.test($scope.version))
$scope.version_url = "https://github.com/medialab/hyphe/tree/" + $scope.version
else $scope.version_url = "https://github.com/medialab/hyphe/releases/tag/" + $scope.version
}, function() {})

$scope.$watchGroup(['highlightedEntry', 'definitions'], function (newValues, oldValues) {
Expand Down
2 changes: 1 addition & 1 deletion hyphe_frontend/app/views/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h3>Login to {{ corpus.name }}</h3>

<div layout="row" class="credits-list" layout-align="center" md-colors="{background: 'default-background-100'}">

<md-list-item ng-if="version" ng-href="https://github.com/medialab/hyphe/tree/{{version}}" target="_blank" aria-label="Hyphe version">
<md-list-item ng-if="version" ng-href="{{version_url}}" target="_blank" aria-label="Hyphe version">
<span layout-padding >
Hyphe {{version}}
</span>
Expand Down
4 changes: 4 additions & 0 deletions hyphe_frontend/app/views/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ angular.module('hyphe.loginController', [])
$scope.currentPage = 'login'

$scope.version = null
$scope.version_url = null

$scope.corpusList
$scope.corpusList_byId = {}
Expand Down Expand Up @@ -93,6 +94,9 @@ angular.module('hyphe.loginController', [])
$scope.$on('$destroy', function(){ clearInterval($scope.loop) })
$http({url: "conf/VERSION"}).then(function(res){
$scope.version = res.data.replace(/[\n\r]/, '').replace(/^(\d)/, 'v$1')
if (!/^v\d/.test($scope.version))
$scope.version_url = "https://github.com/medialab/hyphe/tree/" + $scope.version
else $scope.version_url = "https://github.com/medialab/hyphe/releases/tag/" + $scope.version
}, function() {})

function refresh(){
Expand Down

0 comments on commit 112c61a

Please sign in to comment.