mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-01 15:23:05 +00:00
[wiki] modification
This commit is contained in:
parent
c40b67b297
commit
7184b6502f
@ -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;
|
||||
|
@ -73,15 +73,15 @@
|
||||
</ul>
|
||||
|
||||
{% if repo_perm == 'rw' %}
|
||||
<button id="page-create" class="op-btn">{% trans "New Page" %}</button>
|
||||
<button id="page-delete" class="op-btn" data-url="{% url 'group_wiki_page_delete' group.id page %}">{% trans "Delete Page" %}</button>
|
||||
<button id="page-edit" class="op-btn">{% trans "Edit Page" %}</button>
|
||||
<button id="page-history" class="op-btn">{% trans "Page History" %}</button>
|
||||
<button id="page-create" class="btn-white">{% trans "New Page" %}</button>
|
||||
<button id="page-delete" class="btn-white" data-url="{% url 'group_wiki_page_delete' group.id page %}">{% trans "Delete Page" %}</button>
|
||||
<a class="sf-btn-link btn-white" href="{% url 'group_wiki_page_edit' group.id page %}">{% trans "Edit Page" %}</a>
|
||||
<a class="sf-btn-link btn-white" href="{% url 'file_revisions' repo_id %}?p={{path|urlencode}}" target="_blank">{% trans "Page History" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="wiki-area" class="article">
|
||||
<h1>{{ page|capfirst }}</h1>
|
||||
<h1 class="bold">{{ page|capfirst }}</h1>
|
||||
<div id="wiki-content"></div><!--content will be offered by js-->
|
||||
<p id="wiki-last-modified">{% blocktrans with modifier=latest_contributor|email2nickname modify_time=last_modified|translate_seahub_time %}Last modified by {{modifier}}, {{modify_time}}{% endblocktrans %}</p>
|
||||
</div>
|
||||
@ -91,7 +91,7 @@
|
||||
<label for="page-name">{% trans "Name"%}</label><br/>
|
||||
<input id="page-name" type="text" name="page_name" value="" maxlength="{{max_file_name}}" class="input" /><br />
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" id="page-create-submit" value="{% trans "Submit"%}" class="submit"/>
|
||||
<input type="submit" value="{% trans "Submit"%}" class="submit" />
|
||||
</form>
|
||||
{% 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 () {
|
||||
|
@ -15,7 +15,7 @@
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% if repo_perm == 'rw' %}
|
||||
<button id="page-create" class="op-btn">{% trans "New Page" %}</button>
|
||||
<button id="page-create" class="btn-white">{% trans "New Page" %}</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@ -30,14 +30,21 @@
|
||||
<label for="page-name">{% trans "Name"%}</label><br/>
|
||||
<input id="page-name" type="text" name="page_name" value="" maxlength="{{max_file_name}}" class="input" /><br />
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" id="page-create-submit" value="{% trans "Submit"%}" class="submit" />
|
||||
<input type="submit" value="{% trans "Submit"%}" class="submit" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_script %}{{block.super}}
|
||||
<script type="text/javascript">
|
||||
$('#page-create').click(function() {
|
||||
$('#page-create-form').modal({appendTo: '#main', autoResize: true});
|
||||
})
|
||||
$('#page-create-form').modal({appendTo: '#main'});
|
||||
$('#simplemodal-container').css({'height':'auto'});
|
||||
});
|
||||
$('#page-create-form').submit(function() {
|
||||
var page_name = $.trim($('[name="page_name"]', $(this)).val());
|
||||
if (!page_name) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
{% block cur_personal_wiki %}tab-cur{% endblock %}
|
||||
|
||||
{% comment %}
|
||||
{% block left_panel %}
|
||||
{{ block.super }}
|
||||
{% if wiki_exists %}
|
||||
@ -25,6 +26,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endcomment %}
|
||||
|
||||
{% block right_panel %}
|
||||
{% if not wiki_exists %}
|
||||
@ -49,7 +51,7 @@
|
||||
<form id="wiki-use-lib-form" action="{% url 'personal_wiki_use_lib' %}" method="post" class="file-choose-form hide">{% csrf_token %}
|
||||
<h3 id="dialogTitle">{% trans "Choose a library as wiki:" %}</h3>
|
||||
<div class="dir-tree-cont">
|
||||
<div id="repos-dirs"></div>
|
||||
<div id="repos-dirs"></div>
|
||||
</div>
|
||||
<input type="hidden" name="dst_repo" value="" />
|
||||
<p class="error hide">{% trans "Please click and choose a library."%}</p>
|
||||
@ -65,14 +67,14 @@
|
||||
<li class="item"><a href="{% url 'repo_history' repo_id %}" target="_blank" class="link">{% trans "Wiki History" %}</a></li>
|
||||
</ul>
|
||||
|
||||
<button id="page-create" class="op-btn">{% trans "New Page" %}</button>
|
||||
<button id="page-delete" class="op-btn" data-url="{% url 'personal_wiki_page_delete' page %}">{% trans "Delete Page" %}</button>
|
||||
<button id="page-edit" class="op-btn">{% trans "Edit Page" %}</button>
|
||||
<button id="page-history" class="op-btn">{% trans "Page History" %}</button>
|
||||
<button id="page-create" class="btn-white">{% trans "New Page" %}</button>
|
||||
<button id="page-delete" class="btn-white" data-url="{% url 'personal_wiki_page_delete' page %}">{% trans "Delete Page" %}</button>
|
||||
<a class="sf-btn-link btn-white" href="{% url 'personal_wiki_page_edit' page %}">{% trans "Edit Page" %}</a>
|
||||
<a class="sf-btn-link btn-white" href="{% url 'file_revisions' repo_id %}?p={{path|urlencode}}" target="_blank">{% trans "Page History" %}</a>
|
||||
</div>
|
||||
|
||||
<div id="wiki-area" class="article">
|
||||
<h1>{{ page|capfirst }}</h1>
|
||||
<h1 class="bold">{{ page|capfirst }}</h1>
|
||||
<div id="wiki-content"></div><!--content will be offered by js-->
|
||||
<p id="wiki-last-modified">{% blocktrans with modifier=latest_contributor|email2nickname modify_time=last_modified|translate_seahub_time %}Last modified by {{modifier}}, {{modify_time}}{% endblocktrans %}
|
||||
</p>
|
||||
@ -83,7 +85,7 @@
|
||||
<label for="page-name">{% trans "Name"%}</label><br/>
|
||||
<input id="page-name" type="text" name="page_name" value="" maxlength="{{max_file_name}}" class="input" /><br />
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" id="page-create-submit" value="{% trans "Submit"%}" class="submit"/>
|
||||
<input type="submit" value="{% trans "Submit"%}" class="submit" />
|
||||
</form>
|
||||
{% 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 %}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -14,7 +14,7 @@
|
||||
<li class="item cur-item"><a href="{% url 'personal_wiki_pages' %}" class="link">{% trans "Pages" %}</a></li>
|
||||
<li class="item"><a href="{% url 'repo_history' repo_id %}" target="_blank" class="link">{% trans "Wiki History" %}</a></li>
|
||||
</ul>
|
||||
<button id="page-create" class="op-btn">{% trans "New Page" %}</button>
|
||||
<button id="page-create" class="btn-white">{% trans "New Page" %}</button>
|
||||
</div>
|
||||
|
||||
<ul id="wiki-pages">
|
||||
@ -28,14 +28,21 @@
|
||||
<label for="page-name">{% trans "Name"%}</label><br/>
|
||||
<input id="page-name" type="text" name="page_name" value="" maxlength="{{max_file_name}}" class="input" /><br />
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" id="page-create-submit" value="{% trans "Submit"%}" class="submit" />
|
||||
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_script %}{{block.super}}
|
||||
<script type="text/javascript">
|
||||
$('#page-create').click(function() {
|
||||
$('#page-create-form').modal({appendTo: '#main', autoResize: true});
|
||||
$('#page-create-form').modal({appendTo: '#main'});
|
||||
$('#simplemodal-container').css({'height':'auto'});
|
||||
})
|
||||
$('#page-create-form').submit(function() {
|
||||
var page_name = $.trim($('[name="page_name"]', $(this)).val());
|
||||
if (!page_name) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user