Skip to content

Commit

Permalink
modifying caendar with visiblefields only, and index visiblefields ad…
Browse files Browse the repository at this point in the history
…ded. Now header href links to current OG. CSS and little modifications
  • Loading branch information
Roberto Diaz committed Jul 18, 2018
1 parent 842f468 commit 77dcf3f
Show file tree
Hide file tree
Showing 16 changed files with 182 additions and 185 deletions.
Binary file not shown.
Binary file modified genweb/organs/browser/stylesheets/capcalera_organs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified genweb/organs/browser/stylesheets/capcalera_organs@2x.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 48 additions & 22 deletions genweb/organs/browser/stylesheets/genweb_organs.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
/* START MEDIA QUERY CSS */
@media only screen and (max-width: 639px) {
.header-image {
height:40px !important;
display: block !important;
}
.header-image.l2-image {
height: auto !important;
margin-left: 0px !important;
}
#viewlet-above-content-title,
.documentFirstHeading,
#viewlet-below-content-title,
#viewlet-above-content-body {
display: block !important;
}
}

@media only screen and (-webkit-min-device-pixel-ratio: 2), not all, not all, not all, only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
.header-image {
background-size: auto !important;
background-image: url("++resource++genweb.organs.stylesheets/capcalera_organs@2x.jpg") !important;
}
#viewlet-above-content-title,
.documentFirstHeading,
#viewlet-below-content-title,
#viewlet-above-content-body {
display: block !important;
}
}
/* END MEDIA QUERY CSS */



/* START DEFAULT CSS NO MEDIA QUERY */


.sessionActions {
float:right;
display:flex;
Expand Down Expand Up @@ -1733,24 +1770,6 @@ dd.actionMenuContent.actionMenuContentColor {
}


@media only screen and (max-width: 639px) {
.header-image {
height:40px !important;
display: block !important;
}
.header-image.l2-image {
height: auto !important;
margin-left: 0px !important;
}

}

@media only screen and (-webkit-min-device-pixel-ratio: 2), not all, not all, not all, only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
.header-image {
background-size: auto !important;
background-image: url("++resource++genweb.organs.stylesheets/capcalera_organs@2x.jpg") !important;}
}



