Jump to content

New Noticeboard Widget


pconkie

Recommended Posts

We use the frog noticeboard widget on our dashboards (all-staff email groups don't exist!) and a filedrop for any attachments.  

This doesn't work great - it's sometimes hard to find the right attachment and files remain long after notices have expired.

So I thought i'd have a go at recreating the noticeboard widget with the option to attach files directly to the notice.

 

I've managed to do this.  But I have a few things on the wishlist....... 

1. With advice from @Chris.Smith i'm using the site assets to store the attachments. However, I've noticed that when the page with my noticeboard is nested on our dashboard the attachments get stored in the dashboards assets instead.  I'd rather not do this, so i'm wondering if there is a way to get the uuid of the site the widget is on when that site is nested on a dashboard? This: var site_uuid = this.elements.site.find('[data-site-uuid]:first').data('site-uuid'); doesn't do it.

2. I currently have to drag a frog noticeboard widget onto a page and hunt down the uuid of the forum that got created to hijack. I then provide that forum uuid to the widget via a preference.  Is there a way in edit mode when my noticeboard is dragged onto a page to create a new forum and return the uuid (and i suppose to be tidy, delete a forum when the widget is deleted from a page).

3. Frog seems to use CKeditor in various places in order to add custom mark-up to text.  Is it possible to turn my 'content' textarea into a WYSIWYG enabled element using CKeditor?

4. I'm using this https://froglearn.backwellschool.net/app/public/sprite/os-icon-ext/sprite.png frog sprite map to get the correct file type images for each attachment. However is this reliable across different froglearn instances? Should i be uploading as a widget asset? I'm also getting a weird border around the images which I think is actually sue to not setting a src on the image placeholder i'm using.  Is there a frog transparent.png somewhere i can use or again, should i be uploading one as an asset.

That's it for now!

Thanks

Paul

Link to comment
Share on other sites

On 2017-5-22 at 23:05, pconkie said:

We use the frog noticeboard widget on our dashboards (all-staff email groups don't exist!) and a filedrop for any attachments.  

This doesn't work great - it's sometimes hard to find the right attachment and files remain long after notices have expired.

So I thought i'd have a go at recreating the noticeboard widget with the option to attach files directly to the notice.

 

I've managed to do this.  But I have a few things on the wishlist....... 

1. With advice from @Chris.Smith i'm using the site assets to store the attachments. However, I've noticed that when the page with my noticeboard is nested on our dashboard the attachments get stored in the dashboards assets instead.  I'd rather not do this, so i'm wondering if there is a way to get the uuid of the site the widget is on when that site is nested on a dashboard? This: var site_uuid = this.elements.site.find('[data-site-uuid]:first').data('site-uuid'); doesn't do it.

2. I currently have to drag a frog noticeboard widget onto a page and hunt down the uuid of the forum that got created to hijack. I then provide that forum uuid to the widget via a preference.  Is there a way in edit mode when my noticeboard is dragged onto a page to create a new forum and return the uuid (and i suppose to be tidy, delete a forum when the widget is deleted from a page).

3. Frog seems to use CKeditor in various places in order to add custom mark-up to text.  Is it possible to turn my 'content' textarea into a WYSIWYG enabled element using CKeditor?

4. I'm using this https://froglearn.backwellschool.net/app/public/sprite/os-icon-ext/sprite.png frog sprite map to get the correct file type images for each attachment. However is this reliable across different froglearn instances? Should i be uploading as a widget asset? I'm also getting a weird border around the images which I think is actually sue to not setting a src on the image placeholder i'm using.  Is there a frog transparent.png somewhere i can use or again, should i be uploading one as an asset.

That's it for now!

Thanks

Paul

Hi Paul,

I can address some of your issues now but I'll have to get back to you on the rest.

1. Try...

this.elements.page.controller().options.origin_site_uuid

2. I will have to get back to you...

3. It is supposed to be simple... but for some reason our CKEditor component doesn't want to work for me today, I'll get back to you.

4. For a reliable way to display file icons, use the extension as a css class on a div tag. For example:

.os-icon-ext-jpeg, .os-icon-ext-jpg

 You can add a class of small to get a smaller icon. Here is a full example

<div class="os-icon-ext os-icon-ext-jpeg">
  <span class="file-name">JPEG</span>
</div>

 Hope that helps,

~ Chris

  • Like 2
Link to comment
Share on other sites

Ok, @Graham Quince @Chris.Smith come on, this is getting in the way of writing the timetable for next year!

This is almost 'finished' - thought you might want a look...

This has now replaced the frog noticeboard on our dashboard

Capture.PNG.bfbec5829900d72d8ec6ebf2fc61cba1.PNG

You can:

Choose your title font colour

Add attachments without needed a file drop!

Changed the default date options to "until" rather than "from"

 

This one is on the student dashboard

Capture2.PNG.d3b93734c6779c3081f6047428bfe19d.PNG

You can insert hyperlinks (like the final notice) but not easily! Better if CKEditor was available!

Found this.options.sitePermission so that I could hide the 'Create Notice' button for users that only have 'view' permissions.

BTW: The Croak is our in house student run magazine on frog - it's great!

 

At the moment I have to drag a frog noticeboard onto a page and grab the forum uuid to enter as a preference in my widget.

If the forum uuid is not set, the widget won't work (I do test for this and load in another view,ejs to let them know in detail what to do).  So is there a way to generate a forum uuid from scratch as I presume the real noticeboard widget does?

This must be possible, right?

 

Thanks

Paul

 

 

 

 

  • Like 1
Link to comment
Share on other sites

Help! @Chris.Smith @Graham Quince

Some staff can not attach files to their notices.  They get error: 

{"status":{"code":3000,"message":"You do not have the api.assetsfiles.add role"},"params":{"method":"assetsfiles.add"},"data":null}

BUT....

I can't find this role in Groups and Policies - how do i give all staff this role?

Paul

Edited by pconkie
Link to comment
Share on other sites

Hi Paul

In order to be able to add a notice to a noticeboard, your staff will need edit and manage rights to the site.  If you increase the permissions to the notices site to edit and manage, it should work for you.

Apologies if you've tried this already.

Graham

Link to comment
Share on other sites

Hi Graham

Thanks! That fixed it.  All working as expected now.  I did think it was working for my teacher account (I have an admin account too) but seem i was mistaken.

Of course now all staff get the little "edit" handle when they follow the link from the notification that is generated from a new post (as the site is nested on our dashboard they don't see the edit handler under all other circumstances).  I suppose a member of staff *could* inadvertently delete the widget off the page.  It looks like they can't delete the entire site though (because they are not the owner?).  Would be nice to have the api to tick!  I think with a bit of time to think about it I could probably hide the edit handle for all but those in the admin profile.

Thanks again

Paul

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Made some further improvements to this widget today...

1. If an email address or link is included in the post, it is automatically turned into a clickable link.

2. Introduced a "frog tag" like feature. - Often we have notices that include long lists of student names which take up a lot of screen space!  Now we can put a list like this between two tags <start list> and <stop list>.  The notice board widget turns this into a collapsible "click to show" / "click to hide" container.

If anyone wants the widget, they of course can, but @Graham Quince how would i get if off our platform?

Paul

  • Like 3
Link to comment
Share on other sites

Hi Paul

I've got your widget, but while preparing a video to demonstrate it, I spotted one thing that might cause issues for users.  

When a file is linked to, the link opens in the existing window, so if I upload a PDF or image, I leave Frog.  Is there any chance you could add a target="_blank" to the link?

Works fine for word docs though.

Link to comment
Share on other sites

If you're a Frog3-FrogLearn school, you'll have to wait for Austen as there is a fix in that update you need.  If you're FrogLearn only, you'll need to enable Package Manager via Groups and Policies, then follow the tutorial on the Frogcode community site

Link to comment
Share on other sites

Fantastic work. I really want to use the new noticeboard widget on the student dashboard, however when logged in as my test student account I can create a notice whereas on the original noticeboard widget the permissions are in place where I can’t. Can I restrict students from creating notices using the new widget?

Thank you in advance!

Link to comment
Share on other sites

Hi @paulmitchell1989

As per the original widget if a user or group has only "view" permission for a site then they won't see the button to create a new notice.  If they have "view and contribute" or "admin" permissions then they will see it. That's the theory anyway! And that works on our frog box.

I'm not sure what the default sharing settings are for the student dashboard, but if you create a new site and give students "view" sharing permissions and put the noticeboard on that site, then embed that site on your dashboard, it should work like you want it to.

We don't let students create notices either!

Let me know if you still can't get it to hide.

Paul

  • Like 1
Link to comment
Share on other sites

19 minutes ago, pconkie said:

Hi @paulmitchell1989

As per the original widget if a user or group has only "view" permission for a site then they won't see the button to create a new notice.  If they have "view and contribute" or "admin" permissions then they will see it. That's the theory anyway! And that works on our frog box.

I'm not sure what the default sharing settings are for the student dashboard, but if you create a new site and give students "view" sharing permissions and put the noticeboard on that site, then embed that site on your dashboard, it should work like you want it to.

We don't let students create notices either!

Let me know if you still can't get it to hide.

Paul

Perfect! Thank you for the widget and your help, Frog need to start paying you with all your contributions!

  • Like 1
Link to comment
Share on other sites

Ah, I see a potential problem here.  If a school has a forum on the dashboard site, then students will need contribute access in order to post.  With your notice board only requiring Contribute and not edit and manage, there is a little bit of a conflict.  Personally, i think we need an additional layer of permissions between contribute and edit & manage and there have been some discussions internally about this.

Could I make a suggestion?  How about a preference in the widget to turn off the create notice button for contribute level access or just for students (and one for parents)

Link to comment
Share on other sites

Hi @Graham Quince

Also worth noting that contribute access is required by the forums api to submit a new post (notice). Just wondering why a student would need "contribute" access to their dashboard? In theory Paul could also have solved his problem by changing the students permissions to "view" for their dashboard.  This would be consistent with how other widgets work.  

Having said that, the original widget does hide the new notice button when that widget is placed directly on the student dashboard (but not the staff dashboard) when the students have contribute access. So this is clearly a different behaviour!

If someone can tell what line of code i need to check if the page is a dashboard then i can replicate what the original widget does. Your suggestion of an over-ride is a good one and I can build that in!

Paul

Link to comment
Share on other sites

The original Dashboards sites are a bit of a weird legacy and have several quirks.  If Paul did change the permissions for students to view and has a forum, file drop, poll or wall on the dashboard then I believe the students would not be able to interact with these widgets. :(   

The original noticeboards require Edit and Manage rights to be able to post a notice, which isn't ideal.#

In the API, sites.getInfo

Capture.JPG.8ef5ef96d5c3c69686f5b3dd607f62f1.JPG

A dashboard is listed under "type" as "dashboard", whereas a site is listed as "site"

  • Like 1
Link to comment
Share on other sites

Morning @Graham Quince 

I had my NM create me a new frog account with access to everything...

This seems to have sorted the FrogCode issues i was experiencing yesterday.  I have been able to update the widget to sort out the issues with when and where the new notice button should appear.  I have also added in the over-ride to ensure it is off when you want it off.

Waiting for you when you get a chance to take the latest version.  

Paul

PS: I can't see the video that goes with the widget on the showcase.  That might mean loots of other community members can't see it either.  I can see the office365 video if that helps?

 

Link to comment
Share on other sites

51 minutes ago, pconkie said:

Morning @Graham Quince 

I had my NM create me a new frog account with access to everything...

This seems to have sorted the FrogCode issues i was experiencing yesterday.  I have been able to update the widget to sort out the issues with when and where the new notice button should appear.  I have also added in the over-ride to ensure it is off when you want it off.

Waiting for you when you get a chance to take the latest version.  

Paul

PS: I can't see the video that goes with the widget on the showcase.  That might mean loots of other community members can't see it either.  I can see the office365 video if that helps?

 

Hi @pconkie,

Does this mean you can save changes again?

Thanks,

 

Chris

Link to comment
Share on other sites

Hi Chris

Saving was hit and miss yesterday - sometimes yes, sometime no. That has continued today for my teacher account (the account I have been using for all the frogcode stuff i've been doing).  So something in Austin isn't behaving itself. With a super-dupa admin account the issues seem to have gone away!

Paul  

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...