Skip to content

Commit

Permalink
Apply folders by feature to lightweight pages. (oppia#6876)
Browse files Browse the repository at this point in the history
* About page, contact, donate

* Email dashboard

* Error pages, get started, landing pages

* Maintenance page

* Moderator page

* Notification dashboard page

* Practice session and preferences

* Privacy page

* Profile page

* Signup page

* Splash page

* Teach page

* Teach and terms page

* tests/ is now a sibling of pages/

* landing -> landing-pages

* Fix tests

* Fix tests

* Merge develop and address comment
  • Loading branch information
YashJipkate authored and seanlip committed Jun 9, 2019
1 parent b80147e commit ee776a4
Show file tree
Hide file tree
Showing 70 changed files with 155 additions and 124 deletions.
40 changes: 20 additions & 20 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
/CONTRIBUTORS @seanlip
/LICENSE @seanlip
/NOTICE @seanlip
/core/templates/dev/head/pages/about/ @seanlip
/core/templates/dev/head/pages/privacy/ @seanlip
/core/templates/dev/head/pages/terms/ @seanlip
/core/templates/dev/head/pages/about-page/ @seanlip
/core/templates/dev/head/pages/privacy-page/ @seanlip
/core/templates/dev/head/pages/terms-page/ @seanlip


# Dashboard pages.
Expand All @@ -68,9 +68,9 @@
/core/templates/dev/head/domain/creator_dashboard/ @nithusha21
/core/templates/dev/head/domain/learner_dashboard/ @nithusha21
/core/templates/dev/head/pages/creator_dashboard/ @nithusha21
/core/templates/dev/head/pages/email_dashboard/ @nithusha21
/core/templates/dev/head/pages/email-dashboard-pages/ @nithusha21
/core/templates/dev/head/pages/learner_dashboard/ @nithusha21
/core/templates/dev/head/pages/notifications_dashboard/ @nithusha21
/core/templates/dev/head/pages/notifications-dashboard-page/ @nithusha21


# Dev workflow team.
Expand Down Expand Up @@ -256,7 +256,7 @@
/core/templates/dev/head/components/entity-creation-services/question-creation.service.ts @aks681
/core/templates/dev/head/components/score-ring/ @vinitamurthi
/core/templates/dev/head/domain/question/ @aks681
/core/templates/dev/head/pages/practice_session/ @vinitamurthi
/core/templates/dev/head/pages/practice-session-page/ @vinitamurthi
/core/templates/dev/head/components/question-directives/question-editor/ @aks681
/core/templates/dev/head/components/question-directives/questions-list/ @aks681
/core/templates/dev/head/components/question-directives/question-player/ @vinitamurthi
Expand Down Expand Up @@ -323,7 +323,7 @@
/core/controllers/__init__.py @DubeySandeep
/core/domain/__init__.py @DubeySandeep
/core/domain/config*.py @seanlip
/core/templates/dev/head/pages/tests/ @seanlip
/core/templates/dev/head/tests/ @seanlip
/core/templates/dev/head/domain/utilities/ @DubeySandeep
/schema_utils*.py @seanlip
/utils*.py @aks681
Expand All @@ -335,7 +335,7 @@
/core/controllers/recent_commits*.py @seanlip
/core/domain/moderator_services*.py @seanlip
/core/templates/dev/head/pages/admin/ @seanlip
/core/templates/dev/head/pages/moderator/ @seanlip
/core/templates/dev/head/pages/moderator-page/ @seanlip


# QA team.
Expand Down Expand Up @@ -380,17 +380,17 @@
# Simple pages.
/core/controllers/pages*.py @vojtechjelinek
/core/controllers/custom_landing_pages*.py @vojtechjelinek
/core/templates/dev/head/pages/contact/ @vojtechjelinek
/core/templates/dev/head/pages/donate/ @vojtechjelinek
/core/templates/dev/head/pages/error/ @vojtechjelinek
/core/templates/dev/head/pages/get_started/ @vojtechjelinek
/core/templates/dev/head/pages/landing/ @vojtechjelinek
/core/templates/dev/head/pages/maintenance/ @vojtechjelinek
/core/templates/dev/head/pages/preferences/ @vojtechjelinek
/core/templates/dev/head/pages/signup/ @vojtechjelinek
/core/templates/dev/head/pages/splash/ @vojtechjelinek
/core/templates/dev/head/pages/teach/ @vojtechjelinek
/core/templates/dev/head/pages/thanks/ @vojtechjelinek
/core/templates/dev/head/pages/contact-page/ @vojtechjelinek
/core/templates/dev/head/pages/donate-page/ @vojtechjelinek
/core/templates/dev/head/pages/error-pages/ @vojtechjelinek
/core/templates/dev/head/pages/get-started-page/ @vojtechjelinek
/core/templates/dev/head/pages/landing-pages/ @vojtechjelinek
/core/templates/dev/head/pages/maintenance-page/ @vojtechjelinek
/core/templates/dev/head/pages/preferences-page/ @vojtechjelinek
/core/templates/dev/head/pages/signup-page/ @vojtechjelinek
/core/templates/dev/head/pages/splash-page/ @vojtechjelinek
/core/templates/dev/head/pages/teach-page/ @vojtechjelinek
/core/templates/dev/head/pages/thanks-page/ @vojtechjelinek


# Speed Improvement team.
Expand All @@ -415,7 +415,7 @@
# User’s profile page.
/core/controllers/profile*.py @kevinlee12
/core/templates/dev/head/domain/user/ @kevinlee12
/core/templates/dev/head/pages/profile/ @kevinlee12
/core/templates/dev/head/pages/profile-page/ @kevinlee12
/core/templates/dev/head/services/UserService*.ts @kevinlee12


Expand Down
5 changes: 3 additions & 2 deletions core/controllers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,10 @@ def _render_exception_json_or_html(self, return_type, values):
self.values.update(values)
if 'iframed' in self.values and self.values['iframed']:
self.render_template(
'pages/error/error_iframed.html', iframe_restriction=None)
'pages/error-pages/error-iframed.mainpage.html',
iframe_restriction=None)
else:
self.render_template('dist/error.html')
self.render_template('dist/error-page.mainpage.html')
else:
if return_type != feconf.HANDLER_TYPE_JSON and (
return_type != feconf.HANDLER_TYPE_DOWNLOADABLE):
Expand Down
4 changes: 2 additions & 2 deletions core/controllers/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class FakePage(base.BaseHandler):

