changeset 2720:0365115d5699

Merged thomaswaldmann/moin-2.0 into default
author Saurabh Kathpalia <saurabh.kathpalia95@gmail.com>
date Fri, 15 Aug 2014 00:13:56 +0530
parents ae9dc67fc056 (current diff) b8680cd6cf91 (diff)
children 81dd9e00bac1
files MoinMoin/items/__init__.py MoinMoin/themes/basic/static/css/theme.css MoinMoin/themes/basic/static/custom-less/theme.less MoinMoin/themes/basic/templates/layout.html MoinMoin/themes/foobar/templates/layout.html
diffstat 29 files changed, 162 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/admin/templates/admin/group_acl_report.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/apps/admin/templates/admin/group_acl_report.html	Fri Aug 15 00:13:56 2014 +0530
@@ -3,7 +3,7 @@
 {% block content %}
     <h1>{{ _("Group ACL Report") }}</h1>
     <h2>{{ _("Group Name") }}: {{ group_name }}</h2>
-    <table class="table table-hover tablesorter tablesorter-default moin-sortable" data-sortlist="[[0,0]]">
+    <table class="zebra table table-hover tablesorter tablesorter-default moin-sortable" data-sortlist="[[0,0]]">
         <thead>
             <tr>
                 <th>{{ _("Item Names") }}</th>
--- a/MoinMoin/apps/admin/templates/admin/groupbrowser.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/apps/admin/templates/admin/groupbrowser.html	Fri Aug 15 00:13:56 2014 +0530
@@ -2,7 +2,7 @@
 {% import "utils.html" as utils %}
 {% block content %}
     <h1>{{ _("Groups") }}</h1>
-    <table class="table table-hover tablesorter tablesorter-default moin-sortable" data-sortlist="[[0,0],[1,0]]">
+    <table class="zebra table table-hover tablesorter tablesorter-default moin-sortable" data-sortlist="[[0,0],[1,0]]">
         <thead>
             <tr>
                 <th>{{ _("Group Names") }}</th>
--- a/MoinMoin/apps/admin/templates/admin/item_acl_report.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/apps/admin/templates/admin/item_acl_report.html	Fri Aug 15 00:13:56 2014 +0530
@@ -2,7 +2,7 @@
 {% import "utils.html" as utils %}
 {% block content %}
     <h1>{{ _("Item ACL Report") }}</h1>
-    <table class="table table-hover tablesorter tablesorter-default moin-sortable" data-sortlist="[[0,0]]">
+    <table class="zebra table table-hover tablesorter tablesorter-default moin-sortable" data-sortlist="[[0,0]]">
         <thead>
             <tr>
                 <th>{{ _("Item Names") }}</th>
--- a/MoinMoin/apps/admin/templates/admin/user_acl_report.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/apps/admin/templates/admin/user_acl_report.html	Fri Aug 15 00:13:56 2014 +0530
@@ -3,7 +3,7 @@
 {% block content %}
     <h1>{{ _("User ACL Report") }}</h1>
     <h2>{{ _("User Names") }}: {{ user_names|join(', ') }}</h2>
-    <table class="table table-hover tablesorter tablesorter-default moin-sortable" data-sortlist="[[0,0],[1,0]]">
+    <table class="zebra table table-hover tablesorter tablesorter-default moin-sortable" data-sortlist="[[0,0],[1,0]]">
         <thead>
             <tr>
                 <th>{{ _("Item Names") }}</th>
--- a/MoinMoin/apps/admin/templates/user/itemsize.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/apps/admin/templates/user/itemsize.html	Fri Aug 15 00:13:56 2014 +0530
@@ -2,5 +2,5 @@
 {% extends theme("layout.html") %}
 {% block content %}
 <h1>{{ _("Item Sizes (last revision)") }}</h1>
