Skip to content

Commit

Permalink
Merge pull request #492 from FitzwilliamMuseum/issue471
Browse files Browse the repository at this point in the history
Leaving fitzwilliam change batch
  • Loading branch information
portableant authored Aug 23, 2022
2 parents e3395a0 + d43ce46 commit e4632ab
Show file tree
Hide file tree
Showing 113 changed files with 2,652 additions and 2,340 deletions.
49 changes: 49 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributor Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Attempting collaboration before conflict
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- Violence, threats of violence, or inciting others to commit self-harm
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, intentionally spreading misinformation, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Abuse of the reporting process to intentionally harass or exclude others
- Advocating for, or encouraging, any of the above behavior
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting us anonymously through [this form](https://goo.gl/forms/chVYUnA4bP70WGsL2). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

If you are unsure whether an incident is a violation, or whether the space where the incident took place is covered by our Code of Conduct, **we encourage you to still report it**. We would prefer to have a few extra reports where we decide to take no action, than to leave an incident go unnoticed and unresolved that may result in an individual or group to feel like they can no longer participate in the community. Reports deemed as not a violation will also allow us to improve our Code of Conduct and processes surrounding it. If you witness a dangerous situation or someone in distress, we encourage you to report even if you are only an observer.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), [version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
67 changes: 67 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Contributing to Fitzwilliam Museum projects

A big welcome and thank you for considering contributing to Fitzwilliam Museum open source projects!

Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved.
It also communicates that you agree to respect the time of the developers managing and developing these open source projects.
In return, we will reciprocate that respect by addressing your issue, assessing changes, and helping you finalize your pull
requests.

## Quicklinks

* [Code of Conduct](#code-of-conduct)
* [Getting Started](#getting-started)
* [Issues](#issues)
* [Pull Requests](#pull-requests)

## Code of Conduct

We take our open source community seriously and hold ourselves and other contributors to high standards of communication.
By participating and contributing to this project, you agree to uphold our [Code of Conduct](CODE-OF-CONDUCT.md).

## Getting Started

Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both:

- To report security vulnerabilities, please contact our [IT team](mailto:[email protected]) which is monitored by our team.
- Search for existing Issues and PRs before creating your own.
- We work hard to makes sure issues are handled in a timely manner but, depending on the impact, it could take a while to investigate the root cause. A friendly ping in the comment thread to the submitter or a contributor can help draw attention if your issue is blocking.
- If you've never contributed before, read the Laravel docs for resources and tips on how to get started.

### Issues

Issues should be used to report problems with the project, request a new feature, or to
discuss potential changes before a PR is created. When you create a new Issue, a
template will be loaded that will guide you through collecting and providing the
information we need to investigate.

If you find an Issue that addresses the problem you're having, please add your own
reproduction information to the existing issue rather than creating a new one.

Adding a [reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) can also help
be indicating to our maintainers that a particular problem is affecting more than
just the reporter.

### Pull Requests

PRs to our libraries are always welcome and can be a quick way to get your fix or improvement slated for the next release.

In general, your PRs should:

- Only fix/add the functionality in question **OR** address wide-spread whitespace/style issues, not both at the same time!
- Add unit or integration tests for fixed or changed functionality (if a test suite already exists).
- Address a single concern in the least number of changed lines as possible.
- Be accompanied by a complete Pull Request template (loaded automatically when a PR is created).

For changes that address core functionality or would require breaking changes (e.g. a major release), it's best to open
an Issue to discuss your proposal first. **This is not required but can save time creating and reviewing changes.**

In general, we follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr)

1. Fork the repository to your own Github account
2. Clone the project to your machine
3. Create a branch locally with a succinct but descriptive name
4. Commit changes to the branch
5. Following any formatting and testing guidelines specific to this repo
6. Push changes to your fork
7. Open a PR in our repository and follow the PR template so that we can efficiently review the changes.
25 changes: 15 additions & 10 deletions app/Http/Controllers/aboutusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Pagination\LengthAwarePaginator;

class aboutusController extends Controller
{
Expand Down Expand Up @@ -43,11 +42,12 @@ public function directors(): View
*/
public function director(string $slug): View|Response
{
$directors = Directors::getDirector($slug);
if (empty($directors['data'])) {
$data = Directors::getDirector($slug);
if (empty($data['data'])) {
return response()->view('errors.404', [], 404);
} else {
return view('aboutus.director', ['director' => Collect($data['data'])->first()]);
}
return view('aboutus.director', compact('directors'));
}


Expand Down Expand Up @@ -79,11 +79,12 @@ public function archiveVacancies(Request $request): View
*/
public function vacancy(string $slug): View|Response
{
$vacancies = Vacancies::getVacancy($slug);
if (empty($vacancies['data'])) {
$vacancy = Vacancies::getVacancy($slug);
if (empty($vacancy['data'])) {
return response()->view('errors.404', [], 404);
} else {
return view('aboutus.vacancy', ['vacancy' => Collect($vacancy['data'])->first()]);
}
return view('aboutus.vacancy', compact('vacancies'));
}

/**
Expand Down Expand Up @@ -152,11 +153,15 @@ public function spoliation(Request $request): View

/**
* @param string $priref
* @return View
* @return View|Response
*/
public function spoliationClaim(string $priref): View
public function spoliationClaim(string $priref): View|Response
{
$claims = SpoliationClaims::find($priref);
return view('aboutus.spoliation-claim', compact('claims'));
if(empty($claims ['data'])){
return response()->view('errors.404', [], 404);
} else {
return view('aboutus.spoliation-claim', ['claims' => Collect($claims['data'])->first()]);
}
}
}
37 changes: 20 additions & 17 deletions app/Http/Controllers/collectionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,36 @@ class collectionsController extends Controller
/**
* @return View
*/
public function index(): View
{
$pages = Stubs::getLandingBySlug('about-us', 'collections');
$collections = Collections::list();
return view('collections.index', compact('collections', 'pages'));
}
public function index(): View
{
$pages = Stubs::getLandingBySlug('about-us', 'collections');
$collections = Collections::list();
return view('collections.index', compact('collections', 'pages'));
}

/**
* @param string $slug
* @return View|Response
*/
public function details(string $slug): View|Response
{
$collection = Collections::find($slug);
if(empty($collection['data'])){
return response()->view('errors.404',[],404);
public function details(string $slug): View|Response
{
$collection = Collections::find($slug);
if(empty($collection['data'])) {
return response()->view('errors.404', [], 404);
} else {
return view('collections.details', [
'collection' => Collect($collection['data'])->first()
]);
}
}
return view('collections.details', compact('collection'));
}

/**
* @param string $prirefs
* @return array
*/
public static function getObjects(string $prirefs): array
{
return CIIM::findByPriRefs($prirefs);
}
public static function getObjects(string $prirefs): array
{
return CIIM::findByPriRefs($prirefs);
}

}
6 changes: 4 additions & 2 deletions app/Http/Controllers/departmentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ public function details(string $slug): View|Response
if (empty($departments['data'])) {
return response()->view('errors.404', [], 404);
} else {
$staff = StaffProfiles::findByDepartment($departments['data'][0]['id']);
$department = Collect($departments['data'])->first();
$staff = StaffProfiles::findByDepartment($department['id']);
return view('departments.details', compact('department', 'staff'));
}
return view('departments.details', compact('departments', 'staff'));

}

/**
Expand Down
Loading

0 comments on commit e4632ab

Please sign in to comment.