def get(self):
"""Handles GET requests."""
self.render_template('pages/tests/jinja_escaping.html')
self.render_template('tests/jinja_escaping.html')

def post(self):
"""Handles POST requests."""
Expand Down Expand Up @@ -811,7 +811,7 @@ def get(self):
iframe_restriction = self.request.get(
'iframe_restriction', default_value=None)
self.render_template(
'pages/about/about.html',
'pages/about-page/about-page.mainpage.html',
iframe_restriction=iframe_restriction)

def setUp(self):
Expand Down
2 changes: 1 addition & 1 deletion core/controllers/creator_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get(self):
'meta_description': feconf.CREATOR_DASHBOARD_PAGE_DESCRIPTION,
})
self.render_template(
'dist/notifications_dashboard.html')
'dist/notifications-dashboard-page.mainpage.html')


class NotificationsDashboardHandler(base.BaseHandler):
Expand Down
4 changes: 2 additions & 2 deletions core/controllers/custom_landing_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get(self, subject, topic):
"""Handles GET requests."""
if subject in feconf.AVAILABLE_LANDING_PAGES:
if topic in feconf.AVAILABLE_LANDING_PAGES[subject]:
self.render_template('dist/topic_landing_page.html')
self.render_template('dist/topic-landing-page.mainpage.html')
else:
raise self.PageNotFoundException
else:
Expand All @@ -54,4 +54,4 @@ class StewardsLandingPage(base.BaseHandler):
def get(self):
"""Handles GET requests."""
self.render_template(
'dist/landing_page_stewards.html')
'dist/stewards-landing-page.mainpage.html')
2 changes: 1 addition & 1 deletion core/controllers/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get(self, exploration_id):
"""Handles GET requests."""
if exploration_id in constants.DISABLED_EXPLORATION_IDS:
self.render_template(
'pages/error/disabled_exploration.html',
'pages/error-pages/disabled-exploration.mainpage.html',
iframe_restriction=None)
return

