summaryrefslogtreecommitdiffstats
path: root/extensions/BugModal/template
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/BugModal/template')
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl18
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/field.html.tmpl15
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/user.html.tmpl5
3 files changed, 33 insertions, 5 deletions
diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
index 024f4f6a5..e198a8706 100644
--- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ -364,6 +364,7 @@
[% INCLUDE bug_modal/field.html.tmpl
field = bug_fields.bug_status
field_type = constants.FIELD_TYPE_SINGLE_SELECT
+ editable = bug.choices.bug_status.size > 1
values = bug.choices.bug_status
inline = 1
no_indent = 1
@@ -372,6 +373,7 @@
[% INCLUDE bug_modal/field.html.tmpl
field = bug_fields.resolution
field_type = constants.FIELD_TYPE_SINGLE_SELECT
+ editable = bug.choices.resolution.size > (bug.resolution == "" ? 0 : 1)
values = bug.choices.resolution
inline = 1
edit_only = 1
@@ -432,8 +434,12 @@
hide_on_view = bug.mentors.size == 0
%]
[%
- FOREACH mentor IN bug.mentors;
- INCLUDE bug_modal/user.html.tmpl u=mentor;
+ IF bug.mentors.size;
+ FOREACH mentor IN bug.mentors;
+ INCLUDE bug_modal/user.html.tmpl u=mentor;
+ END;
+ ELSE;
+ "---";
END;
%]
[% END %]
@@ -573,7 +579,7 @@
field_type = constants.FIELD_TYPE_KEYWORDS
hide_on_view = bug.keyword_objects.size == 0
%]
- [% bug.keyword_objects.pluck("name").join(", ") FILTER html %]
+ [% bug.keyword_objects.pluck("name").join(", ") || "---" FILTER html %]
[% END %]
[% UNLESS cf_hidden_in_product('cf_fx_iteration', bug.product, bug.component, bug) %]
@@ -828,7 +834,11 @@
[% END %]
</div>
[% END %]
- <pre id="user-story">[% bug.cf_user_story FILTER html %]</pre>
+ [% IF bug.cf_user_story == "" %]
+ ---
+ [% ELSE %]
+ <pre id="user-story">[% bug.cf_user_story FILTER html %]</pre>
+ [% END %]
[% IF user.id %]
<textarea id="cf_user_story" name="cf_user_story" style="display:none" rows="10" cols="80">
[%~ bug.cf_user_story FILTER html ~%]
diff --git a/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl
index cb2ce7a7a..2d2cb56cf 100644
--- a/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl
@@ -52,10 +52,23 @@ END;
IF field_type == "";
field_type = -1;
END;
+# date picker fields should always be short
IF field_type == constants.FIELD_TYPE_DATE
|| field_type == constants.FIELD_TYPE_DATETIME;
short_width = 1;
END;
+# determine if a field is set
+IF field_type == constants.FIELD_TYPE_BUG_URLS || field_type == constants.FIELD_TYPE_BUG_LIST;
+ has_value = values.size > 0;
+ELSIF field_type == constants.FIELD_TYPE_MULTI_SELECT || field_type == constants.FIELD_TYPE_USERS;
+ has_value = value.size > 0;
+ELSE;
+ has_value = value != "";
+END;
+# switch to view mode if edit-only and the current user cannot edit
+IF !editable && edit_only;
+ edit_only = 0;
+END;
%]
<div class="field
@@ -78,6 +91,8 @@ END;
[% END %]
[% IF content.defined %]
[% content FILTER none %]
+ [% ELSIF !editable && !has_value %]
+ ---
[% ELSE %]
[% SWITCH field_type %]
diff --git a/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl
index 718eb5e79..4f312e654 100644
--- a/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/user.html.tmpl
@@ -15,7 +15,10 @@
#%]
[%
-RETURN UNLESS u.id;
+IF !u.id;
+ "---";
+ RETURN;
+END;
DEFAULT gravatar_size = 0;
IF user.settings.show_gravatars.value != 'On';
gravatar_size = 0;