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

Rearange assos sidebar and hide career (fixing #331) #332

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 31 additions & 29 deletions resources/assets/react/components/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* @author Alexandre Brasseur <[email protected]>
* @author Samy Nastuzzi <[email protected]>
* @author Natan Danous <[email protected]>
* @author Noé Amiot <[email protected]>
*
* @copyright Copyright (c) 2018, SiMDE-UTC
* @license GNU GPL-3.0
Expand All @@ -29,12 +30,13 @@ class Sidebar extends React.Component {
static getAssos(assos) {
return assos.map(asso => {
let color = `color-${asso.login}`;
const icon = asso.pivot.role_id ? 'hourglass' : 'thumbs-up';

if (asso.parent) color += ` color-${asso.parent.login}`;

return (
<NavLink key={asso.id} className="sidebar-link" to={`/assos/${asso.login}`}>
<FontAwesomeIcon icon={asso.pivot.role_id ? 'hands-helping' : 'thumbs-up'} />{' '}
<FontAwesomeIcon icon={asso.pivot.validated_by_id ? 'hands-helping' : icon} />{' '}
<span className={color}>{asso.shortname}</span>
</NavLink>
);
Expand Down Expand Up @@ -92,6 +94,34 @@ class Sidebar extends React.Component {
</NavLink>
</div>

<div className="sidebar-group">
<h6 className="sidebar-header d-hover-zone">
RACCOURCIS{' '}
<NavLink
className="float-right d-hover fas fa-cog"
style={{ display: 'none' }}
to="/settings/sidebar/shortcuts"
/>
</h6>
{isAuthenticated && user.types.contributorBde && (
<NavLink className="sidebar-link" to="/bookings">
<FontAwesomeIcon icon="person-booth" /> Réservations
</NavLink>
)}
<NavLink className="sidebar-link" to="/services">
<FontAwesomeIcon icon="concierge-bell" /> Services
</NavLink>
<NavLink className="sidebar-link" to="/assos">
<FontAwesomeIcon icon="hands-helping" /> Associations
</NavLink>
<NavLink className="sidebar-link" to="/partners">
<FontAwesomeIcon icon="handshake" /> Partenaires
</NavLink>
<NavLink className="sidebar-link" to="/groupes" style={{ display: 'none' }}>
<FontAwesomeIcon icon="users" /> Groupes
</NavLink>
</div>

<div className="sidebar-group">
<h6 className="sidebar-header d-hover-zone">
LIENS UTILES{' '}
Expand Down Expand Up @@ -152,34 +182,6 @@ class Sidebar extends React.Component {
</a>
</div>

<div className="sidebar-group">
<h6 className="sidebar-header d-hover-zone">
RACCOURCIS{' '}
<NavLink
className="float-right d-hover fas fa-cog"
style={{ display: 'none' }}
to="/settings/sidebar/shortcuts"
/>
</h6>
{isAuthenticated && user.types.contributorBde && (
<NavLink className="sidebar-link" to="/bookings">
<FontAwesomeIcon icon="person-booth" /> Réservations
</NavLink>
)}
<NavLink className="sidebar-link" to="/services">
<FontAwesomeIcon icon="concierge-bell" /> Services
</NavLink>
<NavLink className="sidebar-link" to="/assos">
<FontAwesomeIcon icon="hands-helping" /> Associations
</NavLink>
<NavLink className="sidebar-link" to="/partners">
<FontAwesomeIcon icon="handshake" /> Partenaires
</NavLink>
<NavLink className="sidebar-link" to="/groupes" style={{ display: 'none' }}>
<FontAwesomeIcon icon="users" /> Groupes
</NavLink>
</div>

{isAuthenticated && services.length > 0 && (
<div className="sidebar-group">
<h6 className="sidebar-header d-hover-zone">
Expand Down
4 changes: 2 additions & 2 deletions resources/assets/react/screens/Profile/AssociativeCareer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AssociativeCareerScreen extends React.Component {
semesters.forEach(semester => {
if (associativeSemesters[semester.id] === undefined) {
actions.user.assos
.all({ cemetery: true, semester: semester.id })
.all({ cemetery: true, semester: semester.id, only: 'joined,followed' })
.payload.then(({ data }) => {
if (data.length > 0) {
this.addNewAssociativeSemester(semester.id, data);
Expand Down Expand Up @@ -87,7 +87,7 @@ class AssociativeCareerScreen extends React.Component {
key={asso.id + semester.id}
name={asso.name}
shortname={asso.shortname}
additionalInfo={role ? role.name : ''}
additionalInfo={role ? role.name : 'Association suivie'}
image={asso.image}
login={asso.parent ? asso.parent.login : asso.login}
deleted={asso.in_cemetery_at != null}
Expand Down