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

Adding new template views #7

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Adding new template views #7

wants to merge 16 commits into from

Conversation

sitinurliza95
Copy link
Member

No description provided.

@kaerumy
Copy link
Member

kaerumy commented Oct 20, 2023

@sitinurliza95 I would create and use the code for this for a new country-view instead and use the where-we-work-view as the main page template.

@kaerumy
Copy link
Member

kaerumy commented Oct 20, 2023

  <browser:page
    name="front-page"
    for="*"
    class=".front_page.FrontPage"
    template="front_page.pt"
    permission="zope2.View"
    layer="imap.customizations.interfaces.IImapCustomizationsLayer"
    />

Renaming isn't that complicated though, see configure.zcml in the views directory.
Just need to change the respective class and template variables to the new names.

In this example:

.front_page is front_page.py filename that can be changed.
FrontPage is the class name in front_page.py which can be changed
front_page.pt is just the filename and be changed to the new renamed template eg. country-view.pt

@sitinurliza95 sitinurliza95 changed the title Added Where We Work (Entry page) view Adding new template views Oct 23, 2023
	modified:   src/imap/customizations/theme/css/theme.css
	modified:   src/imap/customizations/theme/css/theme.css.map
	modified:   src/imap/customizations/theme/css/theme.min.css
	modified:   src/imap/customizations/theme/css/theme.min.css.map
	modified:   src/imap/customizations/theme/scss/theme.scss
	modified:   src/imap/customizations/views/front_page.pt
@sitinurliza95
Copy link
Member Author

Issue: Unable to view all SDG goals (and other similar fields) related to a Resource

For example in imap_resource.py

   def sdg_title(self):

        factory = getUtility(IVocabularyFactory,
                             'sinar.miscbehavior.SDGGoals')

        vocabulary = factory(self.context.SDG_goals)
        
        for term in vocabulary:
            if self.context.SDG_goals:
                return term.title
            else:
                return None

and imap_resource.pt

<p tal:content="view/sdg_title" id="resource-card-top-text">Encourage and promote effective public, public-
                      private,
                      and civil society partnerships, building on the experience and resourcing
                      strategies of partnerships.</p>

This returns only the first SDG goal related to the Resource as below, even though there is more than 1 SDG goal in the data:

image

image

@sitinurliza95
Copy link
Member Author

Pending issues:

Front page, header, footer

  • Can't activate javascript related objects e.g. carousel (for the banner), nav and tabs (for the events)
  • Unable to show listing of resources and news
  • Unable to show varying logos of countries and partners

Resource page

  • Unable to view all SDG goals/ countries/ similar metadata related
  • Author names and tags come with brackets ('Siti Khadijah', 'Yusoof Baki')
  • Unable to show organizations related using tal repeat
  • Need to add key findings as behavior (?)

Country page

  • Unable to show listing of resources and news
  • Unable to show varying logos of countries and partners

Others

  • Adding view for internet censorship events
  • Adding view for listing pages with filters

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.

2 participants