gui with multiple interfaces? - jquery-ui

I am trying to create a GUI using jquery and html to allow users to enter information into a system. The problem is, I don't know how to create a GUI that will show different interfaces for each step.
For example, I want to have users enter in their personal information in step 1. When they click next, they can choose a photo from a set of photos that appear, and so on.
I suppose I can name different html divs and make them show and hide at certain times as desired. But is there a cleaner technique for doing something like this?

You could use one of the JQuery Form Wizard extensions.
For example:
http://thecodemine.org

Related

Is it possible to have options on select change from when other select changes without javascript

There are a bunch of question on this but no answers on how to do it without javascript.
If you have one form that has 2 select boxes. The second select box has different options based on what you choose for the first select box. Here is a js example. Not all users have js enabled so for these users this option would be unavailable.
Can this be achieved solely using CSS3, HTML5 and Ruby? I would show what I've got so far in trying this but I got nothing.
What you are asking is how to manipulate the DOM after it has loaded without a client-side scripting language. This is not possible as far as I am aware; unfortunately that is not what you want to hear.
The proper solution in this case would be to have the user submit the page and generate the second selection box at that time. You will have to rely entirely on server-side logic to handle the problem. So basically something like:
Serve a page with just a single selection box
When the page is posted generate a similar page where the first selection is locked and display a second selection box with the possible options.
Continue the iteration until you have all of the required selections filled out by the user.
Serve the result that the user requested.

How can I support user edited content in a complex web application?

