-
Notifications
You must be signed in to change notification settings - Fork 55
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
Issue 633 - Remove dependency of portal_calendar tool #653
base: master
Are you sure you want to change the base?
Conversation
|
||
def getEventTypes(self): | ||
types = self.calendar.getCalendarTypes() | ||
return ''.join(map(lambda x: 'Type={0}&'.format(self.url_quote_plus(x)), types)) | ||
return 'Type=Event&' |
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.
@rodfersou do not hard-code this neither; create a getCalendarTypes()
method for both cases.
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.
@hvelarde I didn't finish the changes. My first step is to remove portal_calendar
, after I'll refactor the code and these methods will be removed.
ade5431
to
00741ca
Compare
start = DateTime(self.year, self.month, day['day']) | ||
end = start + 1 | ||
query = dict( | ||
portal_type='Event', review_state='published', |
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.
@rodfersou as mentioned before, this can't be hard coded: the query must search for all contenty types providing the IEvent
interface.
day['eventstring'] = '\n'.join(localized_date + [ | ||
' {0}'.format(self.getEventString(e)) for e in day['eventslist']]) | ||
day['date_string'] = '{0}-{1}-{2}'.format(year, month, daynumber) | ||
def addEvents(self, day): |
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.
@rodfersou please add a doc string.
@@ -169,11 +187,13 @@ def isToday(self, day): | |||
self.now[2] == day and self.now[1] == self.month and self.now[0] == self.year) | |||
|
|||
def getReviewStateString(self): | |||
states = self.calendar.getCalendarStates() | |||
states = ['published'] | |||
return ''.join(map(lambda x: 'review_state={0}&'.format(self.url_quote_plus(x)), states)) | |||
|
|||
def getEventTypes(self): |
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.
@rodfersou this method must be memoized now.
dff29f0
to
93fd065
Compare
2ffebf0
to
bad27b5
Compare
$('body').undelegate('#calendar-next, #calendar-previous', 'click') | ||
.delegate( | ||
'.portletWrapper #calendar-next, ' + | ||
'.portletWrapper #calendar-previous', |
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.
In this override, I just set the selector to target just portlets with the .portletWrapper
class (maybe we should create a PR for plone.app.portlets
package)
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.
@rodfersou maybe you can avoid that using a different selector.
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.
@hvelarde the problem here is that I am getting the html from the portlet without change, this has the benefit to don't have to maintain this code, but the javascript from this portlet has this problem, the selector to refresh portlet is looking out of the portlet too. It would be no problem if there were a <div>
with class .portletWrapper
and the portlet id as data attribute to make it work with the original javascript of the portlet, but we don't have it.
abd7644
to
20a4ee2
Compare
@@ -249,30 +249,23 @@ table.invisible | |||
} | |||
|
|||
/* Tile Calendar */ | |||
.cover-calendar-tile .calendar-tile-header | |||
.cover-calendar-tile .portletCalendar |
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.
@rodfersou I think this is a bad idea.
@agnogueira comments?
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.
@hvelarde I don't understand your concern here with this css code.. this selector is restrict to our calendar tile because of the .cover-calendar-tile
class. It will not affect the portlet calendar.
closes #633