#97 Update to Women and Diversity Section
Merged 2 years ago by a2batic. Opened 2 years ago by thelittlewonder.
thelittlewonder/Fedora-app women  into  master

file modified
+4 -2

@@ -16,7 +16,7 @@ 

  import { MagazinePage } from '../pages/magazine/magazine';

  import { AskPage } from '../pages/ask/ask';

  import { CalendarPage, Search, meetingDetails } from '../pages/calendar/calendar';

- import { MorePage, AboutDetailPage, AboutPage, BookmarksPage } from '../pages/more/more';

+ import { MorePage, AboutDetailPage, AboutPage, BookmarksPage, WomenDiversity } from '../pages/more/more';

  import { NotificationsPage } from '../pages/notifications/notifications';

  import { PackageSearchPage } from '../pages/package-search/package-search';

  import { ViewPackagePage } from '../pages/view-package/view-package';

@@ -45,6 +45,7 @@ 

      ViewPackagePage,

      Search,

      meetingDetails,

+     WomenDiversity,

      NoBookmarksComponent,

      NoMeetingsComponent,

      NoResultsComponent,

@@ -72,7 +73,8 @@ 

      PackageSearchPage,

      ViewPackagePage,

      Search,

-     meetingDetails

+     meetingDetails,

+     WomenDiversity

    ],

    providers: [

      Browser,

file modified
+1 -1

@@ -77,7 +77,7 @@ 

     * Fetch Blog Posts from the Fedora Community Blog

     */

    private updateBlogPosts(): void {

-     this.communityblog.getBlogPosts()

+     this.communityblog.getBlogPosts('null')

        .subscribe(blogposts => {

          this.blogposts = blogposts;

        });

file modified
+40 -1

@@ -51,7 +51,7 @@ 

  

  bookmarks,

  about-us,

- about-detail {

+ about-detail, women-diversity  {

    ion-header {

      padding: 16px 24px;

      background-color: #fff;

@@ -116,3 +116,42 @@ 

      }

    }

  }

+ 

+ women-diversity {

+   ion-content {

+     .scroll-content {

+       p {

+         margin:0;

+         padding: 16px 24px;

+         background-color: #fff;

+       }

+       ion-label{

+         margin: 0 0 4px 0;

+         padding: 12px 24px;

+         background-color: #fff;

+       }

+     }

+   }

+   .card {

+     padding: 12px 24px;

+     background-color: #FFFFFF !important;

+     box-shadow: none;

+     margin: 4px 0;

+     width: 100%;

+   }

+   .card-header {

+     padding: 0 !important;

+   }

+   .card-content {

+     margin-top: 4px;

+     padding: 0 !important;

+   }

+   ion-card {

+     span {

+       display: block;

+     }

+     .active-title {

+       margin-bottom: 4px;

+     }

+   }

+ }

file modified
+48 -1

@@ -2,6 +2,9 @@ 

  import { NavController, NavParams } from 'ionic-angular';

  import { NotificationsPage } from '../../pages/notifications/notifications';

  import { PackageSearchPage } from '../package-search/package-search';

+ import { Browser } from '../../providers/browser/browser';

+ import { Post } from '../../providers/fedora-magazine/fedora-magazine';

+ import { CommunityBlogService } from '../../providers/community-blog/community-blog';

  

  @Component({

    selector: 'page-more',

@@ -88,7 +91,8 @@ 

     * @param navItem clicked item of about Fedora

     */

    openAboutDetailPage(item) {

-     this.navCtrl.push(AboutDetailPage, { item: item });

+     //open details if not women page, else push the women page

+     item.title === 'Women and Diversity' ? this.navCtrl.push(WomenDiversity) : this.navCtrl.push(AboutDetailPage, { item: item });

    }

  }

  

@@ -130,4 +134,47 @@ 

    }

  }

  

+ /** Women and Diversity Page Component */

+ 

+ @Component({

+   selector: 'women-diversity',

+   templateUrl: 'women-diversity.html',

+   providers: [CommunityBlogService]

+ })

+ export class WomenDiversity {

+ 

+   /**

+    * List of posts from Fedora Community Blog

+    */

+   private blogposts: Post[];

+ 

+   constructor(private browser: Browser, private communityblog: CommunityBlogService) {

+     this.blogposts = [];

+   }

+ 

+   /**

+    * Fetch Blog Posts from the Fedora Community Blog

+    */

+   private updateBlogPosts(): void {

+     this.communityblog.getBlogPosts('454')

+       .subscribe(blogposts => {

+         this.blogposts = blogposts;

+       });

+   }

+ 

+   ngOnInit() {

+     this.updateBlogPosts();

+   }

+ 

+   /**

+    * Opens a update in a browser

+    *

+    * Opens the update in an in-app browser in mobile app and in a new tab on desktop.

+    *

+    * @param update update to open

+    */

+   openUpdate(update: any): void {

+     this.browser.open(update.link);

+   }

+ }

  

@@ -0,0 +1,27 @@ 

+ <!--

+ Template for the Women and Diversity Page

+ -->

+ 

+ <ion-header>

+   <ion-title>

+     <img src="./assets/img/back.svg" tappable navPop>

+     <span>Women and Diversity</span>

+   </ion-title>

+ </ion-header>

+ <ion-content>

+   <p>

+     The Fedora Project welcomes and encourages participation by everyone. Our community is based on mutual respect, tolerance,

+     and encouragement, and we are working to help each other live up to these principles. Please, refer to

+     <a (click)="this.browser.open('https://fedoraproject.org/wiki/Diversity_and_Inclusion?rd=Diversity')">our Code of Conduct</a>

+     if you need more information. Fedora Diversity and Inclusion team is committed to fostering diversity and inclusion in Fedora

+     community.

+   </p>

+   <ion-list *ngIf="blogposts.length !== 0">

+     <ion-label class="label">Latest Updates</ion-label>

+     <ion-card *ngFor="let blogpost of blogposts" tappable (click)="openUpdate(blogpost)">

+       <ion-card-header [innerHTML]="blogpost.title" class="body-title"></ion-card-header>

+       <ion-card-content [innerHTML]="blogpost.publishedAt" class="body-subtitle">

+       </ion-card-content>

+     </ion-card>

+   </ion-list>

+ </ion-content>

@@ -18,11 +18,16 @@ 

      /**

       * Fetch the list of latest posts on Fedora Community Blog

       *

+      * @param category from which posts are to be fetched

       * @returns Observable which emits an array of blog posts

       */

-     getBlogPosts(): Observable<Post[]> {

-         return this.http.get(`${ENDPOINT}/posts`)

-             .map((data: any[]) => data.map((blogpost: any) => ({

+     getBlogPosts(category): Observable<Post[]> {

+ 

+         let request;

+         //if no category is specified, fetch posts without parameters.

+         category === 'null' ? request = this.http.get(`${ENDPOINT}/posts`) : request = this.http.get(`${ENDPOINT}/posts`, { params: {'categories': category}});

+ 

+         return request.map((data: any[]) => data.map((blogpost: any) => ({

                  id: blogpost.id,

                  link: blogpost.link,

                  permalink: blogpost.guid.rendered,

@@ -34,4 +39,4 @@ 

                  featuredImage:''

              })));

      }

- }

+ } 

\ No newline at end of file

rebased onto 8a170cd199901ef160d7c84fd4ffc434db073ec0

2 years ago

rebased onto c4ddc8a

2 years ago

rebased onto fcd33a388d098bf62743c84d5d4c07d1a78f2019

2 years ago

rebased onto 93a82ef

2 years ago

rebased onto 6d89fec

2 years ago

rebased onto 529d3c4

2 years ago

Pull-Request has been merged by a2batic

2 years ago