Changeset - ab47e5e9ad77
[Not reviewed]
default
0 2 0
Andrew Shadura - 11 years ago 2015-04-01 11:40:17
andrew@shadura.me
i18n: use the same text for the identical tooltips
2 files changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/i18n/kallithea.pot
Show inline comments
 
@@ -4603,251 +4603,248 @@ msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset.html:54
 
#: kallithea/templates/changeset/diff_block.html:27
 
#: kallithea/templates/files/diff_2way.html:49
 
msgid "Raw diff"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset.html:57
 
msgid "Patch diff"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset.html:60
 
#: kallithea/templates/changeset/diff_block.html:30
 
#: kallithea/templates/files/diff_2way.html:52
 
msgid "Download diff"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset.html:89
 
#: kallithea/templates/changeset/changeset_range.html:88
 
msgid "merge"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset.html:123
 
msgid "Grafted from:"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset.html:129
 
msgid "Transplanted from:"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset.html:137
 
#: kallithea/templates/compare/compare_diff.html:54
 
#: kallithea/templates/pullrequests/pullrequest_show.html:307
 
#, python-format
 
msgid "%s file changed"
 
msgid_plural "%s files changed"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: kallithea/templates/changeset/changeset.html:139
 
#: kallithea/templates/compare/compare_diff.html:56
 
#: kallithea/templates/pullrequests/pullrequest_show.html:309
 
#, python-format
 
msgid "%s file changed with %s insertions and %s deletions"
 
msgid_plural "%s files changed with %s insertions and %s deletions"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: kallithea/templates/changeset/changeset.html:153
 
#: kallithea/templates/changeset/changeset.html:166
 
#: kallithea/templates/pullrequests/pullrequest_show.html:328
 
#: kallithea/templates/pullrequests/pullrequest_show.html:351
 
msgid "Show full diff anyway"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset.html:224
 
#: kallithea/templates/changeset/changeset.html:261
 
msgid "no revisions"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:24
 
msgid "Status change from pull request"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:25
 
#: kallithea/templates/changeset/changeset_file_comment.html:28
 
msgid "No title"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:27
 
msgid "Comment from pull request"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:32
 
msgid "Status change on changeset"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:34
 
msgid "Comment on changeset"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:50
 
msgid "Delete comment?"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:67
 
msgid "Commenting on line {1}."
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:68
 
#: kallithea/templates/changeset/changeset_file_comment.html:163
 
#, python-format
 
msgid "Comments parsed using %s syntax with %s support."
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:70
 
#: kallithea/templates/changeset/changeset_file_comment.html:165
 
msgid "Use @username inside this text to notify another user"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:80
 
#: kallithea/templates/changeset/changeset_file_comment.html:199
 
msgid "Comment preview"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:85
 
msgid "Submitting ..."
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:88
 
#: kallithea/templates/changeset/changeset_file_comment.html:205
 
msgid "Comment"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:90
 
#: kallithea/templates/changeset/changeset_file_comment.html:206
 
msgid "Preview"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:98
 
msgid "You need to be logged in to comment."
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:98
 
msgid "Login now"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:102
 
msgid "Hide"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:114
 
#, python-format
 
msgid "%d comment"
 
msgid_plural "%d comments"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:115
 
#, python-format
 
msgid "%d inline"
 
msgid_plural "%d inline"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:116
 
#, python-format
 
msgid "%d general"
 
msgid_plural "%d general"
 
msgstr[0] ""
 
msgstr[1] ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:165
 
msgid "Use @username inside this text to send notification to another local user."
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:172
 
msgid "Vote for pull request status"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:174
 
msgid "Set changeset status"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:178
 
msgid "No change"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_file_comment.html:191
 
msgid "Close"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_range.html:5
 
#, python-format
 
msgid "%s Changesets"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/changeset_range.html:56
 
msgid "Files affected"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/diff_block.html:21
 
#: kallithea/templates/files/diff_2way.html:43
 
msgid "Show full diff for this file"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/diff_block.html:24
 
#: kallithea/templates/changeset/diff_block.html:99
 
#: kallithea/templates/files/diff_2way.html:46
 
msgid "Show full side-by-side diff for this file"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/diff_block.html:38
 
msgid "Show inline comments"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/diff_block.html:87
 
msgid "Deleted"
 
msgstr ""
 

	
 