-{{ utils.table(headings, rows, itemname_cols=[2]) }}
+{{ utils.table(headings, rows, filesize_cols=[1], itemname_cols=[2]) }}
 {% endblock %}
--- a/MoinMoin/constants/keys.py	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/constants/keys.py	Fri Aug 15 00:13:56 2014 +0530
@@ -57,6 +57,23 @@
 DATAID = u"dataid"
 WIKINAME = u"wikiname"
 CONTENT = u"content"
+IMMUTABLE_KEYS = [
+    ACTION,
+    ADDRESS,
+    DATAID,
+    EXTERNALLINKS,
+    ITEMID,
+    ITEMLINKS,
+    ITEMTRANSCLUSIONS,
+    MTIME,
+    NAME_OLD,
+    PARENTID,
+    REVID,
+    HASH_ALGORITHM,
+    SIZE,
+    USERID,
+    WIKINAME,
+]
 
 # magic REVID for current revision:
 CURRENT = u"current"
--- a/MoinMoin/items/__init__.py	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/items/__init__.py	Fri Aug 15 00:13:56 2014 +0530
@@ -48,8 +48,8 @@
 from MoinMoin.forms import RequiredText, OptionalText, JSON, Tags, Names
 from MoinMoin.constants.keys import (
     NAME, NAME_OLD, NAME_EXACT, WIKINAME, MTIME, ITEMTYPE,
-    CONTENTTYPE, SIZE, ACTION, ADDRESS, HOSTNAME, USERID, COMMENT,
-    HASH_ALGORITHM, ITEMID, REVID, DATAID, CURRENT, PARENTID, NAMESPACE,
+    CONTENTTYPE, SIZE, ACTION, ADDRESS, HOSTNAME, USERID, COMMENT, USERGROUP,
+    HASH_ALGORITHM, ITEMID, REVID, DATAID, CURRENT, PARENTID, NAMESPACE, IMMUTABLE_KEYS,
     UFIELDS_TYPELIST, UFIELDS, TRASH,
     ACTION_SAVE, ACTION_REVERT, ACTION_TRASH, ACTION_RENAME, TAGS, LATEST_REVS
 )
@@ -519,7 +519,7 @@
                 meta['acl'] = "None"
 
             self['meta_form'].set(meta, policy='duck')
-            for k in self['meta_form'].field_schema_mapping.keys():
+            for k in self['meta_form'].field_schema_mapping.keys() + IMMUTABLE_KEYS:
                 meta.pop(k, None)
             self['extra_meta_text'].set(item.meta_dict_to_text(meta))
             self['content_form']._load(item.content)
