Commit b45ffa11 by muzaffaryousaf

Changing the createNew teams-tab.js method to use the viewWithHeader.

TNL-2964
parent 28fddda4
...@@ -654,7 +654,7 @@ class TeamFormActions(TeamsTabBase): ...@@ -654,7 +654,7 @@ class TeamFormActions(TeamsTabBase):
title='Create a New Team', title='Create a New Team',
description='Create a new team if you can\'t find existing teams to ' description='Create a new team if you can\'t find existing teams to '
'join, or if you would like to learn with friends you know.', 'join, or if you would like to learn with friends you know.',
breadcrumbs=self.topic['name'] breadcrumbs='All Topics {topic_name}'.format(topic_name=self.topic['name'])
) )
def verify_and_navigate_to_edit_team_page(self): def verify_and_navigate_to_edit_team_page(self):
......
...@@ -194,27 +194,31 @@ ...@@ -194,27 +194,31 @@
* Render the create new team form. * Render the create new team form.
*/ */
newTeam: function (topicID) { newTeam: function (topicID) {
var self = this; var self = this,
this.getTeamsView(topicID).done(function (teamsView) { createViewWithHeader;
self.mainView = new ViewWithHeader({ this.getTopic(topicID).done(function (topic) {
header: new HeaderView({ var view = new TeamEditView({
model: new TeamsHeaderModel({
description: gettext("Create a new team if you can't find existing teams to join, or if you would like to learn with friends you know."),
title: gettext("Create a New Team"),
breadcrumbs: [
{
title: teamsView.main.teamParams.topicName,
url: '#topics/' + teamsView.main.teamParams.topicID
}
]
})
}),
main: new TeamEditView({
action: 'create', action: 'create',
teamEvents: self.teamEvents, teamEvents: self.teamEvents,
teamParams: teamsView.main.teamParams teamParams: {
}) courseID: self.courseID,
topicID: topic.get('id'),
teamsUrl: self.teamsUrl,
topicName: topic.get('name'),
languages: self.languages,
countries: self.countries,
teamsDetailUrl: self.teamsDetailUrl
}
});
createViewWithHeader = self.createViewWithHeader({
mainView: view,
subject: {
name: gettext("Create a New Team"),
description: gettext("Create a new team if you can't find existing teams to join, or if you would like to learn with friends you know.")
},
parentTopic: topic
}); });
self.mainView = createViewWithHeader;
self.render(); self.render();
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment