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

Remove base controller from HTML tag to after Angular bootstrap and convert I18NFooter and Thanks to component directives. #7283

Merged
merged 15 commits into from
Aug 5, 2019
Prev Previous commit
Next Next commit
Thanks page to component directive
  • Loading branch information
YashJipkate committed Jul 5, 2019
commit 213a31e650895f473aab94ec0782f741201e2414
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ <h2 class="oppia-splash-h2" style="padding-bottom: 30px; font-size: 1.6em; paddi
<img ng-src="<[$ctrl.getStaticImageUrl('/splash/bullet1icon.svg')]>" class="oppia-splash-overlapping-image-1" alt="">
</div>
<div class="oppia-splash-bullet-block oppia-splash-block-right-text"
translate="I18N_SPLASH_FIRST_EXPLORATION_DESCRIPTION">
translate="I18N_SPLASH_FIRST_EXPLORATION_DESCRIPTION">
</div>
</div>

Expand All @@ -155,7 +155,7 @@ <h2 class="oppia-splash-h2" style="padding-bottom: 30px; font-size: 1.6em; paddi
<img ng-src="<[$ctrl.getStaticImageUrl('/splash/bullet2icon.svg')]>" alt="">
</div>
<div class="oppia-splash-bullet-block oppia-splash-block-left-text"
translate="I18N_SPLASH_SECOND_EXPLORATION_DESCRIPTION">
translate="I18N_SPLASH_SECOND_EXPLORATION_DESCRIPTION">
</div>
</div>

Expand All @@ -164,7 +164,7 @@ <h2 class="oppia-splash-h2" style="padding-bottom: 30px; font-size: 1.6em; paddi
<img ng-src="<[$ctrl.getStaticImageUrl('/splash/bullet3icon.svg')]>" alt="">
</div>
<div class="oppia-splash-bullet-block oppia-splash-block-right-text"
translate="I18N_SPLASH_THIRD_EXPLORATION_DESCRIPTION">
translate="I18N_SPLASH_THIRD_EXPLORATION_DESCRIPTION">
</div>
</div>
</div>
Expand Down
25 changes: 14 additions & 11 deletions core/templates/dev/head/pages/thanks-page/thanks-page.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
* @fileoverview Controllers for the 'thanks' page.
*/

require('App.ts');

require('base_components/BaseContentDirective.ts');
require(
'components/common-layout-directives/common-elements/' +
'background-banner.directive.ts');
Expand All @@ -27,11 +24,17 @@ require('domain/utilities/UrlInterpolationService.ts');

var oppia = require('AppInit.ts').module;

oppia.controller('Thanks', [
'$scope', 'UrlInterpolationService',
function(
$scope, UrlInterpolationService) {
$scope.thanksImgUrl = UrlInterpolationService.getStaticImageUrl(
'/general/donate.png');
}
]);
oppia.directive('thanksPage', ['UrlInterpolationService', function(
UrlInterpolationService) {
return {
restrict: 'E',
scope: {},
bindToController: {},
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/pages/thanks-page/thanks-page.directive.html'),
controllerAs: '$ctrl',
controller: ['UrlInterpolationService', function(UrlInterpolationService) {
var ctrl = this;
ctrl.thanksImgUrl = UrlInterpolationService.getStaticImageUrl(
'/general/donate.png');
}]}}]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<background-banner></background-banner>
<div class="oppia-page-card oppia-static-content">
<div class="oppia-static-card-content oppia-static-card-content-wide" style="height: 450px">
<h2>Thank you for donating to The Oppia Foundation!</h2>
<br>
<div style="float:left;">
<img ng-src="<[$ctrl.thanksImgUrl]>" alt="Otter holding a gift" style="height: 250px;">
</div>
<div style="float:right;">
<p>
Your contribution will be used towards:
</p>
<ul style="margin-left: 30px;">
<li>Maintaining our servers</li>
<li>Marketing</li>
<li>Distributing learning materials to students</li>
</ul>
<p>
Thank you for your support!
</p>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,7 @@
</navbar-breadcrumb>

<content>
<background-banner></background-banner>
<div class="oppia-page-card oppia-static-content" ng-controller="Thanks">
<div class="oppia-static-card-content oppia-static-card-content-wide" style="height: 450px">
<h2>Thank you for donating to The Oppia Foundation!</h2>
<br>
<div style="float:left;">
<img ng-src="<[thanksImgUrl]>" alt="Otter holding a gift" style="height: 250px;">
</div>
<div style="float:right;">
<p>
Your contribution will be used towards:
</p>
<ul style="margin-left: 30px;">
<li>Maintaining our servers</li>
<li>Marketing</li>
<li>Distributing learning materials to students</li>
</ul>
<p>
Thank you for your support!
</p>
</div>
</div>
</div>
<thanks-page></thanks-page>
</content>
</base-content>

Expand Down
22 changes: 22 additions & 0 deletions core/templates/dev/head/pages/thanks-page/thanks-page.scripts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2016 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
* @fileoverview Scripts for the 'thanks' page.
*/

require('App.ts');

require('base_components/BaseContentDirective.ts');
require('pages/thanks-page/thanks-page.controller.ts');
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module.exports = {
commonPrefix + '/pages/story-viewer-page/story-viewer-page.scripts.ts',
teach: commonPrefix + '/pages/teach-page/teach-page.scripts.ts',
terms: commonPrefix + '/pages/terms-page/terms-page.controller.ts',
thanks: commonPrefix + '/pages/thanks-page/thanks-page.controller.ts',
thanks: commonPrefix + '/pages/thanks-page/thanks-page.scripts.ts',
topic_editor:
commonPrefix + '/pages/topic-editor-page/topic-editor-page.scripts.ts',
topics_and_skills_dashboard: (
Expand Down