@@ -534,7 +534,8 @@
                       suitable as arguments of the same names to pass to
                       item.modify
             """
-            meta = self['meta_form'].value.copy()
+            meta = dict(item.meta)
+            meta.update(self['meta_form'].value.copy())
             meta.update(item.meta_text_to_dict(self['extra_meta_text'].value))
             data, contenttype_guessed = self['content_form']._dump(item.content)
             comment = self['comment'].value
@@ -592,7 +593,7 @@
             elif not meta.get(ITEMID):
                 meta[NAME] = [name]
 
-        if not meta.get(NAMESPACE):
+        if meta.get(NAMESPACE) is None:
             meta[NAMESPACE] = self.fqname.namespace
 
         if comment is not None:
@@ -760,13 +761,12 @@
             for name in item.meta[NAME]:
                 prefix = self.get_prefix_match(name, prefixes)
                 prefixlen = len(prefix)
-                if prefix:
-                    initial = name[prefixlen]
-                    if uppercase:
-                        initial = initial.upper()
-                    elif lowercase:
-                        initial = initial.lower()
-                    initials.add(initial)
+                initial = name[prefixlen]
+                if uppercase:
+                    initial = initial.upper()
+                elif lowercase:
+                    initial = initial.lower()
+                initials.add(initial)
         return sorted(list(initials))
 
     delete_template = 'delete.html'
--- a/MoinMoin/static/css/common.css	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/static/css/common.css	Fri Aug 15 00:13:56 2014 +0530
@@ -49,3 +49,30 @@
   display: none;
   visibility: hidden;
 }
+.one-col,
+.two-col,
+.three-col,
+.four-col {
+  display: block;
+  float: left;
+  padding-left: 0px;
+}
+.one-col li,
+.two-col li,
+.three-col li,
+.four-col li{
+  padding-bottom: 5px;
+  display: inline-block;
+}
+.one-col li{
+  width: 100%;
+}
+.two-col li{
+  width: 50%;
+}
+.three-col li{
+  width: 33%;
+}
+.four-col li{
+  width: 25%;
+}
--- a/MoinMoin/static/js/common.js	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/static/js/common.js	Fri Aug 15 00:13:56 2014 +0530
@@ -665,6 +665,17 @@
     moin.enhanceUserSettings();
     moin.enhanceEdit();
     $('.moin-sortable').tablesorter();
+
+    $('#moin-modify').on('change keyup keydown', 'input, textarea, select', function (e) {
+        $(this).addClass('moin-changed-input');
+    });
+
+    $(window).on('beforeunload', function() {
+        if ($('.moin-changed-input').length) {
+            return "Data you may have entered will be discarded!";
+        }
+    });
+
     // placing initToggleComments after enhanceEdit prevents odd autoscroll issue when editing hidden comments
     moin.initToggleComments();
 });
--- a/MoinMoin/templates/basic.js	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/templates/basic.js	Fri Aug 15 00:13:56 2014 +0530
@@ -4,18 +4,6 @@
     $('#meta, #help').removeClass('active');
     $('#password, #notification, #ui, #navigation, #options, #acl, #subscriptions').removeClass('active');
     $('textarea').autosize();
-    $('#moin-save-text-button').click(function (){
-        edit = true;
-    });
-    window.onbeforeunload = function(e) {
-        // previously checked if the URL is of the form http://host/+modify/page
-        // it is bad way if we rewrite URL's, hence used a div with id -> "checkmodifyview" in the modify view
-        var test = $('#checkmodifyview').length;
-        if (test == 1 && edit == false) {
-            return "Data you may have entered will be discarded!";
-        }
-        edit = false;
-    }
     $('div.dropup').removeClass('menu');
     $('ul.dropdown-menu').removeClass('submenu');
     $('.topnavcollapse').addClass('collapse');
--- a/MoinMoin/templates/global_history.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/templates/global_history.html	Fri Aug 15 00:13:56 2014 +0530
@@ -16,25 +16,25 @@
                 <div class="moin-history-container-header">
                     <h2>{{ day }}</h2>
                     {% if user.valid %}
-                    <a class="bookmark-link" href="{{ url_for('frontend.bookmark', time=latest_timestamp+1) }}">{{ _("Set bookmark") }}</a>
+                    <a class="bookmark-link btn btn-primary" href="{{ url_for('frontend.bookmark', time=latest_timestamp+1) }}">{{ _("Set bookmark") }}</a>
                     {% endif %}
                 </div>
                 <div class="moin-history-container-body">
-                    <table class="zebra">
+                    <table class="zebra table table-hover">
                     {% for rev in revs %}
                         {% set meta = rev.meta %}
                         <tr>
-                            <td class="moin-action">
+                            <td class="moin-action col-md-1">
                                 <span class="moin-history-{{ meta.action|lower }}"></span>
                             </td>
-                            <td class="moin-history-links">
+                            <td class="moin-history-links col-md-1">
                                 <a href="{{ url_for('frontend.history', item_name=rev.fqname, bookmark=bookmark_time) }}">HIST</a>
                                 {% if bookmark_time -%}
                                     <a href="{{ url_for('frontend.diff', item_name=rev.fqname, bookmark=bookmark_time) }}">DIFF</a>
                                 {%- endif %}
                             </td>
-                            <td class="moin-history-time">{{ meta.mtime|timeformat }}</td>
-                            <td class="moin-history-item">
+                            <td class="moin-history-time col-md-1">{{ meta.mtime|timeformat }}</td>
+                            <td class="moin-history-item col-md-7">
                                 <a class="{{ meta.contenttype|contenttype_to_class }}" href="{{ url_for('frontend.show_item', item_name=rev.fqname) }}" title="{{ meta.contenttype }}">
                                     {% if meta.name %}
                                         {{ meta.name|join(' | ') }}
--- a/MoinMoin/templates/global_tags.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/templates/global_tags.html	Fri Aug 15 00:13:56 2014 +0530
@@ -4,7 +4,7 @@
 <h1>{{ headline }}</h1>
 {% endif %}
 {% if tags %}
-<ul class="moin-tags">
+<ul class="moin-tags three-col">
     {% for cls, tag in tags %}
     <li class="{{ cls }}"><a href="{{ url_for('frontend.tagged_items', tag=tag, namespace=fqname.namespace) }}">{{ tag }}</a></li>
     {% endfor %}
--- a/MoinMoin/templates/layout.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/templates/layout.html	Fri Aug 15 00:13:56 2014 +0530
@@ -131,7 +131,7 @@
         <ul id="moin-navibar" class="panel">
         {% for cls, url, text, title in navibar_items %}
             <li class="{{ cls }}">
-                <a href="{{ url }}" {% if title %}title="{{ title }}"{% endif %}>{{ text }}</a>
+                <a href="{{ url }}" {% if title %}title="{{ title }} : {{ url|safe }}"{% else %}"{{ url|safe }}"{% endif %}>{{ text }}</a>
             </li>
         {% endfor %}
         </ul>
--- a/MoinMoin/templates/utils.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/templates/utils.html	Fri Aug 15 00:13:56 2014 +0530
@@ -23,8 +23,8 @@
 {% endmacro %}
 
 
-{% macro table(headings, rows, itemname_cols=[], url_cols=[]) %}
-<table class="zebra">
+{% macro table(headings, rows, itemname_cols=[], url_cols=[], filesize_cols=[]) %}
+<table class="zebra table table-hover">
 <thead>
     <tr>
         {% for heading in headings %}
@@ -40,7 +40,9 @@
 {% for row in rows %}
     <tr>
         {% for col in row %}
-            {% if col is number %}
+            {% if loop.index in filesize_cols %}
+                <td>{{ col|filesizeformat }}</td>
+            {% elif col is number %}
                 <td class="moin-integer">{{ col }}</td>
             {% elif loop.index in itemname_cols %}
                 <td><a href="{{ url_for('frontend.show_item', item_name=col) }}">{{ col }}</a></td>
--- a/MoinMoin/themes/__init__.py	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/__init__.py	Fri Aug 15 00:13:56 2014 +0530
@@ -161,7 +161,9 @@
                             if endpoint == 'frontend.quicklink_item':
                                 if not flaskg.user.is_quicklinked_to([fqname]):
                                     label = _('Add Link')
-                                    user_actions.append((endpoint, href, iconcls, label, title, True))
+                                else:
+                                    label = _('Remove Link')
+                                user_actions.append((endpoint, href, iconcls, label, title, True))
                             elif endpoint == 'frontend.subscribe_item':
                                 from MoinMoin.items import Item
                                 if flaskg.user.is_subscribed_to(item.item):
--- a/MoinMoin/themes/basic/static/css/theme.css	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/basic/static/css/theme.css	Fri Aug 15 00:13:56 2014 +0530
@@ -6430,9 +6430,13 @@
 .moin-quicklink {
   position: relative;
   padding: 5px 15px 5px 15px;
-  border: 1px solid #dddddd;
+  background-color: #c8ddf1;
+  border: 1px solid #c8ddf1;
   margin-bottom: -1px;
 }
+.moin-quicklink > a {
+  color: #1b436d;
+}
 .moin-quicklink:last-child {
   margin-bottom: 0;
   border-bottom-right-radius: 4px;
@@ -7045,3 +7049,30 @@
 .moin-index-actions .navbar-collapse {
   padding-left: 0;
 }
+#editor > textarea {
+  width: 100%;
+}
+.moin-history-save:before {
+  content: url("../img/moin-save.png");
+}
+.moin-history-trash:before {
+  content: url("../img/moin-trash.png");
+}
+.moin-history-rename:before {
+  content: url("../img/moin-rename.png");
+}
+.moin-history-copy:before {
+  content: url("../img/moin-copy.png");
+}
+.moin-history-revert:before {
+  content: url("../img/moin-revert.png");
+}
+.moin-history-container-header > h2 {
+  display: inline;
+}
+.moin-history-container-header > .bookmark-link {
+  margin-bottom: 15px;
+  margin-left: 20px;
+  height: 2em;
+  line-height: 1em;
+}
--- a/MoinMoin/themes/basic/static/custom-less/theme.less	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/basic/static/custom-less/theme.less	Fri Aug 15 00:13:56 2014 +0530
@@ -175,9 +175,14 @@
 .moin-quicklink {
   position: relative;
   padding: 5px 15px 5px 15px;
-  border: 1px solid @list-group-border;
+  background-color: #c8ddf1;
+  border: 1px solid #c8ddf1;
   margin-bottom: -1px;
 
+  > a {
+    color: #1b436d;
+  }
+
   &:last-child {
     margin-bottom: 0;
     .border-bottom-radius(@border-radius-base);
@@ -768,4 +773,33 @@
     padding-left: 0;
   }
 }
+#editor > textarea {
+  width: 100%;
+}
+.moin-history-save:before {
+  content: url("../img/moin-save.png");
+}
+.moin-history-trash:before {
+  content: url("../img/moin-trash.png");
+}
+.moin-history-rename:before {
+  content: url("../img/moin-rename.png");
+}
+.moin-history-copy:before {
+  content: url("../img/moin-copy.png");
+}
+.moin-history-revert:before {
+  content: url("../img/moin-revert.png");
+}
+.moin-history-container-header {
+  > h2 {
+    display: inline;
+  }
+  > .bookmark-link {
+    margin-bottom: 15px;
+    margin-left: 20px;
+    height: 2em;
+    line-height: 1em;
+  }
+}
 
Binary file MoinMoin/themes/basic/static/img/moin-copy.png has changed
Binary file MoinMoin/themes/basic/static/img/moin-rename.png has changed
Binary file MoinMoin/themes/basic/static/img/moin-revert.png has changed
Binary file MoinMoin/themes/basic/static/img/moin-save.png has changed
Binary file MoinMoin/themes/basic/static/img/moin-trash.png has changed
--- a/MoinMoin/themes/basic/templates/layout.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/basic/templates/layout.html	Fri Aug 15 00:13:56 2014 +0530
@@ -229,11 +229,8 @@
                                 {% if loop.first %}
                                     <div class="list-group-item moin-list-heading">Quick Links</div>
                                 {% endif %}
-                                    <div class="moin-quicklink">
-                                    <a class="moin-quicklink-label {{ cls }}" href="{{ url }}" {% if title %}title="{{ title }}"{% endif %}>{{ text|shorten_item_name }}
-                                    </a>
-                                    <a class="moin-quicklink-delete" href="{{ url_for('frontend.quicklink_item', item_name=text) }}">
-                                        <i class="icon-remove"></i>
+                                <div class="moin-quicklink">
+                                    <a class="moin-quicklink-label {{ cls }}" href="{{ url }}" {% if title %}title="{{ title }} : {{ url|safe }}"{% else %}"{{ url|safe }}"{% endif %}>{{ text|shorten_item_name(20) }}
                                     </a>
                                 </div>
                             {% endfor %}
--- a/MoinMoin/themes/basic/templates/modify.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/basic/templates/modify.html	Fri Aug 15 00:13:56 2014 +0530
@@ -26,7 +26,6 @@
 {% block content %}
 <h2>{{ title }}</h2>
 <div id="moin-modify" class="moin-form">
-    <div id="checkmodifyview"> </div>
     {{ gen.form.open(form, method='post', enctype='multipart/form-data') }}
     {{ forms.render_errors(form) }}
     {{ forms.render_errors(form['meta_form']['acl']) }}
--- a/MoinMoin/themes/foobar/static/css/stylus/theme.styl	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/foobar/static/css/stylus/theme.styl	Fri Aug 15 00:13:56 2014 +0530
@@ -1139,10 +1139,6 @@
     font-size 1.17em
 .moin-small
     font-size .83em
-.moin-integer
-    text-align right
-    padding-right 1em
-    width 2%
 
 html,
 body
--- a/MoinMoin/themes/foobar/static/css/theme.css	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/foobar/static/css/theme.css	Fri Aug 15 00:13:56 2014 +0530
@@ -445,7 +445,6 @@
 ins{background-color:inherit;text-decoration:underline}
 .moin-big{font-size:1.17em}
 .moin-small{font-size:.83em}
-.moin-integer{text-align:right;padding-right:1em;width:2%}
 html,body{height:100%}
 #moin-main-container{min-height:100%;position:relative}
 #moin-main-box{margin-bottom:60px}
--- a/MoinMoin/themes/foobar/templates/layout.html	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/foobar/templates/layout.html	Fri Aug 15 00:13:56 2014 +0530
@@ -28,7 +28,7 @@
             <ul>
             {% for cls, url, text, title in navibar_items %}
                 <li class="{{ cls }}">
-                    <a href="{{ url }}" {% if title %}title="{{ title }}"{% endif %}>{{ text }}</a>
+                    <a href="{{ url }}" {% if title %}title="{{ title }} : {{ url|safe }}"{% else %}"{{ url|safe }}"{% endif %}>{{ text }}</a>
                 </li>
             {% endfor %}
             </ul>
--- a/MoinMoin/themes/modernized/static/css/stylus/theme.styl	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/modernized/static/css/stylus/theme.styl	Fri Aug 15 00:13:56 2014 +0530
@@ -54,11 +54,6 @@
 .moin-small
     font-size .83em
 
-.moin-integer
-    text-align right
-    padding-right 1em
-    width 2%
-
 .moin-inline-label
     display inline
 
@@ -1745,3 +1740,6 @@
 #moin-ticket-create-link button
   width 150px
   height 35px
+
+.zebra .tablesorter-header
+    background-color header_bg_color
--- a/MoinMoin/themes/modernized/static/css/theme.css	Fri Aug 15 00:13:18 2014 +0530
+++ b/MoinMoin/themes/modernized/static/css/theme.css	Fri Aug 15 00:13:56 2014 +0530
@@ -198,7 +198,6 @@
 ins{background-color:inherit;text-decoration:underline}
 .moin-big{font-size:1.17em}
 .moin-small{font-size:.83em}
-.moin-integer{text-align:right;padding-right:1em;width:2%}
 .moin-inline-label{display:inline}
 h1{font-size:2em;margin:.67em 0;border-bottom:5px solid #4e7da9;padding-bottom:5px}
 h2{font-size:1.5em;margin:.75em 0;padding-bottom:4px}
@@ -571,3 +570,4 @@
 .moin-ticket-tags{border-bottom:none}
 #moin-ticket-create-link{display:inline;position:absolute;right:70px;top:170px}
 #moin-ticket-create-link button{width:150px;height:35px}
+.zebra .tablesorter-header{background-color:#708090}