Expand Down
4 changes: 2 additions & 2 deletions core/controllers/email_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class EmailDashboardPage(base.BaseHandler):
@acl_decorators.can_manage_email_dashboard
def get(self):
"""Handles GET requests."""
self.render_template('dist/email_dashboard.html')
self.render_template('dist/email-dashboard-page.mainpage.html')


class EmailDashboardDataHandler(base.BaseHandler):
Expand Down Expand Up @@ -168,7 +168,7 @@ def get(self, query_id):
'query_id': query_id,
})
self.render_template(
'dist/email_dashboard_result.html')
'dist/email-dashboard-result.mainpage.html')

@acl_decorators.can_manage_email_dashboard
def post(self, query_id):
Expand Down
2 changes: 1 addition & 1 deletion core/controllers/moderator.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ModeratorPage(base.BaseHandler):
@acl_decorators.can_access_moderator_page
def get(self):
"""Handles GET requests."""
self.render_template('dist/moderator.html')
self.render_template('dist/moderator-page.mainpage.html')


class FeaturedActivitiesHandler(base.BaseHandler):
Expand Down
20 changes: 10 additions & 10 deletions core/controllers/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get(self):
})

if not c_value:
self.render_template('dist/splash.html')
self.render_template('dist/splash-page.mainpage.html')
else:
try:
self.render_template('dist/splash_%s.html' % c_value)
Expand Down Expand Up @@ -60,7 +60,7 @@ def get(self):
self.values.update({
'meta_description': feconf.ABOUT_PAGE_DESCRIPTION,
})
self.render_template('dist/about.html')
self.render_template('dist/about-page.mainpage.html')


class GetStartedPage(base.BaseHandler):
Expand All @@ -72,7 +72,7 @@ def get(self):
self.values.update({
'meta_description': feconf.GET_STARTED_PAGE_DESCRIPTION,
})
self.render_template('dist/get_started.html')
self.render_template('dist/get-started-page.mainpage.html')


class TeachPage(base.BaseHandler):
Expand All @@ -84,7 +84,7 @@ def get(self):
self.values.update({
'meta_description': feconf.TEACH_PAGE_DESCRIPTION,
})
self.render_template('dist/teach.html')
self.render_template('dist/teach-page.mainpage.html')


class ContactPage(base.BaseHandler):
Expand All @@ -96,7 +96,7 @@ def get(self):
self.values.update({
'meta_description': feconf.CONTACT_PAGE_DESCRIPTION,
})
self.render_template('dist/contact.html')
self.render_template('dist/contact-page.mainpage.html')


class DonatePage(base.BaseHandler):
Expand All @@ -108,7 +108,7 @@ def get(self):
self.values.update({
'meta_description': feconf.DONATE_PAGE_DESCRIPTION,
})
self.render_template('dist/donate.html')
self.render_template('dist/donate-page.mainpage.html')


class ThanksPage(base.BaseHandler):
Expand All @@ -120,7 +120,7 @@ def get(self):
self.values.update({
'meta_description': feconf.THANKS_PAGE_DESCRIPTION,
})
self.render_template('dist/thanks.html')
self.render_template('dist/thanks-page.mainpage.html')


class ForumRedirectPage(base.BaseHandler):
Expand All @@ -141,7 +141,7 @@ def get(self):
'meta_description': feconf.TERMS_PAGE_DESCRIPTION,
})

self.render_template('dist/terms.html')
self.render_template('dist/terms-page.mainpage.html')


class PrivacyPage(base.BaseHandler):
Expand All @@ -150,7 +150,7 @@ class PrivacyPage(base.BaseHandler):
@acl_decorators.open_access
def get(self):
"""Handles GET requests."""
self.render_template('dist/privacy.html')
self.render_template('dist/privacy-page.mainpage.html')


