#514 Add bio, contact and rules info in the hub header
Merged 6 years ago by abompard. Opened 6 years ago by abompard.
abompard/fedora-hubs feature/description-462  into  develop

@@ -45,3 +45,10 @@ 

          "url": "https://github.com",

      },

  )

+ 

+ CHAT_NETWORKS = [

+     {

+         "name": "Freenode",

+         "domain": "irc.freenode.net",

+     },

+ ]

file modified
+3 -2
@@ -35,7 +35,7 @@ 

  

  from hubs.database import BASE

  from hubs.utils import validators

- from .constants import DEV_PLATFORMS, VISIBILITIES

+ from .constants import DEV_PLATFORMS, VISIBILITIES, CHAT_NETWORKS

  

  

  log = logging.getLogger(__name__)
@@ -90,7 +90,7 @@ 

      KEYS = (

          "archived", "summary", "description", "left_width", "avatar",

          "visibility", "chat_domain", "chat_channel", "mailing_list",

-         "calendar",

+         "calendar", "meetings_text", "rules_url",

      ) + tuple(p["name"] for p in DEV_PLATFORMS)

      CONVERTERS = {

          "archived": BooleanConverter(),
@@ -104,6 +104,7 @@ 

          "visibility": "public",

          "left_width": 8,

          "avatar": "",

+         "chat_domain": CHAT_NETWORKS[0]["domain"],

      }

      LISTS = ("pagure", "github")

      VALIDATORS = {

file modified
+2 -1
@@ -59,7 +59,8 @@ 

              'fullname': self.fullname,

              'created_on': self.created_on,

              'last_active': self.last_active,

- 

+             'hub_url': flask.url_for(

+                 'hub', hub_name=self.username, hub_type='u'),

              # We'll need hubs subscribed to, owned, etc..

              # 'hubs': [hub.idx for hub in self.hubx],

          }

@@ -6,9 +6,10 @@ 

  import PropTypes from 'prop-types';

  import GeneralPanel from './HubConfigPanelGeneral';

  import UserPanel from './HubConfigPanelUser';

+ import CommunityPanel from './HubConfigPanelCommunity';

  import MailingListPanel from './HubConfigPanelMailingList';

  import ChatPanel from './HubConfigPanelChat';

- import CalendarPanel from './HubConfigPanelCalendar';

+ import MeetingsPanel from './HubConfigPanelMeetings';

  import DevPlatformPanel from './HubConfigPanelDevPlatform';

  import NotImplementedPanel from './HubConfigPanelNotImpl';

  import Modal from '../../components/Modal';
@@ -33,6 +34,10 @@ 

      id: "hubs.core.config.members",

      defaultMessage: "Members",

    },

+   community: {

+     id: "hubs.core.config.community",

+     defaultMessage: "Community",

+   },

    mailinglist: {

      id: "hubs.core.config.mailinglist",

      defaultMessage: "Mailing-list",
@@ -41,9 +46,9 @@ 

      id: "hubs.core.config.chat",

      defaultMessage: "Chat",

    },

