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

selects the current category when creating a new discussion #167

Merged
merged 1 commit into from
Feb 7, 2018

Conversation

gerbenjacobs
Copy link
Contributor

closes #166

Change-Id: I57bdd8b4fe65e529a491e61a69acb969bee726eb

closes thedevdojo#166

Change-Id: I57bdd8b4fe65e529a491e61a69acb969bee726eb
@foreach($categories as $category)
@if(old('chatter_category_id') == $category->id)
<option value="{{ $category->id }}" selected>{{ $category->name }}</option>
@elseif(!empty($category_id) && $category_id == $category->id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had trouble with the mix of tabs and spaces in this file. So although it looks like it all changed, I only added the middle @elseif part.

It could technically be merged with the first if, since they both just add selected but I feel this is more readable. I.e. You either get selected because you match the old input data or you get selected because you're on a category page at the moment.

@marktopper
Copy link
Collaborator

Thanks

@marktopper marktopper merged commit c0dfa01 into thedevdojo:master Feb 7, 2018
@gerbenjacobs gerbenjacobs deleted the select-current-category branch February 13, 2018 07:59
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.

pre-select the category when viewing a category overview
2 participants