I'm building a web site (using ASP.NET, MVC 3, Razor) and I'm not using an off the shelf CMS. This is because I evaluated a lot of existing CMS's, and found them all to have a massive learning curve, tons of features I didn't need, and they force you into a page oriented model. By "page oriented model", I mean that you can specify a general page layout and stylesheets, but the object that the user can edit is a whole page, which displays, for example, in a central panel, and maybe you can customize the sidebars as well.
But this site is very design centric, and needs to be much more fluid and granular than this. By "design-centric", I mean that the site was built in Photoshop by a graphic designer, and there is heavy use of images and complex styling to map the design to HTML/css/js. Also, every page on the site is totally different. There are also UI elements such as accordion panels, in which we need the user to be able to edit the content of each panel, but certainly not the jQuery+HTML that powers the accordion. The users are subject matter experts but very non-technical.
So I'll have a page with lots of complex layout and styling, which I don't want the user to access, but within this there will be, say, a div containing text that I would like the user to be able to edit.
How can I best accomplish this?
So far, I'm implementing this by having snippets, which are little units of html, stored in external files, that the user can edit. In run mode, these are loaded and displayed inline (with a little "Edit This Content" button if you're logged in and have permissions). If you click the Edit button, you get a little WYSIWYG editing screen, where you can edit and save changes. So I can control all the messy stuff, and put in little placeholders for user editable content. But this isn't entirely simple for me, and I'm wondering if there's a better way.
Don't mean to necro this, but it seems to be the most relevant question to what I'm currently researching. I recently built something similar as you described above, but I'm pulling data from a database instead of static files. For each page (like /about or /contact) in the Controller I pull data for that page from the DB in the form of a Json string key/value pair. Key is the placeholder tag, Value is the.. value. After deserializing, I simply populate a list and assign it to a ViewBag, then in the CSHTML I ViewBag.List.Keyname to grab the text.
I have a small admin control panel which allows me to modify the text in the database. Having little hover-overs like you do is a great idea though!
Well, I stuck with my original plan:
So far, I'm implementing this by having snippets, which are little
units of html, stored in external files, that the user can edit. In
run mode, these are loaded and displayed inline (with a little "Edit
This Content" button if you're logged in and have permissions). If you
click the Edit button, you get a little WYSIWYG editing screen, where
you can edit and save changes. So I can control all the messy stuff,
and put in little placeholders for user editable content. But this
isn't entirely simple for me, and I'm wondering if there's a better
way.
It works reasonably well for now.

Concept for a grails app

I am working on a Grails project, its an accounting project. We have multiple clients and they can have multiple types of accounts. I have to create the 'create' page for client, there should be a way to add multiple types of account to the client.
So I was thinking of making a drop-down list with account types and few text boxes to enter account name and other info about account. Also, as a client can have multiple accounts, so I want to create a 'add' button, when clicked it would display a new row to add a new client. I have done this kind of UI before using javascript but in this case, as there is a drop-down list and other components, I think it would be very hard and may not work.
I was thinking of creating a partial view which would render each time user clicked the 'add' button with additional row, problem with this would be during validation errors, edit page and i would also have to pass all values each time user clicks 'add' button.
Is there any other for doing this?
For the template approach you must use ajax if you don't want to carry on the params that the user has already set.
It is possible to make new drop-down lists appear (or any group of elements inside a <div>) when a user clicks a button, since Grails already comes with jQuery you might want to take a look at the .clone() method.
The problem with the two listed approeaches is that it will be possible to have duplicates.
Now, another option is to use checkboxes, so you can check just the type of account you want.
But to be honest it does seems a bit odd or even inapropiate to let the user choose the type of account he wants with such freedom.

Building a site with Orchard CMS

I'm in the early stages of trying to learn Orchard, and I'm still seem to be struggling with the basics on how to build a page containing a multitude of various content that can be easily managed by non-technical users.
Ideally, what I'm trying to do is the following, I just can't figure out how to fit it into the Orchard architecture using Content Types, Parts, Fields, Widgets, Zones, etc. Also, since I'm still learning, I'm also trying to avoid any custom modules, or hard-coding content into the site (though I'm open to the idea, if that's the best way to get it done!).
Goal: Create a "home page" layout containing a Menu, Image slideshow, and several feature descriptions. For each image in the slideshow, I need a title, sub-title, description, and an image. To make this easy for non-technical users to manage, I would like to define the HTML template (custom Content Type, Part, or whatever), and allow authors to specify just those well-defined properties. I tried using Content Parts for this, but unfortunately, I can only have one Content Part of a particular type on a piece of Content. I also saw recommendations to create multiple Content Parts with the same set of properties, but I don't know how many images will be displayed (and I don't want to assign an arbitrary number).
I need to do something similar for feature descriptions, allowing authors to specify an image, title, description, and a page to link to. I'm running into the same problem as above, I'm not sure how to allow authors to specify a finite list of content, but have each content item be well-defined.
So far, the best option appears to be creating some sort of custom widget to "host" the content, but for some reason, my gut tells me that creating a custom layer for a single page just to specify which content to display is abusing the purpose of layers, which is begin able to customize a particular layout based on some criteria (whether or not the user is authenticated, for example).
I hope that made sense, and I apologize that it took so many words to explain my issue, I've just really reached my peak of frustration, and although I think that the Orchard guys definitely have it figured out in terms of architecture, I just can't get past these seemingly simple problems to build a simple website.
I greatly appreciate any tips, suggestions, advice this community has to offer!
TIA, -Jeremy
What you defined in Orchard terms is a Content Type named Feature.
Go to Contents -> Content Type, and click Create.
Select those parts by default:
Title, because you want your authors to provide a nice title/name for the features
Autoroute, which will create a SEO friendly url based on the Title (can be customized)
Click Save
Add specific Fields
SubTitle, of type TextField. Configure it to Default, Required.
Description, of type TextField. Configure it to TextArea, Required.
Image, of type Media Picker. Configure it to Required.
You can add some Hints to each fields, which will be displayed in the Feature editor to describe what to enter in each field. Very useful for authors.
Now you can create Features by clicking on the link in the top left part of the Dashboard.
Next step is to put those features on the homepage. What I suggest is to create a Projection which will be set as the homepage. A Projection is just a Page with an Url, which will display the result of a query as its content. The Query in your case will be "Give me all Features ordered by Creation Date".
In the dashboard, click on Queries
Click on "Create a new Query"
Enter "All Features"
Click on "Add a new Filter"
Select Content Type, then select Feature, Save
Click on "Add a sort Criterium"
Select "Creation Date", then Descending, Save
At this point, you can already preview the result of the query by clicking on Preview. But what we want is a front-end page.
Create a new Projection by clicking on Projection in the "New" section of the dashboard (top left again)
- Give it a title, and don't forget to check "Set as Home page" to make it the home page
- Select the only available query, named "All Featrues"
- Save
On the home page you should see all the features, ordered by date. But what you want is a slider. At that point you need two more steps:
- Integrate a slider jQuery plugin
- Render the HTML compatible with your jQuery plugin
By default, when you render a Projection it will use the standard "Summary" layout. But using projections you can decide exactly what layout you want to apply, and exactly what html tags and classes.
Edit the query named "All Features"
Add a new Layout
Select Html List
Select "Properties" and Save
Click Add Properties
Select Display Text, Save
Do the same for
Feature:SubTitle
Feature:Description
Feature:Image
Save your query
Edit the home page projection and select this specific Layout instead of the default one.
You will see that each property is rendered in an html container.
By editing each property you can decide which class to apply, and which html tag to use. By changing them you can render exactly what you want, and customize your CSS/HTML to render the slider nicely. This is purely your HTML know have to apply here, or find some articles about that.
For your editors, they just have to go to the dashboard and add/update some feature content items, it will be reflected on the website.
Optionally there is a Slider module on the Orchard Gallery. You can try this one too. But if you want to handle exactly what happens the technique I described is better.
I've just gone through this exact scenario myself. I think that what you want can be accomplished using Orchard Lists. The UX is not exactly intuitive for the end user, but it seems like it's the most straightforward way to accomplish this goal without installing/developing a custom module.
First, make sure you're using Orchard 1.4 because you'll need the built-in support for generating alternates for Container Widgets for each zone. Enable the Shape tracing, Url alternates and Widget alternates modules.
Now, create a list of items as described in the documentation (see http://docs.orchardproject.net/Documentation/Creating-lists). Translate "book review" into "slide" and "book reviews" into "slides" and you get the idea. You can add custom fields to represent your subtitle, description, etc. I'd just keep the image as part of the content itself instead of creating a custom field for it.
If you've followed the steps in the documentation, you should now be seeing a list of your slides rendered as ul/li's. Now you'll want to customize how things are rendered so you can show your custom fields and generally customize the tags. Use the shape tracer and create alternates for the list as you see fit. Now you're free to control all the rendering. See http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx and http://weblogs.asp.net/bleroy/archive/2011/05/23/orchard-list-customization-first-item-template.aspx for ideas.
Managing this list from your end-user's perspective is actually quite easy, but I don't really feel that it's very intuitive.
It took me three days of digging through blogs and docs to figure this out for myself.
I'd also recommend this wonderful module called Featured Item Slider. It has all the basic functionalities of a slideshow, including all mentioned in the question, plus some fantastic additional capabilities, such as different animations. You can also fine tune the layout and styling by providing additional css. Get the source here. And here is the slideshow in action. If a module already exists providing the functionality you're looking for, then it's best to use that rather than reinvent the wheel, unless you do it for learning purposes.

How to have previous and next button in the django admin (change_form)

I want to modify the django admin for a particular model to provide the following behaviour.
A user make a search on the change_list page. The the user click a specific entry and he lands on the change_form for that entry. Nothing different to the usual.
Now, what I want is a mean to navigate the former search results. Basically next and previous buttons on the edit page.
What would be the best approach to implement this feature without modifying the admin site too much?
I will need to memorize the search in the user session, then when an entry is clicked I will need to known which place it has within the results to place my "cursor" accordingly. But I'm a bit in the cloud as the implementation side.
One way is to just put the next and previous button in the template for that particular model.
This can be implemented using simple javascript.
I ended writing a fully custom admin for that.

Resources