-   calendar: {

-     id: "hubs.core.config.calendar",

-     defaultMessage: "Calendar",

+   meetings: {

+     id: "hubs.core.config.meetings",

+     defaultMessage: "Meetings",

    },

    devplatform: {

      id: "hubs.core.config.devplatform",
@@ -135,6 +140,15 @@ 

            hub={this.props.hub}

            />

          ,

+         <CommunityPanel

+           key="community"

+           hubConfig={this.props.hubConfig}

+           globalConfig={this.props.globalConfig}

+           tabTitle={<FormattedMessage {...messages.community} />}

+           handleChange={this.props.onConfigChange}

+           error={this.props.hub.error}

+           />

+         ,

          <MailingListPanel

            key="mailing_list"

            hubConfig={this.props.hubConfig}
@@ -153,11 +167,11 @@ 

            error={this.props.hub.error}

            />

          ,

-         <CalendarPanel

-           key="calendar"

+         <MeetingsPanel

+           key="meetings"

            hubConfig={this.props.hubConfig}

            globalConfig={this.props.globalConfig}

-           tabTitle={<FormattedMessage {...messages.calendar} />}

+           tabTitle={<FormattedMessage {...messages.meetings} />}

            handleChange={this.props.onConfigChange}

            error={this.props.hub.error}

            />

hubs/static/client/app/components/HubConfig/HubConfigPanelCommunity.js hubs/static/client/app/components/HubConfig/HubConfigPanelCalendar.js
file renamed
+21 -21
@@ -7,32 +7,32 @@ 

  

  const messages = defineMessages({

    title: {

-     id: "hubs.core.config.calendar.title",

-     defaultMessage: "Calendar Settings",

+     id: "hubs.core.config.community.title",

+     defaultMessage: "Community Settings",

    },

    intro_1: {

-     id: "hubs.core.config.calendar.intro1",

+     id: "hubs.core.config.community.intro1",

      defaultMessage: (

-       "If your team or project has a calendar associated with it, you "

-      +"can connect this hub to it."

+       "If your team or project has community rules and guidelines, you "

+      +"can point to them here."

       ),

    },

    intro_2: {

-     id: "hubs.core.config.calendar.intro2",

-     defaultMessage: "Please indicate your team's calendar below:",

+     id: "hubs.core.config.community.intro2",

+     defaultMessage: "Please indicate your team's rules below:",

    },

-   address: {

-     id: "hubs.core.config.calendar.calendar",

-     defaultMessage: "Calendar name",

+   url: {

+     id: "hubs.core.config.community.url",

+     defaultMessage: "Rules URL",

    },

    example: {

-     id: "hubs.core.config.calendar.example",

+     id: "hubs.core.config.community.example",

      defaultMessage: "Example:",

    },

  });

  

  

- export default class CalendarPanel extends React.Component {

+ export default class CommunityPanel extends React.Component {

  

    constructor(props) {

      super(props);
@@ -46,12 +46,12 @@ 

  

    render() {

      const stillLoading = (

-           typeof this.props.hubConfig.calendar === "undefined"

+           typeof this.props.hubConfig.rules_url === "undefined"

          );

  

      let invalid = null;

      if (this.props.error && this.props.error.fields) {

-       invalid = this.props.error.fields.calendar;

+       invalid = this.props.error.fields.rules_url;

      }

  

      return (
@@ -60,26 +60,26 @@ 

          <FormattedMessage {...messages.intro_1} tagName="p" />

          <FormattedMessage {...messages.intro_2} tagName="p" />

          <div className="form-group row">

-           <label htmlFor="hub-settings-calendar">

-             <FormattedMessage {...messages.address} />

+           <label htmlFor="hub-settings-rules-url">

+             <FormattedMessage {...messages.url} />

            </label>

            <input

              type="text"

+             name="rules_url"

              className={"form-control" + (invalid ? " is-invalid" : "")}

-             name="calendar"

-             id="hub-settings-calendar"

+             id="hub-settings-rules-url"

              disabled={stillLoading}

              onChange={this.handleChange}

-             value={this.props.hubConfig.calendar || ""}

+             value={this.props.hubConfig.rules_url || ""}

              />

            { invalid &&

-             <div className="invalid-feedback">

+             <div className="invalid-feedback w-100">

                {invalid}

              </div>

            }

            <p className="form-text text-muted">

              <FormattedMessage {...messages.example} tagName="strong" />

-             <span className="ml-2">team</span>

+             <span className="ml-2">https://fedoraproject.org/wiki/YourTeam</span>

            </p>

          </div>

        </form>

@@ -0,0 +1,116 @@ 

+ import React from 'react';

+ import {

+   defineMessages,

+   FormattedMessage,

+   } from 'react-intl';

+ 

+ 

+ const messages = defineMessages({

+   title: {

+     id: "hubs.core.config.meetings.title",

+     defaultMessage: "Meetings Settings",

+   },

+   intro_1: {

+     id: "hubs.core.config.meetings.intro1",

+     defaultMessage: (

+       "If your team or project has regular meetings and a calendar associated with it, you "

+      +"can indicate them and connect this hub to the calendar."

+      ),

+   },

+   intro_2: {

+     id: "hubs.core.config.meetings.intro2",

+     defaultMessage: "Please indicate your team's Fedocal calendar below:",

+   },

+   cal_name: {

+     id: "hubs.core.config.meetings.calendar",

+     defaultMessage: "Calendar name",

+   },

+   meetings_info: {

+     id: "hubs.core.config.meetings.meetings_info",

+     defaultMessage: "Meetings info",

+   },

+   example: {

+     id: "hubs.core.config.meetings.example",

+     defaultMessage: "Example:",

+   },

+   example_meetings: {

+     id: "hubs.core.config.meetings.example_meetings",

+     defaultMessage: "We meet weekly in #fedora-meeting at 18:00 UTC",

+   },

+ });

+ 

+ 

+ export default class CalendarPanel extends React.Component {

+ 

+   constructor(props) {

+     super(props);

+     this.handleChange = this.handleChange.bind(this);

+   }

+ 

+   handleChange(e) {

+     const name = e.target.name, value = e.target.value;

+     this.props.handleChange(name, value);

+   }

+ 

+   render() {

+     const stillLoading = (

+           typeof this.props.hubConfig.calendar === "undefined"

+         );

+ 

+     let invalid = null;

+     if (this.props.error && this.props.error.fields) {

+       invalid = this.props.error.fields.calendar;

+     }

+ 

+     return (

+       <form onSubmit={(e) => {e.preventDefault();}}>

+         <FormattedMessage {...messages.title} tagName="h3" />

+         <FormattedMessage {...messages.intro_1} tagName="p" />

+         <FormattedMessage {...messages.intro_2} tagName="p" />

+         <div className="form-group row">

+           <label htmlFor="hub-settings-calendar">

+             <FormattedMessage {...messages.cal_name} />

+           </label>

+           <input

+             type="text"

+             className={"form-control" + (invalid ? " is-invalid" : "")}

+             name="calendar"

+             id="hub-settings-calendar"

+             disabled={stillLoading}

+             onChange={this.handleChange}

+             value={this.props.hubConfig.calendar || ""}

+             />

+           { invalid &&

+             <div className="invalid-feedback">

+               {invalid}

+             </div>

+           }

+           <p className="form-text text-muted">

+             <FormattedMessage {...messages.example} tagName="strong" />

+             <span className="ml-2">team</span>

+           </p>

+         </div>

+         <div className="form-group row">

+           <label htmlFor="hub-settings-meetings">

+             <FormattedMessage {...messages.meetings_info} />

+           </label>

+           <input

+             type="text"

+             className="form-control"

+             name="meetings_text"

+             id="hub-settings-meetings"

+             disabled={stillLoading}

+             onChange={this.handleChange}

+             value={this.props.hubConfig.meetings_text || ""}

+             />

+           <p className="form-text text-muted">

+             <FormattedMessage {...messages.example} tagName="strong" />

+             <span className="ml-2">

+               <FormattedMessage {...messages.example_meetings} />

+             </span>

+           </p>

+         </div>

+       </form>

+     );

+   }

+ }

@@ -0,0 +1,18 @@ 

+ .HubCommunity {

+     background-color: #e7e7e7;

+     text-align: left;

+ }

+ 

+ .HubCommunity h6 {

+   font-family: 'Open Sans', sans-serif;

+   text-transform: capitalize;

+   font-size: normal;

+   font-weight: 700;

+   color: #808080;

+   margin-bottom: 5px;

+ }

+ .HubCommunity .img-circle-lg {

+   height: 4em;

+   width: 4em;

+   padding: 10px;

+ }

@@ -0,0 +1,214 @@ 

+ import React from 'react';

+ import PropTypes from 'prop-types';

+ import Modal from '../Modal';

+ import "./HubCommunity.css";

+ 

+ 

+ export default class HubCommunity extends React.Component {

+ 

+   render() {

+     return (

+       <div className="HubCommunity p-2 mt-2 rounded">

+         <HubCommunityRules hub={this.props.hub} />

+         <HubCommunityOwners hub={this.props.hub} />

+         <HubCommunityMeetings hub={this.props.hub} />

+         <HubCommunityCommunication hub={this.props.hub} />

+       </div>

+     );

+   }

+ }

+ HubCommunity.propTypes = {

+   hub: PropTypes.object.isRequired,

+ }

+ 

+ 

+ class HubCommunityRules extends React.Component {

+ 

+   render() {

+     if (!this.props.hub.config.rules_url) {

+       return null;

+     }

+     return (

+       <div className="mb-2">

+         <h6>community rules</h6>

+         <p>

+           <a href={this.props.hub.config.rules_url}>

+             Community Rules and Guidelines

+           </a>

+         </p>

+       </div>

+     );

+   }

+ }

+ 

+ 

+ class HubCommunityOwners extends React.Component {

+ 

+   constructor(props) {

+     super(props);

+     this.state = {moreOpen: false};

+     this.handleClickMore = this.handleClickMore.bind(this);

+     this.handleCloseMore = this.handleCloseMore.bind(this);

+   }

+ 

+   handleClickMore(e) {

+     e.preventDefault();

+     this.setState((prevState, props) => ({

+       moreOpen: !prevState.moreOpen

+     }))

+   }

+ 

+   handleCloseMore(e) {

+     e.preventDefault();

+     this.setState({moreOpen: false});

+   }

+ 

+   render() {

+     const ellipsis_limit = 5;

+     let owners = [...this.props.hub.users.owner];

+     //for (const owner in this.props.hub.users.owner) {

+     //  owners.push(this.props.hub.users.owner[owner]);

+     //}

+     const compare = (a, b) => {

+       if (a < b) { return -1; }

+       if (a > b) { return 1; }

+       return 0;

+     }

+     if (owners.length <= ellipsis_limit) {

+       owners.sort((o1, o2) => (compare(o1.username, o2.username)));

+     } else {

+       owners.sort((o1, o2) => {

+         const d1 = Date.parse(o1.created_on);

+         const d2 = Date.parse(o2.created_on);

+         return compare(d1, d2);

+       })

+     }

+     return (

+       <div className="mb-2">

+         <h6>Group Owners ({owners.length})</h6>

+         <div className="row no-gutters">

+         { owners.slice(0, ellipsis_limit).map((owner) => (

+             <div className="col-sm-6 mb-2" key={owner.username}>

+               <img className="img-circle mr-2" src={owner.avatar} />

+               <a href={owner.hub_url}>{owner.username}</a>

+             </div>

+           ))

+         }

+         { owners.length > ellipsis_limit &&

+           <button

+             className="btn btn-secondary"

+             onClick={this.handleClickMore}

+             >

+             View All

+           </button>

+         }

+         </div>

+         { this.state.moreOpen &&

+           <Modal

+             onCloseClicked={this.props.handleCloseMore}

+             title="All group owners"

+             footer={

+               <button

+                 className="btn btn-secondary"

+                 onClick={this.props.handleCloseMore}

+                 >

+                 Close

+               </button>

+             }

+             >

+             { owners.map((owner) => (

+                 <div className="col-sm-6 mb-2" key={owner.username}>

+                   <img className="img-circle img-circle-lg mr-2" src={owner.avatar} />

+                   <a href={owner.hub_url}>{owner.username}</a>

+                 </div>

+               ))

+             }

+           </Modal>

+         }

+       </div>

+     );

+   }

+ }

+ 

+ 

+ class HubCommunityMeetings extends React.Component {

+ 

+   render() {

+     const config = this.props.hub.config;

+     if (!config.meetings_text &&

+         !config.calendar) {

+       return null;

+     }

+     const calendar_url = `https://apps.fedoraproject.org/calendar/${config.calendar}/`;

+     const minutes_url = `https://meetbot.fedoraproject.org/sresults?group_id=${this.props.hub.name}&type=team`

+     return (

+       <div className="mb-2">

+         <h6>Meetings</h6>

+         { config.meetings_text &&

+           <p className="mb-1">{config.meetings_text}</p>

+         }

+         <p>

+           { config.calendar &&

+             <a

+               className="small"

+               target="_blank"

+               href={calendar_url}

+               >

+               Meeting Schedule

+             </a>

+           }

+           { config.calendar && minutes_url &&

+             "|"

+           }

+           { minutes_url &&

+             <a

+               className="small"

+               target="_blank"

+               href={minutes_url}

+               >

+               Past Meeting Minutes

+             </a>

+           }

+         </p>

+       </div>

+     );

+   }

+ }

+ 

+ 

+ class HubCommunityCommunication extends React.Component {

+ 

+   render() {

+     const config = this.props.hub.config;

+     if (!config.mailing_list &&

+         !config.chat_channel) {

+       return null;

+     }

+     const mailing_list_url = `https://lists.fedoraproject.org/archives/list/${config.mailing_list}/`;

+     return (

+       <div>

+         <h6>Communication</h6>

+         <ul className="list-unstyled mb-0">

+           { config.mailing_list &&

+             <li>

+               <i className="fa fa-envelope-o" aria-hidden="true"></i>

+               <span className="ml-2">

+                 <a href={mailing_list_url}>

+                   {config.mailing_list}

+                 </a>

+               </span>

+             </li>

+           }

+           { config.chat_channel &&

+             <li>

+               <i className="fa fa-comment-o" aria-hidden="true"></i>

+               <span className="ml-2">

+                 { config.chat_channel } on { config.chat_domain }

+               </span>

+             </li>

+           }

+         </ul>

+       </div>

+     );

+   }

+ }

@@ -22,3 +22,10 @@ 

      position: absolute;

      left: 1rem;

  }

+ 

+ .HubHeader.hub-user .description {

+     background-color: white;

+ }

+ .HubHeader.hub-team .description {

+     background-color: #dfedf3;

+ }

@@ -27,6 +27,11 @@ 

            </h5>

            <div className="clearfix"></div>

          </div>

+         { this.props.hub.config.description &&

+           <div className="description p-2 mt-2 rounded">

+             {this.props.hub.config.description}

+           </div>

+         }

        </div>

      );

    }

@@ -3,13 +3,14 @@ 

  import HubConfig from '../HubConfig';

  import EditModeButton from './EditModeButton';

  import HubMembership from './HubMembership';

+ import HubCommunity from './HubCommunity';

  

  

  export default class HubHeaderRight extends React.Component {

  

    render() {

      return (

-       <div className="HubHeaderRight">

+       <div className="HubHeaderRight mt-2">

          <HubMembership />

          { this.props.hub.perms.config &&

            <div>
@@ -17,6 +18,7 @@ 

              <EditModeButton />

            </div>

          }

+         <HubCommunity hub={this.props.hub} />

        </div>

      );

    }

@@ -18,7 +18,7 @@ 

        return null;

      }

      return (

-       <div className="HubStats d-flex float-right h-100">

+       <div className="HubStats d-flex float-right mt-2">

          { (this.props.hub.type === "team") &&

            <HubStatsCounter

              title="Members"

@@ -14,10 +14,12 @@ 

    render() {

      let left_width = 8,

          HeaderLeft = null,

-         HeaderRight = null;

+         HeaderRight = null,

+         hubTypeCss = "";

      const isLoaded = this.props.hub.name !== null;

      if (isLoaded) {

        // It's loaded now

+       hubTypeCss = `hub-${this.props.hub.type}`;

        if (this.props.hub.type === "stream") {

          left_width = 8;

          HeaderLeft = StreamHeaderLeft,
@@ -30,7 +32,7 @@ 

      }

      const right_width = 12 - left_width;

      return (

-       <div className="HubHeader">

+       <div className={`HubHeader ${hubTypeCss}`}>

          { this.props.isLoading &&

            <Spinner />

          }
@@ -41,7 +43,7 @@ 

                  hub={this.props.hub}

                  />

              </div>

-             <div className={`col-md-${right_width} text-center align-self-center`}>

+             <div className={`col-md-${right_width} text-center align-self-start`}>

                <HeaderRight

                  hub={this.props.hub}

                  />

@@ -19,6 +19,7 @@ 

          hub.last_refreshed = datetime.datetime(2017, 1, 1, 0, 0, 0)

          user = User.query.get("ralph")

          user.created_on = datetime.datetime(2017, 1, 1, 0, 0, 0)

+         user.last_active = datetime.datetime(2017, 1, 1, 0, 0, 0)

          self.session.commit()

          auth_user = FakeAuthorization('ralph')

          response = self.check_url(
@@ -38,13 +39,15 @@ 

                  "archived": False,

                  "avatar": avatar_url,

                  'chat_channel': None,

-                 'chat_domain': None,

+                 'chat_domain': 'irc.freenode.net',

                  "calendar": None,

                  "description": None,

                  "mailing_list": None,

+                 "meetings_text": None,

                  "github": [],

                  "pagure": [],

                  "left_width": 8,

+                 "rules_url": None,

                  "summary": "Ralph",

                  "visibility": "public",

              },
@@ -54,7 +57,9 @@ 

                          "username": "ralph",

                          "fullname": "Ralph",

                          "avatar": avatar_url,

+                         'hub_url': '/u/ralph/',

                          "created_on": "Sun, 01 Jan 2017 00:00:00 GMT",

+                         "last_active": "Sun, 01 Jan 2017 00:00:00 GMT",

                      },

                  ],

                  "member": [],

@@ -1,6 +1,5 @@ 

  from __future__ import unicode_literals

  

- from hubs.utils import validators

  from hubs.widgets.base import Widget

  from hubs.widgets.view import RootWidgetView

  

file modified
+54 -123
@@ -21,10 +21,8 @@ 

  

  # Register widgets we will use

  hubs.widgets.registry.register_list([

-     "hubs.widgets.rules:Rules",

      "hubs.widgets.meetings:Meetings",

      "hubs.widgets.about:About",

-     "hubs.widgets.sticky:Sticky",

      "hubs.widgets.feed:Feed",

      ])

  
@@ -47,19 +45,15 @@ 

          summary='The Internationalization Team',

          avatar=placekitten,

          archived=True,

-     ))

- 

-     widget = hubs.models.Widget(

-         plugin='rules', index=1, _config=json.dumps({

-             'link': 'https://fedoraproject.org/wiki/I18N',

-             'schedule_text': None,

-             'schedule_link': None,

-             'minutes_link': 'https://meetbot.fedoraproject.org/sresults/'

-                             '?group_id=i18n&type=team',

-         }))

-     hub.widgets.append(widget)

- 

-     widget = hubs.models.Widget(plugin='meetings', index=2,

+         description=(

+             'The Fedora I18N project works on internationalization (i18n)'

+             'to support the localization (l10n) of Fedora in many languages.'

+             'Translation of Fedora software and documentation are handled by'

+             'the Fedora L10N project.'),

+         rules_url='https://fedoraproject.org/wiki/I18N',

+         ))

+ 

+     widget = hubs.models.Widget(plugin='meetings', index=1,

                                  _config=json.dumps({'calendar': 'i18n'}))

      hub.widgets.append(widget)

  
@@ -70,21 +64,7 @@ 

          }))

      hub.widgets.append(widget)

  

-     widget = hubs.models.Widget(

-         plugin='sticky', index=1, left=True, _config=json.dumps({

-             'text': """

-     <p>The Fedora I18N project works on internationalization (i18n) to support the

-     localization (l10n) of Fedora in many languages. Translation of Fedora software

-     and documentation are handled by the Fedora L10N project.</p> <p>The goals of

-     the Project are to:</p> <ul><li>Develop, package, and maintain applications

-     like input methods for different languages</li> <li>Improve applications and

-     utilities to support and process different languages</li> <li>Quality-assure

-     that existing applications meet i18n standards</li> <li>Support the

-     infrastructure of the Fedora Localization Project</li></ul>

-     """,

-         }))

-     hub.widgets.append(widget)

-     widget = hubs.models.Widget(plugin='feed', index=2, left=True)

+     widget = hubs.models.Widget(plugin='feed', index=1, left=True)

      hub.widgets.append(widget)

  

  
@@ -104,19 +84,15 @@ 

      hub.config["chat_channel"] = '#fedora-hubs'

      hub.config["pagure"] = 'fedora-hubs'

      hub.config["calendar"] = 'commops'

+     hub.config["description"] = (

+         "Bringing more heat and light to Fedora, so you don't "

+         "have to choose between 'building things' and 'building communities "

+         "that build things'."

+     )

+     hub.config["rules_url"] = 'https://fedoraproject.org/wiki/CommOps'

  

      widget = hubs.models.Widget(

-         plugin='rules', index=1, _config=json.dumps({

-             'link': 'https://fedoraproject.org/wiki/CommOps',

-             'schedule_text': None,

-             'schedule_link': None,

-             'minutes_link': 'http://meetbot.fedoraproject.org/sresults/'

-                             '?group_id=commops&type=team',

-         }))

-     hub.widgets.append(widget)

- 

-     widget = hubs.models.Widget(

-         plugin='meetings', index=2, _config=json.dumps({

+         plugin='meetings', index=1, _config=json.dumps({

              'calendar': 'commops', 'n_meetings': 4

          }))

      hub.widgets.append(widget)
@@ -128,14 +104,7 @@ 

                                  }))

      hub.widgets.append(widget)

  

-     widget = hubs.models.Widget(

-         plugin='sticky', index=1, left=True, _config=json.dumps({

-             'text': "Bringing more heat and light to Fedora, so you don't have "

-                     "to choose between 'building things' and 'building "

-                     "communities that build things.'",

-         }))

-     hub.widgets.append(widget)

-     widget = hubs.models.Widget(plugin='feed', index=2, left=True)

+     widget = hubs.models.Widget(plugin='feed', index=1, left=True)

      hub.widgets.append(widget)

  

  
@@ -153,19 +122,19 @@ 

      hub = hubs.models.Hub(name='marketing', hub_type="team")

      db.add(hub)

      hub.config["summary"] = 'The Fedora Marketing Team'

+     hub.config["description"] = """

+     The Fedora Marketing Team develops and executes marketing strategies to promote

+     the usage and support of Fedora worldwide. Through the development of processes

+     and content, this project aims to support the efforts of other Fedora projects

+     to spread Fedora and to provide a central repository of ideas and information

+     that can be used to deliver Fedora to new audiences. We work closely with the

+     Fedora Ambassadors who spread the word about Fedora at events and allow the

+     Fedora Project to interact directly with its existing and prospective users.

+     """

+     hub.config["rules_url"] = 'https://fedoraproject.org/wiki/Marketing'

  

      widget = hubs.models.Widget(

-         plugin='rules', index=1, _config=json.dumps({

-             'link': 'https://fedoraproject.org/wiki/Marketing',

-             'schedule_text': None,

-             'schedule_link': None,

-             'minutes_link': 'http://meetbot.fedoraproject.org/sresults/'

-                             '?group_id=fedora-mktg&type=channel',

-         }))

-     hub.widgets.append(widget)

- 

-     widget = hubs.models.Widget(

-         plugin='meetings', index=2, _config=json.dumps({

+         plugin='meetings', index=1, _config=json.dumps({

              'calendar': 'marketing', 'n_meetings': 4

          }))

      hub.widgets.append(widget)
@@ -177,20 +146,7 @@ 

          }))

      hub.widgets.append(widget)

  

