MVC and Unit Testing practice of Fitness website (iv)-action management

Source: Internet
Author: User

The background of the site is responsible for the management of actions, including the name of the action, introduction, training points, map and other content, so that the front desk can use the content. In the previous < fit project picture upload and cloud storage tuning > has been prepared for the main technical difficulties involved here, now the module has been completed.

A list describes

The fitness management module includes muscle group, muscle display and movement management. It's also starting to involve "business content," and fortunately I've had some information about fitness before, and it's time to come up with another.

A) muscle group and muscle because the content is relatively fixed, so in order to reduce the business logic and unit test code, of course, the most important is to lazy, only provide the list of display function, cannot be edited.

Muscle Group Information list:

Muscle Information List

b) Action is not fixed like muscle and muscle, must have editing function, list display, add, edit, delete corresponding to the previous permission module is similar. Mainly add, edit interface difference is large.

Adding and editing of two actions

The addition and editing of the action, as well as the text content, the relevant mapping needs to be uploaded, deleted. The text and the picture are saved by separating the two tables, and the text is submitted when the Save button is clicked, and the image is uploaded and refreshed to display the latest picture list immediately after the selection, and the image can be deleted instantly when the image is clicked. The HTML structure behind the interface is more complex than the previous additions and edits.

A) as a whole, the action is divided into two categories, local training and comprehensive training, local training is able to belong to the muscle group-muscle-action system of training content, is a local muscle training, such as flat-plate support action is mainly to the abdominal transverse muscle exercise, comprehensive training is to improve the overall function of the type of movement, such as running, swimming

So when adding or editing an action, the first thing you set is the type of action:

When selecting the local training, the muscle group and muscle should be further selected, the muscle group is a fixed drop-down content, and the muscle's drop-down content should be loaded dynamically with the selection of the muscle group.

When choosing a comprehensive workout, you don't need to set muscles and muscles to hide these two drop-down boxes.

b) This page also includes a description of the action, Action points and notes for editing, these three items have a consistent editing interface, including multi-line text content and mapping. Not using a rich text editor, but just writing an article reminds me to increase the defenses against cross-site scripting attacks.

Three summary

Although the image uploads and cloud storage implementations have been prepared before, the actual work has been done to find that the pit is much more than that, including page layouts and event firings, which have taken a lot of time, mainly because they are unfamiliar with the front end. There are a few more special questions that need to be recorded.

A) The use of the template check boxes, radio boxes are used Icheck plug-ins, and said the style is beautiful, but today is icheck pits.

The beautiful style of Icheck is mainly from the above-mentioned property setting code. Then, if you want to register the selection event for a radio box, use the generic ID and name selector. To bind the Ifchecked event, use the following method.

b) When the browser loads the page from top to bottom, if $ (document) is written in front of the jquery.js reference, such code is invalid. Also note in the Razor template that the footscript tag used to populate the page script in layout is placed below the JS reference.

Welcome to the public, "rookie programmer growth in mind"

MVC and Unit Testing practice of Fitness website (iv)-action management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.