doortts doortts 2015-02-02
Board: Fix problems caused by the introduction of upgrade
- `requestHeader.getQueryString("readme")` can return `None` instead of null string.
- Now, markdown is rendered at serverside, so loading image doesn't disapear at view page.

This patch fix those problems.
@2e2725d97600a208eeccb5e5c2f40cee7f9fdb89
app/views/board/create.scala.html
--- app/views/board/create.scala.html
+++ app/views/board/create.scala.html
@@ -27,7 +27,7 @@
 @implicitField = @{ helper.FieldConstructor(simpleForm) }
 
 @readmeUpdateMessage = @{
-  if( requestHeader.getQueryString("readme") != null ) {
+  if( !requestHeader.getQueryString("readme").equals(None) ) {
       "Update README.md"
   }
 }
@@ -58,15 +58,14 @@
             @common.editor("body", preparedPostBody, "tabindex=2")
           </dd>
         </dl>
-
-        @** fileUploader **@
+          @** fileUploader **@
         @if(!UserApp.currentUser.isAnonymous) {
             @common.fileUploader(ResourceType.BOARD_POST, null)
         }
         @** end of fileUploader **@
 
         <div class="right-txt mt10 mb10">
-          @if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){
+          @if(isAllowedToNotice ){
           <label class="checkbox">
             <input type="checkbox" id="notice" name="notice">
             @Messages("post.notice.label")
@@ -74,9 +73,9 @@
           }
 
           @if(isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.COMMIT)){
-            @if(project.isGit && stringToBoolean(requestHeader.getQueryString("readme").get)){
+            @if(project.isGit && !requestHeader.getQueryString("readme").equals(None)){
             <label class="checkbox">
-              <input type="checkbox" id="readme" name="readme" @boolToCheckedString(requestHeader.getQueryString("readme"))>
+              <input type="checkbox" id="readme" name="readme" @boolToCheckedString(!requestHeader.getQueryString("readme").equals(None))>
               @Messages("post.readmefy")
             </label>
             }
app/views/board/view.scala.html
--- app/views/board/view.scala.html
+++ app/views/board/view.scala.html
@@ -61,9 +61,6 @@
             }
           </a>
         </div>
-            <div class="markdown-loader">
-                <i class="yobicon-loading2"></i> @Messages("common.loading")
-            </div>
     		<div class="content markdown-wrap">@Html(Markdown.render(post.body, post.asResource().getProject()))</div>
             <div class="attachments" id="attachments" data-attachments="@toJson(AttachmentApp.getFileList(ResourceType.BOARD_POST.toString(), post.id.toString()))"></div>
     	</div>
Add a comment
List