Changeset - f78aa989c9ff
[Not reviewed]
default
1 5 0
Mads Kiilerich - 7 years ago 2018-12-11 00:25:21
mads@kiilerich.com
front-end: More clean-up after YUI is gone
6 files changed with 4 insertions and 75 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/page.py
Show inline comments
 
@@ -5,49 +5,49 @@
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
"""
 
Custom paging classes
 
"""
 
import logging
 
import math
 
import re
 
from kallithea.config.routing import url
 
from webhelpers.html import literal, HTML
 
from webhelpers.paginate import Page as _Page
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class Page(_Page):
 
    """
 
    Custom pager to match rendering style with YUI paginator emitting Bootstrap paginators
 
    Custom pager emitting Bootstrap paginators
 
    """
 

	
 
    def __init__(self, *args, **kwargs):
 
        kwargs.setdefault('url', url.current)
 
        _Page.__init__(self, *args, **kwargs)
 

	
 
    def _get_pos(self, cur_page, max_page, items):
 
        edge = (items / 2) + 1
 
        if (cur_page <= edge):
 
            radius = max(items / 2, items - cur_page)
 
        elif (max_page - cur_page) < edge:
 
            radius = (items - 1) - (max_page - cur_page)
 
        else:
 
            radius = items / 2
 

	
 
        left = max(1, (cur_page - (radius)))
 
        right = min(max_page, cur_page + (radius))
 
        return left, cur_page, right
 

	
 
    def _range(self, regexp_match):
 
        """
 
        Return range of linked pages (e.g. '1 2 [3] 4 5 6 7 8').
 

	
 
        Arguments:
kallithea/public/less/main.less
Show inline comments
 
/*!
 
 * Don't edit the css file directly.
 
 *
 
 * Instead, edit the less file(s) and regenerate the css:
 
 *
 
 * npm install
 
 * npm run less
 
 *
 
 */
 

	
 
/* 3rd party styles */
 
@import "node_modules/bootstrap/less/bootstrap.less";
 
@import (inline) "node_modules/datatables.net-bs/css/dataTables.bootstrap.css";
 
@import (inline) "node_modules/at.js/dist/css/jquery.atwho.css";
 
@import (less) "node_modules/select2/select2.css";
 
@import (less) "node_modules/select2-bootstrap-css/select2-bootstrap.css";
 
@import (less) "tmp/pygments.css";
 
@import (less) "../fontello/css/kallithea.css";
 

	
 
/* kallithea styles */
 
@import "kallithea-variables.less";
 
@import "kallithea-labels.less";
 
@import "yui-ac.less";
 
@import "kallithea-select2.less";
 
@import "kallithea-diff.less";
 
@import "style.less";
 

	
 
/* finally, import the optional theme file with local customizations */
 
@import (optional) "theme.less";
kallithea/public/less/style.less
Show inline comments
 
@@ -438,50 +438,49 @@ img.icon,
 
  padding: 0;
 
}
 
nav.navbar #home,
 
#content div.panel ul.left,
 
#content div.panel ol.left,
 
div#commit_history,
 
div#legend_data,
 
div#legend_container,
 
div#legend_choices {
 
  float: left;
 
}
 

	
 
/* set size for statistics charts */
 
#commit_history {
 
  width: 450px;
 
  height: 300px;
 
}
 
#overview {
 
  clear: both;
 
  width: 450px;
 
  height: 100px;
 
}
 

	
 
#content #left #menu ul.closed,
 
#content #left #menu li ul.collapsed,
 
.yui-tt-shadow {
 
#content #left #menu li ul.collapsed {
 
  display: none;
 
}
 
#content #left #menu ul.opened,
 
#content #left #menu li ul.expanded {
 
  display: block !important;
 
}
 

	
 
#content div.panel ol.lower-roman,
 
#content div.panel ol.upper-roman,
 
#content div.panel ol.lower-alpha,
 
#content div.panel ol.upper-alpha,
 
#content div.panel ol.decimal {
 
  margin: 10px 24px 10px 44px;
 
}
 

	
 
div.form div.form-group div.button input,
 
#content div.panel div.form div.buttons input,
 
div.form div.buttons input,
 
#content div.panel div.action div.button input {
 
  font-size: 11px;
 
  font-weight: 700;
 
  margin: 0;
 
}
 
div.form div.form-group div.highlight,
kallithea/public/less/yui-ac.less
Show inline comments
 
deleted file
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -64,49 +64,49 @@
 
              ${_('Submitting ...')}
 
          </span>
 
      </div>
 
      <div class="panel-body">
 
           <div class="automatic-comment" style="display: none;">
 
             <p>
 
               ${_("Status change")}: <span class="comment-status-label"></span>
 
               <i class="icon-circle"></i>
 
             </p>
 
           </div>
 
           <div class="comment-text">
 
             <div class="formatted-fixed">
 
             </div>
 
           </div>
 
      </div>
 
    </div>
 
  </div>
 
  <div class="ac">
 
  %if request.authuser.username != 'default':
 
    ${h.form('#', class_='inline-form')}
 
      <div class="well well-sm clearfix">
 
        <div class="comment-help">
 
          <span class="text-muted">${_('Comments are in plain text. Use @username to notify another user.')|n}</span>
 
        </div>
 
        <textarea name="text" class="form-control comment-block-ta yui-ac-input"></textarea>
 
        <textarea name="text" class="form-control"></textarea>
 

	
 
        <div id="status_block_container" class="status-block general-only hidden">
 
                %if c.pull_request is None:
 
                  ${_('Set changeset status')}:
 
                %else:
 
                  ${_('Vote for pull request status')}:
 
                %endif
 
                <span class="general-only cs-only">
 
                </span>
 
                <label class="radio-inline">
 
                    <input type="radio" class="status_change_radio" name="changeset_status" id="changeset_status_unchanged" value="" checked="checked" />
 
                    ${_('No change')}
 
                </label>
 
                %for status, lbl in c.changeset_statuses:
 
                    <label class="radio-inline">
 
                        <input type="radio" class="status_change_radio" name="changeset_status" id="${status}" value="${status}">
 
                        ${lbl}<i class="icon-circle changeset-status-${status}"></i>
 
                    </label>
 
                %endfor
 

	
 
                %if c.pull_request is not None and ( \
 
                    h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionLevel('admin')(c.repo_name) \
 
                    or c.pull_request.owner_id == request.authuser.user_id):
 
                <div>
scripts/whitespacecleanup.sh
Show inline comments
 
#!/bin/bash -x
 

	
 
# Enforce some consistency in whitespace - just to avoid spurious whitespaces changes
 

	
 
files=`hg mani | egrep -v '/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history|yui.2.9)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`
 
files=`hg mani | egrep -v '/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`
 

	
 
sed -i "s/`printf '\r'`//g" $files
 
sed -i -e "s,`printf '\t'`,    ,g" $files
 
sed -i -e "s,  *$,,g" $files
 
sed -i -e 's,\([^ ]\)\\$,\1 \\,g' -e 's,\(["'"'"']["'"'"']["'"'"']\) \\$,\1\\,g' $files
 
# ensure one trailing newline - remove empty last line and make last line include trailing newline:
 
sed -i -e '$,${/^$/d}' -e '$a\' $files
 

	
 
sed -i -e 's,\([^ /]\){,\1 {,g' `hg loc '*.css'`
 
sed -i -e 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg loc '*.css'`
 

	
 
hg mani | xargs chmod -x
 
hg loc 'set:!binary()&grep("^#!")&!(**_tmpl.py)&!(**/template**)' | xargs chmod +x
 

	
 
hg diff
0 comments (0 inline, 0 general)