diff --git a/media/css/seahub.css b/media/css/seahub.css index 720a7cd329..da1c09e370 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -1614,8 +1614,7 @@ button.sf-dropdown-toggle:focus { } .btn-white, .tabnav button, -.repo-file-list-topbar .op-btn, -.wiki-top .op-btn { +.repo-file-list-topbar .op-btn { height:29px; background:#fff; line-height:17px; @@ -2719,7 +2718,7 @@ button.sf-dropdown-toggle:focus { text-align:right; height:auto; } -.wiki-top .op-btn { +.wiki-top .btn-white { margin-left:3px; } .wiki-nav .item { @@ -2730,7 +2729,7 @@ button.sf-dropdown-toggle:focus { font-weight:normal; } #wiki-area { - padding: 0 0; + padding: 30px 0 0; } #wiki-last-modified { margin-top: 10px; diff --git a/seahub/group/templates/group/group_wiki.html b/seahub/group/templates/group/group_wiki.html index e0df8b0893..3f1c88d4b6 100644 --- a/seahub/group/templates/group/group_wiki.html +++ b/seahub/group/templates/group/group_wiki.html @@ -73,15 +73,15 @@ {% if repo_perm == 'rw' %} - - - - + + + {% trans "Edit Page" %} + {% trans "Page History" %} {% endif %}
-

{{ page|capfirst }}

+

{{ page|capfirst }}

{% blocktrans with modifier=latest_contributor|email2nickname modify_time=last_modified|translate_seahub_time %}Last modified by {{modifier}}, {{modify_time}}{% endblocktrans %}

@@ -91,7 +91,7 @@

- + {% endif %} @@ -124,36 +124,31 @@ $('#wiki-content') ); $('#page-create').click(function() { - $('#page-create-form').modal({appendTo: '#main', autoResize: true}); -}) - -$('#page-edit').click(function() { - location.href = "{% url 'group_wiki_page_edit' group.id page %}"; -}) - -$('#page-list').click(function () { - location.href = "{% url 'group_wiki_pages' group.id %}"; + $('#page-create-form').modal({appendTo: '#main'}); + $('#simplemodal-container').css({'height':'auto'}); }); - -$('#page-history').click(function () { - window.open("{% url 'file_revisions' repo_id %}" + "?p=" + "{{path|urlencode}}"); +$('#page-create-form').submit(function() { + var page_name = $.trim($('[name="page_name"]', $(this)).val()); + if (!page_name) { + return false; + } }); addConfirmTo($('#page-delete'), { 'title': "{% trans "Delete Page" %}", 'con': "{% trans "Are you sure you want to delete this page?" %}" }); -$('a.wiki-page-missing').each(function(){ - $(this).click(function() { - $('#page-name').val($(this).text()); - $('#page-create-form').modal({appendTo: '#main', autoResize: true}); - return false; - }); +$('a.wiki-page-missing').click(function() { + $('#page-create-form').modal({appendTo: '#main'}); + $('#simplemodal-container').css({'height':'auto'}); + $('#page-name').val($(this).text()); + return false; }); {% else %} $('#wiki-create').click(function() { - $('#wiki-create-form').modal({appendTo: '#main', autoResize: true}); + $('#wiki-create-form').modal({appendTo: '#main'}); + $('#simplemodal-container').css({'height':'auto'}); return false; }); $('#wiki-create-form').submit(function () { diff --git a/seahub/group/templates/group/group_wiki_pages.html b/seahub/group/templates/group/group_wiki_pages.html index 9a4ca57943..f00effbdc6 100644 --- a/seahub/group/templates/group/group_wiki_pages.html +++ b/seahub/group/templates/group/group_wiki_pages.html @@ -15,7 +15,7 @@ {% endif %} {% if repo_perm == 'rw' %} - + {% endif %} @@ -30,14 +30,21 @@

- + {% endblock %} {% block extra_script %}{{block.super}} {% endblock %} diff --git a/seahub/templates/wiki/personal_wiki.html b/seahub/templates/wiki/personal_wiki.html index 1a2845fcd7..b41e9901a6 100644 --- a/seahub/templates/wiki/personal_wiki.html +++ b/seahub/templates/wiki/personal_wiki.html @@ -7,6 +7,7 @@ {% block cur_personal_wiki %}tab-cur{% endblock %} +{% comment %} {% block left_panel %} {{ block.super }} {% if wiki_exists %} @@ -25,6 +26,7 @@ {% endif %} {% endblock %} +{% endcomment %} {% block right_panel %} {% if not wiki_exists %} @@ -49,7 +51,7 @@
{% csrf_token %}

{% trans "Choose a library as wiki:" %}

-
+

{% trans "Please click and choose a library."%}

@@ -65,14 +67,14 @@
  • {% trans "Wiki History" %}
  • - - - - + + + {% trans "Edit Page" %} + {% trans "Page History" %}
    -

    {{ page|capfirst }}

    +

    {{ page|capfirst }}

    {% blocktrans with modifier=latest_contributor|email2nickname modify_time=last_modified|translate_seahub_time %}Last modified by {{modifier}}, {{modify_time}}{% endblocktrans %}

    @@ -83,7 +85,7 @@

    - + {% endif %} @@ -116,36 +118,31 @@ $('#wiki-content') ); $('#page-create').click(function() { - $('#page-create-form').modal({appendTo: '#main', autoResize: true}); -}) - -$('#page-edit').click(function() { - location.href = "{% url 'personal_wiki_page_edit' page %}"; -}) - -$('#page-list').click(function () { - location.href = "{% url 'personal_wiki_pages' %}"; + $('#page-create-form').modal({appendTo: '#main'}); + $('#simplemodal-container').css({'height':'auto'}); }); - -$('#page-history').click(function () { - window.open("{% url 'file_revisions' repo_id %}" + "?p=" + "{{path|urlencode}}"); +$('#page-create-form').submit(function() { + var page_name = $.trim($('[name="page_name"]', $(this)).val()); + if (!page_name) { + return false; + } }); addConfirmTo($('#page-delete'), { 'title': "{% trans "Delete Page" %}", 'con': "{% trans "Are you sure you want to delete this page?" %}" }); -$('a.wiki-page-missing').each(function(){ - $(this).click(function() { - $('#page-name').val($(this).text()); - $('#page-create-form').modal({appendTo: '#main', autoResize: true}); - return false; - }); +$('a.wiki-page-missing').click(function() { + $('#page-create-form').modal({appendTo: '#main'}); + $('#simplemodal-container').css({'height':'auto'}); + $('#page-name').val($(this).text()); + return false; }); {% else %} $('#wiki-create').click(function() { - $('#wiki-create-form').modal({appendTo: '#main', autoResize: true}); + $('#wiki-create-form').modal({appendTo: '#main'}); + $('#simplemodal-container').css({'height':'auto'}); return false; }); $('#wiki-create-form').submit(function () { @@ -216,6 +213,7 @@ $('#wiki-use-lib-form').submit(function() { {% endif %} // END wiki_exists +{% comment %} {% if wiki_exists %} {% if wiki_index_exists %} $('#wiki-index-con').html(marked('{{ index_content|escapejs }}')); @@ -230,5 +228,6 @@ $('#create-index').click(function() { }); {% endif %} {% endif %} +{% endcomment %} {% endblock %} diff --git a/seahub/templates/wiki/personal_wiki_pages.html b/seahub/templates/wiki/personal_wiki_pages.html index fa6a9c710a..975e8d562b 100644 --- a/seahub/templates/wiki/personal_wiki_pages.html +++ b/seahub/templates/wiki/personal_wiki_pages.html @@ -14,7 +14,7 @@
  • {% trans "Pages" %}
  • {% trans "Wiki History" %}
  • - +