#: kallithea/templates/changeset/diff_block.html:90
 
msgid "Renamed"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_cs.html:4
 
msgid "No changesets"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_cs.html:8
 
msgid "Ancestor"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_cs.html:61
 
msgid "Show merge diff"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_cs.html:71
 
#: kallithea/templates/pullrequests/pullrequest_show.html:299
 
msgid "Common ancestor"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_cs.html:75
 
msgid "No common ancestor found - repositories are unrelated"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_cs.html:83
 
msgid "is"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_cs.html:84
 
#, python-format
 
msgid "%s changesets"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_cs.html:85
 
msgid "behind"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_diff.html:6
 
#: kallithea/templates/compare/compare_diff.html:8
 
#, python-format
 
msgid "%s Compare"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_diff.html:13
 
#: kallithea/templates/compare/compare_diff.html:35
 
msgid "Compare Revisions"
 
msgstr ""
 

	
 
#: kallithea/templates/compare/compare_diff.html:33
 
msgid "Swap"
 
msgstr ""
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -69,193 +69,193 @@
 
                 ('<a href="%s">RST</a>' % h.url('rst_help')),
 
                   ('<span style="color:#577632" class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to notify another user'))
 
               )
 
            )|n
 
           }
 
        </div>
 
        <div class="mentions-container" id="mentions_container_{1}"></div>
 
        <textarea id="text_{1}" name="text" class="comment-block-ta yui-ac-input"></textarea>
 
      </div>
 
      <div id="preview-container_{1}" class="clearfix" style="display:none">
 
        <div class="comment-help">
 
            ${_('Comment preview')}
 
        </div>
 
        <div id="preview-box_{1}" class="preview-box"></div>
 
      </div>
 
      <div class="comment-button">
 
        <div class="submitting-overlay">${_('Submitting ...')}</div>
 
        <input type="hidden" name="f_path" value="{0}">
 
        <input type="hidden" name="line" value="{1}">
 
        ${h.submit('save', _('Comment'), class_='btn btn-small save-inline-form')}
 
        ${h.reset('hide-inline-form', _('Cancel'), class_='btn btn-small hide-inline-form')}
 
        <div id="preview-btn_{1}" class="preview-btn btn btn-small">${_('Preview')}</div>
 
        <div id="edit-btn_{1}" class="edit-btn btn btn-small" style="display:none">${_('Edit')}</div>
 
      </div>
 
    ${h.end_form()}
 
  %else:
 
      ${h.form('')}
 
      <div class="clearfix">
 
          <div class="comment-help">
 
            ${_('You need to be logged in to comment.')} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a>
 
          </div>
 
      </div>
 
      <div class="comment-button">
 
      ${h.reset('hide-inline-form', _('Hide'), class_='btn btn-small hide-inline-form')}
 
      </div>
 
      ${h.end_form()}
 
  %endif
 
  </div>
 
</div>
 
</%def>
 

	
 

	
 
## show comment count as "x comments (y inline, z general)"
 
<%def name="comment_count(inline_cnt, general_cnt)">
 
    ${'%s (%s, %s)' % (
 
        ungettext("%d comment", "%d comments", inline_cnt + general_cnt) % (inline_cnt + general_cnt),
 
        ungettext("%d inline", "%d inline", inline_cnt) % inline_cnt,
 
        ungettext("%d general", "%d general", general_cnt) % general_cnt
 
    )}
 
    <span class="firstlink"></span>
 
</%def>
 

	
 
## generates inlines taken from c.comments var
 
<%def name="inlines()">
 
    <div class="comments-number">
 
        ${comment_count(c.inline_cnt, len(c.comments))}
 
    </div>
 
    %for path, lines in c.inline_comments:
 
        % for line,comments in lines.iteritems():
 
            <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}">
 
            %for co in comments:
 
                ${comment_block(co)}
 
            %endfor
 
            </div>
 
        %endfor
 
    %endfor
 

	
 
</%def>
 

	
 
## generate inline comments and the main ones
 
<%def name="generate_comments()">
 
<div class="comments">
 
    <div id="inline-comments-container">
 
    ## generate inlines for this changeset
 
     ${inlines()}
 
    </div>
 

	
 
    %for co in c.comments:
 
        <div id="comment-tr-${co.comment_id}">
 
          ${comment_block(co)}
 
        </div>
 
    %endfor
 
</div>
 