-     widget = hubs.models.Widget(

-         plugin='sticky', index=1, left=True, _config=json.dumps({

-             'text': """

-     The Fedora Marketing Team develops and executes marketing strategies to promote

-     the usage and support of Fedora worldwide. Through the development of processes

-     and content, this project aims to support the efforts of other Fedora projects

-     to spread Fedora and to provide a central repository of ideas and information

-     that can be used to deliver Fedora to new audiences. We work closely with the

-     Fedora Ambassadors who spread the word about Fedora at events and allow the

-     Fedora Project to interact directly with its existing and prospective users.

-     """,

-         }))

-     hub.widgets.append(widget)

-     widget = hubs.models.Widget(plugin='feed', index=2, left=True)

+     widget = hubs.models.Widget(plugin='feed', index=1, left=True)

      hub.widgets.append(widget)

  

  
@@ -206,43 +162,31 @@ 

      db.commit()

  

  # ############# Design team

-     hub = hubs.models.Hub(name='designteam', hub_type="team")

+     hub = hubs.models.Hub(name='design', hub_type="team")

      db.add(hub)

      hub.config["summary"] = 'The Fedora Design Team'

+     hub.config["description"] = """

+     The Design Team is the design group of the Fedora project. Our interests are

+     not only in creating graphics for use by the Fedora community, but also in

+     advocating the use of the creative tools that are a part of Fedora.

+     """

