Commits

Luke Plant committed 38747ae

Beginnings of 'Inner row' and 'Inner column' commands, and frontend changes to make them work.

  • Participants
  • Parent commits f38216d

Comments (0)

Files changed (3)

File semanticeditor/media/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

     if (elem.prev().is("p.newcol") && command.name == 'newrow') {
         elem = elem.prev();
     }
+    // Inner row should appear before inner col
+    if (elem.prev().is("p.newinnercol") && command.name == 'newinnerrow') {
+        elem = elem.prev();
+    }
     elem.before(newelem);
     var newId = this.commandBlockId(sectId, command);
     newelem.attr('id', newId);

File semanticeditor/media/semanticeditor/wymeditor/iframe/default/wymiframe.css

       content:" New column";
   }
 
-  p.newrow, p.newcol {
+  p.newinnerrow:after {
+      content:" Inner row";
+  }
+
+  p.newinnercol:after {
+      content:" Inner column";
+  }
+
+  p.newrow, p.newcol, p.newinnerrow, p.newinnercol {
       background-color: #ffffff;
       color: #adc8ad;
       font-weight: bold;

File semanticeditor/utils/presentation.py

 
 """)
 
-COMMANDS = [NEWROW, NEWCOL]
+NEWINNERROW = PresentationCommand('newinnerrow',
+                                  verbose_name="Inner row",
+                                  description="""
+<p>Use this command to start a nested, inner row within an existing column
+structure.</p>
+
+<p>This must be used in conjunction with 'Inner column'
+to create a column layout.</p>
+
+"""
+                                  )
+
+NEWINNERCOL = PresentationCommand('newinnercol',
+                                  verbose_name="Inner column",
+                                  description="""
+<p>Use this command to start a new inner column, after an 'Inner row' command
+has been used to start a set of nested columns.</p>
+
+""")
+
+COMMANDS = [NEWROW, NEWCOL, NEWINNERROW, NEWINNERCOL]
 
 ## General utilities