Move objects with mouse - django

I would like to have objects that user can move with mouse from place to place (like moving the cards between columns in Trello or GitHub projects). How do I approach this in Django?

This is handled using javascript. If you wanted to roll your own you could canvas or the draggable library

You can do it with javascript, there's a good example in this link:
W3 Schools Code
And there's one simplier here : W3 Schools Code

Related

WidgetKit: Can I replace one widget kind with two widget kinds widget bundle after AppStore submission?

I was watching Apple's WWDC video "Principles of great widgets" and from 22:13 min-23:53 min, there's a part about widget kinds and the engineer says this:
The next axis for personalization is the widget kind. Kinds of widgets offer different perspectives into your data or content. So think about what kinds of widgets might make the most sense in your app. The best way to describe these is really by example. Here’s an example from Clock. On the left, we have a City widget that tracks the time of a single city, and on the right, a World Clock widget that can accommodate many different cities in the same view. Here’s another example from Stocks. On the left, there’s a stock Symbol widget that shows the stock price for a given stock-- in this case, Apple-- and on the right, an Overview widget. The Overview widget will show a series of stocks reflected in the user’s Stocks app. So how do you publish these different kinds of widgets? Well, to publish multiple kinds of widgets is super trivial.Using that Stocks example from before, here I have a Symbol widget and an Overview widget in the top left. To publish these, you just return the different widget configurations in a WidgetBundle object and include the #main attribute to the WidgetBundle. It’s that easy. Note that the order that widgets are defined in the bundle is also very important. This order reflects how your widgets will appear in the widget gallery. So make sure that the first widget listed is your hero use case.
Lastly, it’s not possible to dynamically publish or dynamically retract the availability of a widget once your app is installed. So some care and thought should be applied around the support of your widgets over time.
I have not yet submitted my app to the AppStore, and I plan to submit it with just one Widget kind, and later update the app and replace this one widget kind with WidgetBundle with two Widget kinds.
What does "it’s not possible to dynamically publish or dynamically retract the availability of a widget once your app is installed" mean?Does it mean I won't be able to replace my current 1 widget kind with widget bundle with 2 widget kinds after AppStore submission?

Converting an admin UI design into Ember components

I'm wondering if their is a tutorial on how to convert an admin UI into Ember components? What are the best practices? For example, the following UI framework: http://egemem.com/theme/kode/v1.1/blank.html
Has a main navigation, two sidebar menus, a content body and a footer. What would the best approach be to converting this into components? My initial thoughts, with very little Ember experience and based on the scattering of documents I've been able to find, I get the sense that creating unique components for everything would be the best approach. By everything I mean, everything that is unique. For example, if we take the navigation bar, there would be a parent component for the navigation as a whole and then child components for the sidebar collapse/expand buttons, the search, the drop down menus, notification indicator, etc. There would also be additional parent components for the right hand sidebar, left hand sidebar, and footer.
Looking at one of the sidebars, for example the left one, could that be one component or would child components be required here as well?
The right hand sidebar is more complex with tabs. In this example, would it make sense to break this sidebar into child components for the 3 different tabs? Would you want to go as far as a unique component for different elements of the tabs themselves. For example, each notification type would be a component?
Thank you in advance for your assistance send I look forward to understanding how best to handle this type of scenario.
Cheers,
Dan
Yes, your idea makes sense. It is a good practice to create components (or handlebars) for everything that repeats several times. I would not create different components for different tabs if they are not re-used.
Do not forget to not re-invent wheel. There are a lot of available components, take a look at Ember Observer or other similar resources.
Components are great but some the things you mentioned, like sidebars, might make more sense as nested routes, depending on what's in the sidebars.
Rock 'n Roll with Ember is a fantastic book that takes you all the way through the process of building an Ember application. It's the book I always recommend to people just getting started with the framework. http://balinterdi.com/rock-and-roll-with-emberjs/

Modelling/Programming European roulette board in Clojure

