From d1039e16d53d60c95dd66b3b6a2c1faefef51ff0 Mon Sep 17 00:00:00 2001 From: llj Date: Fri, 15 Mar 2013 16:57:33 +0800 Subject: [PATCH] [wiki] improved ui & fixed bugs --- group/templates/group/group_wiki.html | 102 +++++++++----------- group/templates/group/group_wiki_pages.html | 61 ++++-------- group/views.py | 9 +- media/css/seahub.css | 41 ++++---- 4 files changed, 91 insertions(+), 122 deletions(-) diff --git a/group/templates/group/group_wiki.html b/group/templates/group/group_wiki.html index c994971672..b81319940e 100644 --- a/group/templates/group/group_wiki.html +++ b/group/templates/group/group_wiki.html @@ -7,7 +7,6 @@ {% block title_panel %} -
{% grp_avatar group.props.id 24 %}{{ group.group_name }} @@ -25,65 +24,52 @@ {% endblock %} {% block main_panel %} -
-{% if not wiki_exists %} -
-

{% trans "This group currently has no wiki" %}

-

Wiki is a normal library with pre-defined file/folder structure. It enables group members to manage project documents or take notes using a simplified markup language called Markdown.{% trans "Create Wiki Now." %}

-
-
-

{% trans "Create Wiki"%}

-
-
-
- -

- -
- -{% else %} - + {% if not wiki_exists %} +
+

{% trans "This group currently has no wiki" %}

+

{% trans "Wiki is a normal library with pre-defined file/folder structure. It enables group members to manage project documents or take notes using a simplified markup language called Markdown." %}

+ {% trans "Create Wiki Now" %} +
+
+

{% trans "Create Wiki"%}

+
+
+
+
+

+ +
- - - + {% else %} +
+ + + + +
-
-

{{ page|capfirst }}

-
-
- -
-

{% trans "New Page"%}

-
-
-

- -
-{% endif %} -
+
+

{{ page|capfirst }}

+
+
+
+

{% trans "New Page"%}

+
+
+

+ +
+ {% endif %} {% endblock main_panel %} -{% block left_panel %} - -{% endblock %} - - -{% block right_panel %} - -{% endblock %} - - - {% block extra_script %} {% endblock %} diff --git a/group/templates/group/group_wiki_pages.html b/group/templates/group/group_wiki_pages.html index 6fa23c251c..6bd3578066 100644 --- a/group/templates/group/group_wiki_pages.html +++ b/group/templates/group/group_wiki_pages.html @@ -5,72 +5,49 @@ {% block nav_group_class %}class="cur"{% endblock %} -{% block title_panel %} -{% endblock %} - {% block main_panel %}
+
+ {% grp_avatar group.props.id 24 %}{{ group.group_name }} +
-
- {% grp_avatar group.props.id 24 %} {{ group.group_name }} -
-
- +
+ + +
- +
    + {% for page in pages %} +
  • {{ page }}
  • + {% endfor %} +
-
-

Pages

-
- {% for page in pages %} - - {% endfor %} -
-
- -
+

{% trans "New Page"%}



- -
-
+ + {% endblock main_panel %} - -{% block left_panel %} - -{% endblock %} - - -{% block right_panel %} - -{% endblock %} - - - {% block extra_script %} {% endblock %} diff --git a/group/views.py b/group/views.py index dc7e792a32..132e2429a3 100644 --- a/group/views.py +++ b/group/views.py @@ -1138,7 +1138,7 @@ def convert_wiki_link(content, group, repo_id, username): (reverse('group_wiki', args=[group.id, linkname.replace('/', '-')]), linkname) token = web_get_access_token(repo_id, obj_id, 'view', username) - return '' % gen_file_get_url(token, filename) + return '%s' % (gen_file_get_url(token, filename), filename) else: from base.templatetags.seahub_tags import file_icon_filter @@ -1146,8 +1146,8 @@ def convert_wiki_link(content, group, repo_id, username): path = "/" + linkname icon = file_icon_filter(linkname) s = reverse('repo_view_file', args=[repo_id]) + '?p=' + path - a_tag = '''%s''' - return a_tag % (s, MEDIA_URL, icon, linkname) + a_tag = '''%s %s''' + return a_tag % (MEDIA_URL, icon, icon, s, linkname) return re.sub(r'\[\[(.+)\]\]', repl, content) @@ -1211,9 +1211,12 @@ def group_wiki_pages(request, group): if ext == '.md': pages.append(name) + is_staff = True if check_group_staff(group.id, request.user) else False + return render_to_response("group/group_wiki_pages.html", { "group": group, "pages": pages, + "is_staff": is_staff, }, context_instance=RequestContext(request)) @login_required diff --git a/media/css/seahub.css b/media/css/seahub.css index 6b130e45fd..9124439769 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -1745,7 +1745,8 @@ textarea:-moz-placeholder {/* for FF */ #md-view { width:756px; } -#md-view h2 { +#md-view h2, +#wiki-content h2 { border-bottom: 1px solid #ccc; } #svg-view { @@ -2016,31 +2017,35 @@ textarea:-moz-placeholder {/* for FF */ } /* wiki page */ -.wiki-nav li{ - display: inline-block; +.wiki-top { + text-align:right; + padding-bottom:8px; + border-bottom:1px solid #eee; } -#wiki-area.article { +.wiki-top .op-btn { + margin-left:3px; +} +.wiki-nav .item { + float:left; + font-size:15px; + margin:4px 5px 0 10px; +} +.wiki-nav .link { + font-weight:normal; +} +#wiki-area { padding: 0 0; } -#wiki-create-form { - width: 262px; -} -#wiki-create-form input[type="text"]{ - width: 100%; -} -#wiki-create-form textarea { - width: 100%; -} -#page-edit { - margin-right:6px; +#wiki-pages { + list-style-type:disc; + padding-left:2em; + margin-top:1.6em; } .wiki-page-missing { color:red; } -.wiki-link-icon { - margin: 0 3px -5px 0; -} +/* search */ .search-form { padding-left:5px; height:24px;