div.header-image.nomarginleft {
Expand Down Expand Up @@ -1827,7 +1846,7 @@ td.organevent.cal_has_events .popover-content a {
background-image: linear-gradient(89deg, #00BCD4 0%, #007bc1 100%);
width: 128px;
height: 128px;
border-radius: 50%;
border-radius: 50% !important;
position: absolute;
left: 18px;
display: table-cell;
Expand Down Expand Up @@ -1855,8 +1874,8 @@ td.organevent.cal_has_events .popover-content a {
height: 84px;
background: rgba(255,255,255,0.9);
position: absolute;
width: 90%;
margin: 0;
width: 91%;
margin: 0px;
bottom: 0;
padding: 12px;
text-align: center;
Expand Down Expand Up @@ -1885,7 +1904,7 @@ td.organevent.cal_has_events .popover-content a {
margin-top: -18px;
width: 36px;
height: 36px;
border-radius: 50%;
border-radius: 50% !important;
text-align: center;
color: #007BC1;
background: rgba(255,255,255,0.8);
Expand Down Expand Up @@ -2044,3 +2063,10 @@ a.calendari-seguent:hover {
.portlet-calendari .calendari-seguent::before {
content: "\f061";
}

.globeBox {
border: 3px solid #f6f7f7 !important;
}


/* END DEFAULT CSS NO MEDIA QUERY */
12 changes: 8 additions & 4 deletions genweb/organs/browser/viewlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def getCustomLink(self):

def getTitle(self):
if IOrgansfolder.providedBy(self.context):
return 'Govern UPC - ' + str(self.context.title)
return dict(title='Govern UPC - ' + str(self.context.title),
url=self.context.absolute_url())
else:
portal_state = self.context.unrestrictedTraverse('@@plone_portal_state')
root = getNavigationRootObject(self.context, portal_state.portal())
Expand All @@ -124,12 +125,15 @@ def getTitle(self):
try:
# Some objects in path are in pending state
obj = aq_inner(root.restrictedTraverse(now))
return 'Govern UPC - ' + str(obj.title)
return dict(title='Govern UPC - ' + str(obj.title),
url=obj.absolute_url())
except:
# return default text if problems...
return 'Govern UPC'
return dict(title='Govern UPC',
url=self.context.absolute_url())
# By default returns Site Title
return 'Govern UPC'
return dict(title='Govern UPC',
url=self.context.absolute_url())

def getLogo(self):
if IOrgansfolder.providedBy(self.context):
Expand Down
16 changes: 8 additions & 8 deletions genweb/organs/browser/viewlets_templates/header.pt
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
Identifica't</tal:bk>
</a>
</li>
<li>
<tal:block replace="structure provider:genweb.search_manager" />
</li>
<!-- <li>
<a tal:attributes="href string:${portal_url}/${lang}/search"><i class="fa fa-search">&nbsp;<tal:bk i18n:translate="" i18n:domain="genweb.organs">Cercador</tal:bk></i></a>
<tal:block replace="structure provider:genweb.search_manager" />
</li> -->
<li>
<a tal:attributes="href string:${portal_url}/${lang}/search"><i class="fa fa-search">&nbsp;<tal:bk i18n:translate="" i18n:domain="genweb.organs">Cercador</tal:bk></i></a>
</li>
</ul>

</div>
Expand Down Expand Up @@ -104,18 +104,18 @@
<tal:block tal:condition="getLogo">
<img tal:attributes="src getLogo" style="height:78px; width: 100%;" />
<div tal:condition="getTitle" class="bannerTitle visible-tablet hidden-phone visible-desktop">
<a tal:attributes="href string:${portal_url}" tal:content="getTitle">Govern UPC - FIB</a>
<a tal:attributes="href string:${getTitle/url}" tal:content="getTitle/title">Govern UPC - FIB</a>
</div>
<div tal:condition="getTitle" class="bannerTitle Mobile hidden-tablet visible-phone hidden-desktop">
<a tal:attributes="href string:${portal_url}" tal:content="getTitle">Govern UPC - FIB</a>
<a tal:attributes="href string:${getTitle/url}" tal:content="getTitle/title">Govern UPC - FIB</a>
</div>
</tal:block>
<tal:block tal:condition="not:getLogo">
<div class="bannerTitle visible-tablet hidden-phone visible-desktop">
<a tal:attributes="href string:${portal_url}" tal:content="getTitle">Govern UPC - FIB</a>
<a tal:attributes="href string:${getTitle/url}" tal:content="getTitle/title">Govern UPC - FIB</a>
</div>
<div class="bannerTitle Mobile hidden-tablet visible-phone hidden-desktop">
<a tal:attributes="href string:${portal_url}" tal:content="getTitle">Govern UPC - FIB</a>
<a tal:attributes="href string:${getTitle/url}" tal:content="getTitle/title">Govern UPC - FIB</a>
</div>
<div tal:attributes="class string:header-image nomarginleft ${viewlet/get_image_class}"></div>
</tal:block>
Expand Down
8 changes: 7 additions & 1 deletion genweb/organs/content/organgovern.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class IOrgangovern(form.Schema):

fieldset('organ',
label=_(u'Tab organ'),
fields=['title', 'acronim', 'descripcioOrgan', 'fromMail', 'organType', 'logoOrgan', 'eventsColor', 'estatsLlista']
fields=['title', 'acronim', 'descripcioOrgan', 'fromMail', 'organType', 'logoOrgan', 'eventsColor', 'visiblefields', 'estatsLlista']
)

fieldset('assistents',
Expand Down Expand Up @@ -169,6 +169,12 @@ class IOrgangovern(form.Schema):
required=False,
)

visiblefields = schema.Bool(
title=_(u"Visible fields"),
description=_(u"Make the sessions and composition members fields visibles to everyone, omitting the security systems."),
required=False,
)


@indexer(IOrgangovern)
def organType(obj):
Expand Down
22 changes: 14 additions & 8 deletions genweb/organs/content/templates/acord_view.pt
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,20 @@
<ul class="ul_items">
<tal:documents repeat="item filesanddocs">
<li class="listFiles">
<a tal:attributes="href item/absolute_url;
titls item/title;
alt item/title" tal:condition="item/new_tab" target="_blank">
<i tal:attributes="class item/classCSS"></i>&nbsp;&nbsp;<tal:omit-tag tal:content="item/title"> Document title </tal:omit-tag></a>
<a tal:attributes="href item/absolute_url;
title item/title;
alt item/title" tal:condition="not:item/new_tab">
<i tal:attributes="class item/classCSS"></i>&nbsp;&nbsp;<tal:omit-tag tal:content="item/title"> Document title </tal:omit-tag></a>
<tal:omit-tag tal:condition="item/new_tab">
<a tal:attributes="href item/absolute_url;
title item/title;
alt item/title" target="_blank">
<i tal:attributes="class item/classCSS"></i>&nbsp;
<tal:omit-tag tal:content="item/title"> Document title </tal:omit-tag></a>
</tal:omit-tag>
<tal:omit-tag tal:condition="not:item/new_tab">
<a tal:attributes="href item/absolute_url;
title item/title;
alt item/title">
<i tal:attributes="class item/classCSS"></i>&nbsp;
<tal:omit-tag tal:content="item/title"> Document title </tal:omit-tag></a>
</tal:omit-tag>
</li>
</tal:documents>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions genweb/organs/content/templates/punt+subpunt_view.pt
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
<li class="listFiles">
<tal:block tal:condition="item/new_tab">
<a tal:attributes="href item/absolute_url; title item/title; alt item/title" target="_blank">
<i tal:attributes="class item/classCSS"></i>&nbsp;&nbsp;<tal:omit-tag tal:content="item/title"> Doc title</tal:omit-tag>
</a>
<i tal:attributes="class item/classCSS"></i>&nbsp;
<tal:omit-tag tal:content="item/title"> Doc title</tal:omit-tag></a>
</tal:block>
<tal:block tal:condition="not:item/new_tab">
<a tal:attributes="href item/absolute_url; title item/title; alt item/title">
<i tal:attributes="class item/classCSS"></i>&nbsp;&nbsp;<tal:omit-tag tal:content="item/title"> Doc title</tal:omit-tag>
</a>
<i tal:attributes="class item/classCSS"></i>&nbsp;
<tal:omit-tag tal:content="item/title"> Doc title</tal:omit-tag></a>
</tal:block>
</li>
</tal:documents>
Expand Down
4 changes: 2 additions & 2 deletions genweb/organs/overrides.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<!-- modified search to hide organs types based on state and role in searches
and search only in organs types -->
<!--<browser:page
<browser:page
name="search"
class=".search.Search"
permission="zope2.View"
Expand All @@ -45,5 +45,5 @@
template="updated_search.pt"
layer=".interfaces.IGenwebOrgansLayer"
/>
-->

</configure>
1 change: 0 additions & 1 deletion genweb/organs/portlets/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
assignment=".portlet_calendar.Assignment"
renderer=".portlet_calendar.Renderer"
addview=".portlet_calendar.AddForm"
editview=".portlet_calendar.EditForm"
/>

</configure>
109 changes: 53 additions & 56 deletions genweb/organs/portlets/portlet_calendar.pt
Original file line number Diff line number Diff line change
@@ -1,63 +1,60 @@
<div id="calendari" class="portlet portlet-calendari portletCalendar" tal:define="year view/year;" i18n:domain="plone">

<div>


<header class="portlet-header">
<a href="#" rel="nofollow" class="calendari-anterior" title="Previous month"
tal:define="prev_month view/prev_month; prev_year view/prev_year; "
tal:attributes="href view/prev_query; data-year prev_year; data-month prev_month;"
i18n:attributes="title title_previous_month;"></a>
<h3>
<span i18n:translate="" tal:omit-tag="">
<span i18n:name="monthname" i18n:translate="" tal:content="view/month_name" tal:omit-tag="">monthname</span>
</span>
<span i18n:translate="" tal:omit-tag="">
<span i18n:name="year" i18n:translate="" tal:content="year" tal:omit-tag="">year</span>
</span>
</h3>
<a href="#" rel="nofollow" class="calendari-seguent" title="Next month"
tal:define="next_month view/next_month; next_year view/next_year"
tal:attributes="href view/next_query; data-year next_year; data-month next_month; "
i18n:attributes="title title_next_month;"></a>
</header>

<header class="portlet-header">
<a href="#" rel="nofollow" class="calendari-anterior" title="Previous month"
tal:define="prev_month view/prev_month; prev_year view/prev_year; "
tal:attributes="href view/prev_query; data-year prev_year; data-month prev_month;"
i18n:attributes="title title_previous_month;"></a>
<h3>
<span i18n:translate="" tal:omit-tag="">
<span i18n:name="monthname" i18n:translate="" tal:content="view/month_name" tal:omit-tag="">monthname</span>
</span>
<span i18n:translate="" tal:omit-tag="">
<span i18n:name="year" i18n:translate="" tal:content="year" tal:omit-tag="">year</span>
</span>
</h3>
<a href="#" rel="nofollow" class="calendari-seguent" title="Next month"
tal:define="next_month view/next_month; next_year view/next_year"
tal:attributes="href view/next_query; data-year next_year; data-month next_month; "
i18n:attributes="title title_next_month;"></a>
</header>
<article class="portlet-content">
<div class="pad">
<table class="calendari" summary="Calendar"
i18n:attributes="summary summary_calendar">
<thead>
<tr class="weekdays">
<tal:data repeat="weekday view/weekdays">
<th scope="col" i18n:translate="" tal:content="weekday">Su</th>
</tal:data>
</tr>
</thead>
<tbody>
<tr tal:repeat="week view/cal_data">
<tal:block repeat="day week">
<td tal:define="today day/today;
next_month day/next_month;
prev_month day/prev_month;
events day/events;
classtag python:view.getclasstag_event(day);
limit python:len(events) if events is not None else 0"
tal:attributes="class python:u'%s%s%s%s%s' %
((today and ' today' or ''),
(next_month and ' cal_next_month' or ''),
(prev_month and ' cal_prev_month' or ''),
(events and ' cal_has_events' or ''),
(classtag or ''));
style string:background-color:${day/color};
data-year day/year; data-month day/month; data-day day/day;">
<a tal:omit-tag="not:events" tal:content="day/day">31</a>
</td>
</tal:block>
<div class="pad">
<table class="calendari" summary="Calendar"
i18n:attributes="summary summary_calendar">
<thead>
<tr class="weekdays">
<tal:data repeat="weekday view/weekdays">
<th scope="col" i18n:translate="" tal:content="weekday">Su</th>
</tal:data>
</tr>
</tbody>
</table>
</div>
</article>
</thead>
<tbody>
<tr tal:repeat="week view/cal_data">
<tal:block repeat="day week">
<td tal:define="today day/today;
next_month day/next_month;
prev_month day/prev_month;
events day/events;
classtag python:view.getclasstag_event(day);
limit python:len(events) if events is not None else 0"
tal:attributes="class python:u'%s%s%s%s%s' %
((today and ' today' or ''),
(next_month and ' cal_next_month' or ''),
(prev_month and ' cal_prev_month' or ''),
(events and ' cal_has_events' or ''),
(classtag or ''));
style string:background-color:${day/color};
data-year day/year; data-month day/month; data-day day/day;">
<a tal:omit-tag="not:events" tal:content="day/day">31</a>
</td>
</tal:block>
</tr>
</tbody>
</table>
</div>
</article>
<ul class="icons-ul">
<tal:block tal:repeat="events view/getDayEventsGroup">
<li tal:attributes="class string:${events/community_type} text">
Expand Down Expand Up @@ -137,5 +134,5 @@ $(document).ready(function () {
});
}

}); //ready
});
</script>
Loading

0 comments on commit 77dcf3f

Please sign in to comment.