1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 19:42:01 +02:00

Adding basic user redirect for external URL.

This commit is contained in:
Gunther Brunner 2015-03-16 20:48:24 +09:00
parent d8a972c7eb
commit f5cb2f91c0
5 changed files with 36 additions and 1 deletions

View file

@ -16,6 +16,7 @@ require.ensure([], function (require) {
require('./settings').name,
require('./help').name,
require('./docs').name,
require('./user').name,
require('./../common/lang').name,
require('stf/standalone').name
])

View file

@ -1,5 +1,5 @@
module.exports = function MenuCtrl($scope, $rootScope, SettingsService,
$location, ExternalUrlModalService, NativeUrlService) {
$location) {
SettingsService.bind($scope, {
target: 'lastUsedDevice'

28
res/app/user/index.js Normal file
View file

@ -0,0 +1,28 @@
module.exports = angular.module('stf.user-profile', [])
.config(function ($routeProvider) {
// if CONFIG.externalProfileURL else show page
var externalProfileURL = ''
var templateString
if (!externalProfileURL) {
templateString = require('./user.jade')
}
$routeProvider
.when('/user/:user*', {
template: function (params) {
console.log('params', params)
if (externalProfileURL) {
window.location.href = 'http://www.google.com';
}
return '<div></div>'
},
controller: function () {
}
})
})
.controller('UserProfileCtrl', require('./user-controller'))

View file

@ -0,0 +1,5 @@
module.exports =
function UserCtrl() {
}

1
res/app/user/user.jade Normal file
View file

@ -0,0 +1 @@
h1 Hola