Skip to content
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

Merged
merged 12 commits into from Jul 31, 2018
Merged

XAMEETINGS-148 : Don't display PARTICIPATING GROUPS field if value is empty #15 #16

merged 12 commits into from Jul 31, 2018

Conversation

CostiChD
Copy link

No description provided.

; <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('')
Copy link

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') != '')
Copy link

@acotiuga acotiuga Jul 13, 2018

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>##
Copy link

@acotiuga acotiuga Jul 13, 2018

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.

… empty #15

*indent
*minor code improvements
*deleted hint with no translation key
@@ -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="">

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.

… empty #15

*dont display labels if there is no value
*minor code improvements
… empty #15

*use the "for" attribute only in edit mode
$!services.icon.render('user') $services.localization.render('contrib.meeting.field.leader')
</label>
: $doc.display('leader')
#if ($xcontext.action == 'edit' || "$!doc.getValue('leader')" != '')
Copy link

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.

@evalica
Copy link

evalica commented Jul 19, 2018

Also first fix the conflict.

@@ -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'))

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.

@acotiuga acotiuga merged commit 656a11f into xwikisas:master Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants