New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XAMEETINGS-148 : Don't display PARTICIPATING GROUPS field if value is empty #15 #16
Conversation
; <label for="Meeting.Code.MeetingClass_0_groups">$!services.icon.render('group') $services.localization.render('contrib.meeting.field.groups')</label>## | ||
#if ($xcontext.action == 'edit') | ||
#if ($xcontext.action == 'edit' || $doc.getValue('groups') != '') | ||
; <label for="Meeting.Code.MeetingClass_0_groups">$!services.icon.render('group') $services.localization.render('contrib.meeting.field.groups')</label>## | ||
(% class="xHint" %)$services.localization.render('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rendering an empty string, is there any translation associated to that label?
@@ -236,19 +236,19 @@ | |||
#end | |||
: $doc.display('participants') | |||
## groups | |||
; <label for="Meeting.Code.MeetingClass_0_groups">$!services.icon.render('group') $services.localization.render('contrib.meeting.field.groups')</label>## | |||
#if ($xcontext.action == 'edit') | |||
#if ($xcontext.action == 'edit' || $doc.getValue('groups') != '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right check here would be "$!doc.getValue('groups')" != ''
.
; <label for="Meeting.Code.MeetingClass_0_groups">$!services.icon.render('group') $services.localization.render('contrib.meeting.field.groups')</label>## | ||
#if ($xcontext.action == 'edit') | ||
#if ($xcontext.action == 'edit' || $doc.getValue('groups') != '') | ||
; <label for="Meeting.Code.MeetingClass_0_groups">$!services.icon.render('group') $services.localization.render('contrib.meeting.field.groups')</label>## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please indent here the code, so it stays in max 120 chars in a line.
@@ -112,7 +112,9 @@ | |||
#set ($title = $doc.getValue('meetingTitle')) | |||
#end | |||
#set ($meetingTitleId = 'Meeting.Code.MeetingClass_0_meetingTitle') | |||
; <label for="">$!services.icon.render('font') $services.localization.render('contrib.meeting.field.meetingTitle')</label> | |||
; <label for=""> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the value in the for
attribute is empty and the label won't work properly.
$!services.icon.render('user') $services.localization.render('contrib.meeting.field.leader') | ||
</label> | ||
: $doc.display('leader') | ||
#if ($xcontext.action == 'edit' || "$!doc.getValue('leader')" != '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of duplication. You could also write a macro with some parameters to handle multiple fields.
Also first fix the conflict. |
… empty #15 *created a macro to avoid duplication
…ion-meeting into XAMEETINGS-148
… empty #15 *small fixes
@@ -94,6 +107,8 @@ | |||
#set($newPollReference = $services.model.createDocumentReference('', 'XPoll', $title)) | |||
$response.sendRedirect($xwiki.getURL($newPollReference, 'edit', "$!{request.queryString}")) | |||
#end | |||
##if ($doc.getObject('Meeting.Code.MeetingClass')) | |||
#set ($job = $doc.getObject('Meeting.Code.MeetingClass')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$job
name doesn't seem to make any sense here. Instead, you could use $obj
.
… empty #15 *small fixes
No description provided.