xing-framework 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/default_configuration/base_app/API_DOC/README +23 -0
  3. data/default_configuration/base_app/API_DOC/admin-menus +167 -0
  4. data/default_configuration/base_app/API_DOC/admin-pages +173 -0
  5. data/default_configuration/base_app/API_DOC/content-block +10 -0
  6. data/default_configuration/base_app/API_DOC/navigation +54 -0
  7. data/default_configuration/base_app/API_DOC/page +38 -0
  8. data/default_configuration/base_app/CHANGELOG.md +122 -0
  9. data/default_configuration/base_app/Capfile +26 -0
  10. data/default_configuration/base_app/Gemfile +7 -0
  11. data/default_configuration/base_app/Gemfile.lock +155 -0
  12. data/default_configuration/base_app/README.md +24 -0
  13. data/default_configuration/base_app/Rakefile +25 -0
  14. data/default_configuration/base_app/backend/Gemfile +45 -0
  15. data/default_configuration/base_app/backend/Gemfile.lock +292 -0
  16. data/default_configuration/base_app/backend/README +12 -0
  17. data/default_configuration/base_app/backend/Rakefile +10 -0
  18. data/default_configuration/base_app/backend/app/controllers/application_controller.rb +3 -0
  19. data/default_configuration/base_app/backend/app/controllers/confirmations_controller.rb +3 -0
  20. data/default_configuration/base_app/backend/app/controllers/passwords_controller.rb +3 -0
  21. data/default_configuration/base_app/backend/app/controllers/registrations_controller.rb +15 -0
  22. data/default_configuration/base_app/backend/app/models/ability.rb +13 -0
  23. data/default_configuration/base_app/backend/app/models/role/admin.rb +8 -0
  24. data/default_configuration/base_app/backend/app/models/user.rb +43 -0
  25. data/default_configuration/base_app/backend/autotest/discover.rb +2 -0
  26. data/default_configuration/base_app/backend/bin/bundle +3 -0
  27. data/default_configuration/base_app/backend/bin/rails +4 -0
  28. data/default_configuration/base_app/backend/bin/rake +4 -0
  29. data/default_configuration/base_app/backend/config.ru +6 -0
  30. data/default_configuration/base_app/backend/config/application.rb +71 -0
  31. data/default_configuration/base_app/backend/config/boot.rb +4 -0
  32. data/default_configuration/base_app/backend/config/database.yml.ci +9 -0
  33. data/default_configuration/base_app/backend/config/database.yml.example +22 -0
  34. data/default_configuration/base_app/backend/config/environment.rb +5 -0
  35. data/default_configuration/base_app/backend/config/environments/development.rb +45 -0
  36. data/default_configuration/base_app/backend/config/environments/production.rb +78 -0
  37. data/default_configuration/base_app/backend/config/environments/staging.rb +48 -0
  38. data/default_configuration/base_app/backend/config/environments/test.rb +47 -0
  39. data/default_configuration/base_app/backend/config/initializers/assets.rb +8 -0
  40. data/default_configuration/base_app/backend/config/initializers/backtrace_silencers.rb +7 -0
  41. data/default_configuration/base_app/backend/config/initializers/constants.rb +1 -0
  42. data/default_configuration/base_app/backend/config/initializers/cookies_serializer.rb +3 -0
  43. data/default_configuration/base_app/backend/config/initializers/devise.rb +241 -0
  44. data/default_configuration/base_app/backend/config/initializers/devise_token_auth.rb +22 -0
  45. data/default_configuration/base_app/backend/config/initializers/filter_parameter_logging.rb +4 -0
  46. data/default_configuration/base_app/backend/config/initializers/inflections.rb +16 -0
  47. data/default_configuration/base_app/backend/config/initializers/mime_types.rb +4 -0
  48. data/default_configuration/base_app/backend/config/initializers/session_store.rb +3 -0
  49. data/default_configuration/base_app/backend/config/initializers/smtp.rb +25 -0
  50. data/default_configuration/base_app/backend/config/initializers/time_formats.rb +12 -0
  51. data/default_configuration/base_app/backend/config/initializers/wrap_parameters.rb +14 -0
  52. data/default_configuration/base_app/backend/config/locales/en.yml +23 -0
  53. data/default_configuration/base_app/backend/config/locales/json.yml +29 -0
  54. data/default_configuration/base_app/backend/config/routes.rb +33 -0
  55. data/default_configuration/base_app/backend/config/secrets.yml.ci +22 -0
  56. data/default_configuration/base_app/backend/config/secrets.yml.example +57 -0
  57. data/default_configuration/base_app/backend/config/sidekiq.yml +4 -0
  58. data/default_configuration/base_app/backend/db/sample_data/users.rake +10 -0
  59. data/default_configuration/base_app/backend/db/seeds.rb +14 -0
  60. data/default_configuration/base_app/backend/lib/static-app.rb +15 -0
  61. data/default_configuration/base_app/backend/public/404.html +26 -0
  62. data/default_configuration/base_app/backend/public/422.html +26 -0
  63. data/default_configuration/base_app/backend/public/500.html +26 -0
  64. data/default_configuration/base_app/backend/public/favicon.ico +0 -0
  65. data/default_configuration/base_app/backend/public/index.html +0 -0
  66. data/default_configuration/base_app/backend/public/robots.txt +5 -0
  67. data/default_configuration/base_app/backend/script/rails +6 -0
  68. data/default_configuration/base_app/backend/spec/factories/user_sessions_factory.rb +6 -0
  69. data/default_configuration/base_app/backend/spec/factories/users_factory.rb +35 -0
  70. data/default_configuration/base_app/backend/spec/features/user_sends_reset_password_email_spec.rb +30 -0
  71. data/default_configuration/base_app/backend/spec/features/user_signs_up_spec.rb +32 -0
  72. data/default_configuration/base_app/backend/spec/models/role/admin_spec.rb +12 -0
  73. data/default_configuration/base_app/backend/spec/models/role_spec.rb +48 -0
  74. data/default_configuration/base_app/backend/spec/models/user_spec.rb +59 -0
  75. data/default_configuration/base_app/backend/spec/requests/resources_index_spec.rb +22 -0
  76. data/default_configuration/base_app/backend/spec/spec_helper.rb +65 -0
  77. data/default_configuration/base_app/backend/spec/support/devise_helper.rb +78 -0
  78. data/default_configuration/base_app/backend/spec/support/log_tests.rb +5 -0
  79. data/default_configuration/base_app/backend/spec/support/session_helpers.rb +67 -0
  80. data/default_configuration/base_app/backend/spec/tasks/sample_data_rake_spec.rb +17 -0
  81. data/default_configuration/base_app/backend/static-app.ru +3 -0
  82. data/default_configuration/base_app/codeclimate.yml +7 -0
  83. data/default_configuration/base_app/config/compass.rb +21 -0
  84. data/default_configuration/base_app/config/deploy.rb +157 -0
  85. data/default_configuration/base_app/config/deploy/bundle-config +4 -0
  86. data/default_configuration/base_app/config/deploy/production.rb +7 -0
  87. data/default_configuration/base_app/config/deploy/staging.rb +6 -0
  88. data/default_configuration/base_app/doc/01_fail_resources.txt +173 -0
  89. data/default_configuration/base_app/doc/02_fail_auth.txt +165 -0
  90. data/default_configuration/base_app/doc/03_fail_menus.txt +174 -0
  91. data/default_configuration/base_app/dummy-api/admin/menu_items/10.json +15 -0
  92. data/default_configuration/base_app/dummy-api/admin/menu_items/11.json +15 -0
  93. data/default_configuration/base_app/dummy-api/admin/menu_items/12.json +15 -0
  94. data/default_configuration/base_app/dummy-api/admin/menu_items/13.json +15 -0
  95. data/default_configuration/base_app/dummy-api/admin/menu_items/14.json +15 -0
  96. data/default_configuration/base_app/dummy-api/admin/menu_items/15.json +15 -0
  97. data/default_configuration/base_app/dummy-api/admin/menu_items/16.json +15 -0
  98. data/default_configuration/base_app/dummy-api/admin/menus.json +23 -0
  99. data/default_configuration/base_app/dummy-api/admin/menus/1.json +118 -0
  100. data/default_configuration/base_app/dummy-api/admin/menus/2.json +8 -0
  101. data/default_configuration/base_app/dummy-api/admin/pages.json +105 -0
  102. data/default_configuration/base_app/dummy-api/admin/pages/about_us.json +45 -0
  103. data/default_configuration/base_app/dummy-api/admin/pages/contact_us.json +36 -0
  104. data/default_configuration/base_app/dummy-api/admin/pages/gallery.json +36 -0
  105. data/default_configuration/base_app/dummy-api/admin/pages/home.json +36 -0
  106. data/default_configuration/base_app/dummy-api/admin/pages/homepage.json +18 -0
  107. data/default_configuration/base_app/dummy-api/admin/pages/links.json +36 -0
  108. data/default_configuration/base_app/dummy-api/admin/pages/newsletter.json +54 -0
  109. data/default_configuration/base_app/dummy-api/homepage.json +14 -0
  110. data/default_configuration/base_app/dummy-api/navigation/main.json +119 -0
  111. data/default_configuration/base_app/dummy-api/pages/about_us.json +41 -0
  112. data/default_configuration/base_app/dummy-api/pages/contact_us.json +32 -0
  113. data/default_configuration/base_app/dummy-api/pages/gallery.json +32 -0
  114. data/default_configuration/base_app/dummy-api/pages/home.json +32 -0
  115. data/default_configuration/base_app/dummy-api/pages/homepage.json +14 -0
  116. data/default_configuration/base_app/dummy-api/pages/links.json +32 -0
  117. data/default_configuration/base_app/dummy-api/pages/newsletter.json +50 -0
  118. data/default_configuration/base_app/dump.rdb +0 -0
  119. data/default_configuration/base_app/example-lrd-dev-tmux.conf +17 -0
  120. data/default_configuration/base_app/frontend/CHANGELOG.md +125 -0
  121. data/default_configuration/base_app/frontend/Gemfile +5 -0
  122. data/default_configuration/base_app/frontend/Gemfile.lock +34 -0
  123. data/default_configuration/base_app/frontend/Gruntfile.js +3 -0
  124. data/default_configuration/base_app/frontend/LICENSE +19 -0
  125. data/default_configuration/base_app/frontend/README.md +5 -0
  126. data/default_configuration/base_app/frontend/bin/index.html +0 -0
  127. data/default_configuration/base_app/frontend/build.config.js +110 -0
  128. data/default_configuration/base_app/frontend/changelog.tpl +23 -0
  129. data/default_configuration/base_app/frontend/config/compass.rb +33 -0
  130. data/default_configuration/base_app/frontend/config/environments/development.js +4 -0
  131. data/default_configuration/base_app/frontend/config/environments/integration.js +4 -0
  132. data/default_configuration/base_app/frontend/config/environments/production.js +3 -0
  133. data/default_configuration/base_app/frontend/config/environments/test.js +4 -0
  134. data/default_configuration/base_app/frontend/create +0 -0
  135. data/default_configuration/base_app/frontend/karma/karma-unit.tpl.js +80 -0
  136. data/default_configuration/base_app/frontend/module.prefix +1 -0
  137. data/default_configuration/base_app/frontend/module.suffix +1 -0
  138. data/default_configuration/base_app/frontend/npm-shrinkwrap.json +4334 -0
  139. data/default_configuration/base_app/frontend/package.json +75 -0
  140. data/default_configuration/base_app/frontend/sprockets/index.tpl.js +2 -0
  141. data/default_configuration/base_app/frontend/src/README.md +48 -0
  142. data/default_configuration/base_app/frontend/src/app/README.md +68 -0
  143. data/default_configuration/base_app/frontend/src/app/app.js +47 -0
  144. data/default_configuration/base_app/frontend/src/app/appConfig.js +19 -0
  145. data/default_configuration/base_app/frontend/src/app/auth/auth.js +66 -0
  146. data/default_configuration/base_app/frontend/src/app/auth/config.js +22 -0
  147. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmations-success.tpl.html +1 -0
  148. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmations.js +8 -0
  149. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmationsStates.js +12 -0
  150. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-request-success.tpl.html +3 -0
  151. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-request.tpl.html +16 -0
  152. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-update-success.tpl.html +3 -0
  153. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-update.tpl.html +21 -0
  154. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords.js +11 -0
  155. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwordsControllers.js +47 -0
  156. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwordsStates.js +38 -0
  157. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations-success.tpl.html +1 -0
  158. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations.js +14 -0
  159. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations.tpl.html +37 -0
  160. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrationsControllers.js +25 -0
  161. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrationsStates.js +18 -0
  162. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions-success.tpl.html +1 -0
  163. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions.js +18 -0
  164. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions.tpl.html +25 -0
  165. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js +26 -0
  166. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessionsStates.js +20 -0
  167. data/default_configuration/base_app/frontend/src/app/homepage/homepage-show.tpl.html +2 -0
  168. data/default_configuration/base_app/frontend/src/app/homepage/homepage.js +10 -0
  169. data/default_configuration/base_app/frontend/src/app/homepage/homepage.tpl.html +13 -0
  170. data/default_configuration/base_app/frontend/src/app/homepage/homepageControllers.js +9 -0
  171. data/default_configuration/base_app/frontend/src/app/homepage/homepageStates.js +22 -0
  172. data/default_configuration/base_app/frontend/src/app/inner.tpl.html +16 -0
  173. data/default_configuration/base_app/frontend/src/app/root.tpl.html +2 -0
  174. data/default_configuration/base_app/frontend/src/app/rootController.js +8 -0
  175. data/default_configuration/base_app/frontend/src/app/rootStates.js +20 -0
  176. data/default_configuration/base_app/frontend/src/assets/README.md +4 -0
  177. data/default_configuration/base_app/frontend/src/assets/icons/alert.svg +1 -0
  178. data/default_configuration/base_app/frontend/src/common/README.md +19 -0
  179. data/default_configuration/base_app/frontend/src/common/components/OnLoginDirective/OnLoginDirective.js +17 -0
  180. data/default_configuration/base_app/frontend/src/common/components/adminOnly/admin-only.tpl.html +4 -0
  181. data/default_configuration/base_app/frontend/src/common/components/adminOnly/adminOnly.js +23 -0
  182. data/default_configuration/base_app/frontend/src/common/components/sessionLinks/session-links.tpl.html +5 -0
  183. data/default_configuration/base_app/frontend/src/common/components/sessionLinks/sessionLinks.js +25 -0
  184. data/default_configuration/base_app/frontend/src/common/components/signOut/signOut.js +19 -0
  185. data/default_configuration/base_app/frontend/src/common/config.js +27 -0
  186. data/default_configuration/base_app/frontend/src/index.html +86 -0
  187. data/default_configuration/base_app/frontend/src/styles/_constants.sass +14 -0
  188. data/default_configuration/base_app/frontend/src/styles/main.sass +52 -0
  189. data/default_configuration/base_app/frontend/src/styles/partials/_footer.sass +18 -0
  190. data/default_configuration/base_app/frontend/src/styles/partials/_forms.sass +9 -0
  191. data/default_configuration/base_app/frontend/src/styles/partials/_layout.sass +17 -0
  192. data/default_configuration/base_app/frontend/src/styles/partials/_navbar.sass +10 -0
  193. data/default_configuration/base_app/frontend/src/styles/partials/_typography.sass +18 -0
  194. data/default_configuration/base_app/frontend/src/styles/states/_errorFallback.sass +7 -0
  195. data/default_configuration/base_app/frontend/src/styles/states/_root_homepage.sass +8 -0
  196. data/default_configuration/base_app/frontend/test-help/xpath.js +9 -0
  197. data/default_configuration/base_app/frontend/test/app.js +24 -0
  198. data/default_configuration/base_app/frontend/test/auth/confirmations/confirmationsStates.js +46 -0
  199. data/default_configuration/base_app/frontend/test/auth/passwords/passwordsControllers.js +193 -0
  200. data/default_configuration/base_app/frontend/test/auth/passwords/passwordsStates.js +108 -0
  201. data/default_configuration/base_app/frontend/test/auth/registrations/registrationsControllers.js +117 -0
  202. data/default_configuration/base_app/frontend/test/auth/registrations/registrationsStates.js +64 -0
  203. data/default_configuration/base_app/frontend/test/auth/sessions/sessionsControllers.js +95 -0
  204. data/default_configuration/base_app/frontend/test/auth/sessions/sessionsStates.js +67 -0
  205. data/default_configuration/base_app/frontend/test/specHelper.js +33 -0
  206. data/default_configuration/base_app/frontend/test/support/mockDirective.js +13 -0
  207. data/default_configuration/base_app/frontend/test/support/stateResolveFn.js +3 -0
  208. data/default_configuration/base_app/frontend/test/support/testStates.js +20 -0
  209. data/default_configuration/base_app/frontend/tools.md +223 -0
  210. data/default_configuration/base_app/lib/capistrano/tasks/sidekiq.rake +218 -0
  211. data/default_configuration/base_app/static-app.ru +3 -0
  212. data/default_configuration/base_app/tmux-windows +68 -0
  213. data/default_configuration/base_app/tmux-windows.txt +53 -0
  214. data/lib/xing/cli.rb +8 -3
  215. data/lib/xing/cli/generators/new_project.rb +48 -13
  216. metadata +219 -7
