From 486bacede4f0002b9f1a814e8124bd3bb14639ec Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Wed, 12 Jun 2013 10:54:04 -0400 Subject: [PATCH] Clean up HTML structure in textbooks page --- cms/templates/js/textbook-edit.underscore | 48 ++++++++++++----------- cms/templates/js/textbook-show.underscore | 48 +++++++++++------------ cms/templates/textbooks.html | 5 +-- 3 files changed, 50 insertions(+), 51 deletions(-) diff --git a/cms/templates/js/textbook-edit.underscore b/cms/templates/js/textbook-edit.underscore index 07d12739f7..758b182b87 100644 --- a/cms/templates/js/textbook-edit.underscore +++ b/cms/templates/js/textbook-edit.underscore @@ -1,24 +1,26 @@ -<% if (errors) { %> -
- <%= errors %> +
+ <% if (errors) { %> +
+ <%= errors %> +
+ <% } %> + +
+ <%= gettext("Textbook information") %> +
+ + " value="<%= name %>"> + <%= gettext("the title/name of the text book as you would like your students to see it.") %> +
+
+
+ <%= gettext("Chapter(s) information") %> +
    +
    + +
    + + +
    -<% } %> - -
    - <%= gettext("Textbook information") %> -
    - - " value="<%= name %>"> - <%= gettext("the title/name of the text book as you would like your students to see it.") %> -
    -
    -
    - <%= gettext("Chapter(s) information") %> -
      -
      - -
      - - - -
      +
      diff --git a/cms/templates/js/textbook-show.underscore b/cms/templates/js/textbook-show.underscore index 260d8a51e7..140340eab4 100644 --- a/cms/templates/js/textbook-show.underscore +++ b/cms/templates/js/textbook-show.underscore @@ -1,25 +1,23 @@ -
    1. - <%= name %> - <% if(chapters.length > 1) {%> - - - <%= chapters.length %> PDF Chapters - - <% } else if(chapters.length === 1) { %> - <%= chapters.at(0).get("asset_path") %> - <% } %> - <%= gettext("view in course") %> - - - <% if(showChapters) { %> -
      -
        - <% chapters.each(function(chapter) { %> -
      1. <%= chapter.get('name') %> - <%= chapter.get('asset_path') %> -
      2. - <% }) %> -
      - <% } %> -
    2. +<%= name %> +<% if(chapters.length > 1) {%> + + + <%= chapters.length %> PDF Chapters + +<% } else if(chapters.length === 1) { %> + <%= chapters.at(0).get("asset_path") %> +<% } %> +<%= gettext("view in course") %> + + +<% if(showChapters) { %> +
      +
        + <% chapters.each(function(chapter) { %> +
      1. <%= chapter.get('name') %> + <%= chapter.get('asset_path') %> +
      2. + <% }) %> +
      +<% } %> diff --git a/cms/templates/textbooks.html b/cms/templates/textbooks.html index 528f9bc510..0aad59ac19 100644 --- a/cms/templates/textbooks.html +++ b/cms/templates/textbooks.html @@ -72,6 +72,7 @@ CMS.Views.TextbookShow = Backbone.View.extend({ this.template = _.template($("#show-textbook-tpl").text()); this.listenTo(this.model, "change", this.render); }, + tagName: "li", events: { "click .edit": "editTextbook", "click .delete": "removeSelf", @@ -108,9 +109,7 @@ CMS.Views.TextbookEdit = Backbone.View.extend({ this.listenTo(chapters, "all", this.render); this.listenTo(this.model.collection, "editOne", this.remove); }, - tagName: "form", - className: "edit-textbook", - id: "edit_textbook_form", + tagName: "li", render: function() { this.$el.html(this.template({ name: this.model.escape('name'),