class AboutRedirectPage(base.BaseHandler):
Expand Down Expand Up @@ -195,4 +195,4 @@ class MaintenancePage(base.BaseHandler):
@acl_decorators.open_access
def get(self, *args, **kwargs):
"""Handles GET requests."""
self.render_template('dist/maintenance.html')
self.render_template('dist/maintenance-page.mainpage.html')
2 changes: 1 addition & 1 deletion core/controllers/practice_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get(self, topic_name):
'dependencies_html': jinja2.utils.Markup(dependencies_html),
'topic_name': topic.name,
})
self.render_template('dist/practice_session.html')
self.render_template('dist/practice-session-page.mainpage.html')


class PracticeSessionsPageDataHandler(base.BaseHandler):
Expand Down
6 changes: 3 additions & 3 deletions core/controllers/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get(self, username):
self.values.update({
'PROFILE_USERNAME': user_settings.username,
})
self.render_template('dist/profile.html')
self.render_template('dist/profile-page.mainpage.html')


class ProfileHandler(base.BaseHandler):
Expand Down Expand Up @@ -108,7 +108,7 @@ def get(self):
self.values.update({
'meta_description': feconf.PREFERENCES_PAGE_DESCRIPTION,
})
self.render_template('dist/preferences.html')
self.render_template('dist/preferences-page.mainpage.html')


class PreferencesHandler(base.BaseHandler):
Expand Down Expand Up @@ -261,7 +261,7 @@ def get(self):
'meta_description': feconf.SIGNUP_PAGE_DESCRIPTION,
'CAN_SEND_EMAILS': feconf.CAN_SEND_EMAILS,
})
self.render_template('dist/signup.html')
self.render_template('dist/signup-page.mainpage.html')


class SignupHandler(base.BaseHandler):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Unit tests for the email dashboard page.
*/

require('pages/email_dashboard/EmailDashboardDataService.ts');
require('pages/email-dashboard-pages/email-dashboard-data.service.ts');

describe('Email Dashboard Services', function() {
beforeEach(angular.mock.module('oppia'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Controller for oppia email dashboard page.
*/

require('pages/email_dashboard/EmailDashboardDataService.ts');
require('pages/email-dashboard-pages/email-dashboard-data.service.ts');
require('services/UserService.ts');

oppia.controller('EmailDashboard', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ oppia.controller('Stewards', [
};

// Note: This should be kept in sync with the CSS media query on
// landing_page_stewards.html.
// stewards-landing-page.mainpage.html.
var isWindowNarrow = function(windowWidthPx) {
return windowWidthPx <= 890;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ <h2>
}

/* Note: This should be kept in sync with the CSS media query on
landing_page_stewards.html.
stewards-landing-page.mainpage.html.
*/
@media screen and (max-width: 890px) {
.oppia-stewards-landing-background-icon-row-container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

require('domain/utilities/UrlInterpolationService.ts');
require('filters/string-utility-filters/capitalize.filter.ts');
require('pages/landing/TopicLandingPage.ts');
require(
'pages/landing-pages/topic-landing-page/topic-landing-page.controller.ts');
require('services/PageTitleService.ts');
require('services/SiteAnalyticsService.ts');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ oppia.constant('TOTAL_QUESTIONS', 20);
oppia.constant('INTERACTION_SPECS', GLOBALS.INTERACTION_SPECS);
oppia.constant(
'PRACTICE_SESSIONS_DATA_URL',
'/practice_session/data/<topic_name>');
'/practice-session-page/data/<topic_name>');

require(
'components/common-layout-directives/common-elements/' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Unit tests for the Preferences page.
*/

require('pages/preferences/Preferences.ts');
require('pages/preferences-page/preferences-page.controller.ts');

describe('Preferences Controller', function() {
describe('PreferencesCtrl', function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ oppia.controller('Preferences', [
$scope.showEditProfilePictureModal = function() {
$uibModal.open({
templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(
'/pages/preferences/edit_profile_picture_modal_directive.html'),
'/pages/preferences-page/modal-templates/' +
'edit-profile-picture-modal.directive.html'),
backdrop: true,
controller: [
'$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Unit tests for the editor prerequisites page.
*/

require('pages/signup/Signup.ts');
require('pages/signup-page/signup-page.controller.ts');

describe('Signup controller', function() {
describe('SignupCtrl', function() {
Expand Down
Loading

0 comments on commit ee776a4

Please sign in to comment.