Commits

Jacob Moen  committed 875960f

Added cancel button to edit form, adjusted school_book style (the default style) and started thinking about image uploads.

  • Participants
  • Parent commits e9dc6be

Comments (0)

Files changed (5)

File protected/modules/wiki/assets/images/imgupload.png

Added
New image

File protected/modules/wiki/assets/styles/school_book.css

   background: scroll 0 0 #f6f6ae url(./school_book.png);
   border-top: solid 2px #d2e8b9;
   border-bottom: solid 1px #d2e8b9;
+  border-left: none;
+  color: #222;
+
+  /*FIXME: should this be an option? */
+  white-space: pre-wrap;
 }
 
 pre .keyword,

File protected/modules/wiki/assets/wiki.css

 }
 
 .wiki-text {
+    background: #fff;
 	min-height: 400px;
 }
 
     color: #207861;
 }
 
+.wiki-text a {
+    color: rgb(0, 102, 204);
+}
+
+.wiki-text a:hover {
+    text-decoration: underline;
+}
+
 .wiki-diff {
 	font-family: monospace;
 	white-space: pre;
     text-decoration:none;
 }
 .markItUp  {
-    width:700px;
+    width:99%;
     margin:5px 0 5px 0;
     border:5px solid #F5F5F5;
 }
 .markItUpContainer  {
     border:1px solid #3C769D;
-    background:#FFF url(images/bg-container.png) repeat-x top left;
     padding:5px 5px 2px 5px;
     font:11px Verdana, Arial, Helvetica, sans-serif;
 }
 .markItUpEditor {
     font:12px 'Courier New', Courier, monospace;
     padding:5px 5px 5px 35px;
-    border:3px solid #3C769D;
-    width:643px;
-    height:320px;
-    background:#FFF url(images/bg-editor.png) no-repeat;
+    border:1px solid #3C769D;
+    width:99%;
+    height:auto;
     clear:both;
     line-height:18px;
     overflow:auto;
 .markItUpPreviewFrame   {
     overflow:auto;
     background-color:#FFFFFF;
-    border:1px solid #3C769D;
     width:99.9%;
     height:300px;
     margin:5px 0;
     list-style:none;
     float:left;
     position:relative;
+    height: 20px;
 }
 .markItUpHeader ul li ul{
     display:none;
     background-image:url(images/picture.png);
 }
 .markItUp .markItUpButton12 a {
+    background-image:url(images/imgupload.png);
+}
+.markItUp .markItUpButton13 a {
     background-image:url(images/link.png);
 }
-.markItUp .markItUpButton13 a {
+.markItUp .markItUpButton14 a {
     background-image:url(images/url.png);
 }
 
-.markItUp .markItUpButton14 a   {
+.markItUp .markItUpButton15 a   {
     background-image:url(images/code.png);
 }
 
 .markItUp .preview a {
     background-image:url(images/preview.png);
-}
+}

File protected/modules/wiki/assets/wiki.js

         {separator:'---------------' },
         {name:'Bold', key:'B', openWith:"**", closeWith:"**"},
         {name:'Italic', key:'I', openWith:"//", closeWith:"//"},
-        {name:'Monospace', openWith:'{{{', closeWith:'}}}'},
+        {name:'Monospace', key:'M', openWith:'{{{', closeWith:'}}}'},
         {separator:'---------------' },
         {name:'Bulleted list', openWith:'(!(* |!|*)!)'},
         {name:'Numeric list', openWith:'(!(# |!|#)!)'},
         {separator:'---------------' },
-        {name:'Picture', key:"P", replaceWith:'{{[![Url:!:http://]!]|[![name]!]}}'},
-        {name:'Link', key:"L", openWith:"[[", closeWith:']]', placeHolder:'Your text to link here...' },
-        {name:'Url', openWith:"[[[![Url:!:http://]!]|", closeWith:']]', placeHolder:'Your text to link here...' },
+        {name:'Insert Image', replaceWith:'{{[![Url:!:http://]!]|[![name]!]}}'},
+        {name:'Upload Image', replaceWith:'{{[![Url:!:http://]!]|[![name]!]}}'},
+        {name:'Wiki Link', key:"L", openWith:"[[", closeWith:']]', placeHolder:'Your text to link here...' },
+        {name:'External Link', openWith:"[[[![Url:!:http://]!]|", closeWith:']]', placeHolder:'Your text to link here...' },
         {separator:'---------------' },
         {name:'Code', openWith:'(!(|:pre code [![Language:!:cpp]!]:|{{{|!|)!)\n', closeWith:'\n}}}\n'},
         {separator:'---------------' },
         {name:'Preview', call:'preview', className:'preview'}
     ]
-	}
+	};
+
+    function markitupimageupload(){
+        $('#mymodal').dialog('open');
+    }
 
 	$('#edit-page-form textarea').markItUp(settings);
 });

