]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/question.html
Reverts some changes in a previous commit.
[osqa.git] / forum / skins / default / templates / question.html
index a9a170608a036ac8df4d873040d8ff655adf3eab..1173ce94726a36782af95cde7057fcc7e1d2d0c8 100644 (file)
@@ -8,12 +8,14 @@
 {% load humanize %}\r
 {% load i18n %}\r
 {% load cache %}\r
 {% load humanize %}\r
 {% load i18n %}\r
 {% load cache %}\r
-{% block metadescription %}{{question.summary}}{% endblock %}\r
+{% block metadescription %}{{ question.meta_description }}{% endblock %}\r
 {% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}\r
 {% block metakeywords %}{{question.tagname_meta_generator}}{% endblock %}\r
-{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}\r
-{% block forejs %}\r
+{% block meta %}\r
         <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />\r
         <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ question.get_absolute_url }}?type=rss">\r
         <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}" />\r
         <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ question.get_absolute_url }}?type=rss">\r
+{% endblock %}\r
+{% block title %}{% spaceless %}{{ question.headline }}{% endspaceless %}{% endblock %}\r
+{% block forejs %}\r
         {% if not question.nis.closed %}\r
         <script type='text/javascript' src='{% media  "/media/js/wmd/showdown.js" %}'></script>\r
         <script type='text/javascript' src='{% media  "/media/js/wmd/wmd.js" %}'></script>\r
         {% if not question.nis.closed %}\r
         <script type='text/javascript' src='{% media  "/media/js/wmd/showdown.js" %}'></script>\r
         <script type='text/javascript' src='{% media  "/media/js/wmd/wmd.js" %}'></script>\r
                 $('#previewer').toggle();\r
                 $('#pre-collapse').text(txt);\r
             });\r
                 $('#previewer').toggle();\r
                 $('#pre-collapse').text(txt);\r
             });\r
-\r
         });\r
 \r
         });\r
 \r
+        function submitClicked(e, f) {\r
+            if(!(browserTester('chrome') || browserTester('safari'))) {\r
+                $("input.submit")[0].disabled=true;\r
+            }\r
+            window.removeEventListener('beforeunload', beforeUnload, true);\r
+            if (f) {\r
+                f.submit();\r
+            }\r
+        }\r
+\r
         function beforeUnload(e) {\r
         function beforeUnload(e) {\r
+\r
             if($("textarea#editor")[0].value != "") {\r
             if($("textarea#editor")[0].value != "") {\r
-               yourWorkWillBeLost(e);\r
+                return yourWorkWillBeLost(e);\r
             }\r
 \r
             }\r
 \r
-            $("textarea.commentBox").each(function() {\r
-               if(this.value != "") {\r
-                   yourWorkWillBeLost(e);\r
-               }\r
-            });\r
-\r
-            return false;\r
+            var commentBoxes = $("textarea.commentBox");\r
+            for(var index = 0; index < commentBoxes.length; index++) {\r
+                if(commentBoxes[index].value != "") {\r
+                    return yourWorkWillBeLost(e);\r
+                }\r
+            }\r
         }\r
         window.addEventListener('beforeunload', beforeUnload, true);\r
         }\r
         window.addEventListener('beforeunload', beforeUnload, true);\r
-\r
-        function submitClicked() {\r
-             window.removeEventListener('beforeunload', beforeUnload, true);\r
-             $("input.submit").each(function() {\r
-                 this.disabled=true;\r
-             });\r
-         }\r
-\r
-         </script>\r
+        </script>\r
         <noscript>\r
             <style>\r
                 .comment.not_top_scorer {\r
         <noscript>\r
             <style>\r
                 .comment.not_top_scorer {\r
                                             {% trans "toggle preview" %}\r
                                     </span>\r
                                 </td>\r
                                             {% trans "toggle preview" %}\r
                                     </span>\r
                                 </td>\r
+                                <td style="text-align: right;" id="editor-metrics"></td>\r
                                 {% if settings.WIKI_ON %}\r
                                 <td style="text-align:right;">\r
                                     {{ answer.wiki }} \r
                                 {% if settings.WIKI_ON %}\r
                                 <td style="text-align:right;">\r
                                     {{ answer.wiki }} \r
                     <div id="previewer" class="wmd-preview"></div>                    \r
                 </div>\r
                 <p><span class="form-error"></span></p>\r
                     <div id="previewer" class="wmd-preview"></div>                    \r
                 </div>\r
                 <p><span class="form-error"></span></p>\r
-                <input type="submit"\r
+                <input type="button"\r
                     {% if user.is_anonymous %}\r
                         value="{% trans "Login/Signup to Post Your Answer" %}" \r
                     {% else %}\r
                     {% if user.is_anonymous %}\r
                         value="{% trans "Login/Signup to Post Your Answer" %}" \r
                     {% else %}\r
                         value="{% trans "Answer the question" %}" \r
                         {% endif %}\r
                     {% endif %}\r
                         value="{% trans "Answer the question" %}" \r
                         {% endif %}\r
                     {% endif %}\r
-                    class="submit" style="float:left" onclick="submitClicked()" />\r
+                    class="submit" style="float:left" onclick="submitClicked(event, this.form)"/>\r
             {% endif %}\r
         </form>\r
     </div>\r
             {% endif %}\r
         </form>\r
     </div>\r