@@ -0,0 +1,47 @@
1
+ import { Controller } from 'a1atscript';
2
+
3
+ @Controller('PasswordsRequestCtrl', ['$scope', '$auth', '$state', '$lrdToast', 'Serializer'])
4
+ export function PasswordsRequestController( $scope, $auth, $state, $lrdToast, Serializer) {
5
+ $scope.passwordRequest = {
6
+ email: '',
7
+ };
8
+
9
+ $scope.passwordRequestSubmit = function() {
10
+ var serializer = new Serializer();
11
+
12
+ $auth.requestPasswordReset(serializer.serialize({
13
+ user: $scope.passwordRequest,
14
+ update_url: $state.href("^.passwordsUpdate")
15
+ }))
16
+ .then(function(resp) {
17
+ $state.go('root.inner.passwordsRequestSuccess');
18
+ })
19
+ .catch(function(resp) {
20
+ $lrdToast.errorList(resp.data.errors);
21
+ // handle error response
22
+ });
23
+ };
24
+ }
25
+
26
+ @Controller('PasswordsUpdateCtrl', ['$scope', '$auth', '$state', '$lrdToast', '$location', 'Serializer'])
27
+ export function PasswordsUpdateController( $scope, $auth, $state, $lrdToast, $location, Serializer) {
28
+ $scope.passwordUpdate = {
29
+ password: '',
30
+ passwordConfirmation: ''
31
+ };
32
+
33
+ $scope.passwordUpdateSubmit = function() {
34
+ var serializer = new Serializer();
35
+ var query = $location.search();
36
+ query["user"] = $scope.passwordUpdate;
37
+
38
+ $auth.updatePassword(serializer.serialize(query))
39
+ .then(function(resp) {
40
+ $state.go('root.inner.passwordsUpdateSuccess');
41
+ })
42
+ .catch(function(resp) {
43
+ $lrdToast.errorList(resp.data.errors, "We could not update your password because:");
44
+ // handle error response
45
+ });
46
+ };
47
+ }
@@ -0,0 +1,38 @@
1
+ import {State, Resolve} from 'stateInjector';
2
+ import {LoggedInOnlyState} from 'stateClasses';
3
+
4
+ @State( 'root.inner.passwordsRequest')
5
+ export class PasswordsRequestState {
6
+ constructor() {
7
+ this.url = '^/reset-password';
8
+ this.controller = 'PasswordsRequestCtrl';
9
+ this.templateUrl = 'auth/passwords/passwords-request.tpl.html';
10
+ }
11
+ }
12
+
13
+ @State( 'root.inner.passwordsRequestSuccess')
14
+ export class PasswordsRequestSuccessState {
15
+ constructor() {
16
+ this.url = '^/reset-password-sent';
17
+ this.templateUrl = 'auth/passwords/passwords-request-success.tpl.html';
18
+ }
19
+ }
20
+
21
+ @State( 'root.inner.passwordsUpdate')
22
+ export class PasswordsUpdateState extends LoggedInOnlyState {
23
+ constructor() {
24
+ super();
25
+ this.url = '^/update-password';
26
+ this.controller = 'PasswordsUpdateCtrl';
27
+ this.templateUrl = 'auth/passwords/passwords-update.tpl.html';
28
+ }
29
+ }
30
+
31
+ @State( 'root.inner.passwordsUpdateSuccess')
32
+ export class PasswordsUpdateSuccessState extends LoggedInOnlyState {
33
+ constructor() {
34
+ super();
35
+ this.url = '^/updated-password';
36
+ this.templateUrl = 'auth/passwords/passwords-update-success.tpl.html';
37
+ }
38
+ }
@@ -0,0 +1 @@
1
+ <h2>A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.</h2>
@@ -0,0 +1,14 @@
1
+ import {Module} from 'a1atscript';
2
+ import {Toast, Serializer} from 'xing-frontend-utils';
3
+ import * as RegistrationsStates from './registrationsStates.js';
4
+ import RegistrationsController from './registrationsControllers.js';
5
+
6
+ var registrations = new Module( 'auth.registrations', [
7
+ 'ui.router.state',
8
+ 'ng-token-auth',
9
+ Toast,
10
+ Serializer,
11
+ RegistrationsStates,
12
+ RegistrationsController]);
13
+
14
+ export default registrations;
@@ -0,0 +1,37 @@
1
+ <h1>Sign Up</h1>
2
+
3
+ <form id='registrations-form'>
4
+
5
+ <div class='lrd-form-row'>
6
+ <label for="email">Email:</label>
7
+ <input name="email" ng-model="registration.email" placeholder="Email" />
8
+ <span class='comment'></span>
9
+ </div>
10
+
11
+ <div class='lrd-form-row'>
12
+ <label for="email-confirmation">Email Confirmation:</label>
13
+ <input name="email-confirmation" ng-model="registration.emailConfirmation" placeholder="Email Confirmation" />
14
+ <span class='comment'></span>
15
+ </div>
16
+
17
+ <div class='lrd-form-row'>
18
+ <label for="password">Password:</label>
19
+ <input type="password" name="password" ng-model="registration.password" placeholder="Password" />
20
+ <span class='comment'></span>
21
+ </div>
22
+
23
+ <div class='lrd-form-row'>
24
+ <label for="password-confirmation">Password Confirmation:</label>
25
+ <input type="password" name="password-confirmation" ng-model="registration.passwordConfirmation" placeholder="Password Confirmation" />
26
+ <span class='comment'></span>
27
+ </div>
28
+
29
+ <div class='lrd-form-row'>
30
+ <button type="submit" ng-click="registrationSubmit()" class='call-to-action'>Sign Up</button>
31
+ </div>
32
+
33
+ <div class='lrd-form-row'>
34
+ <a ui-sref='root.inner.sessions' class='input-like'>Already have an account?</a>
35
+ </div>
36
+
37
+ </form>
@@ -0,0 +1,25 @@
1
+ import {Controller} from 'a1atscript';
2
+
3
+ @Controller('RegistrationsCtrl', ['$scope', '$auth', '$state', '$lrdToast', 'Serializer'])
4
+ export default function RegistrationsController( $scope, $auth, $state, $lrdToast, Serializer) {
5
+ $scope.registration = {
6
+ email: '',
7
+ emailConfirmation: '',
8
+ password: '',
9
+ passwordConfirmation: ''
10
+ };
11
+
12
+ $scope.registrationSubmit = function() {
13
+ var serializer = new Serializer();
14
+
15
+ $auth.submitRegistration(serializer.serialize({user: $scope.registration}))
16
+ .then(function(resp) {
17
+ $state.go('root.inner.registrationsSuccess');
18
+ })
19
+ .catch(function(resp) {
20
+ $lrdToast.errorList(resp.data.errors, "We cannot process your registration because:");
21
+ // handle error response
22
+ });
23
+ };
24
+
25
+ }
@@ -0,0 +1,18 @@
1
+ import {State} from 'stateInjector';
2
+
3
+ @State( 'root.inner.registrations')
4
+ export class RegistrationsState {
5
+ constructor() {
6
+ this.url = '^/sign-up';
7
+ this.controller = 'RegistrationsCtrl';
8
+ this.templateUrl = 'auth/registrations/registrations.tpl.html';
9
+ }
10
+ }
11
+
12
+ @State( 'root.inner.registrationsSuccess')
13
+ export class RegistrationsSuccessState {
14
+ constructor() {
15
+ this.url = '^/signed-up';
16
+ this.templateUrl = 'auth/registrations/registrations-success.tpl.html';
17
+ }
18
+ }
@@ -0,0 +1 @@
1
+ <h1>You have successfully logged in!</h1>
@@ -0,0 +1,18 @@
1
+ import {Module} from 'a1atscript';
2
+ import {Toast, Serializer} from 'xing-frontend-utils';
3
+ import Inflector from 'xing-inflector';
4
+ import Config from '../config.js';
5
+ import * as SessionsStates from './sessionsStates.js';
6
+ import SessionsController from './sessionsControllers.js';
7
+
8
+ var sessions = new Module('auth.sessions', [
9
+ 'ui.router.state',
10
+ 'ng-token-auth',
11
+ Toast,
12
+ Inflector,
13
+ Serializer,
14
+ Config,
15
+ SessionsStates,
16
+ SessionsController]);
17
+
18
+ export default sessions;
@@ -0,0 +1,25 @@
1
+ <h1>Sign In</h1>
2
+
3
+ <form id='sessions-form'>
4
+ <div class='lrd-form-row'>
5
+ <label for="{{authKey}}">{{humanAuthKey}}:</label>
6
+ <input name="{{authKey}}" ng-model="session[authKey]" placeholder="{{humanAuthKey}}" required />
7
+ <span class='messages'></span>
8
+ </div>
9
+
10
+ <div class='lrd-form-row'>
11
+ <label for="password">Password:</label>
12
+ <input type="password" name="password" ng-model="session.password" placeholder="Password" required />
13
+ <span class='messages'></span>
14
+ </div>
15
+
16
+ <div class='lrd-form-row'>
17
+ <button type="submit" ng-click="sessionSubmit()" class="call-to-action">Sign In</button>
18
+ </div>
19
+
20
+ <div class='lrd-form-row'>
21
+ <div ng-if="passwordShow" class='input-like'>
22
+ <a ui-sref='root.inner.passwordsRequest'>Forgot your password?</a>
23
+ </div>
24
+ </div>
25
+ </form>
@@ -0,0 +1,26 @@
1
+ import {Controller} from 'a1atscript';
2
+
3
+ @Controller('SessionsCtrl', ['$scope', '$auth', '$state', '$lrdToast', 'Serializer', 'authConfig', 'Inflector'])
4
+ export default function SessionsController( $scope, $auth, $state, $lrdToast, Serializer, authConfig, Inflector) {
5
+ $scope.session = {
6
+ password: ''
7
+ };
8
+ $scope.session[authConfig.authKey] = '';
9
+ $scope.authKey = authConfig.authKey;
10
+ $scope.humanAuthKey = Inflector.humanize(authConfig.authKey);
11
+ $scope.passwordShow = authConfig.recoverable;
12
+
13
+ $scope.sessionSubmit = function() {
14
+ var serializer = new Serializer();
15
+
16
+ $auth.submitLogin(serializer.serialize({user: $scope.session}))
17
+ .then(function(resp) {
18
+ $state.go('root.inner.sessionsSuccess');
19
+ })
20
+ .catch(function(resp) {
21
+ $lrdToast.error(resp.errors);
22
+ // handle error response
23
+ });
24
+ };
25
+
26
+ }
@@ -0,0 +1,20 @@
1
+ import {State, Resolve} from 'stateInjector';
2
+ import {LoggedInOnlyState} from 'stateClasses';
3
+
4
+ @State( 'root.inner.sessions')
5
+ export class SessionsState {
6
+ constructor() {
7
+ this.url = '^/sign-in';
8
+ this.controller = 'SessionsCtrl';
9
+ this.templateUrl = 'auth/sessions/sessions.tpl.html';
10
+ }
11
+ }
12
+
13
+ @State( 'root.inner.sessionsSuccess')
14
+ export class SessionsSuccessState extends LoggedInOnlyState {
15
+ constructor() {
16
+ super();
17
+ this.url = '^/signed-in';
18
+ this.templateUrl = 'auth/sessions/sessions-success.tpl.html';
19
+ }
20
+ }
@@ -0,0 +1,2 @@
1
+ <h1>Xing Homepage</h1>
2
+ <p>This will be the home page of whatever project is based on Xing.</p>
@@ -0,0 +1,10 @@
1
+ import {Module} from 'a1atscript';
2
+ import * as HomepageControllers from './homepageControllers.js';
3
+ import * as HomepageStates from './homepageStates.js';
4
+
5
+ var Homepage = new Module('homepage', [
6
+ HomepageControllers,
7
+ HomepageStates
8
+ ]);
9
+
10
+ export default Homepage;
@@ -0,0 +1,13 @@
1
+ <lrd-responsive-menu>
2
+ <a ui-sref='root.inner.homepage'>Homepage</a>
3
+ <lrd-session-links>
4
+ </lrd-session-links>
5
+ </lrd-responsive-menu>
6
+
7
+ <ui-view lrd-state-attrs></ui-view>
8
+
9
+ <footer>
10
+ <span id="copyright">&copy; 2014 Your Organization Here</span>
11
+ <a ui-sref='root.inner.sessions' id='sign-in-link'>Sign In</a>
12
+ <a href='#' xng-unimplemented>Demo Unimplemented Feature</a>
13
+ </footer>
@@ -0,0 +1,9 @@
1
+ import {Controller} from 'a1atscript';
2
+
3
+ @Controller('HomepageShowCtrl', [])
4
+ export function HomepageShowController(){
5
+ }
6
+
7
+ @Controller('HomepageCtrl', [])
8
+ export function HomepageController() {
9
+ }
@@ -0,0 +1,22 @@
1
+ import {State, Resolve} from 'stateInjector';
2
+ import {AdminOnlyState, TrackAdminState} from 'stateClasses';
3
+
4
+ @State('root.homepage')
5
+ export class HomepageState extends TrackAdminState {
6
+ constructor() {
7
+ super();
8
+ this.controller = 'HomepageCtrl';
9
+ this.templateUrl = 'homepage/homepage.tpl.html';
10
+ this.abstract = true;
11
+ this.url = 'home';
12
+ }
13
+ }
14
+
15
+ @State('root.homepage.show')
16
+ export class HomepageShowState {
17
+ constructor() {
18
+ this.url = '';
19
+ this.controller = 'HomepageShowCtrl';
20
+ this.templateUrl = 'homepage/homepage-show.tpl.html';
21
+ }
22
+ }
@@ -0,0 +1,16 @@
1
+ <lrd-responsive-menu>
2
+ <lrd-navbar id="main_nav" menu="mainMenu">
3
+ </lrd-navbar>
4
+ <lrd-session-links>
5
+ </lrd-session-links>
6
+ </lrd-responsive-menu>
7
+
8
+ <div id="toast_main">
9
+ </div>
10
+
11
+ <ui-view lrd-state-attrs></ui-view>
12
+
13
+ <footer>
14
+ <span id="copyright">&copy; 2014 Your Organization Here</span>
15
+ <a ui-sref='root.inner.sessions' id='sign-in-link'>Sign In</a>
16
+ </footer>
@@ -0,0 +1,2 @@
1
+ <ui-view lrd-state-attrs>
2
+ </ui-view>
@@ -0,0 +1,8 @@
1
+ import {Controller} from 'a1atscript';
2
+
3
+ @Controller( 'RootCtrl', ['$scope', '$state', '$rootScope', '$window' ])
4
+ export default function RootCtrl( $scope, $state, $rootScope, $window ) {
5
+ $rootScope.$on("$viewContentLoaded", function(event) {
6
+ $window.frontendContentLoaded = true;
7
+ });
8
+ }
@@ -0,0 +1,20 @@
1
+ import {State} from 'stateInjector';
2
+
3
+ @State('root')
4
+ export class RootState {
5
+ constructor() {
6
+ this.templateUrl = "root.tpl.html";
7
+ this.controller = 'RootCtrl';
8
+ this.abstract = true;
9
+ this.url = "/";
10
+ }
11
+ }
12
+
13
+ @State('root.inner')
14
+ export class RootInnerState {
15
+ constructor() {
16
+ this.templateUrl ="inner.tpl.html";
17
+ this.abstract = true;
18
+ this.url = "inner";
19
+ }
20
+ }
@@ -0,0 +1,4 @@
1
+ # The `src/assets` Directory
2
+
3
+ There's really not much to say here. Every file in this directory is recursively transferred to `dist/assets/`.
4
+
@@ -0,0 +1 @@
1
+ <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="512px" id="Layer_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M476.7,422.2L270.1,72.7c-2.9-5-8.3-8.7-14.1-8.7c-5.9,0-11.3,3.7-14.1,8.7L35.3,422.2c-2.8,5-4.8,13-1.9,17.9 c2.9,4.9,8.2,7.9,14,7.9h417.1c5.8,0,11.1-3,14-7.9C481.5,435.2,479.5,427.1,476.7,422.2z M288,400h-64v-48h64V400z M288,320h-64 V176h64V320z"/></g></svg>
@@ -0,0 +1,19 @@
1
+ # The `src/common/` Directory
2
+
3
+ The `src/common/` directory is reusable components that serve as the business logic of the application. They may be specific to this application, but should be organized so that they can be easily copied and reused in another application. In general user visible components like directives, controllers, states, and templates should not live here.
4
+
5
+ ```
6
+ src/
7
+ |- common/
8
+ | |- resources
9
+ | |- components
10
+ | |- config.js
11
+ | |- environment.js
12
+ | |- AppBackend.js
13
+ ```
14
+
15
+ - `resources` - this houses sub-classes of BackendResource which provide an object oriented interface to backend data
16
+ - `components` - reusuable UI components, usually directives, that do not make up an entire new view on the page that would change the URL
17
+ - config.js - contains important configuration variables used throughout the app
18
+ - environment.js - DON'T EDIT THIS FILE. it gets regenerated. instead, edit the individual environment files in frontend/config
19
+ - AppBackend.js provides app specific endpoints to the backend