+     hub.config["rules_url"] = 'https://fedoraproject.org/wiki/Design'

+     hub.config["meetings_text"] = 'Meetings are every other Tuesday at 16:00 UTC'

  

      widget = hubs.models.Widget(

-         plugin='rules', index=1, _config=json.dumps({

-             'link': 'https://fedoraproject.org/wiki/Design',

-             'schedule_text': 'Meetings are every other Tuesday at 16:00 UTC',

-             'schedule_link': 'https://apps.fedoraproject.org/calendar/design/',

-             'minutes_link': 'http://meetbot.fedoraproject.org/sresults/'

-                             '?group_id=fedora-design&type=channel',

-         }))

-     hub.widgets.append(widget)

- 

-     widget = hubs.models.Widget(

-         plugin='meetings', index=2, _config=json.dumps({

-             'calendar': 'design', 'n_meetings': 4

+         plugin='meetings', index=1, _config=json.dumps({

+             'n_meetings': 4

          }))

      hub.widgets.append(widget)

  

  # Added a hubs about widget

      widget = hubs.models.Widget(

-         plugin='about', index=3, _config=json.dumps({

+         plugin='about', index=2, _config=json.dumps({

              "text": "I'm a Fedora user, and this is my about widget text!",

          }))

      hub.widgets.append(widget)

  

-     widget = hubs.models.Widget(

-         plugin='sticky', index=1, left=True, _config=json.dumps({

-             'text': """

-     The Design Team is the design group of the Fedora project. Our interests are

-     not only in creating graphics for use by the Fedora community, but also in

-     advocating the use of the creative tools that are a part of Fedora.

-     """,

-         }))

-     hub.widgets.append(widget)

-     widget = hubs.models.Widget(plugin='feed', index=2, left=True)

+     widget = hubs.models.Widget(plugin='feed', index=1, left=True)

      hub.widgets.append(widget)

  

  
@@ -262,42 +206,29 @@ 

      hub = hubs.models.Hub(name='infrastructure', hub_type="team")

      db.add(hub)

      hub.config["summary"] = 'The Fedora Infra Team'

+     hub.config["description"] = """

+     The Infrastructure Team consists of dedicated volunteers and professionals

+     managing the servers, building the tools and utilities, and creating new

+     applications to make Fedora development a smoother process. We're located all

+     over the globe and communicate primarily by IRC and e-mail.

+     """

+     hub.config["rules_url"] = 'https://fedoraproject.org/wiki/Infrastructure'

+     hub.config["meetings_text"] = 'We meet weekly in #fedora-meeting at 18:00 UTC'

  

      widget = hubs.models.Widget(

-         plugin='rules', index=1, _config=json.dumps({

-             'link': 'https://fedoraproject.org/wiki/Infrastructure',

-             'schedule_text': 'We meet weekly in #fedora-meeting at 18:00 UTC',

-             'schedule_link':

-                 'https://apps.fedoraproject.org/calendar/infrastructure/',

-             'minutes_link': 'http://meetbot.fedoraproject.org/sresults/'

-                             '?group_id=infrastructure&type=team',

-         }))

-     hub.widgets.append(widget)

- 

-     widget = hubs.models.Widget(

-         plugin='meetings', index=2, _config=json.dumps({

-             'calendar': 'infrastructure', 'n_meetings': 4

+         plugin='meetings', index=1, _config=json.dumps({

+             'n_meetings': 4

          }))

      hub.widgets.append(widget)

  

  # Added a hubs about widget

      widget = hubs.models.Widget(

-         plugin='about', index=3, _config=json.dumps({

+         plugin='about', index=2, _config=json.dumps({

              "text": "I'm a Fedora user, and this is my about widget text!",

          }))

      hub.widgets.append(widget)

  

-     widget = hubs.models.Widget(

-         plugin='sticky', index=2, left=True, _config=json.dumps({

-             'text': """

-     The Infrastructure Team consists of dedicated volunteers and professionals

-     managing the servers, building the tools and utilities, and creating new

-     applications to make Fedora development a smoother process. We're located all

-     over the globe and communicate primarily by IRC and e-mail.

-     """,

-         }))

-     hub.widgets.append(widget)

-     widget = hubs.models.Widget(plugin='feed', index=3, left=True)

+     widget = hubs.models.Widget(plugin='feed', index=1, left=True)

      hub.widgets.append(widget)

  

      hub.subscribe(hubs.models.User.by_username('ralph'), 'owner')

Fixes #462

The only issue is that the hub contact & rules block is not overflowing on the right column as in the mockups. I'm relying on someone with better CSS skills (@ryanlerch) to fix it :-)

rebased onto 9a5a7c997dc4fd751945731fbc97a18142dc9492

6 years ago

LGTM!

Let's merge this one

rebased onto 2720130

6 years ago

Pull-Request has been merged by abompard

6 years ago