Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple domains #337

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 55 additions & 48 deletions SequentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
* in this same file, which you might want to edit and tune if needed.
*/

var SEQUENT_CONFIG_VERSION = '8.0.0';
var SEQUENT_CONFIG_VERSION = "8.0.0";

var SequentConfigData = {
// the base url path for ajax requests, for example for sending ballots or
// getting info about an election. This url is usually in the form of
// 'https://foo/api/v3/' and always ends in '/'.
base: '',
base: "",
theme: "default",
baseUrl: "https://sequent/elections/api/",

baseUrl: "/elections/api/",
freeAuthId: 1,

// Webpage title
Expand All @@ -38,15 +39,15 @@ var SequentConfigData = {
showSuccessAction: false,

// AuthApi base url
authAPI: "https://sequent/iam/api/",
dnieUrl: "https://sequent.dev/iam/api/authmethod/dnie/auth/",
authAPI: "/iam/api/",
dnieUrl: "/iam/api/authmethod/dnie/auth/",
// Agora Elections base url
electionsAPI: "https://sequent/elections/api/",
electionsAPI: "/elections/api/",

// Agora Admin help url
helpUrl: "https://sequentech.io/help",

authorities: ['local-auth2'],
authorities: ["local-auth2"],
director: "local-auth1",

// For admins:
Expand All @@ -68,7 +69,7 @@ var SequentConfigData = {

resourceUrlWhitelist: [
// Allow same origin resource loads.
'self',
"self",

// Allow loading from our assets domain. Notice the difference between * and **.
// Uncomment the following to allow youtube videos
Expand All @@ -86,20 +87,17 @@ var SequentConfigData = {
//
language: "es",


// Forces a specific language.
//
// Default: not set
//
lng: "es",


// specifies the set language query string.
//
// Default: "lang"
//
detectLngQS: 'lang',

detectLngQS: "lang",

// Specifies what translations will be available.
//
Expand All @@ -116,8 +114,6 @@ var SequentConfigData = {
// Default: 360
//
// expires: 360,


// Cookie domain
//
// Default: not set
Expand All @@ -135,11 +131,11 @@ var SequentConfigData = {
// If no Route is set, this is the route that will be loaded
//
// Default: '/admin/login'
defaultRoute: '/admin/login',
defaultRoute: "/admin/login",

timeoutSeconds: 3600,

publicURL: "https://sequent/elections/public/",
publicURL: "/elections/public/",

// if we are in debug mode or not
debug: true,
Expand All @@ -150,17 +146,17 @@ var SequentConfigData = {
email: "[email protected]",
// Sales contact email displayed in the footer links
sales: "[email protected]",
tlf: "-no tlf-"
tlf: "-no tlf-",
},

// social networks footer links
social: {
facebook: "https://www.facebook.com/AgoraVoting",
twitter: "https://twitter.com/sequent",
twitterHandle: "sequent",
googleplus: "https://plus.google.com/101939665794445172389/posts",
youtube: "https://www.youtube.com/results?search_query=Agora+Voting",
github: "https://github.com/sequent/"
facebook: "https://www.facebook.com/AgoraVoting",
twitter: "https://twitter.com/sequent",
twitterHandle: "sequent",
googleplus: "https://plus.google.com/101939665794445172389/posts",
youtube: "https://www.youtube.com/results?search_query=Agora+Voting",
github: "https://github.com/sequent/",
},

// technology footer links
Expand All @@ -169,7 +165,7 @@ var SequentConfigData = {
pricing: "https://sequentech.io/#pricing",
overview: "https://sequentech.io/overview/",
solutions: "https://sequentech.io/solutions/",
documentation: "https://bit.ly/avguiadeuso"
documentation: "https://bit.ly/avguiadeuso",
},

// legality footer links
Expand All @@ -178,65 +174,76 @@ var SequentConfigData = {
cookies: "https://sequentech.io/cookies/",
privacy: "https://sequentech.io/privacy/",
security_contact: "https://sequentech.io/security_contact/",
community_website: "https://sequent.org"
community_website: "https://sequent.org",
},

documentation: {
show_help: true,
faq: 'https://sequentech.io/doc/en/',
overview: 'https://sequentech.io/overview/',
technical: 'https://sequentech.io/static/generic_tech_overview_20_08_15.pdf',
security_contact: "https://sequentech.io/security_contact/"
faq: "https://sequentech.io/doc/en/",
overview: "https://sequentech.io/overview/",
technical:
"https://sequentech.io/static/generic_tech_overview_20_08_15.pdf",
security_contact: "https://sequentech.io/security_contact/",
},

documentation_html_include: '',
documentation_html_include: "",

legal_html_include: '',
legal_html_include: "",

// Details pertaining to the organization that runs the software
organization: {
// Name of the organization, appears in the logo mouse hover, in the login
// page ("Login into __NAME__ admin account"), in the poweredBy, etc
orgName: 'Sequent Tech',
orgName: "Sequent Tech",

// Subtitle of the organization, used in the ballot ticket PDF
orgSubtitle: '',
orgSubtitle: "",

// Big logo of the organization, used in the ballot ticket PDF
orgBigLogo: '',
orgBigLogo: "",

// URL that the logo links to
orgUrl: 'https://sequentech.io'
orgUrl: "https://sequentech.io",
},

verifier: {
link: "",
hash: ""
hash: "",
},

success: {
text: ""
text: "",
},

tos: {
text:"",
title: ""
text: "",
title: "",
},

mainVersion: '8.0.0',
repoVersions: []
mainVersion: "8.0.0",
repoVersions: [],
};

angular.module('SequentConfig', [])
.factory('ConfigService', function() {
angular
.module("SequentConfig", [])
.factory("ConfigService", function ($location) {
var baseUrl = $location.protocol() + "://" + $location.host;
SequentConfigData.publicURL = baseUrl + SequentConfigData.publicURL;
SequentConfigData.electionsAPI = baseUrl + SequentConfigData.electionsAPI;
SequentConfigData.dnieUrl = baseUrl + SequentConfigData.dnieUrl;
SequentConfigData.authAPI = baseUrl + SequentConfigData.authAPI;
SequentConfigData.baseUrl = baseUrl + SequentConfigData.baseUrl;
return SequentConfigData;
});

angular.module('SequentConfig')
.provider('ConfigService', function ConfigServiceProvider() {
angular
.module("SequentConfig")
.provider("ConfigService", function ConfigServiceProvider() {
_.extend(this, SequentConfigData);

this.$get = [function ConfigServiceProviderFactory() {
return new ConfigServiceProvider();
}];
this.$get = [
function ConfigServiceProviderFactory() {
return new ConfigServiceProvider();
},
];
});
44 changes: 21 additions & 23 deletions avBooth/booth.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,39 @@
* along with voting-booth. If not, see <http://www.gnu.org/licenses/>.
**/

angular.module(
'avBooth',
[
'ui.bootstrap',
'ui.utils',
'ui.router',
'ngAnimate',
'avUi'
]
);
angular.module("avBooth", [
"ui.bootstrap",
"ui.utils",
"ui.router",
"ngAnimate",
"avUi",
]);

angular.module('avBooth').config(function($stateProvider) {
/* Add New States Above */
angular.module("avBooth").config(function ($stateProvider) {
/* Add New States Above */
});

angular
.module('avBooth')
.module("avBooth")
.controller(
'BoothController',
function(
$scope,
$stateParams,
$filter,
ConfigService,
$i18next,
"BoothController",
function (
$scope,
$stateParams,
$filter,
ConfigService,
$i18next,
$cookies,
$location,
InsideIframeService
) {
$scope.isDemo = $stateParams.isDemo || false;
var previewElectionParam = ($location.search())['preview-election'];
$scope.previewElection = previewElectionParam && decodeURIComponent(previewElectionParam);
var previewElectionParam = $location.search()["preview-election"];
$scope.previewElection =
previewElectionParam && decodeURIComponent(previewElectionParam);
$scope.isPreview = $stateParams.isPreview || false;
$scope.electionId = $stateParams.id;
$scope.baseUrl = ConfigService.baseUrl;
$scope.config = $filter('json')(ConfigService);
$scope.config = $filter("json")(ConfigService);
}
);
Binary file added node-v0.10.31.tar.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,9 @@ commander@^2.19.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==

"common-ui@https://github.com/sequentech/common-ui.git#master":
version "6.0.0"
resolved "https://github.com/sequentech/common-ui.git#9bef1b3c120e6a5f7c7d8e48082ad12c361a99cc"
"common-ui@https://github.com/sequentech/common-ui.git#8.0.0":
version "8.0.0"
resolved "https://github.com/sequentech/common-ui.git#95531243c03cc44563efde2133d7c80d1ba2ae0a"
dependencies:
browser-update "^3.3.28"
karma-ng-html2js-preprocessor "^1.0.0"
Expand Down