</%def>
 

	
 
## MAIN COMMENT FORM
 
<%def name="comments(post_url, cur_status, is_pr=False, change_status=True)">
 

	
 
<div class="comments">
 
    %if c.authuser.username != 'default':
 
    <div class="comment-form ac">
 
      ${h.form(post_url, id="main_form")}
 
        <div id="edit-container" class="clearfix">
 
            <div class="comment-help">
 
                ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')),
 
                  '<span style="color:#577632" class="tooltip" title="%s">@mention</span>' %
 
                  _('Use @username inside this text to send notification to another local user.')))|n}
 
                  _('Use @username inside this text to notify another user.')))|n}
 
            </div>
 
            <div class="mentions-container" id="mentions_container"></div>
 
            ${h.textarea('text', class_="comment-block-ta")}
 
            %if change_status:
 
              <div id="status_block_container" class="status-block">
 
                %if is_pr:
 
                  ${_('Vote for pull request status')}:
 
                %else:
 
                  ${_('Set changeset status')}:
 
                %endif
 
                <input type="radio" class="status_change_radio" name="changeset_status" id="changeset_status_unchanged" value="" checked="checked" />
 
                <label for="changeset_status_unchanged">
 
                  ${_('No change')}
 
                </label>
 
                %for status,lbl in c.changeset_statuses:
 
                    <span style="margin-left: 15px;">
 
                        <input type="radio" class="status_change_radio" name="changeset_status" id="${status}" value="${status}">
 
                        <label for="${status}"><i class="icon-circle changeset-status-${status}" /></i>${lbl}</label>
 
                    </span>
 
                %endfor
 

	
 
                %if is_pr and ( \
 
                    h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) \
 
                    or c.pull_request.author.user_id == c.authuser.user_id):
 
                  <input id="save_close" type="checkbox" name="save_close">
 
                  <label id="save_close_label" for="save_close">${_("Close")}</label>
 
                %endif
 
              </div>
 
            %endif
 
        </div>
 

	
 
        <div id="preview-container" class="clearfix" style="display:none">
 
            <div class="comment-help">
 
                ${_('Comment preview')}
 
            </div>
 
            <div id="preview-box" class="preview-box"></div>
 
        </div>
 

	
 
        <div class="comment-button">
 
            ${h.submit('save', _('Comment'), class_="btn")}
 
            <div id="preview-btn" class="preview-btn btn">${_('Preview')}</div>
 
            <div id="edit-btn" class="edit-btn btn" style="display:none">${_('Edit')}</div>
 
        </div>
 
      ${h.end_form()}
 
    </div>
 
    %endif
 
</div>
 

	
 
<script>
 

	
 
$(document).ready(function () {
 
   MentionsAutoComplete('text', 'mentions_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
 

	
 
   $(window).on('beforeunload', function(){
 
      if($('.form-open').size() || $('textarea#text').val()){
 
         // this message will not be displayed on all browsers
 
         // (e.g. some versions of Firefox), but the user will still be warned
 
         return 'There are uncommitted comments.';
 
      }
 
   });
 

	
 
   $('form#main_form').submit(function(){
 
      // if no open inline forms, disable the beforeunload check - it would
 
      // fail in the check for the textarea we are about to submit
 
      if(!$('.form-open').size()){
 
          $(window).off('beforeunload');
 
      }
 
   });
 

	
 
   $('#preview-btn').click(function(){
 
       var _text = $('#text').val();
 
       if(!_text){
 
           return;
 
       }
 
       var post_data = {'text': _text};
 
       $('#preview-box').addClass('unloaded');
 
       $('#preivew-box').html(_TM['Loading ...']);
 
       $('#edit-container').hide();
 
       $('#edit-btn').show();
 
       $('#preview-container').show();
 
       $('#preview-btn').hide();
 

	
 
       var url = pyroutes.url('changeset_comment_preview', {'repo_name': '${c.repo_name}'});
 
       ajaxPOST(url,post_data,function(html){
 
           $('#preview-box').html(html);
 
           $('#preview-box').removeClass('unloaded');
 
       });
 
   });
 
   $('#edit-btn').click(function(){
 
       $('#edit-container').show();
 
       $('#edit-btn').hide();
 
       $('#preview-container').hide();
 
       $('#preview-btn').show();
 
   });
 

	
 
});
0 comments (0 inline, 0 general)