1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 01:44:13 +00:00

[enable module] improved ui, fixed bug for wiki

This commit is contained in:
llj
2013-10-12 13:49:02 +08:00
parent 8835cfa156
commit bd71a756a9
6 changed files with 28 additions and 14 deletions

View File

@@ -2615,3 +2615,10 @@ textarea:-moz-placeholder {/* for FF */
#search-repo-form input[type=text] {
margin: 4px 4px;
}
#enable-mods {
color:#888;
}
#enable-mods:hover {
color:#666;
text-decoration:none;
}

View File

@@ -1,14 +1,15 @@
{% load i18n %}
<form id="mods-enable-form" method="post" action="{% url 'group_toggle_modules' group.id %}" class="hide">{% csrf_token%}
<h3>{% trans "Available Modules"%}</h3>
<div>
<h3>{% trans "Enable Modules"%}</h3>
<ul>
{% for mod in mods_available %}
{% if mod == 'group wiki' %}
<span><input type="checkbox" name="group_wiki" {%if mod in mods_enabled%}checked {% endif%}/></span>
<span>{% trans "Wiki" %}</span>
<li>
<input class="vam" type="checkbox" name="group_wiki" {%if mod in mods_enabled%}checked {% endif%}/></span>
<span class="vam">{% trans "Wiki" %}</span>
</li>
{% endif %}
{% endfor %}
</div>
</ul>
<input type="submit" id="mods-enable-submit" value="{% trans "Submit"%}" class="submit"/>
</form>

View File

@@ -24,7 +24,7 @@
{% if is_staff %}
<li class="tabnav-tab {% if cur == 'admin'%}tabnav-tab-cur{%endif%}"><a href="{% url 'group_manage' group.id %}">{% trans "Admin" %}</a></li>
<li class="tabnav-tab"><a id="enable-mods" href="#"><img src="{{MEDIA_URL}}img/calcplus-16.png" title="{% trans "Available Modules" %}" alt="{% trans "Available Modules"%}" /></a></li>
<li class="tabnav-tab"><a id="enable-mods" href="#" title="{% trans "Enable Modules" %}"><span class="icon-ellipsis-horizontal"></span></a></li>
{% endif %}
</ul>

View File

@@ -1,14 +1,15 @@
{% load i18n %}
<form id="mods-enable-form" method="post" action="{% url 'toggle_modules' %}" class="hide">{% csrf_token%}
<h3>{% trans "Available Modules"%}</h3>
<div>
<h3>{% trans "Enable Modules"%}</h3>
<ul>
{% for mod in mods_available %}
{% if mod == 'personal wiki' %}
<span><input type="checkbox" name="personal_wiki" {%if mod in mods_enabled%}checked {% endif%}/></span>
<span>{% trans "Personal Wiki" %}</span>
<li>
<input class="vam" type="checkbox" name="personal_wiki" {%if mod in mods_enabled%}checked {% endif%}/>
<span class="vam">{% trans "Personal Wiki" %}</span>
</li>
{% endif %}
{% endfor %}
</div>
</ul>
<input type="submit" id="mods-enable-submit" value="{% trans "Submit"%}" class="submit"/>
</form>

View File

@@ -1,2 +1,2 @@
{% load i18n %}
<li class="tabnav-tab"><a id="enable-mods" href="#"><img src="{{MEDIA_URL}}img/calcplus-16.png" title="{% trans "Available Modules" %}" alt="{% trans "Available Modules"%}" /></a></li>
<li class="tabnav-tab"><a id="enable-mods" href="#" title="{% trans "Enable Modules" %}"><span class="icon-ellipsis-horizontal"></span></a></li>

View File

@@ -46,8 +46,13 @@ def personal_wiki(request, page_name="home"):
content, repo, dirent = get_personal_wiki_page(username, page_name)
except WikiDoesNotExist:
wiki_exists = False
# get available modules(wiki, etc)
mods_available = get_available_mods_by_user(username)
mods_enabled = get_enabled_mods_by_user(username)
return render_to_response("wiki/personal_wiki.html", {
"wiki_exists": wiki_exists,
"mods_enabled": mods_enabled,
"mods_available": mods_available,
}, context_instance=RequestContext(request))
except WikiPageMissing:
repo = get_personal_wiki_repo(username)