Media-Public / mediapublic-server

MediaPublic Website Platform
GNU General Public License v3.0
1 stars 4 forks source link

Admin Functions #4

Open thequbit opened 9 years ago

thequbit commented 9 years ago

So I had the thought that maybe the Admin functionality of the site should actually be built into each page. So that when someone is viewing the page as an Admin, they have little (+) next to things, where they can just add a new item. I've done this before on a few sites with high success in usability, although the target audience was more technical then I think our Admin's may be ...

The thought would be that if you wanted to add something to the site ( and really everything on the site is a list: people, recordings, stations, etc. ) you would just click a "add" button. And that would then just create a new field right there on the site.

I know this won't work with all things ... but it could be adapted pretty universally I think ( or modals could be used to supplement as needed ). As @GabeIsman said, this site is kinda big, and we haven't even touched on the "how do we get data into it" part yet. We can pre-fill things all day from scripts, but eventually we'll need to push that "burden" onto the stations and users.

melodykramer commented 9 years ago

Deleted it after seeing the other thread!

melodykramer commented 9 years ago

I think this is a good idea!

GabeIsman commented 9 years ago

I like this idea. I think we'll need to be careful designing it so that it doesn't turn into an unholy mess on the code side, but I think it's a usability win. If we do it right, the code ought to be fairly general too.

thequbit commented 9 years ago

I think we can spend some time to, like you said Gabe, 'do it right' and make it pretty clean. Any time there is a list, we can just define the items that go into that list and then make those things into inputs. Something like:

var list_item = [
    {
        name: 'name',
        type: 'input/text',
    },
    {
        name: 'age',
        type: 'input/digit',
    },
    {
        name: 'hair_color',
        type: 'combo',
        combo_contents: [
            {
                text: 'Brown',
                value: 0,
            },
            {
                text: 'Blond',
                value: 1,
            },
            {
                text: 'Red',
                value: 2,
            },
            {
                text: 'White',
                value: 3,
            },
        ]
    }

This way we can just have the code render the fields, and validate them before submit ( that will be done server side as well, but much easier to check them client side first ).

I agree that usability should be one of ( if not our highest ) priority.

GabeIsman commented 9 years ago

Makes sense to me. I've had some success working with https://github.com/powmedia/backbone-forms (on backbone projects), I'm sure there are tools in other frameworks for turning a JSON representation of a data structure into a working form with validation, etc.

thequbit commented 9 years ago

See, I knew that someone had to have solved that problem already :). That's exactly what I was thinking.