File protected/modules/wiki/views/default/edit.php

-<h1><?php echo CHtml::encode($page->getWikiUid())?></h1>
+<?php
+    $this->breadcrumbs=array(
+        'Wiki'=>array('/wiki'),
+        str_replace('_', ' ', $page->getWikiUid()) => array('/wiki/default/view', 'uid'=>$page->getWikiUid()),
+        );
+?>
 
-<?php echo CHtml::beginForm('', 'post', array('id' => 'edit-page-form'))?>
 <div>
-<?php echo CHtml::activeTextArea($page, 'content')?>
+    <div class="wiki-controls">
+        <?php echo CHtml::link(Yii::t('wiki', 'View Page'), array('view', 'uid' => $page->getWikiUid()))?>
+
+        <?php echo CHtml::link(Yii::t('wiki', 'History'), array('history', 'uid' => $page->getWikiUid()))?>
+
+        <?php if($this->module->user->isGuest): ?>
+            <?php echo CHtml::link(Yii::t('wiki', 'Wiki Login'), array('wikilogin'))?>
+        <?php else: ?>
+            <?php echo CHtml::link(Yii::t('wiki', 'Wiki Logout'), array('wikilogout'))?>
+        <?php endif; ?>
+    </div>
+
+    <div class="wiki-text">
+            <h1><?php echo CHtml::encode($page->getWikiUid())?></h1>
+
+            <?php echo CHtml::beginForm('', 'post', array('id' => 'edit-page-form'))?>
+            <div>
+            <?php echo CHtml::activeTextArea($page, 'content')?>
+            </div>
+            <div>
+                <?php echo CHtml::label(Yii::t('wiki', 'Change summary'), CHtml::getIdByName('comment'))?>: <?php echo CHtml::textField('comment', $comment)?>
+            </div>
+            <div>
+            <?php echo CHtml::submitButton(Yii::t('wiki', 'Save'))?>
+            <?php echo CHtml::Button(Yii::t('wiki', 'Cancel'), array('submit' => Yii::app()->request->getUrlReferrer())); ?>
+            </div>
+            <?php echo CHtml::endForm()?>
+    </div>
+
+    <div class="wiki-controls">
+                <?php echo CHtml::link(Yii::t('wiki', 'View Page'), array('view', 'uid' => $page->getWikiUid()))?>
+
+                <?php echo CHtml::link(Yii::t('wiki', 'History'), array('history', 'uid' => $page->getWikiUid()))?>
+
+                <?php echo CHtml::link(Yii::t('wiki', 'Page Index'), array('pageIndex'))?>
+
+                <?php if($this->module->user->isGuest): ?>
+                    <?php echo CHtml::link(Yii::t('wiki', 'Wiki Login'), array('wikilogin'))?>
+                <?php else: ?>
+                    <?php echo CHtml::link(Yii::t('wiki', 'Wiki Logout'), array('wikilogout'))?>
+                <?php endif; ?>
+    </div>
 </div>
-<div>
-	<?php echo CHtml::label(Yii::t('wiki', 'Change summary'), CHtml::getIdByName('comment'))?>: <?php echo CHtml::textField('comment', $comment)?>
-</div>
-<div>
-<?php echo CHtml::submitButton(Yii::t('wiki', 'Save'))?>
-</div>
-<?php echo CHtml::endForm()?>