For school we are creating a roulette webapplication in Clojure with the webnoir framework. Everything seems realizable in Clojure, but the problem is: how do we define the board in our domain in Clojure? It must be possible to place corner bets etc.
And if we modelled this in our domain how do we send the information of the view to our domain/board?
Does anyone has ideas or suggestions?
Since there are infinite ways to define a board, many of them good, I'll avoid that question and primarily address the second: communicating between your board view and model.
One solution using webnoir is to have your board view contain form[s] to perform actions. Submitting that form updates your board model and redirects to the same route, resulting in an updated view. I'm sure you've been leafing through Chris Granger's excellent documentation.
Another route, albeit one that might be outside the scope of your project, is to have client side code dynamically communicate with the model and update your view, the end result being a single page webapp. This could be done with ClojureScript. If you are considering this, take a look at Chris Granger's libraries formerly known as pinot. They provide a wonderful complement to webnoir.

How can I visually design a component in C++ Builder?

I have been away from C++ for a couple of years now doing AS3/Flex work. I have gotten used to being able to create a component and place it in design mode with very little fuss and I am struggling to get my head around the C++ Builder way of doing the same thing.
I have written many components for C++ Builder in the past, but none of them have been visual. What I would like to do now is create a component for customer search and another for order processing because I want to be able to create a new instance of these on the fly. What I don't want to do is have to place each of the components like the dbgrid and search fields manually in code. I would like to do this (as well as set their properties) in design mode.
How do I go about this? I have browsed the source for other Delphi components and I notice they have dfm files which seems to be what I need. How do I do this in C++ Builder? The only option I see is to add a new form if I want a dfm, but this isn't what I want as my components will be based on TPanel.
Is there a way to do this or do I have to resort to doing it all in code with no visual reference?
Pursuing the DFM idea I did a test this morning where I created a component based on TPanel and added a new form to it which I create and parent in the constructor of the component. In design mode I set the form border to none and placed a grid on it. This all looks OK until I place the component in my application, at that point it looks like a panel with a standard looking form in it and the grid is missing. If I run the app the panel shows as expected, borderless and with a grid. The DFM appears to be ignored in design mode for some reason.
If you know a better way to do this than using components then please give me some pointers.
Any help and advice will be appreciated beyond words
You might want to have a look at frames (look for "Frame objects"). They are "subforms" you can design visually and then place on forms.
Just as an FYI item, you can also drop the panel on a form, put any other controls on it, position them, set captions, etc..
Now, click the panel to select it, and use Component->Create Component Template from the IDE's main menu. This creates a unit you can install as a component which will add the panel and it's sub-controls (as a single component) to the IDE's component palette.
Of course, you can then modify the source for that new component like any other component source.

Does MFC have a built in grid control?

First what I want: The ability to display a grid with multiple columns, each cell having a custom render callback. So you might use such a control to display your inventory in a game, or something like the behaviour in Google Chrome where it shows a grid of popular pages you visit.
I've been playing with CListCtrl and while I can get custom rendering ability on each item, I can't get it work with columns - having say 3 items per row. The control has column-related methods but I think these are specifically for the built-in functionality where different attributes of an item are shown automatically in each column... not for providing a generic grid control.
So, does such functionality exist in MFC? If not then I wonder if the easiest approach is for me to actually insert each of the rows as an Item... and then the custom rendering draws the multiple cells in the row, I could also do custom UI to support clicking on the cells.
But what I really want is to be able to create a custom control, and add this as an item to a list - like in Flex for instance - so I/O etc is automatically handled.
Any advice/information welcome...
Dundas has thrown some of its (excellent) components in the public domain. Their Ultimate Grid is available on CodeProject.
I'm not aware of a built-in control, but I think you should take a look at this.
The article is describing in detail the functionality of a fully featured MFC grid control, derived from CWnd, for displaying tabular data.
YOUR_LIST_CONTROL.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_INFOTIP|LVS_EX_GRIDLINES);
I think it will help you (SetExtendedStyle).
I suggest this one:
https://code.google.com/p/cgridlistctrlex/
very complete