You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2014/02/27 03:14:38 UTC
svn commit: r1572404 [8/8] - in
/bloodhound/branches/bep_0007_embeddable_objects: ./ bloodhound_dashboard/
bloodhound_dashboard/bhdashboard/
bloodhound_dashboard/bhdashboard/default-pages/
bloodhound_dashboard/bhdashboard/layouts/ bloodhound_dashboard/...
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_report_list.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_report_list.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_report_list.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_report_list.html Thu Feb 27 02:14:33 2014
@@ -23,6 +23,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="layout.html" />
<head>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_report_view.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_report_view.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_report_view.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_report_view.html Thu Feb 27 02:14:33 2014
@@ -23,6 +23,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="layout.html" />
<head>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_reset_password.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_reset_password.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_reset_password.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_reset_password.html Thu Feb 27 02:14:33 2014
@@ -24,7 +24,7 @@
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:i18n="http://genshi.edgewall.org/i18n"
- i18n:domain="bloodhound">
+ i18n:domain="bhtheme">
<xi:include href="layout.html" />
<?python
if _dgettext is not None:
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_revisionlog.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_revisionlog.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_revisionlog.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_revisionlog.html Thu Feb 27 02:14:33 2014
@@ -23,6 +23,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="layout.html" />
<head>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_search.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_search.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_search.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_search.html Thu Feb 27 02:14:33 2014
@@ -23,6 +23,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="layout.html" />
<head>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket.html Thu Feb 27 02:14:33 2014
@@ -24,6 +24,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
xmlns:bh="http://issues.apache.org/bloodhound/wiki/Ui/Dashboard"
py:with="preview_mode = 'preview' in req.args;
can_append = 'TICKET_APPEND' in perm(ticket.resource);
@@ -57,7 +58,10 @@
<script type="text/javascript" py:choose="">
jQuery(document).ready(function($) {
/* Affixed navbar */
- $(".local-nav a").click(function() { $($(this).attr('href')).removeClass('collapsed').parent().removeClass("collapsed"); });
+ $(".local-nav a").click(function() {
+ $($(this).attr('href')).removeClass('collapsed')
+ .parent().removeClass("collapsed");
+ });
$('.trac-nav').hide();
$('.trac-topnav').hide();
@@ -66,8 +70,7 @@
install_workflow();
$('#edit-cancel, #edit-cancel-below').click(revert_ticket);
- var modify_elem = $('#modify');
- modify_elem.parent().hide();
+ $('#modify').parent().hide();
$('#propertyform .buttons [name="preview"]').hide();
$('#comment').change(function (e) {
$('#hidden-comment').val($('#comment').val());
@@ -124,8 +127,7 @@
$('#inplace-edit, #vc-status a').hide();
$('#edit-state-buttons, #edit-state-buttons-below, #edit-workflow-buttons, #edit-comment').show();
- if (!newticket)
- {
+ if (!newticket) {
// disable input controls on all other forms when in modify mode
$('.activityfeed, .relations, #attachments').css('opacity', '0.3');
$('form:not("#inplace-propertyform") :input').attr('disabled', 'disabled');
@@ -159,11 +161,7 @@
e.preventDefault();
}
- function install_workflow(){
- <py:if test="bhrelations">
- var act = $('#action_resolve_resolve_resolution').parent();
- act.append('<span id="duplicate_id" class="hide">Duplicate ID: <input name="duplicate_id" type="text" class="input-mini" value="${ticket_duplicate_of}"></input></span>');
- </py:if>
+ function install_workflow() {
var actions_box = $('#workflow-actions')
.click(function(e) { e.stopPropagation(); });
$('#action').children('div').each(function() {
@@ -177,24 +175,13 @@
var action = action_ui.find('input[name=action]').val();
var newowner = action_ui.find('input[id$=_reassign_owner]').val();
var newresolution = action_ui.find('select[id$=_resolution]').val();
- var newlabel = action_ui.find('label[for^=action_]')
- .text();
+ var newlabel = action_ui.find('label[for^=action_]').text();
if (action === 'leave')
newlabel = newlabel + ' as ' + $('#vc-status a').text();
else if (newowner)
newlabel = newlabel + ' to ' + newowner;
else if (newresolution)
- {
newlabel = newlabel + ' as ' + newresolution;
- if (newresolution === 'duplicate')
- {
- $('#duplicate_id').show();
- }
- else
- {
- $('#duplicate_id').hide();
- }
- }
$('#submit-action-label').text(newlabel);
// Enable | disable action controls
@@ -203,20 +190,13 @@
.enable($(this).checked());
$(this).siblings().filter("*[id]")
.enable($(this).checked());
- });
+ });
}
action_trigger.click(action_click);
action_select_trigger.change(action_click);
action_input_trigger.blur(action_click);
if (action_trigger.attr('checked'))
action_click();
-
- var action_help = action_ui.find('.help-block').detach()
- .text().replace(/\s+/g, ' ').replace(/^ Tip /g, 'Tip: ')
- .replace(/^\s$/, '');
- if (action_help)
- $('<i class="icon-info-sign"></i>').appendTo(action_ui)
- .attr('title', action_help);
});
}
@@ -288,6 +268,23 @@
var comment = $("#trac-comment-editor").next("div.comment").html(reply);
comment.toggle(comment.children().length != 0);
}, "#changelog .trac-loading");
+
+ // quick hack to set arrow direction on change
+ if (typeof(comments_prefs) !== "undefined") {
+ arrow_dir = {
+ 'oldest': function() {
+ $('div#changelog').addClass('downarrow');
+ $('div#changelog').removeClass('uparrow');
+ },
+ 'newest': function() {
+ $('div#changelog').addClass('uparrow');
+ $('div#changelog').removeClass('downarrow');
+ },
+ };
+ $('#trac-comments-newest').change(arrow_dir['newest']);
+ $('#trac-comments-oldest').change(arrow_dir['oldest']);
+ arrow_dir[comments_prefs.comments_order]();
+ };
/*]]>*/
<py:if test="preview_mode">
$("#attachments").toggleClass("collapsed");
@@ -695,7 +692,7 @@
</div>
</div>
- <div class="$cols_activity">
+ <div>
<!--! Preview of ticket changes -->
<div py:if="ticket.exists and can_append" id="ticketchange" class="ticketdraft"
style="${'display: none' if not (change_preview.fields or change_preview.comment)
@@ -720,7 +717,7 @@
</tr>
</table>
<p py:if="author_id == 'anonymous'" class="hint">
- <i18n:msg>E-mail address and user name can be saved in the <a href="${href.prefs()}">Preferences</a>.</i18n:msg>
+ <i18n:msg>E-mail address and user name can be saved in the <a href="${href.prefs()}" class="trac-target-new">Preferences</a>.</i18n:msg>
</p>
</fieldset>
</div>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_actions.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_actions.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_actions.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_actions.html Thu Feb 27 02:14:33 2014
@@ -20,21 +20,29 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip="">
+ <script py:if="bhrelations" type="text/javascript">
+ jQuery(document).ready(function($) {
+ $('select[id$=_resolve_resolution]').each(function () {
+ var prefix = $(this).attr('id').split('_').slice(0, 2).join('_');
+ $(this).parent().append('<span class="duplicate_id hide">Duplicate ID: ' +
+ '<input id="' + prefix + '_duplicate_id" name="duplicate_id" type="text" class="input-mini" value="${ticket_duplicate_of}" /></span>');
+ }).change(function() {
+ if ($(this).val() === 'duplicate')
+ $('.duplicate_id', $(this).parent()).show();
+ else
+ $('.duplicate_id', $(this).parent()).hide();
+ });
+ });
+ </script>
<div py:for="key, label, controls, hints in action_controls">
- <input type="radio" id="action_$key" name="action" value="$key"
- checked="${key == action or None}" />
- <label for="action_$key">$label</label>
- $controls
- <div class="help-block" py:if="hints">
- <p py:for="idx, hint in
- enumerate(h for h in hints if h.strip())">
- <span class="label label-info"
- py:if="idx == 0">Tip</span>
- $hint
- </p>
- </div>
+ <input type="radio" id="action_$key" name="action" value="$key"
+ checked="${key == action or None}" />
+ <label for="action_$key">$label</label>
+ $controls
+ <i py:if="hints" class="icon-info-sign" title="${'\n'.join(h for h in hints if h.strip())}"></i>
</div>
</html>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_box.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_box.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_box.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_box.html Thu Feb 27 02:14:33 2014
@@ -34,6 +34,7 @@ Arguments:
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
id="ticket" class="${'ticketdraft' if preview_mode else None}">
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_change.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_change.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_change.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_change.html Thu Feb 27 02:14:33 2014
@@ -34,6 +34,7 @@ Arguments:
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
py:with="cnum = change.get('cnum'); hide_buttons = value_of('hide_buttons', False);
cnum_edit = value_of('cnum_edit'); cnum_hist = value_of('cnum_hist');
can_append = value_of('can_append', False); has_edit_comment = value_of('has_edit_comment', False);
@@ -59,7 +60,7 @@ Arguments:
<div class="pull-right">
<span py:if="'cnum' in change" id="comment:$cnum" class="cnum">${commentref('comment:', cnum)}</span>
</div>
- <div py:if="show_buttons" class="pull-right bh-ticket-buttons hidden-desktop trac-ticket-buttons">
+ <div py:if="show_buttons" class="pull-right bh-ticket-buttons shade-desktop trac-ticket-buttons">
<py:if test="'date' in change">
${pretty_dateinfo(change.date)}
</py:if>
@@ -163,7 +164,7 @@ ${edited_comment if edited_comment is no
<em>${field.old}</em> deleted
</i18n:msg></py:otherwise>
</py:choose>
- <span class="${'hidden-desktop' if change.cnum else ''}">
+ <span class="${'shade-desktop' if change.cnum else ''}">
- by ${authorinfo(change.author)}<span py:if="'date' in change">, ${pretty_dateinfo(change.date)}</span>
</span>
<span py:if="field_name == 'attachment' and change.comment" class="attachment-desc searchable" xml:space="preserve">
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_delete.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_delete.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_delete.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_delete.html Thu Feb 27 02:14:33 2014
@@ -23,6 +23,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="layout.html" />
<head>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_preview.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_preview.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_preview.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_ticket_preview.html Thu Feb 27 02:14:33 2014
@@ -24,6 +24,7 @@ Render data relevant to automatic ticket
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
py:with="can_append = 'TICKET_APPEND' in perm(ticket.resource);
has_edit_comment = 'TICKET_EDIT_COMMENT' in perm(ticket.resource);"
py:strip="">
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_timeline.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_timeline.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_timeline.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_timeline.html Thu Feb 27 02:14:33 2014
@@ -23,7 +23,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
- xmlns:i18n="http://genshi.edgewall.org/i18n">
+ xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme">
<xi:include href="layout.html" />
<head>
<title>Timeline</title>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_verify_email.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_verify_email.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_verify_email.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_verify_email.html Thu Feb 27 02:14:33 2014
@@ -24,7 +24,7 @@
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:i18n="http://genshi.edgewall.org/i18n"
- i18n:domain="bloodhound">
+ i18n:domain="bhtheme">
<xi:include href="layout.html" />
<?python
if _dgettext is not None:
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_delete.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_delete.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_delete.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_delete.html Thu Feb 27 02:14:33 2014
@@ -23,7 +23,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
- xmlns:i18n="http://genshi.edgewall.org/i18n">
+ xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme">
<xi:include href="layout.html" />
<head>
<title>$title</title>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_edit.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_edit.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_edit.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_edit.html Thu Feb 27 02:14:33 2014
@@ -23,7 +23,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:py="http://genshi.edgewall.org/"
- xmlns:i18n="http://genshi.edgewall.org/i18n">
+ xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme">
<xi:include href="layout.html" />
<!--! Note: the wiki edit page can be presented according to several modes:
@@ -143,7 +144,7 @@
<py:choose test="action">
<py:when test="'collision'">
<div class="span12">
- <div class="alert alert-error">
+ <div class="alert alert-error" i18n:msg="">
<span class="label label-important">Oops !</span>
Sorry, this page has been modified by somebody else since you started
editing. Your changes cannot be saved.
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_edit_form.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_edit_form.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_edit_form.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_edit_form.html Thu Feb 27 02:14:33 2014
@@ -22,7 +22,8 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
- xmlns:i18n="http://genshi.edgewall.org/i18n" py:strip="">
+ xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme" py:strip="">
<form id="edit" action="${href.wiki(page.name)}" method="post">
<fieldset class="${classes('controlgroup', sidebyside=sidebyside)}">
<input type="hidden" name="from_editor" value="1" />
@@ -67,7 +68,7 @@ $page.text</textarea>
<input id="author" type="text" class="input-xlarge" name="author" value="$author" />
</label>
<p py:if="author == 'anonymous'" class="hint">
- <i18n:msg>E-mail address and user name can be saved in the <a href="${href.prefs()}">Preferences</a>.</i18n:msg>
+ <i18n:msg>E-mail address and user name can be saved in the <a href="${href.prefs()}" class="trac-target-new">Preferences</a>.</i18n:msg>
</p>
</div>
<div class="field">
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_rename.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_rename.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_rename.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_rename.html Thu Feb 27 02:14:33 2014
@@ -23,7 +23,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
- xmlns:i18n="http://genshi.edgewall.org/i18n">
+ xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme">
<xi:include href="layout.html" />
<head>
<title>$title</title>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_view.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_view.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_view.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bh_wiki_view.html Thu Feb 27 02:14:33 2014
@@ -23,6 +23,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
xmlns:xi="http://www.w3.org/2001/XInclude"
py:with="modify_perm = 'WIKI_MODIFY' in perm(page.resource);
admin_perm = 'WIKI_ADMIN' in perm(page.resource);
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bloodhound_theme.html?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bloodhound_theme.html (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/templates/bloodhound_theme.html Thu Feb 27 02:14:33 2014
@@ -1,4 +1,4 @@
-<!--
+<!--!
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
@@ -23,6 +23,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:py="http://genshi.edgewall.org/"
+ xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="bhtheme"
py:strip="">
<py:match path="head" once="true"><head>
@@ -98,7 +100,7 @@
method="get">
<div class="input-append">
<input type="text" class="input-medium" id="q" name="q"
- placeholder="Search all products. Try TracLinks."
+ placeholder="${dgettext('bhtheme', 'Search all products. Try TracLinks.')}"
value="${req.search_query}" />
<input py:for="name, value in extra_search_fields"
type="hidden"
@@ -115,12 +117,13 @@
<!--! create ticket button + dropdown -->
<py:def function="field_select(field)">
<select id="field-${field.name}" name="field_${field.name}"
- class="input-block-level" data-empty="true" data-field="${field.name}">
- <option py:if="field.optional"></option>
+ class="input-block-level" data-field="${field.name}" data-optional="${'true' if field.optional else 'false'}">
+ <option value="">${'' if field.optional else 'Choose...'}</option>
<option py:for="idx,option in enumerate(field.options)"
py:with="description = field.options_desc[idx] if field.options_desc else option"
selected="${field.value == option or None}"
- value = "$option"
+ value = "${option.value}"
+ data-product-new-ticket-url = "${option.product_new_ticket_url}"
py:content="description"></option>
<optgroup py:for="optgroup in field.optgroups"
py:if="optgroup.options"
@@ -174,7 +177,7 @@
</div>
<py:for each="field in qct.hidden_fields">
- <input type="hidden" name="field_${field.name}" value="${field.value}" />
+ <input class="qct-product-scope-extra" type="hidden" name="field_${field.name}" value="${field.value}" />
</py:for>
</form>
@@ -183,12 +186,17 @@
<a id="qct-more" class="btn btn-link" href="${href.newticket()}">More fields</a>
<button id="qct-cancel" class="btn btn-link">Cancel</button>
</div>
+ <div id="qct-last-container" style="display:none">
+ <small class="pull-right" id="qct-last"></small>
+ </div>
</py:when>
<div py:otherwise="" class="alert alert-info">
<p>
<span class="label label-important">TICKET_CREATE</span>
privileges are required to perform this operation.
You don't have the required permissions
+ </p>
+ <p>
<py:choose>
<py:when test="req.authname == 'anonymous'">
<br/><br/>
@@ -338,6 +346,8 @@
<span class="label label-important">TICKET_CREATE</span>
privileges are required to perform this operation.
You don't have the required permissions
+ </p>
+ <p>
<py:choose>
<py:when test="req.authname == 'anonymous'">
<br/><br/>
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/theme.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/theme.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/theme.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/bhtheme/theme.py Thu Feb 27 02:14:33 2014
@@ -1,3 +1,4 @@
+# -*- coding: UTF-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -32,12 +33,12 @@ from trac.ticket.notification import Tic
from trac.ticket.web_ui import TicketModule
from trac.util.compat import set
from trac.util.presentation import to_json
-from trac.util.translation import _
from trac.versioncontrol.web_ui.browser import BrowserModule
from trac.web.api import IRequestFilter, IRequestHandler, ITemplateStreamFilter
from trac.web.chrome import (add_stylesheet, add_warning, INavigationContributor,
- ITemplateProvider, prevnext_nav, Chrome)
+ ITemplateProvider, prevnext_nav, Chrome, add_script)
from trac.wiki.admin import WikiAdmin
+from trac.wiki.formatter import format_to_html
from themeengine.api import ThemeBase, ThemeEngineSystem
@@ -46,14 +47,15 @@ from bhdashboard.web_ui import Dashboard
from bhdashboard import wiki
from multiproduct.env import ProductEnvironment
+from multiproduct.model import Product
from multiproduct.web_ui import PRODUCT_RE, ProductModule
+from bhtheme.translation import _, add_domain
try:
from multiproduct.ticket.web_ui import ProductTicketModule
except ImportError:
ProductTicketModule = None
-
class BloodhoundTheme(ThemeBase):
"""Look and feel of Bloodhound issue tracker.
"""
@@ -127,11 +129,14 @@ class BloodhoundTheme(ThemeBase):
# Version control
'browser.html': ('bh_browser.html', '_modify_browser'),
+ 'changeset.html': ('bh_changeset.html', None),
+ 'diff_form.html': ('bh_diff_form.html', None),
'dir_entries.html': ('bh_dir_entries.html', None),
'revisionlog.html': ('bh_revisionlog.html', '_modify_browser'),
# Multi Product
'product_view.html': ('bh_product_view.html', '_add_products_general_breadcrumb'),
+ 'product_list.html': ('bh_product_list.html', '_modify_product_list'),
# General purpose
'about.html': ('bh_about.html', None),
@@ -151,23 +156,26 @@ class BloodhoundTheme(ThemeBase):
("body//table[not(contains(@class, 'table'))]", # TODO: Accurate ?
['table', 'table-condensed']),
)
-
- labels_application_short = Option('labels', 'application_short',
- 'Bloodhound', """A short version of application name most commonly
- displayed in text, titles and labels""")
-
- labels_application_full = Option('labels', 'application_full',
- 'Apache Bloodhound', """This is full name with trade mark and
- everything, it is currently used in footers and about page only""")
-
- labels_footer_left_prefix = Option('labels', 'footer_left_prefix', '',
- """Text to display before full application name in footers""")
-
- labels_footer_left_postfix = Option('labels', 'footer_left_postfix', '',
- """Text to display after full application name in footers""")
-
+
+ labels_application_short = Option('labels', 'application_short',
+ 'Bloodhound', """A short version of application name most commonly
+ displayed in text, titles and labels""", doc_domain='bhtheme')
+
+ labels_application_full = Option('labels', 'application_full',
+ 'Apache Bloodhound', """This is full name with trade mark and
+ everything, it is currently used in footers and about page only""",
+ doc_domain='bhtheme')
+
+ labels_footer_left_prefix = Option('labels', 'footer_left_prefix', '',
+ """Text to display before full application name in footers""",
+ doc_domain='bhtheme')
+
+ labels_footer_left_postfix = Option('labels', 'footer_left_postfix', '',
+ """Text to display after full application name in footers""",
+ doc_domain='bhtheme')
+
labels_footer_right = Option('labels', 'footer_right', '',
- """Text to use as the right aligned footer""")
+ """Text to use as the right aligned footer""", doc_domain='bhtheme')
_wiki_pages = None
Chrome.default_html_doctype = DocType.HTML5
@@ -192,8 +200,8 @@ class BloodhoundTheme(ThemeBase):
# ITemplateStreamFilter methods
def filter_stream(self, req, method, filename, stream, data):
- """Insert default Bootstrap CSS classes if rendering
- legacy templates (i.e. determined by template name prefix)
+ """Insert default Bootstrap CSS classes if rendering
+ legacy templates (i.e. determined by template name prefix)
and renames wiki guide links.
"""
tx = Transformer('body')
@@ -210,12 +218,12 @@ class BloodhoundTheme(ThemeBase):
self.log.debug('BH Theme : Inserting class ' + out_classes)
return out_classes
return attr_modifier
-
+
# Insert default bootstrap CSS classes if necessary
for xpath, classes in self.BOOTSTRAP_CSS_DEFAULTS:
tx = tx.end().select(xpath) \
.attr('class', add_classes(classes))
-
+
# Rename wiki guide links
tx = tx.end() \
.select("body//a[contains(@href,'/wiki/%s')]" % wiki.GUIDE_NAME) \
@@ -226,7 +234,7 @@ class BloodhoundTheme(ThemeBase):
tx = tx.end() \
.select("body//div[@class='error']/h1") \
.map(lambda text: text.replace("Trac", app_short), TEXT)
-
+
return stream | tx
# IRequestFilter methods
@@ -250,22 +258,16 @@ class BloodhoundTheme(ThemeBase):
req.href.wiki = hwiki
- # Move 'admin' entry from mainnav to metanav
- for i, entry in enumerate(req.chrome['nav']['mainnav']):
- if entry['name'] == 'admin':
- req.chrome['nav']['metanav'] \
- .append(req.chrome['nav']['mainnav'].pop(i))
-
return handler
def post_process_request(self, req, template, data, content_type):
"""Post process request filter.
Removes all trac provided css if required"""
-
+
if template is None and data is None and \
sys.exc_info() == (None, None, None):
return template, data, content_type
-
+
def is_active_theme():
is_active = False
active_theme = ThemeEngineSystem(self.env).theme
@@ -290,9 +292,15 @@ class BloodhoundTheme(ThemeBase):
links.get('icon')[0].update(new_icon)
if links.get('shortcut icon'):
links.get('shortcut icon')[0].update(new_icon)
-
+
is_active_theme = is_active_theme()
if self.disable_all_trac_css and is_active_theme:
+ # Move 'admin' entry from mainnav to metanav
+ for i, entry in enumerate(req.chrome['nav'].get('mainnav', [])):
+ if entry['name'] == 'admin':
+ req.chrome['nav'].setdefault('metanav', []) \
+ .append(req.chrome['nav']['mainnav'].pop(i))
+
if self.disable_all_trac_css:
stylesheets = links.get('stylesheet', [])
if stylesheets:
@@ -314,6 +322,9 @@ class BloodhoundTheme(ThemeBase):
data['bhrelations'] = \
self.env.config.getbool('components', 'bhrelations.*', 'false')
+ if req.locale is not None:
+ add_script(req, 'theme/bloodhound/%s.js' % req.locale)
+
return template, data, content_type
# ITemplateProvider methods
@@ -440,6 +451,60 @@ class BloodhoundTheme(ThemeBase):
if isinstance(req.perm.env, ProductEnvironment):
data['resourcepath_template'] = 'bh_path_general.html'
+ def _modify_product_list(self, req, template, data, content_type,
+ is_active):
+ """Transform products list into media list by adding
+ configured product icon as well as further navigation items.
+ """
+ products = data.pop('products')
+ context = data['context']
+ with self.env.db_query as db:
+ icons = db.execute("""
+ SELECT product, value FROM bloodhound_productconfig
+ WHERE product IN (%s) AND section='project' AND
+ option='icon'""" % ', '.join(["%s"] * len(products)),
+ tuple(p.prefix for p in products))
+ icons = dict(icons)
+ data['thumbsize'] = 64
+ # FIXME: Gray icon for missing products
+ no_thumbnail = req.href('chrome/theme/img/bh.ico')
+ product_ctx = lambda item: context.child(item.resource)
+
+ def product_media_data(icons, product):
+ return dict(href=product.href(),
+ thumb=icons.get(product.prefix, no_thumbnail),
+ title=product.name,
+ description=format_to_html(self.env,
+ product_ctx(product),
+ product.description),
+ links={'extras': (([{'href': req.href.products(
+ product.prefix, action='edit'),
+ 'title': _('Edit product %(prefix)s',
+ prefix=product.prefix),
+ 'icon': tag.i(class_='icon-edit'),
+ 'label': _('Edit')},]
+ if 'PRODUCT_MODIFY' in req.perm
+ else []) +
+ [{'href': product.href(),
+ 'title': _('Home page'),
+ 'icon': tag.i(class_='icon-home'),
+ 'label': _('Home')},
+ {'href': product.href.dashboard(),
+ 'title': _('Tickets dashboard'),
+ 'icon': tag.i(class_='icon-tasks'),
+ 'label': _('Tickets')},
+ {'href': product.href.wiki(),
+ 'title': _('Wiki'),
+ 'icon': tag.i(class_='icon-book'),
+ 'label': _('Wiki')}]),
+ 'main': {'href': product.href(),
+ 'title': None,
+ 'icon': tag.i(class_='icon-chevron-right'),
+ 'label': _('Browse')}})
+
+ data['products'] = [product_media_data(icons, product)
+ for product in products]
+
# INavigationContributor methods
def get_active_navigation_item(self, req):
@@ -449,18 +514,25 @@ class BloodhoundTheme(ThemeBase):
if 'BROWSER_VIEW' in req.perm and 'VERSIONCONTROL_ADMIN' in req.perm:
bm = self.env[BrowserModule]
if bm and not list(bm.get_navigation_items(req)):
- yield ('mainnav', 'browser',
- tag.a(_('Browse Source'),
+ yield ('mainnav', 'browser',
+ tag.a(_('Source'),
href=req.href.wiki('TracRepositoryAdmin')))
class QuickCreateTicketDialog(Component):
implements(IRequestFilter, IRequestHandler)
- qct_fields = ListOption('ticket', 'quick_create_fields',
+ qct_fields = ListOption('ticket', 'quick_create_fields',
'product, version, type',
- doc="""Multiple selection fields displayed in create ticket menu""")
+ doc="""Multiple selection fields displayed in create ticket menu""",
+ doc_domain='bhtheme')
+ def __init__(self, *args, **kwargs):
+ import pkg_resources
+ locale_dir = pkg_resources.resource_filename(__name__, 'locale')
+ add_domain(self.env.path, locale_dir)
+ super(QuickCreateTicketDialog, self).__init__(*args, **kwargs)
+
# IRequestFilter(Interface):
def pre_process_request(self, req, handler):
@@ -480,21 +552,28 @@ class QuickCreateTicketDialog(Component)
if (template, data, content_type) != (None,) * 3: # TODO: Check !
if data is None:
data = {}
- req = dummy_request(self.env)
+ dum_req = dummy_request(self.env)
+ dum_req.perm = req.perm
ticket = Ticket(self.env)
- tm._populate(req, ticket, False)
- all_fields = dict([f['name'], f]
- for f in tm._prepare_fields(req, ticket)
+ tm._populate(dum_req, ticket, False)
+ all_fields = dict([f['name'], self.add_prod_new_ticket_url(dum_req, f)]
+ for f in tm._prepare_fields(dum_req, ticket)
if f['type'] == 'select')
product_field = all_fields.get('product')
if product_field:
- if self.env.product:
+ # Filter out products for which user doesn't have TICKET_CREATE
+ product_field['options'] = \
+ [prefix for prefix in product_field['options']
+ if req.perm.has_permission('TICKET_CREATE',
+ Neighborhood('product', prefix['value'])
+ .child(None, None))]
+
+ if self.env.product and \
+ self.env.product.prefix in product_field['options']:
product_field['value'] = self.env.product.prefix
- else:
- product_field['value'] = product_field['options'][0]
product_field['options_desc'] = [
- ProductEnvironment.lookup_env(self.env, p).product.name
+ ProductEnvironment.lookup_env(self.env, p['value']).product.name
for p in product_field['options']
]
else:
@@ -510,8 +589,7 @@ class QuickCreateTicketDialog(Component)
'fields': [all_fields[k] for k in self.qct_fields
if k in all_fields],
'hidden_fields': [all_fields[k] for k in all_fields.keys()
- if k not in self.qct_fields]
- }
+ if k not in self.qct_fields] }
return template, data, content_type
# IRequestHandler methods
@@ -558,7 +636,7 @@ class QuickCreateTicketDialog(Component)
# Public API
def create(self, req, summary, description, attributes={}, notify=False):
- """ Create a new ticket, returning the ticket ID.
+ """ Create a new ticket, returning the ticket ID.
PS: Borrowed from XmlRpcPlugin.
"""
@@ -588,5 +666,17 @@ class QuickCreateTicketDialog(Component)
"of ticket #%s: %s" % (t.id, e))
return t['product'], t.id
+ def add_prod_new_ticket_url(self, req, fields):
+ if fields.get('name') == 'product':
+ options_with_attrs = []
+ for option in fields.get('options', []):
+ options_with_attrs.append({
+ 'value': option,
+ 'product_new_ticket_url': \
+ req.href.products(option, 'newticket')
+ })
+ fields['options'] = options_with_attrs
+ return fields
+
from pkg_resources import get_distribution
application_version = get_distribution('BloodhoundTheme').version
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/setup.cfg
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/setup.cfg?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/setup.cfg (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/setup.cfg Thu Feb 27 02:14:33 2014
@@ -23,3 +23,51 @@ tag_svn_revision = true
[sdist]
formats = gztar,bztar,ztar,tar,zip
+[extract_messages]
+add_comments = TRANSLATOR:
+copyright_holder = Apache Software Foundation
+msgid_bugs_address = dev@bloodhound.apache.org
+output_file = bhtheme/locale/messages.pot
+keywords = _ ngettext:1,2 N_ tag_ tagn_:1,2 Option:4 BoolOption:4 IntOption:4 ListOption:6 ExtensionOption:5 PathOption:4
+no-wrap = true
+
+[init_catalog]
+input_file = bhtheme/locale/messages.pot
+output_dir = bhtheme/locale
+domain = bhtheme
+
+[compile_catalog]
+directory = bhtheme/locale
+domain = bhtheme
+
+[update_catalog]
+input_file = bhtheme/locale/messages.pot
+output_dir = bhtheme/locale
+domain = bhtheme
+
+[extract_messages_js]
+add_comments = TRANSLATOR:
+copyright_holder = Apache Software Foundation
+msgid_bugs_address = dev@bloodhound.apache.org
+output_file = bhtheme/locale/messages-js.pot
+keywords = _ ngettext:1,2 N_
+mapping_file = messages-js.cfg
+
+[init_catalog_js]
+domain = bhtheme-js
+input_file = bhtheme/locale/messages-js.pot
+output_dir = bhtheme/locale
+
+[compile_catalog_js]
+domain = bhtheme-js
+directory = bhtheme/locale
+
+[update_catalog_js]
+domain = bhtheme-js
+input_file = bhtheme/locale/messages-js.pot
+output_dir = bhtheme/locale
+
+[generate_messages_js]
+domain = bhtheme-js
+input_dir = bhtheme/locale
+output_dir = bhtheme/htdocs/bloodhound
\ No newline at end of file
Modified: bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/setup.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/setup.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/setup.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/bloodhound_theme/setup.py Thu Feb 27 02:14:33 2014
@@ -21,6 +21,25 @@
from setuptools import setup
import sys
+extra = {}
+try:
+ from trac.util.dist import get_l10n_js_cmdclass
+ cmdclass = get_l10n_js_cmdclass()
+ if cmdclass:
+ extra['cmdclass'] = cmdclass
+ extractors = [
+ ('**.py', 'trac.dist:extract_python', None),
+ ('**/templates/**.html', 'genshi', None),
+ ('**/templates/**.txt', 'genshi', {
+ 'template_class': 'genshi.template:TextTemplate'
+ }),
+ ]
+ extra['message_extractors'] = {
+ 'bhtheme': extractors,
+ }
+except ImportError:
+ pass
+
setup(
name = 'BloodhoundTheme',
version = '0.8.0',
@@ -32,7 +51,7 @@ setup(
packages = ['bhtheme'],
package_data = {'bhtheme': ['htdocs/*.*', 'htdocs/img/*.*',
'htdocs/js/*.js', 'htdocs/css/*.css',
- 'templates/*.*']},
+ 'templates/*.*', 'locale/*/LC_MESSAGES/*.mo']},
classifiers = [
'Framework :: Trac',
],
@@ -41,5 +60,6 @@ setup(
entry_points = {
'trac.plugins': [
'bhtheme.theme = bhtheme.theme',
- ]}
+ ]},
+ **extra
)
Modified: bloodhound/branches/bep_0007_embeddable_objects/installer/bloodhound_setup.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/installer/bloodhound_setup.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/installer/bloodhound_setup.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/installer/bloodhound_setup.py Thu Feb 27 02:14:33 2014
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
+#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
@@ -31,16 +31,17 @@ import time
from createdigest import htdigest_create
-from trac.util import translation
-from trac.util.translation import _, get_negotiated_locale, has_babel
LANG = os.environ.get('LANG')
try:
+ from trac.util import translation
+ from trac.util.translation import _, get_negotiated_locale, has_babel
from trac.admin.console import TracAdmin
from trac.config import Configuration
except ImportError, e:
- print ("Post install setup requires that Bloodhound is properly installed "
- "Traceback for error follows:\n")
+ print ("Requirements should be installed before running bloodhound_setup.py.\n"
+ "You can install them with the following command:\n"
+ " pip install -r requirements.txt\n")
traceback.print_exc()
sys.exit(1)
@@ -70,9 +71,7 @@ BASE_CONFIG = {'components': {'bhtheme.*
'header_logo': {'src': '',},
'mainnav': {'roadmap': 'disabled',
'search': 'disabled',
- 'timeline': 'disabled',
- 'browser.label': 'Source',
- 'tickets.label': 'Tickets',},
+ 'timeline': 'disabled',},
'metanav': {'about': 'disabled',},
'theme': {'theme': 'bloodhound',},
'trac': {'mainnav': ','.join(['dashboard', 'wiki', 'browser',
@@ -133,6 +132,9 @@ class BloodhoundSetup(object):
options['envsdir'] = os.path.join('bloodhound',
'environments')
+ # Flags used when running the functional test suite
+ self.apply_bhwiki_upgrades = True
+
def _generate_db_str(self, options):
"""Builds an appropriate db string for trac-admin for sqlite and
postgres options. Also allows for a user to provide their own db string
@@ -157,16 +159,16 @@ class BloodhoundSetup(object):
def setup(self, **kwargs):
"""Do the setup. A kwargs dictionary may be passed to override base
options, potentially allowing for multiple environment creation."""
-
+
if has_babel:
import babel
try:
- locale = get_negotiated_locale([LANG])
+ locale = get_negotiated_locale([LANG])
locale = locale or babel.Locale.default()
except babel.UnknownLocaleError:
pass
translation.activate(locale)
-
+
options = dict(self.options)
options.update(kwargs)
if psycopg2 is None and options.get('dbtype') == 'postgres':
@@ -212,14 +214,15 @@ class BloodhoundSetup(object):
trac = TracAdmin(os.path.abspath(new_env))
if not trac.env_check():
try:
- trac.do_initenv('%(project)s %(db)s '
- '%(repo_type)s %(repo_path)s '
- '--inherit=%(inherit)s '
- '--nowiki'
- % options)
+ rv = trac.do_initenv('%(project)s %(db)s '
+ '%(repo_type)s %(repo_path)s '
+ '--inherit=%(inherit)s '
+ '--nowiki'
+ % options)
+ if rv == 2:
+ raise SystemExit
except SystemExit:
- print ("Error: Unable to initialise the database"
- "Traceback for error is above")
+ print ("Error: Unable to initialise the environment.")
return False
else:
print ("Warning: Environment already exists at %s." % new_env)
@@ -265,9 +268,12 @@ class BloodhoundSetup(object):
print "Running wiki upgrades"
bloodhound.onecmd('wiki upgrade')
-
- print "Running wiki Bloodhound upgrades"
- bloodhound.onecmd('wiki bh-upgrade')
+
+ if self.apply_bhwiki_upgrades:
+ print "Running wiki Bloodhound upgrades"
+ bloodhound.onecmd('wiki bh-upgrade')
+ else:
+ print "Skipping Bloodhound wiki upgrades"
print "Loading default product wiki"
bloodhound.onecmd('product admin %s wiki load %s' %
@@ -278,9 +284,12 @@ class BloodhoundSetup(object):
bloodhound.onecmd('product admin %s wiki upgrade' %
default_product_prefix)
- print "Running default product wiki Bloodhound upgrades"
- bloodhound.onecmd('product admin %s wiki bh-upgrade' %
- default_product_prefix)
+ if self.apply_bhwiki_upgrades:
+ print "Running default product Bloodhound wiki upgrades"
+ bloodhound.onecmd('product admin %s wiki bh-upgrade' %
+ default_product_prefix)
+ else:
+ print "Skipping default product Bloodhound wiki upgrades"
print """
You can now start Bloodhound by running:
Modified: bloodhound/branches/bep_0007_embeddable_objects/installer/createdigest.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/installer/createdigest.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/installer/createdigest.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/installer/createdigest.py Thu Feb 27 02:14:33 2014
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-
+#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
@@ -38,11 +38,11 @@ def htdigest_create(filename, user, real
data line by line into a temporary file, commenting out any lines that match
the user and realm data. The new entry is then appended before the temporary
copy is moved back to the original location"""
-
+
user_realm = ':'.join((user, realm))
digest = md5(':'.join((user_realm, password))).hexdigest()
data = ':'.join((user_realm, digest)) + '\n'
-
+
filepath = os.path.join(path, filename)
temp, tempfilepath = mkstemp()
with open(tempfilepath,'w') as tempdigestfile:
@@ -61,7 +61,7 @@ def htdigest_create(filename, user, real
def main():
"""Parse arguments and run the function"""
-
+
parser = OptionParser()
parser.add_option('-f', '--digestfile', dest='digestfile',
help='htdigest filename')
@@ -71,18 +71,18 @@ def main():
help='user name')
parser.add_option('-p', '--password', dest='password',
help='password for USER')
-
+
(opts, args) = parser.parse_args()
-
+
if not opts.digestfile:
input_file = raw_input('Enter the file [%s]: ' % DEFAULT_FILE)
opts.digestfile = input_file if input_file else DEFAULT_FILE
path, filename = os.path.split(opts.digestfile)
-
+
if not opts.user:
input_user = raw_input('Enter the user [%s]: ' % DEFAULT_USER)
opts.user = input_user if input_user else DEFAULT_USER
-
+
if not opts.password:
attempts = 3
for attempt in range(attempts):
@@ -97,11 +97,11 @@ def main():
if not opts.password:
print "Passwords did not match. Quitting."
sys.exit(1)
-
+
if not opts.realm:
input_realm = raw_input('Enter the auth realm [%s]: ' % DEFAULT_REALM)
opts.realm = input_realm if input_realm else DEFAULT_REALM
-
+
htdigest_create(filename, opts.user, opts.realm, opts.password, path)
if __name__ == '__main__':
Modified: bloodhound/branches/bep_0007_embeddable_objects/installer/tests.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/installer/tests.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/installer/tests.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/installer/tests.py Thu Feb 27 02:14:33 2014
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
@@ -56,23 +58,23 @@ class BloodhoundSetupTest(unittest.TestC
self.bhs = BloodhoundSetup({})
self.basedata = {'section': {'option1': 'option1value',
'option2': 'option2value',},}
-
+
def tearDown(self):
shutil.rmtree(self.tempdir)
-
+
def test_db_str_no_options(self):
"""Checks that giving no options at all has defaults enough to create
a sqlite db string"""
self.assertEqual(self.bhs._generate_db_str({}), 'sqlite:' +
os.path.join('db', 'bloodhound.db'))
-
+
def test_db_str_provided_db_string(self):
"""Checks that if a dbstring is provided it will not be respected above
other options"""
dbstr = 'sillyexample'
options = {'dbstring': dbstr,}
self.assertEqual(self.bhs._generate_db_str(options), dbstr)
-
+
def test_writeconfig_create_basic_config(self):
filepath = os.path.join(self.tempdir, 'basic.ini')
data = [self.basedata]
@@ -82,7 +84,7 @@ class BloodhoundSetupTest(unittest.TestC
with file(filepath) as f:
fdata = f.read()
self.assertIn('option1value', fdata)
-
+
def test_writeconfig_update_config(self):
"""Checks that writing a new config with non-overlapping values updates
an existing file"""
@@ -95,7 +97,7 @@ class BloodhoundSetupTest(unittest.TestC
with file(filepath) as f:
fdata = f.read()
self.assertIn('option3value', fdata)
-
+
def test_writeconfig_update_config_overwrite_values(self):
"""Checks that writing a new config with non-overlapping values updates
an existing file"""
Propchange: bloodhound/branches/bep_0007_embeddable_objects/trac/
------------------------------------------------------------------------------
Merged /bloodhound/trunk/trac:r1523787-1572402
Modified: bloodhound/branches/bep_0007_embeddable_objects/trac/trac/resource.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/trac/trac/resource.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/trac/trac/resource.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/trac/trac/resource.py Thu Feb 27 02:14:33 2014
@@ -665,7 +665,7 @@ def get_resource_description(env, resour
rsys = ResourceSystem(manager_for_neighborhood(env,
resource.neighborhood))
except ResourceNotFound:
- pass
+ rsys = ResourceSystem(env)
else:
manager = rsys.get_resource_manager(resource.realm)
if manager and hasattr(manager, 'get_resource_description'):
@@ -791,8 +791,7 @@ def resource_exists(env, resource):
False
"""
try:
- rsys = ResourceSystem(manager_for_neighborhood(env,
- resource.neighborhood))
+ ResourceSystem(manager_for_neighborhood(env, resource.neighborhood))
except ResourceNotFound:
return False
manager = ResourceSystem(env).get_resource_manager(resource.realm)
Modified: bloodhound/branches/bep_0007_embeddable_objects/trac/trac/test.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/trac/trac/test.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/trac/trac/test.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/trac/trac/test.py Thu Feb 27 02:14:33 2014
@@ -285,7 +285,7 @@ class EnvironmentStub(Environment):
init_global = False
if self.global_databasemanager:
- self.components[DatabaseManager] = global_databasemanager
+ self.components[DatabaseManager] = self.global_databasemanager
else:
self.config.set('trac', 'database', self.dburi)
self.global_databasemanager = DatabaseManager(self)
Modified: bloodhound/branches/bep_0007_embeddable_objects/trac/trac/tests/functional/__init__.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/trac/trac/tests/functional/__init__.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/trac/trac/tests/functional/__init__.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/trac/trac/tests/functional/__init__.py Thu Feb 27 02:14:33 2014
@@ -104,6 +104,8 @@ if twill:
else:
env_class = FunctionalTestEnvironment
+ tester_class = FunctionalTester
+
def setUp(self, port=None):
"""If no port is specified, use a semi-random port and subdirectory
'testenv'; but if a port is specified, use that port and
@@ -119,7 +121,7 @@ if twill:
baseurl = "http://127.0.0.1:%s" % port
self._testenv = self.env_class(dirname, port, baseurl)
self._testenv.start()
- self._tester = FunctionalTester(baseurl)
+ self._tester = self.tester_class(baseurl)
self.fixture = (self._testenv, self._tester)
def tearDown(self):
Modified: bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/api.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/api.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/api.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/api.py Thu Feb 27 02:14:33 2014
@@ -364,8 +364,9 @@ class TicketSystem(Component):
# Fields without possible values are treated as if they didn't
# exist
continue
- field.update({'value': getattr(self, 'default_' + name, ''),
- 'options': options})
+ if 'value' not in field:
+ field['value'] = getattr(self, 'default_' + name, '')
+ field['options'] = options
fields.append(field)
# Advanced text fields
Modified: bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/model.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/model.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/model.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/model.py Thu Feb 27 02:14:33 2014
@@ -242,11 +242,17 @@ class Ticket(object):
if getattr(self.env, '_multiproduct_schema_enabled', False):
tkt_id = db.get_last_id(cursor, 'ticket', 'uid')
rows = db("""SELECT id FROM ticket WHERE uid=%s""", (tkt_id,))
- tkt_id = rows[0][0] if rows else -1
+ if len(rows) != 1:
+ # One row SHOULD always be retrieved, but if it does not
+ # then insertion MUST fail since the cause may be a bug in
+ # BH SQL translator executing previous INSERT without
+ # product prefix properly setup.
+ # By raising the error the transaction should be rolled back
+ raise AssertionError("No ticket id for uid " + str(tkt_id))
+ tkt_id = rows[0][0]
else:
tkt_id = db.get_last_id(cursor, 'ticket')
-
# Insert custom fields
if custom_fields:
db.executemany(
Modified: bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/query.py
URL: http://svn.apache.org/viewvc/bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/query.py?rev=1572404&r1=1572403&r2=1572404&view=diff
==============================================================================
--- bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/query.py (original)
+++ bloodhound/branches/bep_0007_embeddable_objects/trac/trac/ticket/query.py Thu Feb 27 02:14:33 2014
@@ -40,7 +40,6 @@ from trac.util.datefmt import format_dat
from trac.util.presentation import Paginator
from trac.util.text import empty, shorten_line, quote_query_string
from trac.util.translation import _, tag_, cleandoc_
-from trac.util.introspection import get_enabled_component_subclass
from trac.web import arg_list_to_args, parse_arg_list, IRequestHandler, IRequestFilter
from trac.web.href import Href
from trac.web.chrome import (INavigationContributor, Chrome,
@@ -873,7 +872,7 @@ class QueryModule(Component):
def get_navigation_items(self, req):
from trac.ticket.report import ReportModule
if 'TICKET_VIEW' in req.perm and \
- get_enabled_component_subclass(self.env, ReportModule) is None:
+ not self.env.is_component_enabled(ReportModule):
yield ('mainnav', 'tickets',
tag.a(_('View Tickets'), href=req.href.query()))