I think this is a basic problem or question, but i can't find any solution that solves this problem, so probably i'm searching in the wrong way or on the wrong keywords.
I have a bunch of articles in my DB, and there are a number of ways to read/edit them on the site.
- The visitor can see them in a list, click on them and read the whole article
- The registered users can see them in the same list, but click on them to read or edit the article
- The admin can see a different list (an different view), and edit or delete them
and i'm sure i will come up with some other ways to read or edit the articles or other data.
The point is, that if a visitor or user had read or edited the article, i want them to return to their own index of articles, but if an admin has read or edited the article i want him to go back to the admin-index.
So from the start i have a number of routes:
Route::get('/article'... will display the index of articles
Route::get('/article/{name}'... will display an article
Route::get('/article/{name}/edit'... will display the edit form for the article
Route::post('/article/{name}'... will update the article
And for the admin:
Route::get('/admin/article'... will display the index of article
Route::get('/admin/article/{name}'... will display an article
Route::get('/admin/article/{name}/edit'... will display the edit form for the article
Route::post('/admin/article/{name}'... will update the article
But..Route::post('/article/{name}' and Route::post('/admin/article/{name} should point to the same function to update the data, and that function should redirect to different routes, in this case Route::get('/article' and Route::get('/admin/article'
I really dont want to write 2 different routines to store or update the data in the database, that are in fact the same, except for the 'redirect'-line after updating or storing.
My first thought was to make 2 routes, with two entries in my controller that each call the same routine that saves the data, and return where i can redirect, but then i would have to use different 'actions' in my form. That would mean i would have to make 2 forms that are the same, except for the 'action'-line.
Whatever i do, i would have to redirect somewhere based on the section of my site where i was before i started to read or edit my data.
I read something about the 'back()'-function, but that won't help me because i want to be able to read an article, and then choose to edit it, then return back to my index.
I hope i was able to explain what i want to do, and i'm sure i'm not the only one looking for this, but again, i failed in finding a right solution.
What is het best way to achieve this?!?
I would just separate the controllers between normal users and admin users. This way your code will stay clean and understandable.
You could for example make the following folder structure:
app
- Http
- Controllers
- Admin
- User
Don't forget to change the namespace in your controllers.
If you really want to stick with the same controller for both users then you need to make some kind of if else statement to see what kind of user your are dealing with and redirect on that outcome. Do you have some kind of role structure in your application?
Here is a little background on the task:
My client has a sharepoint site that has a list of data. One of the columns or fields is a date field, this date is entered manually using MM/DD/YY Format.
My client has requested me to add an option where they could filter the columns by a range of dates on the webpart view.
I read this guide: https://www.nothingbutsharepoint.com/sites/eusp/pages/sharepoint-list-filtering-by-date-range.aspx and i got it to work, but it seems to be a bit buggy, meaning that sometimes the list will not get filtered by the specified dates..
Another issue with this method is that there is no Submit/Go button.
FROM: [ Text Field ] TO: [ Text Field ] [GO Button]
My client would love to have something like the example above where there are two text fields next to each other and a button that they can click to make the filter activate.
I searched for hours and hours and was not able to find something like this.
Do you guys know of a solution and if so, provide me with a link or guide, on how to achieve this problem? Thanks
EDIT:
It seems that there is a Apply Filters Button Web Part that does what i need. I added it and it seems to work Okay. I have to click Apply Filters TWICE in order for it to work.. weird huh? is there a fix for that?
FYI: i followed the guide linked above and just added the apply filters button.
Okay i fixed it,
It was because i was adding the date filter web parts to the library itself, and i was supposed to create a page for it and add my web-parts in there.
Found a solution that'll load the filters on first click for me.
In SPD, under the web part that displays the list items (XsltListViewWebPart), change these two to "True":
ClientRender="True" and IsClientRender="True"
Similar issues mentioned in this thread gave insights to button load sequences and why it doesn't render results on the first click.
I want to find all the GitHub issues that I commented on. I tried searching for commenter:mbigras type:issue like the Searching issues and pull requests GitHub article suggests. But that method returns fewer results than the public activity section of my profile.
See both attached images:
Search method
Doesn't display current results:
Profile method
Gets mixed up with other public activity:
Is there a way to get the full history of my comments on GitHub?
EDIT
author:mbigras type:issue gives wider results but still not the full history:
What I'm looking for is a way to quickly view all my comment/issue history in all issues.
EDIT
I emailed GitHub about this. Search doesn't match the public activity section because search indexes issues by creation date and not last active date.
How do you keep organized about which issues you've commented on?
Search for commenter:username in the main Github search box.
For example commenter:gavinandresen
To see recent activity, select Recently updated from Sort dropdown
You can also narrow the search: is:issue commenter:gavinandresen
I have also been very frustrated when I could not find an issue that I have commented on a while ago. I even did not remember the project it was in. I knew only the problem I was referring to.
Then, I went to the Notification settings on Github and saw there is an Include your own updates option that is unchecked by default.
Once you check it, Github will send you an e-mail notification about every comment or PR you make. They you probably want to add an appropriate label and filter for emails so Github messages do not clutter an inbox.
My life has changed since then. Now, every time I want to find something I have written on Github, I just search for it in the e-mail notifications.
You can view all the issues on Github you have commented on by going to https://github.com/notifications/subscriptions and selecting Reason as Comment.
This will show all the issues that you've commented on.
You can also filter the issues by selecting other reason such as Assign, Author, Manual, Mention, etc. but you can select only one reason at a time. Also, you can filter the issues by repository by selecting the concerned repository from dropdown after clicking Repository
Search All GitHub using the search term is:issue author:#me
You can also check the following links.
For all your subscriptions
https://github.com/notifications/subscriptions
For all your issues
https://github.com/issues
For all your pull requests
https://github.com/pulls
In case someone is interested to know how to find these links, go to github's resi api documentation. The URL's are not explicitly described there. However, look for the page names bellow REFERENCE.
If you lowercase the relevant word (for example Issues become issues, Pulls become pulls) and put that after https://github.com/, you most probably will find what you are looking for.
This might be a little late, but there's also another way to find what issues/PRs you have participated in. This method also brings in a lot more things you might be interested in too!
When you are on the website main page, on github.com, use the keyboard shortcuts as described here to open your pull requests or issues. The shortcut for these is in particular [g, i] for issues and [g, p] for pull requests (I remember g by go, but whatever works for you.)
After you go to the page directed by these shortcuts you are greeted by an entire screen of goodies you can use! The search bar can be edited and the buttons can be used to make your experience fast!
Type involves:<your username> in the search box on the GitHub's main page. This will find all the issues that you commented on, was assigned to or mentioned in.
For example, if your username on GitHub is unclebob, the search query should look like:
involves:unclebob
Or if you're logged in to GitHub, then simply:
involves:#me
Note the difference between involves and similar search qualifiers - author and commenter:
author will find only the issues that were started by you; if you comment on the issue that was started by someone else, author query won't return it in the search results.
E.g., compare involves:unclebob and author:unclebob type:issue.
commenter will find only those issues where you commented second or later (creator of the first comment in an issue is considered its author and not a commenter); if you start an issue and then never comment on it, the commenter query won't return it in the search results.
E.g., compare involves:unclebob and commenter:unclebob.
In other words, when it comes to searching comments, author and commenter return only a subset of involves' results. So I recommend using involves not to miss anything.
Also, since Github is on the web, any HTTP search engine works, eg Google, Bing, etc. This works to the extent of your search engine's quality and the uniqueness of the writer name.
(Indeed, I actually do this all the time when I need to find any previously written web (engine)-accessible publication, including those on StackExchange. Names I use are 1 in probably an infinity, so Google often works better than forum search options.)
(Sample Google link.)
If you want to search for multiple users in a single search, use it like in the global search bar without the OR logical conjugation:
commenter:FantomX1 commenter:FantomX1-github
since the similar google way approach with 'OR' would not work
commenter:FantomX1 OR commenter:FantomX1-github
In moodle is it is possible to count correct/incorrect answers in Immediate feedback Test and show them in the quiz navigation panel?
at the end of the test there is a summary which count the correct answers, but how to show this in the quiz navigation panel after every question is verified?
The "quiz navigation panel" is a special fake block that is displayed as part of the quiz attempt page, it is not an addon or a plugin, it's part of Moodle's core. so, any solution for your question has to involve core changes. if you are willing to do so, you can either use mod/quiz internal questions status display mechanism:
https://github.com/moodle/moodle/blob/master/mod/quiz/attemptlib.php#L1580-L1597
mod/quiz marks with green all the questions that the student has submitted correct answer to. so you can use that mechanism to display the count yourself.
Pick up parts of the following code snipets:
Loop through the questions (slots):
https://github.com/moodle/moodle/blob/master/mod/quiz/attemptlib.php#L2114
And count the correct answers:
https://github.com/moodle/moodle/blob/master/mod/quiz/attemptlib.php#L2125
Make a new function from the above snipets or just add the above snipets after the following line:
https://github.com/moodle/moodle/blob/master/mod/quiz/renderer.php#L336
Hope it helps.
I add sub class information to blocks , items and buttons. When i ran the form in application it shows only prompts not shows item fields
can any one suggest what is happen here
Thank you
Little bit hard to say without more information but most likely the forms compiler is not able to find your object library. Please make sure that the object library is in the forms path.