You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by ju...@apache.org on 2013/01/08 15:37:01 UTC
svn commit: r1430304 [2/2] - in
/incubator/bloodhound/branches/bep_0003_multiproduct: ./
bloodhound_dashboard/bhdashboard/ bloodhound_dashboard/bhdashboard/widgets/
bloodhound_multiproduct/multiproduct/ bloodhound_multiproduct/tests/
bloodhound_search/...
Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html?rev=1430304&r1=1430303&r2=1430304&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html (original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/templates/bloodhound_theme.html Tue Jan 8 14:37:00 2013
@@ -104,45 +104,37 @@
<option py:if="field.optional"></option>
<option py:for="option in field.options"
selected="${value == option or None}"
+ value = "$option"
py:content="option"></option>
<optgroup py:for="optgroup in field.optgroups"
py:if="optgroup.options"
label="${optgroup.label}">
<option py:for="option in optgroup.options"
selected="${value == option or None}"
+ value = "$option"
py:content="option"></option>
</optgroup>
</select>
</py:def>
<py:def function="qct_box()">
- <label for="field-summary">Summary</label>
- <input type="text" id="field-summary"
- name="field_summary" placeholder="Ticket summary" />
+ <div>
+ <label for="field-summary">Summary</label>
+ <input type="text" id="field-summary"
+ name="field_summary" placeholder="Ticket summary" />
+ </div>
+ <div>
+ <label for="field-description">Description</label>
+ <textarea id="field-description" name="field_description"
+ rows="3" cols="28"
+ placeholder="Ticket description"></textarea>
+ </div>
<div class="form-horizontal">
- <py:if test="qct.fields.product">
- <label class="control-label" for="field-product">Product</label>
- <div class="controls">
- ${field_select(qct.fields.product, None)}
- </div>
- </py:if>
- <py:if test="qct.fields.version">
- <label class="control-label" for="field-version">Version</label>
- <div class="controls">
- ${field_select(qct.fields.version, None)}
- </div>
- </py:if>
- <py:if test="qct.fields.type">
- <label class="control-label" for="field-type">Type</label>
- <div class="controls">
- ${field_select(qct.fields.type, None)}
- </div>
- </py:if>
- <py:if test="qct.fields.component">
- <label class="control-label" for="field-component">Component</label>
- <div class="controls">
- ${field_select(qct.fields.component, None)}
- </div>
- </py:if>
+ <py:for each="field in qct.fields">
+ <label class="control-label" for="field-${field.name}">${field.label}</label>
+ <div class="controls">
+ ${field_select(field, None)}
+ </div>
+ </py:for>
</div>
</py:def>
<py:choose test="">
@@ -156,7 +148,13 @@
<div id="qct-box" class="dropdown-menu" style="width: 300px;"
py:choose="">
<div class="popover-title">
- <a href="${href.newticket()}"><h3>Create Ticket</h3></a>
+ <h3>
+ Create Ticket
+ <a style="top: -33px; right: -25px; position: relative;"
+ class="pull-right" href="${href.newticket()}">
+ <small>Full dialogue »</small>
+ </a>
+ </h3>
</div>
<div class="popover-content">
<py:when test="'TICKET_CREATE' in perm">
@@ -278,8 +276,8 @@
<div class="row footer">
<div class="span8">
${chrome.labels.footer_left_prefix}
- Powered by <a href="http://www.apache.org/">Apache<sup>TM</sup></a>
- <a href="${href.about()}">${chrome.labels.application_short}
+ Powered by
+ <a href="${href.about()}">${chrome.labels.application_full}
${chrome.labels.application_version}</a>
${chrome.labels.footer_left_postfix}
</div>
Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py?rev=1430304&r1=1430303&r2=1430304&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py (original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py Tue Jan 8 14:37:00 2013
@@ -17,10 +17,12 @@
# under the License.
from genshi.builder import tag
-from genshi.core import TEXT
+from genshi.core import TEXT
from genshi.filters.transform import Transformer
+from trac.config import Option
from trac.core import *
+from trac.config import ListOption
from trac.mimeview.api import get_mimetype
from trac.resource import Resource
from trac.ticket.api import TicketSystem
@@ -117,12 +119,34 @@ class BloodhoundTheme(ThemeBase):
("body//table[not(contains(@class, 'table'))]", # TODO: Accurate ?
['table', 'table-condensed']),
)
+
+ labels_application_short = Option('labels', 'application_short',
+ 'Bloodhound')
+
+ labels_application_full = Option('labels', 'application_full',
+ 'Apache Bloodhound')
+
+ labels_footer_left_prefix = Option('labels', 'footer_left_prefix', '')
+
+ labels_footer_left_postfix = Option('labels', 'footer_left_postfix', '')
+
+ labels_footer_right = Option('labels', 'footer_right', '')
_wiki_pages = None
implements(IRequestFilter, INavigationContributor, ITemplateProvider,
ITemplateStreamFilter)
+ def _get_whitelabelling(self):
+ """Gets the whitelabelling config values"""
+ return dict(
+ application_short = self.labels_application_short,
+ application_full = self.labels_application_full,
+ footer_left_prefix = self.labels_footer_left_prefix,
+ footer_left_postfix = self.labels_footer_left_postfix,
+ footer_right = self.labels_footer_right,
+ application_version = ".".join(map(str, application_version)))
+
# ITemplateStreamFilter methods
def filter_stream(self, req, method, filename, stream, data):
@@ -153,7 +177,13 @@ class BloodhoundTheme(ThemeBase):
# Rename wiki guide links
tx = tx.end() \
.select("body//a[contains(@href,'/wiki/%s')]" % wiki.GUIDE_NAME) \
- .map(lambda text: wiki.new_name(text), TEXT)
+ .map(lambda text: wiki.new_name(text), TEXT)
+
+ # Rename trac error
+ app_short = self.labels_application_short
+ tx = tx.end() \
+ .select("body//div[@class='error']/h1") \
+ .map(lambda text: text.replace("Trac", app_short), TEXT)
return stream | tx
@@ -191,19 +221,7 @@ class BloodhoundTheme(ThemeBase):
is_active = active_theme['name'] == this_theme_name
return is_active
- c = self.env.config
- req.chrome['labels'] = dict(
- application_short = c.get(
- 'labels', 'application_short', "Bloodhound"),
- application_full = c.get(
- 'labels', 'application_full', "Apache Bloodhound"),
- footer_left_prefix = c.get(
- 'labels', 'footer_left_prefix', ""),
- footer_left_postfix = c.get(
- 'labels', 'footer_left_postfix', ""),
- footer_right = c.get(
- 'labels', 'footer_right', ""),
- application_version = ".".join(map(str, application_version)))
+ req.chrome['labels'] = self._get_whitelabelling()
links = req.chrome.get('links',{})
# replace favicon if appropriate
@@ -313,6 +331,10 @@ class BloodhoundTheme(ThemeBase):
class QuickCreateTicketDialog(Component):
implements(IRequestFilter, IRequestHandler)
+ qct_fields = ListOption('ticket', 'quick_create_fields',
+ 'product,version,type',
+ doc="""Multiple selection fields displayed in create ticket menu""")
+
# IRequestFilter(Interface):
def pre_process_request(self, req, handler):
@@ -335,9 +357,11 @@ class QuickCreateTicketDialog(Component)
fakereq = dummy_request(self.env)
ticket = Ticket(self.env)
tm._populate(fakereq, ticket, False)
- fields = dict([f['name'], f] \
- for f in tm._prepare_fields(fakereq, ticket))
- data['qct'] = { 'fields' : fields }
+ all_fields = dict([f['name'], f] \
+ for f in tm._prepare_fields(fakereq, ticket) \
+ if f['type'] == 'select')
+ data['qct'] = {'fields': [all_fields[k] for k in self.qct_fields
+ if k in all_fields]}
return template, data, content_type
# IRequestHandler methods
Modified: incubator/bloodhound/branches/bep_0003_multiproduct/installer/bloodhound_setup.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/installer/bloodhound_setup.py?rev=1430304&r1=1430303&r2=1430304&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/installer/bloodhound_setup.py (original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/installer/bloodhound_setup.py Tue Jan 8 14:37:00 2013
@@ -95,7 +95,6 @@ ACCOUNTS_CONFIG = {'account-manager': {'
'htdigest_realm' : '',
'htpasswd_file' : '',
'htpasswd_hash_type' : 'crypt',
- 'password_file' : '',
'password_store' : 'HtDigestStore',
'persistent_sessions' : 'False',
'refresh_passwd' : 'False',
@@ -197,7 +196,6 @@ class BloodhoundSetup(object):
accounts_config = dict(ACCOUNTS_CONFIG)
accounts_config['account-manager']['htdigest_file'] = digestfile
accounts_config['account-manager']['htdigest_realm'] = realm
- accounts_config['account-manager']['password_file'] = digestfile
trac = TracAdmin(os.path.abspath(new_env))
if not trac.env_check():
Propchange: incubator/bloodhound/branches/bep_0003_multiproduct/trac/
------------------------------------------------------------------------------
Merged /incubator/bloodhound/trunk/trac:r1420072-1430287
Modified: incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/mimeview/patch.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/mimeview/patch.py?rev=1430304&r1=1430303&r2=1430304&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/mimeview/patch.py (original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/mimeview/patch.py Tue Jan 8 14:37:00 2013
@@ -40,7 +40,7 @@ class PatchRenderer(Component):
# IHTMLPreviewRenderer methods
def get_quality_ratio(self, mimetype):
- if mimetype == 'text/x-diff':
+ if mimetype in ('text/x-diff', 'text/x-patch'):
return 8
return 0