Changeset - 68f9c216377d
rhodecode/controllers/pullrequests.py
Show inline comments
 
@@ -88,25 +88,25 @@ class PullrequestsController(BaseRepoCon
 
        Get's default revision to do compare on pull request
 

	
 
        :param repo:
 
        """
 
        repo = repo.scm_instance
 
        if 'default' in repo.branches:
 
            return 'default'
 
        else:
 
            #if repo doesn't have default branch return first found
 
            return repo.branches.keys()[0]
 

	
 
    def _get_is_allowed_change_status(self, pull_request):
 
        owner = self.rhodecode_user.user_id == pull_request.user_id 
 
        owner = self.rhodecode_user.user_id == pull_request.user_id
 
        reviewer = self.rhodecode_user.user_id in [x.user_id for x in
 
                                                   pull_request.reviewers]
 
        return (self.rhodecode_user.admin or owner or reviewer)
 

	
 
    def show_all(self, repo_name):
 
        c.pull_requests = PullRequestModel().get_all(repo_name)
 
        c.repo_name = repo_name
 
        return render('/pullrequests/pullrequest_show_all.html')
 

	
 
    @NotAnonymous()
 
    def index(self):
 
        org_repo = c.rhodecode_db_repo
rhodecode/lib/helpers.py
Show inline comments
 
@@ -1161,13 +1161,12 @@ def journal_filter_help():
 

	
 
def not_mapped_error(repo_name):
 
    flash(_('%s repository is not mapped to db perhaps'
 
            ' it was created or renamed from the filesystem'
 
            ' please run the application again'
 
            ' in order to rescan repositories') % repo_name, category='error')
 

	
 

	
 
def ip_range(ip_addr):
 
    from rhodecode.model.db import UserIpMap
 
    s, e = UserIpMap._get_ip_range(ip_addr)
 
    return '%s - %s' % (s, e)
 

	
rhodecode/lib/utils.py
Show inline comments
 
@@ -742,13 +742,13 @@ def jsonify(func, *args, **kwargs):
 
    from pylons.decorators.util import get_pylons
 
    from rhodecode.lib.ext_json import json
 
    pylons = get_pylons(args)
 
    pylons.response.headers['Content-Type'] = 'application/json; charset=utf-8'
 
    data = func(*args, **kwargs)
 
    if isinstance(data, (list, tuple)):
 
        msg = "JSON responses with Array envelopes are susceptible to " \
 
              "cross-site data leak attacks, see " \
 
              "http://wiki.pylonshq.com/display/pylonsfaq/Warnings"
 
        warnings.warn(msg, Warning, 2)
 
        log.warning(msg)
 
    log.debug("Returning JSON wrapped action output")
 
    return json.dumps(data, encoding='utf-8')
 
\ No newline at end of file
 
    return json.dumps(data, encoding='utf-8')
rhodecode/model/validators.py
Show inline comments
 
@@ -557,25 +557,25 @@ def ValidPerms(type_='repo'):
 
                    log.exception('Updated permission failed')
 
                    msg = M(self, 'perm_new_member_type', state)
 
                    raise formencode.Invalid(msg, value, state,
 
                        error_dict=dict(perm_new_member_name=msg)
 
                    )
 
            return value
 
    return _validator
 

	
 

	
 
def ValidSettings():
 
    class _validator(formencode.validators.FancyValidator):
 
        def _to_python(self, value, state):
 
            # settings  form for users that are not admin 
 
            # settings  form for users that are not admin
 
            # can't edit certain parameters, it's extra backup if they mangle
 
            # with forms
 

	
 
            forbidden_params = [
 
                'user', 'repo_type', 'repo_enable_locking',
 
                'repo_enable_downloads', 'repo_enable_statistics'
 
            ]
 

	
 
            for param in forbidden_params:
 
                if param in value:
 
                    del value[param]
 
            return value
rhodecode/templates/admin/admin.html
Show inline comments
 
@@ -44,13 +44,12 @@ var fix_j_filter_width = function(len){
 
}
 
YUE.on('j_filter','keyup',function(){
 
	fix_j_filter_width(YUD.get('j_filter').value.length);
 
});
 
YUE.on('filter_form','submit',function(e){
 
	YUE.preventDefault(e)
 
    var val = YUD.get('j_filter').value;
 
	window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val);
 
});
 
fix_j_filter_width(YUD.get('j_filter').value.length);
 
</script>
 
</%def>
 

	
rhodecode/templates/admin/admin_log.html
Show inline comments
 
@@ -7,25 +7,25 @@
 
		<th class="left">${_('Repository')}</th>
 
		<th class="left">${_('Date')}</th>
 
		<th class="left">${_('From IP')}</th>
 
	</tr>
 

	
 
	%for cnt,l in enumerate(c.users_log):
 
	<tr class="parity${cnt%2}">
 
		<td>
 
        %if l.user is not None:
 
          ${h.link_to(l.user.username,h.url('edit_user', id=l.user.user_id))}
 
        %else:
 
          ${l.username}
 
        %endif    
 
        %endif
 
        </td>
 
		<td>${h.action_parser(l)[0]()}
 
		  <div class="journal_action_params">
 
            ${h.literal(h.action_parser(l)[1]())}
 
          </div>
 
		</td>
 
		<td>
 
		%if l.repository is not None:
 
		  ${h.link_to(l.repository.repo_name,h.url('summary_home',repo_name=l.repository.repo_name))}
 
		%else:
 
		  ${l.repository_name}
 
		%endif
rhodecode/templates/base/root.html
Show inline comments
 
@@ -65,34 +65,34 @@
 
           ## EXTRA FOR JS
 
           ${self.js_extra()}
 
            <script type="text/javascript">
 
            (function(window,undefined){
 
                // Prepare
 
                var History = window.History; // Note: We are using a capital H instead of a lower h
 
                if ( !History.enabled ) {
 
                     // History.js is disabled for this browser.
 
                     // This is because we can optionally choose to support HTML4 browsers or not.
 
                    return false;
 
                }
 
            })(window);
 
            
 

	
 
            YUE.onDOMReady(function(){
 
              tooltip_activate();
 
              show_more_event();
 
              show_changeset_tooltip();
 

	
 
              YUE.on('quick_login_link','click',function(e){
 
                 // make sure we don't redirect
 
                 YUE.preventDefault(e);
 
              
 

	
 
                 if(YUD.hasClass('quick_login_link','enabled')){
 
                     YUD.setStyle('quick_login','display','none');
 
                     YUD.removeClass('quick_login_link','enabled');
 
                 }
 
                 else{
 
                     YUD.setStyle('quick_login','display','');
 
                     YUD.addClass('quick_login_link','enabled');
 
                     var usr = YUD.get('username');
 
                     if(usr){
 
                    	 usr.focus();
 
                     }
 
                 }
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -31,59 +31,59 @@
 
    AJAX_COMMENT_DELETE_URL = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
 
    </script>
 
    <div class="table">
 
		<div class="diffblock">
 
            <div class="parents">
 
                %if c.changeset.parents:
 
                 %for n, p_cs in enumerate(reversed(c.changeset.parents)):
 
                    <span class="changeset_hash">&laquo; ${h.link_to('%s:%s' % (p_cs.revision,p_cs.raw_id[:6]),h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span>
 
                    <br>
 
                 %endfor
 
                 %else:
 
                    <span>${_('No parents')}</span>
 
                 %endif                
 
                 %endif
 
            </div>
 
            <div class="children">
 
                %if c.changeset.children:
 
                 %for n, p_cs in enumerate(reversed(c.changeset.children)):
 
                    <span class="changeset_hash">${h.link_to('%s:%s' % (p_cs.revision,p_cs.raw_id[:6]),h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} &raquo;</span>
 
                    <br>
 
                 %endfor
 
                 %else:
 
                    <span>${_('No children')}</span>
 
                 %endif                
 
            </div>              
 
                 %endif
 
            </div>
 
			<div class="code-header banner">
 
      
 

	
 
                <div class="hash">
 
                 r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
 
                </div>
 
                <div class="date">
 
                  ${h.fmt_date(c.changeset.date)}
 
                </div>
 
                <div class="changeset-status-container">
 
                    %if c.statuses:
 
                      <div title="${_('Changeset status')}" class="changeset-status-lbl">[${h.changeset_status_lbl(c.statuses[0])}]</div>
 
                      <div class="changeset-status-ico"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses[0])}" /></div>
 
                    %endif
 
                </div>
 
                <div class="diff-actions">
 
                  <a href="${h.url('changeset_raw_home',repo_name=c.repo_name,revision=c.changeset.raw_id)}"  class="tooltip" title="${h.tooltip(_('raw diff'))}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
 
                  <a href="${h.url('changeset_patch_home',repo_name=c.repo_name,revision=c.changeset.raw_id)}"  class="tooltip" title="${h.tooltip(_('patch diff'))}"><img class="icon" src="${h.url('/images/icons/page_add.png')}"/></a>
 
                  <a href="${h.url('changeset_download_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}"  class="tooltip" title="${h.tooltip(_('download diff'))}"><img class="icon" src="${h.url('/images/icons/page_save.png')}"/></a>
 
                  ${c.ignorews_url(request.GET)}
 
                  ${c.context_url(request.GET)}
 
                </div>
 
                <div class="comments-number" style="float:right;padding-right:5px">${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt}</div>
 
            </div>          
 
            </div>
 
		</div>
 
	    <div id="changeset_content">
 
			<div class="container">
 
	             <div class="left">
 
	                 <div class="author">
 
	                     <div class="gravatar">
 
	                         <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(c.changeset.author),20)}"/>
 
	                     </div>
 
	                     <span>${h.person(c.changeset.author)}</span><br/>
 
	                     <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
 
	                 </div>
 
	                 <div class="message">${h.urlify_commit(c.changeset.message, c.repo_name)}</div>
rhodecode/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -121,25 +121,25 @@
 
                ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')),
 
          		'<span style="color:#003367" class="tooltip" title="%s">@mention</span>' %
 
          		_('Use @username inside this text to send notification to this RhodeCode user')))|n}
 
              %if change_status:
 
                | <label for="show_changeset_status_box" class="tooltip" title="${_('Check this to change current status of code-review for this changeset')}"> ${_('change status')}</label>
 
                  <input style="vertical-align: bottom;margin-bottom:-2px" id="show_changeset_status_box" type="checkbox" name="change_changeset_status" />
 
              %endif
 
            </div>
 
            %if change_status:
 
            <div id="status_block_container" class="status-block" style="display:none">
 
                %for status,lbl in c.changeset_statuses:
 
                    <div class="">
 
                        <img src="${h.url('/images/icons/flag_status_%s.png' % status)}" /> <input ${'checked="checked"' if status == cur_status else ''}" type="radio" class="status_change_radio" name="changeset_status" id="${status}" value="${status}"> 
 
                        <img src="${h.url('/images/icons/flag_status_%s.png' % status)}" /> <input ${'checked="checked"' if status == cur_status else ''}" type="radio" class="status_change_radio" name="changeset_status" id="${status}" value="${status}">
 
                        <label for="${status}">${lbl}</label>
 
                    </div>
 
                %endfor
 
            </div>
 
            %endif
 
            <div class="mentions-container" id="mentions_container"></div>
 
             ${h.textarea('text')}
 
        </div>
 
        <div class="comment-button">
 
        ${h.submit('save', _('Comment'), class_="ui-btn large")}
 
        %if close_btn and change_status:
 
           ${h.submit('save_close', _('Comment and close'), class_='ui-btn blue large %s' % ('hidden' if cur_status in ['not_reviewed','under_review'] else ''))}
rhodecode/templates/email_templates/pull_request.html
Show inline comments
 
@@ -6,14 +6,12 @@ ${_('User %s opened pull request for rep
 
<div>${_('description')}:</div>
 
<div>${_('View this pull request here')}: ${pr_url}</div>
 
<p>
 
${body}
 
</p>
 

	
 
<div>${_('revisions for reviewing')}</div>
 
<ul>
 
%for r in pr_revisions:
 
    <li>${r}</li>
 
%endfor
 
</ul>
 

	
 

	
rhodecode/templates/index_base.html
Show inline comments
 
@@ -259,25 +259,25 @@
 
            return res;
 
        }
 

	
 
        // main table sorting
 
        var myColumnDefs = [
 
            {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"},
 
            {key:"name",label:"${_('Name')}",sortable:true,
 
                sortOptions: { sortFunction: nameSort }},
 
            {key:"desc",label:"${_('Description')}",sortable:true},
 
            {key:"last_change",label:"${_('Last Change')}",sortable:true,
 
                sortOptions: { sortFunction: ageSort }},
 
            {key:"tip",label:"${_('Tip')}",sortable:true,
 
                sortOptions: { sortFunction: revisionSort }},                
 
                sortOptions: { sortFunction: revisionSort }},
 
            {key:"owner",label:"${_('Owner')}",sortable:true},
 
            {key:"rss",label:"",sortable:false},
 
            {key:"atom",label:"",sortable:false},
 
        ];
 

	
 
        var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{
 
          sortedBy:{key:"name",dir:"asc"},
 
          paginator: new YAHOO.widget.Paginator({
 
              rowsPerPage: ${c.visual.lightweight_dashboard_items},
 
              alwaysVisible: false,
 
              template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}",
 
              pageLinks: 5,
rhodecode/templates/journal/journal.html
Show inline comments
 
@@ -105,44 +105,44 @@
 
                %endfor
 
            </tbody>
 
            </table>
 
          %else:
 
              <div style="padding:5px 0px 10px 0px;">
 
              ${_('You are not following any users or repositories')}
 
              </div>
 
          %endif
 
        </div>
 
    </div>
 

	
 
    <script type="text/javascript">
 
    
 

	
 
    YUE.on('j_filter','click',function(){
 
        var jfilter = YUD.get('j_filter');
 
        if(YUD.hasClass(jfilter, 'initial')){
 
            jfilter.value = '';
 
        }
 
    });
 
    var fix_j_filter_width = function(len){
 
        YUD.setStyle(YUD.get('j_filter'),'width',Math.max(80, len*6.50)+'px');
 
    }
 
    YUE.on('j_filter','keyup',function(){
 
        fix_j_filter_width(YUD.get('j_filter').value.length);
 
    });
 
    YUE.on('filter_form','submit',function(e){
 
        YUE.preventDefault(e)
 
        var val = YUD.get('j_filter').value;
 
        window.location = "${url.current(filter='__FILTER__')}".replace('__FILTER__',val);
 
    });
 
    fix_j_filter_width(YUD.get('j_filter').value.length);    
 
    
 
    fix_j_filter_width(YUD.get('j_filter').value.length);
 

	
 
    var show_my = function(e){
 
        YUD.setStyle('watched','display','none');
 
        YUD.setStyle('my','display','');
 

	
 
        var url = "${h.url('admin_settings_my_repos')}";
 
        ypjax(url, 'my', function(){
 
            tooltip_activate();
 
            quick_repo_menu();
 
            var nodes = YUQ('#my tr td a.repo_name');
 
            var func = function(node){
 
                return node.parentNode.parentNode.parentNode;
 
            }
rhodecode/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -189,22 +189,22 @@
 
                  YUD.setStyle(btns[c],'display',show);
 
               }
 
          })
 

	
 
          YUE.on(YUQ('.line'),'click',function(e){
 
              var tr = e.currentTarget;
 
              injectInlineForm(tr);
 
          });
 

	
 
          // inject comments into they proper positions
 
          var file_comments = YUQ('.inline-comment-placeholder');
 
          renderInlineComments(file_comments);
 
          
 

	
 
          YUE.on(YUD.get('update_pull_request'),'click',function(e){
 
        	  updateReviewers();
 
          })
 
      })
 
    </script>
 

	
 
</div>
 

	
 
</%def>
rhodecode/templates/settings/repo_settings.html
Show inline comments
 
@@ -85,25 +85,25 @@
 
                <div class="label">
 
                    <label for="">${_('Permissions')}:</label>
 
                </div>
 
                <div class="input">
 
                    <%include file="../admin/repos/repo_edit_perms.html"/>
 
                </div>
 
            </div>
 

	
 
            <div class="buttons">
 
              ${h.submit('save',_('Save'),class_="ui-btn large")}
 
              ${h.reset('reset',_('Reset'),class_="ui-btn large")}
 
            </div>
 
        
 

	
 
    </div>
 
    ${h.end_form()}
 
</div>
 

	
 
<h3>${_('Delete repository')}</h3>
 
<div class="form">
 
    <!-- fields -->
 
    <div class="fields">
 

	
 
        <div class="field">
 
            <div class="label">
 
                <label for="">${_('Remove repo')}:</label>
rhodecode/tests/models/test_user_permissions_on_repos.py
Show inline comments
 
#TODO; write tests when we activate algo for permissions.
 
\ No newline at end of file
 
#TODO; write tests when we activate algo for permissions.
0 comments (0 inline, 0 general)