diff options
author | Alvin Li <liweitianux@gmail.com> | 2013-10-30 10:16:21 +0800 |
---|---|---|
committer | Alvin Li <liweitianux@gmail.com> | 2013-10-30 10:16:21 +0800 |
commit | 1e4a9c0565c3d2f52ec205ae7627ebfc84278735 (patch) | |
tree | b26921e2f5fdec3fa7578584d10ba476abbace40 /97suifangqa/apps/indicator | |
parent | 02afd8a32edb13ea7fc2266ac80092ea15c0930c (diff) | |
download | 97dev-master.tar.bz2 |
* moved 'ValueKind' model from 'recommend/models' to 'indicator/models'
* added field 'type' for 'indicator.models.Indicator'
* added field 'kind' for 'indicator.models.IndicatorRecord',
'InnateConfine'
* updated methods for models 'Indicator', 'IndicatorRecord',
'InnateConfine'
* updated views and templates for 'apps/indicator'
* added 'INDICATOR_RECOMMEND_PERIOD' into 'settings.py'
* added 'type' field for 'indicator.models.Indicator' in
'search_indexes.py'
* added a confirm step for 'EditHistoryData' page when delete a record
* removed dir 'backupdata'; 'queries.txt' moved to 'backup' dir
* moved *.json to 'backup' dir
* removed 'apps/managers*.py'
* updated 'indicator/popup/IndexDesc.html'
* created dir 'apps/indicator/obsolete';
* moved 'indicator/forms.py' to dir 'obsolete';
* splitted views related forms.py from 'views.py', and placed in
'obsolete/views_forms.py'
* loadded newest data into database
* cleaned pervious data files in 'backup' dir
* updated 'README.txt'; added a solution to a redis problem
* added field 'type' of 'indicator.models.Indicator';
for filtering search results and only returning 'NORMAL_TYPE'
Diffstat (limited to '97suifangqa/apps/indicator')
46 files changed, 2531 insertions, 1530 deletions
diff --git a/97suifangqa/apps/indicator/fixtures_bak/initial_data.json b/97suifangqa/apps/indicator/fixtures_bak/initial_data.json deleted file mode 100644 index d26f8b9..0000000 --- a/97suifangqa/apps/indicator/fixtures_bak/initial_data.json +++ /dev/null @@ -1,862 +0,0 @@ -[ - { - "pk": 4, - "model": "indicator.indicatorcategory", - "fields": { - "pinyin": "gan-chuan-ci", - "englishName": "Liver Puncture", - "addByUser": 1, - "name": "\u809d\u7a7f\u523a", - "description": "\u809d\u7a7f\u523a" - } - }, - { - "pk": 3, - "model": "indicator.indicatorcategory", - "fields": { - "pinyin": "gan-gong-neng", - "englishName": "Liver Function", - "addByUser": 1, - "name": "\u809d\u529f\u80fd", - "description": "\u809d\u529f\u80fd" - } - }, - { - "pk": 5, - "model": "indicator.indicatorcategory", - "fields": { - "pinyin": "lei-bie-5", - "englishName": "category5", - "addByUser": 1, - "name": "\u7c7b\u522b5", - "description": "\u7c7b\u522b5\r\n\u6d4b\u8bd5" - } - }, - { - "pk": 6, - "model": "indicator.indicatorcategory", - "fields": { - "pinyin": "lei-bie-6", - "englishName": "category6", - "addByUser": 1, - "name": "\u7c7b\u522b6", - "description": "\u7c7b\u522b6\r\n\r\n\u6d4b\u8bd5" - } - }, - { - "pk": 7, - "model": "indicator.indicatorcategory", - "fields": { - "pinyin": "lei-bie-7", - "englishName": "category7", - "addByUser": 1, - "name": "\u7c7b\u522b7", - "description": "\u7c7b\u522b7\r\n\r\n\u6d4b\u8bd5" - } - }, - { - "pk": 2, - "model": "indicator.indicatorcategory", - "fields": { - "pinyin": "liang-dui-ban", - "englishName": "TODO", - "addByUser": 1, - "name": "\u4e24\u5bf9\u534a", - "description": "\u4e59\u809d\u4e24\u5bf9\u534a" - } - }, - { - "pk": 1, - "model": "indicator.indicatorcategory", - "fields": { - "pinyin": "xie-chang-gui", - "englishName": "Blood Routine", - "addByUser": 1, - "name": "\u8840\u5e38\u89c4", - "description": "\u8840\u5e38\u89c4" - } - }, - { - "pk": 3, - "model": "indicator.indicator", - "fields": { - "addByUser": 1, - "name": "\u6d4b\u8bd51", - "dataType": "PM", - "pinyin": "ce-shi-1", - "helpText": "\u5e2e\u52a9 help", - "englishName": "test1", - "categories": [ - 2 - ], - "description": "forms \u6d4b\u8bd51\r\npm type" - } - }, - { - "pk": 4, - "model": "indicator.indicator", - "fields": { - "addByUser": 1, - "name": "\u5b9a\u503c2", - "dataType": "FL", - "pinyin": "ding-zhi-2", - "helpText": "\u6d6e\u70b9\u5b9a\u503c", - "englishName": "float2", - "categories": [ - 2, - 1 - ], - "description": "float type" - } - }, - { - "pk": 2, - "model": "indicator.indicator", - "fields": { - "addByUser": 1, - "name": "\u8303\u56f41", - "dataType": "RG", - "pinyin": "fan-wei-1", - "helpText": "\u8303\u56f4\u578b", - "englishName": "range1", - "categories": [ - 1 - ], - "description": "range type\r\n\r\n\u8303\u56f4\u578b" - } - }, - { - "pk": 1, - "model": "indicator.indicator", - "fields": { - "addByUser": 1, - "name": "\u8c37\u4e19\u8f6c\u6c28\u9176", - "dataType": "FL", - "pinyin": "gu-bing-zhuan-an-mei", - "helpText": "\u63a5\u53d7\u5b9a\u503c\u6570\u636e\uff0c\u5982: 45, 38.7", - "englishName": "Alanine Transaminase", - "categories": [ - 3 - ], - "description": "\u8c37\u4e19\u8f6c\u6c28\u9176\r\nAlanine transaminase (ALT)\r\n\r\n\u6d6e\u70b9\u5b9a\u503c\u578b\u6570\u636e" - } - }, - { - "pk": 1, - "model": "indicator.userindicator", - "fields": { - "followedHistories": [], - "followedIndicators": [ - 3, - 4, - 2, - 1 - ], - "user": 1 - } - }, - { - "pk": 2, - "model": "indicator.userindicator", - "fields": { - "followedHistories": [], - "followedIndicators": [], - "user": 2 - } - }, - { - "pk": 3, - "model": "indicator.userindicator", - "fields": { - "followedHistories": [], - "followedIndicators": [], - "user": 3 - } - }, - { - "pk": 4, - "model": "indicator.userindicator", - "fields": { - "followedHistories": [], - "followedIndicators": [], - "user": 4 - } - }, - { - "pk": 18, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8865\u5145\r\n\u8bb0\u5f558", - "created_at": "2013-08-22T06:56:08.417Z", - "updated_at": "2013-08-22T06:56:08.417Z", - "value": "45", - "val_min": null, - "user": 1, - "date": "2013-06-29", - "val_max": null, - "unit": 4 - } - }, - { - "pk": 17, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8865\u5145\r\n\u8bb0\u5f557", - "created_at": "2013-08-22T06:48:18.864Z", - "updated_at": "2013-08-22T06:55:36.704Z", - "value": "57", - "val_min": null, - "user": 1, - "date": "2013-07-04", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 15, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8865\u5145\r\n\u8bb0\u5f555", - "created_at": "2013-08-22T06:44:43.567Z", - "updated_at": "2013-08-22T06:44:43.567Z", - "value": "81", - "val_min": null, - "user": 1, - "date": "2013-07-07", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 16, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8865\u5145\r\n\u8bb0\u5f556", - "created_at": "2013-08-22T06:45:19.971Z", - "updated_at": "2013-08-22T06:47:19.645Z", - "value": "98", - "val_min": null, - "user": 1, - "date": "2013-07-13", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 12, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8865\u5145\r\n\u8bb0\u5f554", - "created_at": "2013-08-22T06:41:28.455Z", - "updated_at": "2013-08-22T06:41:28.455Z", - "value": "31", - "val_min": null, - "user": 1, - "date": "2013-07-18", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 11, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8865\u5145\r\n\u8bb0\u5f553", - "created_at": "2013-08-22T06:40:45.950Z", - "updated_at": "2013-08-22T06:40:54.585Z", - "value": "49", - "val_min": null, - "user": 1, - "date": "2013-07-21", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 10, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8865\u5145\r\n\u8bb0\u5f552", - "created_at": "2013-08-22T06:37:16.110Z", - "updated_at": "2013-08-22T06:39:16.251Z", - "value": "78", - "val_min": null, - "user": 1, - "date": "2013-07-27", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 9, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8865\u5145\r\n\u8bb0\u5f551", - "created_at": "2013-08-22T06:36:32.924Z", - "updated_at": "2013-08-22T06:36:32.924Z", - "value": "59", - "val_min": null, - "user": 1, - "date": "2013-08-01", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 1, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8c37\u4e19\u8f6c\u6c28\u9176\r\n\r\n\u7b2c1\u6761\u8bb0\u5f55\r\nmodified", - "created_at": "2013-08-05T15:48:00.035Z", - "updated_at": "2013-08-26T12:13:14.102Z", - "value": "50", - "val_min": null, - "user": 1, - "date": "2013-08-05", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 2, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8bb0\u5f552", - "created_at": "2013-08-09T10:53:15.927Z", - "updated_at": "2013-08-26T12:12:42.041Z", - "value": "100", - "val_min": null, - "user": 1, - "date": "2013-08-09", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 4, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8bb0\u5f553", - "created_at": "2013-08-18T13:33:20.569Z", - "updated_at": "2013-09-12T07:11:09.763Z", - "value": "78.3", - "val_min": null, - "user": 1, - "date": "2013-08-15", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 13, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8bb0\u5f554", - "created_at": "2013-08-22T06:42:44.782Z", - "updated_at": "2013-08-22T06:45:43.807Z", - "value": "89", - "val_min": null, - "user": 1, - "date": "2013-08-18", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 14, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 1, - "notes": "\u8bb0\u5f555", - "created_at": "2013-08-22T06:43:32.415Z", - "updated_at": "2013-08-22T06:43:32.415Z", - "value": "56", - "val_min": null, - "user": 1, - "date": "2013-08-22", - "val_max": null, - "unit": 1 - } - }, - { - "pk": 6, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 2, - "notes": "", - "created_at": "2013-08-18T13:46:26.511Z", - "updated_at": "2013-08-18T13:46:26.511Z", - "value": "", - "val_min": 10000.0, - "user": 1, - "date": "2013-08-05", - "val_max": 23000.0, - "unit": 3 - } - }, - { - "pk": 5, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 2, - "notes": "", - "created_at": "2013-08-18T13:37:41.124Z", - "updated_at": "2013-08-26T16:04:54.703Z", - "value": "", - "val_min": 15000.0, - "user": 1, - "date": "2013-08-10", - "val_max": 20000.0, - "unit": 3 - } - }, - { - "pk": 7, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 2, - "notes": "range type\r\nrecord 3", - "created_at": "2013-08-19T11:30:26.675Z", - "updated_at": "2013-08-19T11:30:26.675Z", - "value": "", - "val_min": 15000.0, - "user": 1, - "date": "2013-08-17", - "val_max": 30000.0, - "unit": 3 - } - }, - { - "pk": 21, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 2, - "notes": "", - "created_at": "2013-09-12T07:21:24.976Z", - "updated_at": "2013-09-12T07:21:24.977Z", - "value": "", - "val_min": 50000.0, - "user": 1, - "date": "2013-09-01", - "val_max": 80000.0, - "unit": 3 - } - }, - { - "pk": 3, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 3, - "notes": "pm type\r\nrecord 1", - "created_at": "2013-08-16T16:07:00.547Z", - "updated_at": "2013-09-09T01:56:20.103Z", - "value": "+", - "val_min": null, - "user": 1, - "date": "2013-08-16", - "val_max": null, - "unit": null - } - }, - { - "pk": 20, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 4, - "notes": "", - "created_at": "2013-09-12T07:12:42.394Z", - "updated_at": "2013-09-12T07:12:42.394Z", - "value": "600", - "val_min": null, - "user": 1, - "date": "2013-09-02", - "val_max": null, - "unit": 4 - } - }, - { - "pk": 19, - "model": "indicator.indicatorrecord", - "fields": { - "indicator": 4, - "notes": "", - "created_at": "2013-09-11T16:35:15.307Z", - "updated_at": "2013-09-11T16:35:15.307Z", - "value": "710", - "val_min": null, - "user": 1, - "date": "2013-09-12", - "val_max": null, - "unit": 4 - } - }, - { - "pk": 1, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-08-05T16:07:01.832Z", - "indicatorRecord": 1, - "reason": "\u6d4b\u8bd5\r\nadmin\u754c\u9762\u76f4\u63a5\u4fee\u6539", - "unit_bak": 1, - "val_max_bak": null, - "value_bak": "250", - "date_bak": "2013-08-05", - "notes_bak": "\u6307\u68071\r\n\u7b2c1\u6761\u8bb0\u5f55" - } - }, - { - "pk": 2, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-08-10T11:40:23.170Z", - "indicatorRecord": 1, - "reason": "\u6d4b\u8bd5\u4fee\u6539", - "unit_bak": 1, - "val_max_bak": null, - "value_bak": "250", - "date_bak": "2013-08-05", - "notes_bak": "\u6307\u68071\r\n\u7b2c1\u6761\u8bb0\u5f55" - } - }, - { - "pk": 3, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-08-26T08:08:16.911Z", - "indicatorRecord": 1, - "reason": "test reason", - "unit_bak": 1, - "val_max_bak": null, - "value_bak": "50", - "date_bak": "2013-08-05", - "notes_bak": "\u8c37\u4e19\u8f6c\u6c28\u9176\r\n\r\n\u7b2c1\u6761\u8bb0\u5f55\r\n" - } - }, - { - "pk": 4, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-08-26T12:11:29.572Z", - "indicatorRecord": 1, - "reason": "test", - "unit_bak": 1, - "val_max_bak": null, - "value_bak": "50", - "date_bak": "2013-08-05", - "notes_bak": "\u8c37\u4e19\u8f6c\u6c28\u9176\r\n\r\n\u7b2c1\u6761\u8bb0\u5f55\r\nmodified" - } - }, - { - "pk": 5, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-08-26T12:20:54.790Z", - "indicatorRecord": 1, - "reason": "test", - "unit_bak": 1, - "val_max_bak": null, - "value_bak": "50", - "date_bak": "2013-08-05", - "notes_bak": "\u8c37\u4e19\u8f6c\u6c28\u9176\r\n\r\n\u7b2c1\u6761\u8bb0\u5f55\r\nmodified" - } - }, - { - "pk": 13, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-09-09T01:53:47.362Z", - "indicatorRecord": 3, - "reason": "test to modify pm_data 1", - "unit_bak": null, - "val_max_bak": null, - "value_bak": "+", - "date_bak": "2013-08-17", - "notes_bak": "pm type\r\nrecord 1" - } - }, - { - "pk": 14, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-09-09T01:54:44.215Z", - "indicatorRecord": 3, - "reason": "test to modify pm_data 2, modified date", - "unit_bak": null, - "val_max_bak": null, - "value_bak": "-", - "date_bak": "2013-08-17", - "notes_bak": "pm type\r\nrecord 1" - } - }, - { - "pk": 15, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-09-09T01:56:19.906Z", - "indicatorRecord": 3, - "reason": "test 3, modified date & value", - "unit_bak": null, - "val_max_bak": null, - "value_bak": "-", - "date_bak": "2013-08-18", - "notes_bak": "pm type\r\nrecord 1" - } - }, - { - "pk": 7, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-08-26T12:24:26.681Z", - "indicatorRecord": 4, - "reason": "modification test1", - "unit_bak": 1, - "val_max_bak": null, - "value_bak": "150", - "date_bak": "2013-08-15", - "notes_bak": "\u8bb0\u5f553" - } - }, - { - "pk": 8, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-08-26T12:29:57.344Z", - "indicatorRecord": 4, - "reason": "modification test2", - "unit_bak": 1, - "val_max_bak": null, - "value_bak": "0", - "date_bak": "2013-08-15", - "notes_bak": "\u8bb0\u5f553" - } - }, - { - "pk": 16, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": null, - "created_at": "2013-09-12T07:11:09.554Z", - "indicatorRecord": 4, - "reason": "test", - "unit_bak": 1, - "val_max_bak": null, - "value_bak": "81.3", - "date_bak": "2013-08-14", - "notes_bak": "\u8bb0\u5f553" - } - }, - { - "pk": 9, - "model": "indicator.recordhistory", - "fields": { - "val_min_bak": 15000.0, - "created_at": "2013-08-26T16:04:54.516Z", - "indicatorRecord": 5, - "reason": "modify1(popup)", - "unit_bak": 3, - "val_max_bak": 25000.0, - "value_bak": "", - "date_bak": "2013-08-10", - "notes_bak": "" - } - }, - { - "pk": 1, - "model": "indicator.unit", - "fields": { - "indicator": 1, - "description": "IU/L\r\n\r\n\u8c37\u4e19\u8f6c\u6c28\u9176\r\nAlanine transaminase (ALT)", - "symbol": "IU/L", - "addByUser": 1, - "standard": true, - "relation": "v", - "name": "\u62f7\u8d1d/\u5347" - } - }, - { - "pk": 2, - "model": "indicator.unit", - "fields": { - "indicator": 1, - "description": "", - "symbol": "unit12", - "addByUser": 1, - "standard": false, - "relation": "log10(v) + 10", - "name": "\u5355\u4f4d12" - } - }, - { - "pk": 3, - "model": "indicator.unit", - "fields": { - "indicator": 2, - "description": "", - "symbol": "\u62f7\u8d1d/mL", - "addByUser": 1, - "standard": true, - "relation": "v", - "name": "\u62f7\u8d1d/mL" - } - }, - { - "pk": 4, - "model": "indicator.unit", - "fields": { - "indicator": 4, - "description": "\u7b80\u5355\u63cf\u8ff0", - "symbol": "unit41", - "addByUser": 1, - "standard": true, - "relation": "v", - "name": "\u5355\u4f4d41" - } - }, - { - "pk": 1, - "model": "indicator.innateconfine", - "fields": { - "math_max": 200.0, - "indicator": 1, - "human_max": 64.0, - "description": "\u8c37\u4e19\u8f6c\u6c28\u9176\r\n\r\n\u6b63\u5e38\u503c\u8303\u56f4\r\n\u5141\u8bb8\u6570\u636e\u8303\u56f4", - "val_norm": "", - "addByUser": 1, - "human_min": 10.0, - "unit": 1, - "math_min": 0.0 - } - }, - { - "pk": 2, - "model": "indicator.innateconfine", - "fields": { - "math_max": 80000.0, - "indicator": 2, - "human_max": 50000.0, - "description": "\u6307\u6807\r\n\r\n\u6570\u636e\u7c7b\u578b\uff1a\u8303\u56f4\u578b\r\n\r\n\u6570\u636e\u8303\u56f4", - "val_norm": "", - "addByUser": 1, - "human_min": 10000.0, - "unit": 3, - "math_min": 5000.0 - } - }, - { - "pk": 3, - "model": "indicator.innateconfine", - "fields": { - "math_max": null, - "indicator": 3, - "human_max": null, - "description": "pm type", - "val_norm": "+", - "addByUser": 1, - "human_min": null, - "unit": null, - "math_min": null - } - }, - { - "pk": 4, - "model": "indicator.innateconfine", - "fields": { - "math_max": 15000.0, - "indicator": 4, - "human_max": 10000.0, - "description": "float type", - "val_norm": "", - "addByUser": 1, - "human_min": 500.0, - "unit": 4, - "math_min": 0.0 - } - }, - { - "pk": 1, - "model": "indicator.relatedindicator", - "fields": { - "indicator": 1, - "weight": 5.9, - "created_at": "2013-08-10T22:40:00.035Z", - "updated_at": "2013-08-10T22:40:00.326Z", - "blog": null, - "annotation": 2, - "objectType": "AN" - } - }, - { - "pk": 3, - "model": "indicator.relatedindicator", - "fields": { - "indicator": 1, - "weight": 8.0, - "created_at": "2013-08-11T00:56:08.080Z", - "updated_at": "2013-08-11T00:56:08.080Z", - "blog": null, - "annotation": 1, - "objectType": "AN" - } - }, - { - "pk": 2, - "model": "indicator.relatedindicator", - "fields": { - "indicator": 2, - "weight": 8.3, - "created_at": "2013-08-10T22:50:00.035Z", - "updated_at": "2013-08-10T22:50:00.326Z", - "blog": 3, - "annotation": null, - "objectType": "BL" - } - }, - { - "pk": 4, - "model": "indicator.relatedindicator", - "fields": { - "indicator": 1, - "weight": 4.0, - "created_at": "2013-08-11T00:56:49.463Z", - "updated_at": "2013-08-11T00:56:49.463Z", - "blog": 1, - "annotation": null, - "objectType": "BL" - } - }, - { - "pk": 5, - "model": "indicator.relatedindicator", - "fields": { - "indicator": 1, - "weight": 6.0, - "created_at": "2013-08-11T00:57:23.067Z", - "updated_at": "2013-08-11T00:57:23.067Z", - "blog": 3, - "annotation": null, - "objectType": "BL" - } - } -]
\ No newline at end of file diff --git a/97suifangqa/apps/indicator/models.py b/97suifangqa/apps/indicator/models.py index 87cd80f..cf9b716 100644 --- a/97suifangqa/apps/indicator/models.py +++ b/97suifangqa/apps/indicator/models.py @@ -79,6 +79,10 @@ class IndicatorCategory(models.Model): # {{{ class Indicator(models.Model): # {{{ """ 指标模型 + + type: + normal: 普通类别,用户可以follow/unfollow + basic: 基本信息指标,用于记录基本信息,不可以follow """ name = models.CharField(u"指标名称", max_length=100) pinyin = models.CharField(u"拼音", max_length=200, @@ -88,6 +92,16 @@ class Indicator(models.Model): # {{{ description = models.TextField(u"指标描述", blank=True) # Indicator 接受数据类型/格式等说明/示例 helpText = models.CharField(u"帮助", max_length=300, blank=True) + # indicator type + NORMAL_TYPE = u'NORM' + BASIC_TYPE = u'BASI' + INDICATOR_TYPES = ( + (NORMAL_TYPE, u"普通指标"), + (BASIC_TYPE, u"基本信息指标"), + ) + type = models.CharField(u"指标类型", max_length=4, + choices=INDICATOR_TYPES, + help_text=u"基本信息指标:用于记录用户的基本信息,不可以被用户关注") # 记录添加指标的用户,用户只能修改自己添加的指标 addByUser = models.ForeignKey(User, verbose_name=u"添加的用户", related_name="indicators") @@ -95,21 +109,23 @@ class Indicator(models.Model): # {{{ categories = models.ManyToManyField(IndicatorCategory, verbose_name=u"所属类别", related_name="indicators") # DATA_TYPES for indicator - INTEGER_TYPE = u'IN' # 整数型 - FLOAT_TYPE = u'FL' # 浮点型 - RANGE_TYPE = u'RG' # 范围型(eg. 250-500) + INTEGER_TYPE = u'IN' # 整数型 + FLOAT_TYPE = u'FL' # 浮点型 + RANGE_TYPE = u'RG' # 范围型(eg. 250-500) FLOAT_RANGE_TYPE = u'FR' # 浮点型/范围型,接受定值或范围 - PM_TYPE = u'PM' # +/- 型 - RADIO_TYPE = u'RD' # 单选型 - CHECKBOX_TYPE = u'CB' # 多选多 + PM_TYPE = u'PM' # +/- 型 + KIND_TYPE = u'KD' # 种类型 + RADIO_TYPE = u'RD' # 单选型 + CHECKBOX_TYPE = u'CB' # 多选多 DATA_TYPES = ( - (INTEGER_TYPE, u"整数型"), - (FLOAT_TYPE, u"浮点定值型"), - (RANGE_TYPE, u"浮点范围型"), + (INTEGER_TYPE, u"整数型"), + (FLOAT_TYPE, u"浮点定值型"), + (RANGE_TYPE, u"浮点范围型"), (FLOAT_RANGE_TYPE, u"定值或范围型"), - (PM_TYPE, u"阴阳型(+/-)"), - #(RADIO_TYPE, u"单选型"), - #(CHECKBOX_TYPE, u"多选型"), + (PM_TYPE, u"阴阳型(+/-)"), + (KIND_TYPE, u"种类型"), + #(RADIO_TYPE, u"单选型"), + #(CHECKBOX_TYPE, u"多选型"), ) dataType = models.CharField(u"数据类型", max_length=2, choices=DATA_TYPES) @@ -119,8 +135,8 @@ class Indicator(models.Model): # {{{ ordering = ['pinyin', 'id'] def __unicode__(self): - return u"< Indicator: #%s, %s, dataType %s addBy %s >"\ - % (self.id, self.name, self.dataType, + return u"< Indicator: #%s(%s), %s, dataType %s addBy %s >"\ + % (self.id, self.type, self.name, self.dataType, self.addByUser.username) def show(self): @@ -140,11 +156,11 @@ class Indicator(models.Model): # {{{ self.pinyin = p.get_pinyin(self.name) super(Indicator, self).save(**kwargs) - def check_unit(self, **kwargs): + def check_unit(self, **kwargs): # {{{ """ Check if the validity of the units specified for the indicator. A indicator must have one 'standard unit'. - if indicator.dataType in [INTEGER_TYPE, PM_TYPE], + if indicator.dataType in [INTEGER_TYPE, PM_TYPE, KIND_TYPE], then units are not needed. """ if self.dataType in [self.FLOAT_TYPE, self.RANGE_TYPE, @@ -153,13 +169,14 @@ class Indicator(models.Model): # {{{ if std_unit: return True else: - print u"Indicator id=%s 未指定标准单位" % self.id + print u"Indicator(id=%s)未指定标准单位" % self.id return False else: - print u"dataType=%s 不需要单位" % self.dataType + #print u"dataType='%s' 不需要单位" % self.dataType return True + # }}} - def _get_unit(self, type="standard"): + def _get_unit(self, type="standard"): # {{{ if type == "standard": _units = self.units.filter(standard=True) elif type == "other": @@ -167,8 +184,9 @@ class Indicator(models.Model): # {{{ else: _units = [] return list(_units) + # }}} - def get_unit(self, type="standard"): + def get_unit(self, type="standard"): # {{{ """ return a 'list' which contains the 'Unit's related to the indicator @@ -185,6 +203,17 @@ class Indicator(models.Model): # {{{ return _units else: return self._get_unit(type) + # }}} + + def get_kind(self): + """ + get the valid ValueKind's that can be used with this indicator + (1) general 'ValueKind's + (2) 'ValueKind's related to this indicator + """ + general_kinds = list(ValueKind.objects.filter(indicator=None)) + ind_kinds = list(ValueKind.objects.filter(indicator=self)) + return list(general_kinds + ind_kinds) def check_confine(self): """ @@ -225,6 +254,7 @@ class Indicator(models.Model): # {{{ 'englishName': self.englishName, 'description': self.description, 'helpText': self.helpText, + 'type': self.type, 'addByUser_id': self.addByUser.id, 'dataType': self.dataType, 'categories_id': [c.id @@ -291,6 +321,13 @@ class IndicatorRecord(models.Model): # {{{ null=True, blank=True) val_max = models.FloatField(u"数据范围上限", null=True, blank=True) + # kind (for KIND_TYPE) + kind = models.ForeignKey("ValueKind", + related_name="indicator_records", + verbose_name=u"指标种类值", + null=True, blank=True, + help_text=u"仅供'种类型'指标填写") + # notes notes = models.TextField(u"记录说明", blank=True) class Meta: @@ -309,7 +346,8 @@ class IndicatorRecord(models.Model): # {{{ if self.is_valid() and self.check_confine(): super(IndicatorRecord, self).save(**kwargs) else: - raise ValueError(u'您输入的数据不符合要求') + raise ValueError(u'Error: 您输入的数据不符合要求') + return self def is_valid(self, **kwargs): # {{{ """验证输入数据是否合法""" @@ -317,8 +355,8 @@ class IndicatorRecord(models.Model): # {{{ qs = IndicatorRecord.objects.filter(indicator=self.indicator, date=self.date) if qs and qs[0].id != self.id: - #raise ValueError(u'date="%s" 该日期已经存在记录' % self.date) - print u'date="%s" 该日期已经存在记录' % self.date + #raise ValueError(u'Error: date="%s" 该日期已经存在记录' % self.date) + print u'Error: date="%s" 该日期已经存在记录' % self.date return False # check unit sind = self.indicator @@ -327,12 +365,12 @@ class IndicatorRecord(models.Model): # {{{ # unit required ind_units = sind.get_unit(type="all") if not self.unit: - #raise ValueError(u'未填写单位') - print u'未填写单位' + #raise ValueError(u'Error: 未填写单位') + print u'Error: 未填写单位' return False elif self.unit not in ind_units: - #raise ValueError(u'所选单位与该指标不符') - print u'所选单位与该指标不符' + #raise ValueError(u'Error: 所选单位与该指标不符') + print u'Error: 所选单位与该指标不符' return False # check dataType if self.indicator.dataType == self.indicator.INTEGER_TYPE: @@ -341,8 +379,8 @@ class IndicatorRecord(models.Model): # {{{ value = int(self.value) return True except ValueError: - #raise ValueError(u'您提交的指标数据类型不正确') - print u'您提交的指标数据类型不正确' + #raise ValueError(u'Error: 您提交的指标数据类型不正确') + print u'Error: 您提交的指标数据类型不正确' return False elif self.indicator.dataType == self.indicator.FLOAT_TYPE: # 浮点型 @@ -350,17 +388,17 @@ class IndicatorRecord(models.Model): # {{{ value = float(self.value) return True except ValueError: - #raise ValueError(u'value 数据类型不正确') - print u'value 数据类型不正确' + #raise ValueError(u'Error: value 数据类型不正确') + print u'Error: value 数据类型不正确' return False elif self.indicator.dataType == self.indicator.RANGE_TYPE: # 范围型 if (self.val_max is None) or (self.val_min is None): - #raise ValueError(u'val_max 或 val_min 未填写') - print u'val_max 或 val_min 未填写' + #raise ValueError(u'Error: val_max 或 val_min 未填写') + print u'Error: val_max 或 val_min 未填写' return False if (self.val_max <= self.val_min): - #raise ValueError(u'val_max <= val_min') + #raise ValueError(u'Error: val_max <= val_min') print u'Error: val_max <= val_min' return False return True @@ -372,33 +410,44 @@ class IndicatorRecord(models.Model): # {{{ value = float(self.value) return True except ValueError: - #raise ValueError(u'value 数据类型不正确') - print u'value 数据类型不正确' + #raise ValueError(u'Error: value 数据类型不正确') + print u'Error: value 数据类型不正确' return False elif (self.val_max is not None) and (self.val_min is not None): # 范围值 if (self.val_max <= self.val_min): - #raise ValueError(u'val_max <= val_min') + #raise ValueError(u'Error: val_max <= val_min') print u'Error: val_max <= val_min' return False else: return True else: - #raise ValueError(u'您提交的指标数据不符合要求') - print u'您提交的指标数据不符合要求' + #raise ValueError(u'Error: 您提交的指标数据不符合要求') + print u'Error: 您提交的指标数据不符合要求' return False elif self.indicator.dataType == self.indicator.PM_TYPE: # +/- 型,无单位要求 if (len(self.value) == 1) and (self.value in [u'+', u'-']): return True else: - #raise ValueError(u'value 只接受 "+" 或 "-"') + #raise ValueError(u'Error: value 只接受 "+" 或 "-"') print u'Error: value 只接受 "+" 或 "-"' return False - ## TODO: RADIO_TYPE, CHECKBOX_TYPE + elif self.indicator.dataType == self.indicator.KIND_TYPE: + ## KIND_TYPE + ## only the general 'ValueKind's and the ones related + ## to this indicator can be used + valid_kinds = self.indicator.get_kind() + if self.kind in valid_kinds: + return True + else: + #raise ValueError(u'Error: kind 不符合要求') + print u'Error: kind 不符合要求' + return False elif self.indicator.dataType in [self.indicator.RADIO_TYPE, self.indicator.CHECKBOX_TYPE]: - #raise ValueError(u'RADIO_TYPE, CHECKBOX_TYPE 验证未实现') + ## TODO: RADIO_TYPE, CHECKBOX_TYPE + #raise ValueError(u'Error: RADIO_TYPE, CHECKBOX_TYPE 验证未实现') print u'Error: RADIO_TYPE, CHECKBOX_TYPE 验证未实现' return False else: @@ -478,7 +527,7 @@ class IndicatorRecord(models.Model): # {{{ # check finished return True else: - # INTEGER_TYPE or PM_TYPE + # INTEGER_TYPE or PM_TYPE or KIND_TYPE return True # }}} @@ -489,6 +538,12 @@ class IndicatorRecord(models.Model): # {{{ """ # check the indicator.dataType sind = self.indicator + # kind_dump + if self.kind: + kind_dump = self.kind.dump() + else: + kind_dump = {} + # if sind.dataType in [sind.FLOAT_TYPE, sind.RANGE_TYPE, sind.FLOAT_RANGE_TYPE]: # self.value @@ -514,6 +569,7 @@ class IndicatorRecord(models.Model): # {{{ 'val_max': val_max, 'val_min': val_min, 'unit': self.unit.dump(), + 'kind': kind_dump, 'notes': self.notes, 'record_histories_id': [rh.id for rh in self.record_histories.all()], @@ -526,6 +582,7 @@ class IndicatorRecord(models.Model): # {{{ 'val_max': self.val_max, 'val_min': self.val_min, 'unit': {}, + 'kind': kind_dump, 'notes': self.notes, 'record_histories_id': [rh.id for rh in self.record_histories.all()], @@ -586,6 +643,11 @@ class IndicatorRecord(models.Model): # {{{ raise ValueError(errmsg) else: val_min_std = None + # kind_dump + if self.kind: + kind_dump = self.kind.dump + else: + kind_dump = {} # output data data_std = { 'id': self.id, @@ -594,6 +656,7 @@ class IndicatorRecord(models.Model): # {{{ 'val_max': val_max_std, 'val_min': val_min_std, 'unit': std_unit.dump(), + 'kind': kind_dump, 'notes': self.notes, 'record_histories_id': [rh.id for rh in self.record_histories.all()], @@ -685,7 +748,15 @@ class IndicatorRecord(models.Model): # {{{ return True else: return False + elif sind.dataType == sind.KIND_TYPE: + ## KIND_TYPE + kind_id = data_std['kind_id'] + if kind_id == sic.kind.id: + return True + else: + return False elif sind.dataType in [sind.RADIO_TYPE, sind.CHECKBOX_TYPE]: + ## TODO: RADIO_TYPE, CHECKBOX_TYPE print u'Error: RADIO_TYPE, CHECKBOX_TYPE 验证未实现' #raise ValueError(u'RADIO_TYPE, CHECKBOX_TYPE 验证未实现') return None @@ -695,12 +766,17 @@ class IndicatorRecord(models.Model): # {{{ return None # }}} - def dump(self, **kwargs): + def dump(self, **kwargs): # {{{ # check if the indicator needs unit if self.unit: unit_id = self.unit.id else: unit_id = None + # kind_id + if self.kind: + kind_dump = self.kind.dump() + else: + kind_dump = {} # dump dump_data = { 'id': self.id, @@ -713,11 +789,13 @@ class IndicatorRecord(models.Model): # {{{ 'value': self.value, 'val_min': self.val_min, 'val_max': self.val_max, + 'kind': kind_dump, 'notes': self.notes, 'record_histories_id': [rh.id for rh in self.record_histories.all()], } return dump_data + # }}} # }}} @@ -744,6 +822,10 @@ class RecordHistory(models.Model): # {{{ null=True, blank=True, editable=False) val_max_bak = models.FloatField(u"原数据范围上限", null=True, blank=True, editable=False) + kind_bak = models.ForeignKey("ValueKind", + related_name="record_histories", + verbose_name=u"原种类值", + null=True, blank=True, editable=False) notes_bak = models.TextField(u"原记录说明", blank=True, editable=False) @@ -763,6 +845,7 @@ class RecordHistory(models.Model): # {{{ self.value_bak = sr.value self.val_min_bak = sr.val_min self.val_max_bak = sr.val_max + self.kind_bak = sr.kind self.notes_bak = sr.notes # save super(RecordHistory, self).save(**kwargs) @@ -773,6 +856,11 @@ class RecordHistory(models.Model): # {{{ unit_bak_id = self.unit_bak.id else: unit_bak_id = None + # kind_bak_id + if self.kind_bak: + kind_bak_id = self.kind_bak.id + else: + kind_bak_id = None # dump dump_data = { 'id': self.id, @@ -784,6 +872,7 @@ class RecordHistory(models.Model): # {{{ 'value_bak': self.value_bak, 'val_min_bak': self.val_min_bak, 'val_max_bak': self.val_max_bak, + 'kind_bak_id': kind_bak_id, 'notes_bak': self.notes_bak, } return dump_data @@ -829,23 +918,23 @@ class Unit(models.Model): # {{{ if self.id == std_unit.id: return True else: - print u"该指标已经指定了标准单位" - raise ValueError(u"该指标已经指定了标准单位") + print u"Error: 该指标已经指定了标准单位" + raise ValueError(u"Error: 该指标已经指定了标准单位") return False else: return True else: if (not self.relation): - print u"单位映射关系未填写" - raise ValueError(u"单位映射关系未填写") + print u"Error: 单位映射关系未填写" + raise ValueError(u"Error: 单位映射关系未填写") return False else: try: fsym = sympy.sympify(self.relation) return True except SympifyError: - print u"'%s' 不是合法的算术表达式" % self.relation - raise ValueError(u"'%s' 不是合法的算术表达式"\ + print u"Error: '%s' 不是合法的算术表达式" % self.relation + raise ValueError(u"Error: '%s' 不是合法的算术表达式"\ % self.relation) return False @@ -878,6 +967,10 @@ class InnateConfine(models.Model): # {{{ 如果数据类型需要单位,则必须使用"标准单位"; IndicatorRecord.is_normal() 方法需要如此; 因为 标准单位 到 其他单位 的换算没有实现。 + + KIND_TYPE: + 对于'种类型'指标,如果每个可选种类不区分正常和异常, + 且程序其他地方也不涉及是否正常,则可以随便选一个。 """ # indicator indicator = models.OneToOneField("Indicator", @@ -889,6 +982,12 @@ class InnateConfine(models.Model): # {{{ # normal value (for INTEGER_TYPE, PM_TYPE) val_norm = models.CharField(u"正常值", max_length=30, blank=True, help_text=u'填写"整数型","阴阳(+/-)型数据"') + # normal kind (for KIND_TYPE) + kind_norm = models.ForeignKey("ValueKind", + related_name="innate_confines", + verbose_name=u"正常种类值", + null=True, blank=True, + help_text=u"仅供'种类型'指标填写") # normal range human_min = models.FloatField(u"人体正常值下限", null=True, blank=True) @@ -929,10 +1028,15 @@ class InnateConfine(models.Model): # {{{ sind = self.indicator if sind.dataType in [sind.FLOAT_TYPE, sind.RANGE_TYPE, sind.FLOAT_RANGE_TYPE]: - # check unit - if not (self.unit and self.unit.standard): - raise ValueError(u'单位未填写/不是标准单位') + # check unit if given + # check the unit if related to the indicator + ind_std_unit = sind.get_unit(type="standard") + if self.unit and self.unit in ind_std_unit: + return True + else: + raise ValueError(u'ERROR: 单位未填写/不是该指标的标准单位') return False + # if (self.human_max is None) or (self.human_min is None): raise ValueError(u'Error: human_max 或 human_min 未填写') return False @@ -959,7 +1063,7 @@ class InnateConfine(models.Model): # {{{ val_norm = int(self.val_norm) return True except ValueError: - raise ValueError(u'val_norm="%s" 不是整数型值' + raise ValueError(u'ERROR: val_norm="%s" 不是整数型值' % self.val_norm) return False elif sind.dataType == sind.PM_TYPE: @@ -968,14 +1072,27 @@ class InnateConfine(models.Model): # {{{ self.val_norm in [u'+', u'-']): return True else: - raise ValueError(u'value 只接受 "+" 或 "-"') + raise ValueError(u'ERROR: value 只接受 "+" 或 "-"') + return False + elif sind.dataType == sind.KIND_TYPE: + ## KIND type + ## (KIND type indicator not need 'InnateConfine') + if not self.kind_norm: + raise ValueError(u'ERROR: kind_norm 未填写') return False - ## TODO: RADIO_TYPE, CHECKBOX_TYPE + else: + valid_kinds = self.indicator.get_kind() + if self.kind_norm in valid_kinds: + return True + else: + raise ValueError(u'ERROR: kind_norm 不符合要求') + return False elif sind.dataType in [sind.RADIO_TYPE, sind.CHECKBOX_TYPE]: - raise ValueError(u'RADIO_TYPE, CHECKBOX_TYPE 验证未实现') + ## TODO: RADIO_TYPE, CHECKBOX_TYPE + raise ValueError(u'ERROR: RADIO_TYPE, CHECKBOX_TYPE 验证未实现') return False else: - raise ValueError(u'数据不符合要求') + raise ValueError(u'ERROR: 数据不符合要求') return False # }}} @@ -985,12 +1102,18 @@ class InnateConfine(models.Model): # {{{ unit_dump = self.unit.dump() else: unit_dump = {} + # check 'kind_norm' + if self.kind_norm: + kind_norm_dump = self.kind_norm.dump() + else: + kind_norm_dump = {} # dump dump_data = { 'id': self.id, 'indicator_id': self.indicator.id, 'unit': unit_dump, 'val_norm': self.val_norm, + 'kind_norm': kind_norm_dump, 'human_min': self.human_min, 'human_max': self.human_max, 'math_min': self.math_min, @@ -1123,17 +1246,76 @@ class RelatedIndicator(models.Model): # {{{ # }}} +class ValueKind(models.Model): # {{{ + """ + 记录某指标可以可使用的"种类"值 + + 并为需要使用"种类"值的地方提供可选范围(e.g.: recommend.ResearchAtom) + 使用统一的符号(symbol)来寻找及匹配 + """ + name = models.CharField(u"名称", max_length=30) + symbol = models.CharField(u"符号", max_length=30, + help_text=u"仅能使用字母、数字和下划线,最长30字符") + description = models.TextField(u"描述", blank=True) + indicator = models.ForeignKey("Indicator", + related_name="value_kinds", verbose_name=u"关联的指标", + null=True, blank=True) + + class Meta: + verbose_name_plural = u"指标可用种类" + + def __unicode__(self): + if self.indicator: + indicator_name = self.indicator.name + else: + indicator_name = '*' + return u'< ValueKind: %s(%s) for indicator(%s) >' %\ + (self.name, self.symbol, indicator_name) + + def save(self, **kwargs): + if self.is_valid(): + super(ValueKind, self).save(**kwargs) + else: + return self + + def is_valid(self): + # check symbol + sym_regex = re.compile(r'^[_0-9a-zA-Z]+$') + if sym_regex.search(self.symbol): + return True + else: + raise ValueError(u"仅能使用字母、数字和下划线,最长30字符") + return False + + def dump(self, **kwargs): + if self.indicator: + indicator_id = self.indicator.id + else: + indicator_id = None + # + dump_data = { + 'id': self.id, + 'name': self.name, + 'symbol': self.symbol, + 'description': self.description, + 'indicator_id': indicator_id, + } + return dump_data +# }}} + + admin.site.register([ - IndicatorCategory, - Indicator, - UserIndicator, - IndicatorRecord, - RecordHistory, - Unit, - InnateConfine, - StatisticalConfine, - RelatedIndicator, - ]) + IndicatorCategory, + Indicator, + UserIndicator, + IndicatorRecord, + RecordHistory, + Unit, + InnateConfine, + StatisticalConfine, + RelatedIndicator, + ValueKind, +]) # vim: set ts=4 sw=4 tw=0 fenc=utf-8 ft=python: # diff --git a/97suifangqa/apps/indicator/forms.py b/97suifangqa/apps/indicator/obsolete/forms.py index 2e0b709..2e0b709 100644 --- a/97suifangqa/apps/indicator/forms.py +++ b/97suifangqa/apps/indicator/obsolete/forms.py diff --git a/97suifangqa/apps/indicator/obsolete/views_forms.py b/97suifangqa/apps/indicator/obsolete/views_forms.py new file mode 100644 index 0000000..89af21f --- /dev/null +++ b/97suifangqa/apps/indicator/obsolete/views_forms.py @@ -0,0 +1,311 @@ +# -*- coding: utf-8 -*- + +""" +views for used with forms.py + +splitted from 'views.py' +""" + +from indicator.forms import * + +########################################################### +###### forms ###### + +## add_edit_category # {{{ +@login_required +def add_edit_category(request, category_id=None, template='indicator/simple.html'): + """ + add/edit category: 'models.IndicatorCategory' + for 'staff' or 'normal user' + """ + # get or create model instance + if category_id: + category_id = int(category_id) + category = get_object_or_404(im.IndicatorCategory, + id=category_id) + action = 'Edit' + # check the user + # 'staff' can edit all data; + # normal users can only edit their own. + if category.addByUser != request.user and ( + not request.user.is_staff): + return HttpResponseForbidden() + else: + category = im.IndicatorCategory(addByUser=request.user) + action = 'Add' + + if request.method == 'POST': + form = IndicatorCategoryForm(request.POST, instance=category) + if form.is_valid(): + # form posted and valid + # save form to create/update the model instance + form.save() + # redirect url, avoid page reload/refresh + return HttpResponseRedirect('/indicator/done/') + else: + # form with data of the specified instance + form = IndicatorCategoryForm(instance=category) + + return render(request, template, { + 'object': 'IndicatorCategory', + 'action': action, + 'form': form, + }) +# }}} + + +# add_edit_indicator # {{{ +@login_required +def add_edit_indicator(request, indicator_id=None, template='indicator/simple.html'): + """ + add/edit indicator: 'models.Indicator' + for 'staff' or 'normal user' + """ + if indicator_id: + indicator_id = int(indicator_id) + indicator = get_object_or_404(im.Indicator, + id=indicator_id) + action = 'Edit' + # check the user + # 'staff' can edit all data; + # normal users can only edit their own. + if indicator.addByUser != request.user and ( + not request.user.is_staff): + return HttpResponseForbidden() + else: + indicator = im.Indicator(addByUser=request.user) + action = 'Add' + + if request.method == 'POST': + form = IndicatorForm(request.POST, instance=indicator) + if form.is_valid(): + # form posted and valid + form.save() + # redirect url, avoid page reload/refresh + return HttpResponseRedirect('/indicator/done/') + else: + # form with instance + form = IndicatorForm(instance=indicator) + + return render(request, template, { + 'object': 'Indicator', + 'action': action, + 'form': form, + }) +# }}} + + +## add_edit_unit {{{ +@login_required +def add_edit_unit(request, unit_id=None, template='indicator/simple.html'): + """ + add unit for indicator + """ + if unit_id: + unit_id = int(unit_id) + unit = get_object_or_404(im.Unit, id=unit_id) + action = 'Edit' + # check the user + # 'staff' can edit all data; + # normal users can only edit their own. + if unit.addByUser != request.user and ( + not request.user.is_staff): + return HttpResponseForbidden() + else: + unit = im.Unit(addByUser=request.user) + action = 'Add' + + if request.method == 'POST': + form = UnitForm(request.POST, instance=unit) + if form.is_valid(): + # form posted and valid + form.save() + # redirect url, avoid page reload/refresh + return HttpResponseRedirect('/indicator/done/') + else: + # form with instance + form = UnitForm(instance=unit) + + return render(request, template, { + 'object': 'Unit', + 'action': action, + 'form': form, + }) +# }}} + + +## add_edit_confine {{{ +@login_required +def add_edit_confine(request, confine_id=None, template='indicator/simple.html'): + """ + InnateConfine + add confines for indicator + """ + if confine_id: + confine_id = int(confine_id) + confine = get_object_or_404(im.InnateConfine, id=confine_id) + action = 'Edit' + # check the user + # 'staff' can edit all data; + # normal users can only edit their own. + if confine.addByUser != request.user and ( + not request.user.is_staff): + return HttpResponseForbidden() + else: + confine = im.InnateConfine(addByUser=request.user) + action = 'Add' + + if request.method == 'POST': + form = InnateConfineForm(request.POST, instance=confine) + if form.is_valid(): + # form posted and valid + form.save() + # redirect url, avoid page reload/refresh + return HttpResponseRedirect('/indicator/done/') + else: + # form with instance + form = InnateConfineForm(instance=confine) + + return render(request, template, { + 'object': 'InnateConfine', + 'action': action, + 'form': form, + }) +# }}} + + +## add_edit_record {{{ +@login_required +def add_edit_record(request, record_id=None, template='indicator/simple.html'): + """ + add/edit 'IndicatorRecord' + + staff 能自由地修改所有的记录,并且无需填写"修改原因"; + 普通用户只能修改自己的记录,而且必须填写"修改原因" -> RecordHistory + + TODO: + * 当用户选择好"indicator"后,重新筛选"unit",只提供与"indicator" + 对应的"unit"供选择; + * 对"普通用户"增加限制,修改数据"记录"时必须同时提交"修改原因", + 对应模型"RecordHistory"。 + """ + if record_id: + record_id = int(record_id) + record = get_object_or_404(im.IndicatorRecord, id=record_id) + action = 'Edit' + # check the user + if request.user.is_staff: + # 'staff' can edit all data; + pass + elif request.user == record.user: + # user modify the record + return HttpResponse("Not finished yet ...") + #return modify_record(request, record_id) + else: + return HttpResponseForbidden() + else: + record = im.IndicatorRecord(user=request.user) + action = 'Add' + + if request.method == 'POST': + form = IndicatorRecordForm(request.POST, instance=record) + if form.is_valid(): + #raise ValueError + form.save() + # redirect url, avoid page reload/refresh + return HttpResponseRedirect('/indicator/done/') + else: + # form with instance + form = IndicatorRecordForm(instance=record) + + return render(request, template, { + 'object': 'IndicatorRecord', + 'action': action, + 'form': form, + }) +# }}} + + +## modify_record {{{ +@login_required +def modify_record(request, record_id=None, template='indicator/simple.html'): + """ + modify an existing IndicatorRecord + + TODO: + a new 'RecordHistory' is added to record the modification reason + and backup the original data + """ + if record_id: + record_id = int(record_id) + record = get_object_or_404(im.IndicatorRecord, id=record_id) + action = 'Edit' + # check the user + if request.user.is_staff: + # 'staff' can edit all data; + return add_edit_record(request, record_id) + elif request.user == record.user: + # user modify the record + action = 'Modify' + pass + else: + return HttpResponseForbidden() + else: + return add_edit_record(request) + + if request.method == 'POST': + form = IndicatorRecordForm(request.POST, instance=record) + if form.is_valid(): + # form posted and valid + # TODO + raise ValueError(u"该功能尚未完整实现") + form.save() + # redirect url, avoid page reload/refresh + return HttpResponseRedirect('/indicator/done/') + else: + # form with instance + form = IndicatorRecordForm(instance=record) + + return render(request, template, { + 'object': 'IndicatorRecord', + 'action': action, + 'form': form, + }) +## }}} + + +## add_recordhistory_view {{{ +@login_required +def add_recordhistory_view(request, record_id, template='indicator/simple.html'): + """ + add 'RecordHistory' for a record by given + + 'staff' should use the 'admin' interface. + """ + record_id = int(record_id) + record = get_object_or_404(im.IndicatorRecord, id=record_id) + recordhistory = im.RecordHistory(indicatorRecord=record) + action = 'Add' + # check the user + if request.user != record.user: + return HttpResponseForbidden() + + if request.method == 'POST': + form = RecordHistoryForm(request.POST, instance=recordhistory) + if form.is_valid(): + # form posted and valid + form.save() + # redirect url, avoid page reload/refresh + return HttpResponseRedirect('/indicator/done/') + else: + # form with instance + form = RecordHistoryForm(instance=recordhistory) + + return render(request, template, { + 'object': 'RecordHistory', + 'action': action, + 'form': form, + }) +# }}} + + diff --git a/97suifangqa/apps/indicator/search_indexes.py b/97suifangqa/apps/indicator/search_indexes.py index f225b2c..aa0653d 100644 --- a/97suifangqa/apps/indicator/search_indexes.py +++ b/97suifangqa/apps/indicator/search_indexes.py @@ -12,7 +12,7 @@ class IndicatorCategoryIndex(indexes.SearchIndex, indexes.Indexable): search index for 'Indicator' """ text = indexes.CharField(document=True, use_template=True) - # pinyin: for ordering the search result + # fields used to filter results pinyin = indexes.CharField(model_attr='pinyin') addByUser = indexes.CharField(model_attr='addByUser') @@ -33,8 +33,9 @@ class IndicatorIndex(indexes.SearchIndex, indexes.Indexable): search index for 'Indicator' """ text = indexes.CharField(document=True, use_template=True) - # pinyin: for ordering the search result + # fields used to filter results pinyin = indexes.CharField(model_attr='pinyin') + type = indexes.CharField(model_attr='type') addByUser = indexes.CharField(model_attr='addByUser') dataType = indexes.CharField(model_attr='dataType') categories_id = indexes.MultiValueField() diff --git a/97suifangqa/apps/indicator/static/css/delete_card_tip.css b/97suifangqa/apps/indicator/static/css/delete_card_tip.css index 89eee88..9fef26f 100644 --- a/97suifangqa/apps/indicator/static/css/delete_card_tip.css +++ b/97suifangqa/apps/indicator/static/css/delete_card_tip.css @@ -4,6 +4,7 @@ background-color: #FFFFFF; border: 1px solid #94C721; padding: 0 20px 0 20px; + border-radius: 3px; } .delete_card_tip_title_line { height: 42px; @@ -26,26 +27,49 @@ cursor: pointer; } .delete_card_tip_content { - height: 55px; + height: 60px; line-height: 55px; color: #4A4A4A; font-size: 14px; + text-align: center } .delete_card_tip_action { height: 67px; + margin-left: -20px; } -.delete_card_tip_action .action_confirm_cancel, .delete_card_tip_action .action_confirm_ignore { +.delete_card_tip_action .action_confirm_ignore { background-color: #99CC33; - border-radius: 2px; - width: 75px; + border-radius: 3px; + width: 100px; color: white; cursor: pointer; - height: 22px; - line-height: 22px; + height: 26px; display: inline-block; text-align: center; - margin-top: 13px; text-decoration: none; + font-size: 15px; + padding:2px; + padding-top:7px; + margin-right: 20px; + +} + +.delete_card_tip_action .action_confirm_cancel{ + background-color: #a8a8a8; + border-radius: 3px; + width: 100px; + color: white; + cursor: pointer; + height: 26px; + display: inline-block; + text-align: center; + text-decoration: none; + padding:2px; + font-size: 15px; + padding-top:7px; + margin-right: 40px; + + } .delete_card_tip_action .action_confirm_cancel { margin: 0 11px 0 213px; diff --git a/97suifangqa/apps/indicator/static/css/edit_history_data.css b/97suifangqa/apps/indicator/static/css/edit_history_data.css index e1caa9f..d3124de 100644 --- a/97suifangqa/apps/indicator/static/css/edit_history_data.css +++ b/97suifangqa/apps/indicator/static/css/edit_history_data.css @@ -23,16 +23,18 @@ input[type="radio"]:checked + label { #edit_history_data_container { width: 588px; - height: 180px; + height: 230px; background-color: #FFFFFF; border: 1px solid #94C721; padding: 0 20px 0 20px; + border-radius: 3px; } .edit_history_data_title_line { height: 42px; line-height: 42px; border-bottom: 1px solid #D6D0D6; width: 588px; + margin-top: 10px; } .edit_history_data_title_line .edit_history_data_title { font-weight: bold; @@ -51,6 +53,7 @@ input[type="radio"]:checked + label { .edit_history_data_content { color: #4A4A4A; font-size: 14px; + margin-top:10px; } .edit_history_data_content .refer_range { height: 26px; @@ -60,9 +63,11 @@ input[type="radio"]:checked + label { } .edit_history_data_content .refer_range .refer_text { margin-right: 8px; + margin-bottom:-5px; } .edit_history_data_content .refer_range .refer_value { margin-right: 8px; + margin-bottom:-10px; } .edit_history_data_content .edit_data { line-height: 26px; @@ -70,6 +75,7 @@ input[type="radio"]:checked + label { .edit_history_data_content .edit_data .date { height: 26px; line-height: 26px; + margin-top: -10px; } .edit_history_data_content .edit_data .date .date_text { margin-right: 8px; @@ -93,11 +99,11 @@ input[type="radio"]:checked + label { font-weight: bold; } .edit_history_data_content .edit_data .state .normal { - background-color: #B8DB70; + /*background-color: #B8DB70;*/ padding: 2px; } .edit_history_data_content .edit_data .state .abnormal { - background-color: #FFB3B3; + color: #99CC33; padding: 2px; } .edit_history_data_content .edit_data .state .unknown { @@ -105,19 +111,45 @@ input[type="radio"]:checked + label { padding: 2px; } .edit_history_data_content .edit_data #delete_btn { - float: right; - height: 26px; - line-height: 22px; - padding: 1px 26px; - margin-right: 8px; - background-color: #E64848; + background-color: rgb(50, 53, 61); + border-radius: 3px 3px 3px 3px; + color: rgb(255, 255, 255); + float: right; + font-size: 15px; + height: 35px; + margin-right: 15px; + margin-top: 5px; + padding: 1px 26px 1px 20px; + width: 100px; } .edit_history_data_content .edit_data #edit_btn, .edit_history_data_content .editing_data #save_btn { - float: right; - height: 26px; - line-height: 22px; - padding: 1px 26px; + border-radius: 3px 3px 3px 3px; + float: right; + font-size: 15px; + height: 35px; + margin-top: 5px; + padding: 1px 26px 1px 20px; + width: 100px +} +.edit_history_data_content .delete_prompt { + float: right; + height: 35px; + margin-top: 10px; +} +.edit_history_data_content .delete_prompt div { + float: right; + margin-right: 10px; +} +.edit_history_data_content .delete_prompt .prompt { + font-size: 16px; + line-height: 24px; + padding: 1px 10px 1px 10px; +} +.edit_history_data_content .delete_prompt .prompt_btns { + cursor: pointer; } + + .edit_history_data_content .editing_data { line-height: 26px; display: none; @@ -138,30 +170,40 @@ input[type="radio"]:checked + label { position: relative; } .edit_history_data_content .editing_data .date .datepicker { - background: #FFFFFF; - border: 1px solid #9C9C9C; - color: #B9B9B9; - width: 131px; - height: 17px; - line-height: 17px; - position: relative; - padding-top: 2px; - padding-bottom: 2px; + background: none repeat scroll 0 0 rgb(255, 255, 255); + border: 1px solid rgb(217, 217, 217); + border-radius: 3px 3px 3px 3px; + color: rgb(217, 217, 217); + height: 30px; + line-height: 17px; + margin: -3px 0 15px; + padding-top: 2px; + position: absolute; + width: 123px; } + +.edit_history_data_content .editing_data .date .datepicker:focus { + outline:0; + border-color:#99cc33; +} + .edit_history_data_content .editing_data .date .ui-datepicker-trigger { position: absolute; - top: 4px; - right: 8px; + top: 5px; + right: 20px; + /* margin-right: -10px; */ cursor: pointer; + margin-top: -1px; + /* margin-left: -50px; */ + } .edit_history_data_content .editing_data .date .datepicker_container .valid { - border: 2px solid green; + color:inherit; } .edit_history_data_content .editing_data .date .datepicker_container .invalid { border: 2px solid red; } .edit_history_data_content .editing_data .data { - height: 26px; line-height: 26px; float: left; top: 1px; @@ -169,14 +211,24 @@ input[type="radio"]:checked + label { .edit_history_data_content .editing_data .data .prompt { margin-right: 8px; float: left; + margin-top: 16px; + line-height: 1.6em; } .edit_history_data_content .editing_data .data input { color: #5C5C5C; background-color: #FFFFFF; - border: 1px solid #9C9C9C; + border: 1px solid rgb(217,217,217); + border-radius: 3px; + padding-left: 10px; +} + +.edit_history_data_content .editing_data .data input:focus { + border-color:#99cc33; } + .edit_history_data_content .editing_data .data .valid { - border: 2px solid green; + /* border: 2px solid green; */ + color: inherit; } .edit_history_data_content .editing_data .data .invalid { border: 2px solid red; @@ -186,17 +238,20 @@ input[type="radio"]:checked + label { float: left; } .edit_history_data_content .editing_data .data .data_input { - width: 200px; - height: 17px; - line-height: 17px; - padding-top: 2px; - padding-bottom: 2px; - margin-right: 8px; + float: right; + height: 28px; + line-height: 17px; + margin-right: 8px; + margin-top: 10px; + padding-bottom: 2px; + padding-top: 2px; + width: 120px; } .edit_history_data_content .editing_data .data_unit { height: 26px; line-height: 26px; margin-right: 8px; + margin-top: 16px; } .edit_history_data_content .editing_data .reason { height: 26px; @@ -206,6 +261,7 @@ input[type="radio"]:checked + label { .edit_history_data_content .editing_data .reason .prompt { margin-right: 8px; float: left; + margin-top: 10px; } .edit_history_data_content .editing_data .reason input { color: #5C5C5C; @@ -216,12 +272,19 @@ input[type="radio"]:checked + label { border: 2px solid green; } .edit_history_data_content .editing_data .reason .invalid { - border: 2px solid red; } .edit_history_data_content .editing_data .reason .reason_input { width: 330px; - height: 17px; + height: 26px; line-height: 17px; padding-top: 2px; padding-bottom: 2px; + margin-top: 7px; + border-radius: 3px; + border-color: rgb(217,217,217); } + +.edit_history_data_content .editing_data .reason .reason_input :focus{ + + border-color:#99cc33; + } diff --git a/97suifangqa/apps/indicator/static/css/nav.css b/97suifangqa/apps/indicator/static/css/nav.css new file mode 100644 index 0000000..a103f90 --- /dev/null +++ b/97suifangqa/apps/indicator/static/css/nav.css @@ -0,0 +1,1213 @@ +@charset "UTF-8";
+/**
+ * @file
+ * Blog specific styles
+ */
+/* line 10, ../../../sass/sass/blog.scss */
+body.scrolled-down.blog #blog-top-nav {
+ background-color: white;
+}
+/* line 13, ../../../sass/sass/blog.scss */
+body.scrolled-down.blog #blog-top-nav .background {
+ border-bottom: 1px solid #eee;
+}
+
+/* line 22, ../../../sass/sass/blog.scss */
+.blog .post-question input[type="text"] {
+ background-color: #8b8885;
+ color: white;
+ border: 1px solid white;
+ -webkit-box-shadow: 0px 0px 2px white;
+ -moz-box-shadow: 0px 0px 2px white;
+ box-shadow: 0px 0px 2px white;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"].placeholder {
+ color: #eeeeee;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]:focus.placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"].input-placeholder {
+ color: #eeeeee;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]:focus.input-placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]:-moz-placeholder {
+ color: #eeeeee;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]:focus:-moz-placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]::-webkit-input-placeholder {
+ color: #eeeeee;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]:focus::-webkit-input-placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]::-moz-placeholder {
+ color: #eeeeee;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]:focus::-moz-placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]:-ms-input-placeholder {
+ color: #eeeeee;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+.blog .post-question input[type="text"]:focus:-ms-input-placeholder {
+ color: transparent;
+}
+/* line 32, ../../../sass/sass/blog.scss */
+.blog #sidebar-first #header {
+ position: absolute;
+ bottom: 30px;
+ text-align: center;
+ width: auto;
+
+}
+/* line 40, ../../../sass/sass/blog.scss */
+ #nav-ribbon {
+ font-size: 1.07143em;
+ line-height: 1.33333em;
+ margin-bottom: 1.5em;
+ color: white;
+ position: relative;
+ white-space: nowrap;
+ height: 33px;
+ min-width: 89px;
+ -webkit-transition: min-width 0.3s ease;
+ -webkit-transition-delay: 0s;
+ -moz-transition: min-width 0.3s ease 0s;
+ -o-transition: min-width 0.3s ease 0s;
+ transition: min-width 0.3s ease 0s;
+}
+/* line 56, ../../../sass/sass/blog.scss */
+ #nav-ribbon .controls-wrap,
+ #nav-ribbon .head-background,
+ #nav-ribbon .tail-cut {
+ height: 33px;
+}
+/* line 60, ../../../sass/sass/blog.scss */
+ #nav-ribbon .controls-wrap {
+ position: absolute;
+ padding-left: 20px;
+}
+/* line 67, ../../../sass/sass/blog.scss */
+ #nav-ribbon .head-background,
+ #nav-ribbon .links-wrap,
+ #nav-ribbon .tail {
+ background-color: #0063a8;
+}
+/* line 71, ../../../sass/sass/blog.scss */
+ #nav-ribbon .head-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 20px;
+ -webkit-box-shadow: inset 20px 0px 20px -20px;
+ -moz-box-shadow: inset 20px 0px 20px -20px;
+ box-shadow: inset 20px 0px 20px -20px;
+}
+/* line 81, ../../../sass/sass/blog.scss */
+ #nav-ribbon .links-wrap,
+ #nav-ribbon .tail,
+ #nav-ribbon .tail-cut {
+ float: left;
+}
+/* line 85, ../../../sass/sass/blog.scss */
+ #nav-ribbon .links-wrap {
+ -webkit-transition: width 0.3s ease;
+ -webkit-transition-delay: 0s;
+ -moz-transition: width 0.3s ease 0s;
+ -o-transition: width 0.3s ease 0s;
+ transition: width 0.3s ease 0s;
+ width: 0px;
+ overflow: hidden;
+}
+/* line 93, ../../../sass/sass/blog.scss */
+ #nav-ribbon:hover .links-wrap, #nav-ribbon.active .links-wrap,
+ #nav-ribbon ul.links {
+ width: 174px;
+}
+/* line 100, ../../../sass/sass/blog.scss */
+ #nav-ribbon:hover, #nav-ribbon.active {
+ min-width: 263px;
+}
+/* line 105, ../../../sass/sass/blog.scss */
+ #nav-ribbon ul.links li a,
+#nav-ribbon .tail {
+ line-height: 33px;
+ text-align: center;
+}
+/* line 110, ../../../sass/sass/blog.scss */
+#nav-ribbon ul.links {
+ display: block;
+ white-space: nowrap;
+ margin: 0;
+ padding: 0;
+}
+/* line 115, ../../../sass/sass/blog.scss */
+#nav-ribbon ul.links li {
+ display: block;
+ padding: 0;
+ float: left;
+}
+/* line 119, ../../../sass/sass/blog.scss */
+#nav-ribbon ul.links li a {
+ width: 86px;
+ display: block;
+ color: white;
+ border-right: 1px solid #267ab5;
+}
+/* line 126, ../../../sass/sass/blog.scss */
+#nav-ribbon ul.links li a:hover, #nav-ribbon ul.links li a:active, #nav-ribbon ul.links li a.active {
+ text-decoration: none;
+ background-color: #00497f;
+}
+/* line 134, ../../../sass/sass/blog.scss */
+#nav-ribbon .tail {
+ width: 50px;
+ cursor: pointer;
+}
+/* line 139, ../../../sass/sass/blog.scss */
+#nav-ribbon .tail-cut {
+ width: 19px;
+ height: 33px;
+ background: url(../../static/images/nav-ribbon-tail-cut.png);
+}
+
+/* line 150, ../../../sass/sass/blog.scss */
+.blog-details #return-to-results-button {
+ visibility: hidden;
+}
+/* line 154, ../../../sass/sass/blog.scss */
+.blog-details.blog-results-detail #return-to-results-button {
+ visibility: visible;
+}
+/* line 159, ../../../sass/sass/blog.scss */
+.blog-details a.jargon:hover {
+ text-decoration: none;
+ border-bottom: 1px dashed;
+}
+/* line 163, ../../../sass/sass/blog.scss */
+.blog-details .jargon-explanations {
+ display: none;
+}
+/* line 168, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .region-wrap,
+.blog-details #content .region-wrap {
+ padding-top: 0.5em;
+ padding-left: 2em;
+ padding-right: 2em;
+}
+/* line 177, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav {
+ z-index: 10;
+ position: absolute;
+}
+/* line 181, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .breadcrumb {
+ margin-top: 1.5em;
+}
+/* line 184, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .breadcrumb ul.inline li {
+ padding-right: 0;
+}
+/* line 186, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .breadcrumb ul.inline li a.button {
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+ padding-left:0.8em;
+ padding-right: 0.8em;
+ border-radius: 3px 3px 3px 3px;
+ font-weight: bold;
+}
+/* line 191, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .breadcrumb ul.inline li a.button.first {
+ background-image: url(../../images/breadcrumb-dark-grey-button-left-arrow-wbg.png);
+ background-position: center left;
+ background-repeat: no-repeat;
+ -webkit-border-radius: 0 3px 3px 0;
+ -moz-border-radius: 0 3px 3px 0;
+ -ms-border-radius: 0 3px 3px 0;
+ -o-border-radius: 0 3px 3px 0;
+ border-radius: 0 3px 3px 0;
+ border: none;
+ padding-left: 20px;
+}
+/* line 198, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .breadcrumb ul.inline li a.button.first:hover {
+ background-color: #4c4948;
+}
+/* line 211, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .section-name {
+ font-size: 18px;
+ color: #9fa0a0;
+}
+/* line 215, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .section-nav {
+ width: auto;
+}
+/* line 222, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .section-nav ul.links {
+ display: block;
+ width: auto;
+ margin: 0;
+}
+/* line 226, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .section-nav ul.links li {
+ margin-right: 3em;
+ padding: 0;
+}
+/* line 229, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .section-nav ul.links li a {
+ color: inherit;
+}
+/* line 231, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .section-nav ul.links li a.active {
+ color: #99cc33;
+ /*border-bottom: 1px dashed #99cc33;*/
+ text-decoration: none;
+}
+/* line 237, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .section-nav ul.links:hover li a.active {
+ color: inherit;
+ border-bottom: none;
+}
+/* line 244, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .section-nav ul.links li a:hover, .blog-details #blog-top-nav .section-nav ul.links:hover li a:hover {
+ color: #99cc33;
+ /*border-bottom: 1px dashed #99cc33;*/
+ text-decoration: none;
+}
+/* line 250, ../../../sass/sass/blog.scss */
+.blog-details #blog-top-nav .background {
+ z-index: -1;
+ position: absolute;
+ top: 0;
+ bottom: -2px;
+ left: 0;
+ right: 0;
+ margin-left: 2em;
+ margin-right: 2em;
+ background-color: white;
+ border-bottom: 1px solid transparent;
+}
+/* line 265, ../../../sass/sass/blog.scss */
+.blog-details #content {
+ margin-top: 150px;
+ position: relative;
+}
+/* line 268, ../../../sass/sass/blog.scss */
+.blog-details #content .text {
+ font-size: 1.14286em;
+ line-height: 1.6875em;
+}
+/* line 270, ../../../sass/sass/blog.scss */
+.blog-details #content .text h3 {
+ font-size: 1.1em;
+ color: #4c4a49;
+ line-height: 1.5em;
+}
+/* line 274, ../../../sass/sass/blog.scss */
+.blog-details #content .text h4 {
+ color: #4c4a49;
+}
+/* line 280, ../../../sass/sass/blog.scss */
+.blog-details #content .text .image-wrap {
+ border: 1px solid #c9caca;
+ margin-bottom: 1.14286em;
+}
+/* line 285, ../../../sass/sass/blog.scss */
+.blog-details #content .text a.enlarge-image {
+ cursor: pointer;
+ cursor: url(../../images/zoom.cur), auto;
+}
+/* line 290, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box {
+ z-index: 1;
+ position: absolute;
+ display: none;
+ position: absolute;
+ margin-top: 8px;
+ left: 20px;
+ right: 20px;
+ background-color: white;
+ border: 1px solid #8fc31f;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -o-border-radius: 2px;
+ border-radius: 2px;
+ -webkit-box-shadow: 0px 0px 30px #999999;
+ -moz-box-shadow: 0px 0px 30px #999999;
+ box-shadow: 0px 0px 30px #999999;
+}
+/* line 105, ../../../sass/sass/_custom.scss */
+.blog-details #content .jargon-explanation-box.open {
+ display: block;
+}
+/* line 300, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .content-wrap {
+ padding-left: 1.5em;
+ padding-right: 1.5em;
+ padding-top: 0.7em;
+}
+/* line 306, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .content-wrap .jargon-details {
+ min-height: 150px;
+ max-height: 250px;
+ overflow: auto;
+}
+/* line 311, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .content-wrap .references {
+ font-size: 0.8em;
+ font-style: italic;
+}
+/* line 316, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .text-pointer {
+ z-index: 10;
+ position: absolute;
+ width: 20px;
+ height: 8px;
+ background-image: url(../../images/popup-text-pointer.png);
+ top: -8px;
+ margin-left: -10px;
+ left: 10px;
+}
+/* line 326, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .close-box {
+ z-index: 1;
+ position: absolute;
+ width: 20px;
+ height: 20px;
+ background: url(../../images/grey-cross.png) no-repeat center center;
+ cursor: pointer;
+ right: 1.5em;
+ top: 1.5em;
+}
+/* line 336, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box h3.name {
+ margin: 0;
+ border-bottom: 1px solid #c9cacb;
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+/* line 342, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .like-button {
+ display: block;
+ margin: 1em;
+ width: auto;
+}
+/* line 347, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .like-button * {
+ vertical-align: middle;
+}
+/* line 350, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .like-button a.login-button {
+ vertical-align: top;
+}
+/* line 356, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .content-wrap,
+.blog-details #content .jargon-explanation-box .like-button {
+ visibility: hidden;
+}
+/* line 360, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box .loading-image {
+ visibility: visible;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ margin-top: -38.5px;
+ margin-left: -53.5px;
+}
+/* line 371, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box.loaded .content-wrap,
+.blog-details #content .jargon-explanation-box.loaded .like-button {
+ visibility: visible;
+}
+/* line 374, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box.loaded .loading-image {
+ visibility: hidden;
+}
+/* line 378, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box.modal {
+ position: fixed;
+ z-index: 2001;
+ padding: 0;
+ left: 50%;
+ margin-left: -350px;
+ width: 700px;
+ top: 50% !important;
+ -webkit-box-shadow: 0px 0px 30px #444444;
+ -moz-box-shadow: 0px 0px 30px #444444;
+ box-shadow: 0px 0px 30px #444444;
+}
+/* line 383, ../../../sass/sass/blog.scss */
+.blog-details #content .jargon-explanation-box.modal .text-pointer {
+ display: none;
+}
+/* line 390, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card-brief {
+ font-size: 0.875em;
+ line-height: 1.63265em;
+}
+/* line 393, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card {
+ font-size: 0.875em;
+ line-height: 1.30612em;
+ cursor: pointer;
+ border: 1px solid #c9caca;
+}
+/* line 397, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .back .card-wrap {
+ height: 200px;
+ color: white;
+ background-color: #4c4948;
+ background-image: url(../../images/card-bg-grey.png);
+ background-repeat: no-repeat;
+ background-position: center center;
+ text-align: center;
+ line-height: 1.5em;
+}
+/* line 407, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .back .card-wrap .content-wrap {
+ padding-top: 2em;
+}
+/* line 411, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .front .card-wrap {
+ height: 200px;
+ position: relative;
+ overflow: hidden;
+}
+/* line 415, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .front .card-wrap .card-title {
+ font-weight: normal;
+ background-color: #4c4948;
+ color: white;
+ margin: 0;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ width: auto;
+ line-height: 50px;
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+ padding-top: 0;
+ padding-bottom: 0;
+}
+/* line 433, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .front .card-wrap .card-subtitle {
+ font-size: 0.95em;
+ font-weight: normal;
+ color: white;
+ background-color: #3e3a39;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ bottom: 50px;
+ left: 0;
+ right: 0;
+ padding-left: 0.5em;
+ padding-top: 0.1em;
+ padding-bottom: 0.1em;
+}
+/* line 450, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .front .card-wrap .card-details {
+ padding: 0.5em;
+}
+/* line 455, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .front {
+ height: 200px;
+}
+/* line 459, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .back {
+ height: 0;
+}
+/* line 463, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .abstract {
+ display: none;
+}
+/* line 468, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card .front,
+.blog-details #content .cards .card .back {
+ overflow: hidden;
+ -webkit-transition: height 0.3s ease;
+ -webkit-transition-delay: 0s;
+ -moz-transition: height 0.3s ease 0s;
+ -o-transition: height 0.3s ease 0s;
+ transition: height 0.3s ease 0s;
+}
+/* line 475, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card:hover .front, .blog-details #content .cards .card:active .front {
+ height: 0;
+}
+/* line 478, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card:hover .back, .blog-details #content .cards .card:active .back {
+ height: 200px;
+}
+/* line 484, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card.green .back .card-wrap {
+ background-image: url(../../images/card-bg-green.png);
+ background-color: #8fc41f;
+}
+/* line 488, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card.green .front .card-wrap {
+ color: #8fc41f;
+}
+/* line 490, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card.green .front .card-wrap .card-title {
+ background-color: #8fc41f;
+}
+/* line 493, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card.green .front .card-wrap .card-subtitle {
+ background-color: #7cb617;
+}
+/* line 500, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card.blue .back .card-wrap {
+ background-image: url(../../images/card-bg-blue.png);
+ background-color: #0063a8;
+}
+/* line 504, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card.blue .front .card-wrap {
+ color: #006699;
+}
+/* line 506, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card.blue .front .card-wrap .card-title {
+ background-color: #0063a8;
+}
+/* line 509, ../../../sass/sass/blog.scss */
+.blog-details #content .cards .card.blue .front .card-wrap .card-subtitle {
+ background-color: #00508f;
+}
+/* line 517, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first,
+.blog-details #sidebar-second {
+ position: absolute;
+ min-height: 650px;
+ height: auto;
+ top: 0;
+ bottom: 0;
+}
+/* line 525, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second #login {
+ margin-top: 1.5em;
+}
+/* line 528, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .social {
+ font-size: 1em;
+ line-height: 1.42857em;
+ margin-top: 3em;
+}
+/* line 532, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .social ul.buttons li {
+ padding: 0;
+}
+/* line 535, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .social ul.buttons .multi-segment-button .segment.first {
+ width: 60px;
+ white-space: nowrap;
+ overflow: hidden;
+}
+/* line 540, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .social ul.buttons .multi-segment-button {
+ font-weight: bold;
+}
+/* line 544, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .social ul.buttons #like-button .like-button {
+ background-image: url(../../images/grey-star.png);
+ background-repeat: no-repeat;
+ background-position: 10px center;
+}
+/* line 550, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .social ul.buttons #no-idea-button {
+ float: right;
+}
+/* line 552, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .social ul.buttons #no-idea-button .no-idea-button {
+ background-image: url(../../images/white-unhappy-face.png);
+ background-repeat: no-repeat;
+ background-position: 10px center;
+}
+/* line 561, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .comments {
+ margin-top: 2.5em;
+}
+/* line 563, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .comments ol {
+ font-size: 0.92857em;
+ line-height: 1.38462em;
+ max-height: 400px;
+ overflow: hidden;
+ overflow: auto;
+ counter-reset: comments-counter;
+ margin: 0;
+ padding: 0;
+}
+/* line 571, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .comments ol li:before {
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ -ms-border-radius: 3px;
+ -o-border-radius: 3px;
+ border-radius: 3px;
+ width: 1.3em;
+ text-align: center;
+ font-family: "Courier New", "DejaVu Sans Mono", monospace, sans-serif, "STHeiti", "WenQuanYi Micro Hei", "Microsoft YaHei", SimSun, sans-serif;
+ background-color: #898989;
+ color: white;
+ float: left;
+ margin-left: -2em;
+ padding-left: 0.05em;
+ content: counter(comments-counter);
+ counter-increment: comments-counter;
+}
+/* line 581, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .comments ol li {
+ margin-left: 2em;
+ margin-bottom: 1em;
+}
+/* line 584, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .comments ol li a {
+ color: inherit;
+}
+/* line 592, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second #card-abstract {
+ margin-top: 3em;
+ -webkit-transition: all ease;
+ -webkit-transition-delay: 0.5s;
+ -moz-transition: all ease 0.5s;
+ -o-transition: all ease 0.5s;
+ transition: all ease 0.5s;
+ visibility: hidden;
+ opacity: 0;
+}
+/* line 124, ../../../sass/sass/_custom.scss */
+.blog-details #sidebar-second #card-abstract.show {
+ visibility: visible;
+ opacity: 1;
+}
+/* line 598, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .jargon-list {
+ font-size: 1em;
+ line-height: 1.71429em;
+}
+/* line 600, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .jargon-list ul {
+ margin: 0;
+ padding: 0;
+ max-height: 400px;
+ overflow: auto;
+}
+/* line 605, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .jargon-list ul li {
+ padding: 0;
+}
+/* line 607, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .jargon-list ul li a {
+ outline: 0;
+ display: block;
+ color: inherit;
+ text-decoration: none;
+ padding-left: 1.5em;
+ padding-top: 0.3em;
+ padding-bottom: 0.3em;
+}
+/* line 619, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-second .jargon-list ul li a:hover,
+.blog-details #sidebar-second .jargon-list ul li a .active {
+ background-color: #898989;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ -ms-border-radius: 3px;
+ -o-border-radius: 3px;
+ border-radius: 3px;
+ color: white;
+ text-decoration: none;
+}
+/* line 630, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first {
+ z-index: 10;
+ padding-top: 1.5em;
+ padding-bottom: 1.5em;
+}
+/* line 637, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first #nav-ribbon {
+ margin-left: -20px;
+}
+/* line 640, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .post-question {
+ overflow: hidden;
+ width: auto;
+}
+/* line 643, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .post-question .question {
+ width: 60%;
+}
+/* line 646, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .post-question .submit {
+ float: right;
+ width: 30%;
+}
+/* line 651, ../../../sass/sass/blog.scss */
+.related-questions {
+ padding:15px 13px 15px 13px;
+ background-color: white;
+ margin-top: 0;
+ margin-bottom: 17px;
+ -webkit-box-shadow: 0px 0px 5px #bbbbbb;
+ -moz-box-shadow: 0px 0px 5px #bbbbbb;
+ box-shadow: 0px 0px 5px #bbbbbb;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -o-border-radius: 2px;
+ border-radius: 3px;
+ width:300px;
+ font-size:15px;
+ line-height: 1.6em;
+}
+
+.related-questions:hover{
+ box-shadow:0px 0px 10px #898989;
+ -webkit-box-shadow: 0px 0px 10px #898989;
+ -moz-box-shadow: 0px 0px 10px #898989;
+ -ms-box-shadow:0px 0px 10px #898989;
+ -o-box-shadow:0px 0px 10px #898989;
+}
+
+.related-questions span{
+ color: #a8a8a8;
+}
+/* line 658, ../../../sass/sass/blog.scss */
+.related-questions h3 {
+ margin: 0;
+ line-height: 1.5em;
+}
+/* line 665, ../../../sass/sass/blog.scss */
+.related-questions a {
+ color: #727171;
+}
+
+.related-questions a {
+ text-decoration: none;
+}
+/* line 669, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .toc {
+ margin-top: 1em;
+}
+/* line 675, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .toc .toc-title {
+ margin: 0;
+ padding-left: 1em;
+ border-bottom: 1px solid #c9caca;
+ -webkit-box-shadow: 0px 1px 0px 0px white;
+ -moz-box-shadow: 0px 1px 0px 0px white;
+ box-shadow: 0px 1px 0px 0px white;
+}
+/* line 681, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .toc ul.links {
+ font-size: 16.38px;
+ margin: 0;
+ padding: 0;
+}
+/* line 685, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .toc ul.links li {
+ list-style: none;
+ background-image: url(../../images/righticon.png);
+ background-repeat: no-repeat;
+ background-position: center right;
+ margin: 0;
+ padding-left: 1em;
+ border-bottom: 1px solid #c9caca;
+ -webkit-box-shadow: 0px 1px 0px 0px white;
+ -moz-box-shadow: 0px 1px 0px 0px white;
+ box-shadow: 0px 1px 0px 0px white;
+ -webkit-transition: 0.1s ease;
+ -webkit-transition-delay: 0s;
+ -moz-transition: 0.1s ease 0s;
+ -o-transition: 0.1s ease 0s;
+ transition: 0.1s ease 0s;
+}
+/* line 694, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .toc ul.links li:hover, .blog-details #sidebar-first .toc ul.links li.active {
+ background-color: white;
+}
+/* line 698, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .toc ul.links li a {
+ display: block;
+ color: inherit;
+ padding-top: 0.4em;
+ padding-bottom: 0.4em;
+}
+/* line 705, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first .toc ul.links li a:hover {
+ text-decoration: none;
+}
+/* line 714, ../../../sass/sass/blog.scss */
+.blog-details #sidebar-first {
+ background-color: #f3f2f0;
+}
+/* line 717, ../../../sass/sass/blog.scss */
+.blog-details .page-expand {
+ height: 0;
+}
+@media all and (min-width: 1300px) and (min-height: 670px) {
+ /* line 724, ../../../sass/sass/blog.scss */
+ .blog-details #sidebar-first,
+ .blog-details #sidebar-second,
+ .blog-details #blog-top-nav {
+ position: fixed;
+ }
+ /* line 727, ../../../sass/sass/blog.scss */
+ .blog-details .page-expand {
+ height: 100%;
+ }
+}
+/* line 732, ../../../sass/sass/blog.scss */
+.blog-details #back-to-top-button {
+ bottom: 50px;
+ left: 960px;
+}
+/* line 736, ../../../sass/sass/blog.scss */
+.blog-details .confirm-dialog {
+ padding-top: 4em;
+ min-width: 500px;
+ min-height: 80px;
+ text-align: center;
+}
+/* line 741, ../../../sass/sass/blog.scss */
+.blog-details .confirm-dialog .controls {
+ text-align: right;
+ position: absolute;
+ bottom: 2em;
+ right: 2em;
+}
+/* line 750, ../../../sass/sass/blog.scss */
+.blog-details.blog-results #sidebar-second .lists-container {
+ display: none;
+}
+
+/* line 759, ../../../sass/sass/blog.scss */
+.blog-list #content .region-wrap {
+ margin-top: 1.5em;
+}
+/* line 762, ../../../sass/sass/blog.scss */
+.blog-list #content #login {
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+/* line 767, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-top-nav {
+ position: relative;
+ margin-top: 2em;
+ padding-top: 2em;
+}
+/* line 771, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-top-nav .search-type-nav {
+ vertical-align: bottom;
+ /*border-bottom: 1px solid #c9caca;*/
+}
+/* line 776, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-top-nav .search-type-nav ul.links li a {
+ color: inherit;
+}
+/* line 780, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-top-nav .search-type-nav ul.links li a:hover,
+.blog-list #content #blog-list-top-nav .search-type-nav ul.links li a.active {
+ text-decoration: none;
+ color: #0063a8;
+ border-bottom: 1px solid #0063a8;
+}
+/* line 786, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-top-nav .search-type-nav ul.links li.first-level {
+ font-size: 1.5em;
+ padding-right: 50px;
+}
+/* line 791, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-top-nav .search-type-nav ul.links li.second-level a {
+ padding-bottom: 2px;
+}
+/* line 799, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content .not-found {
+ text-align: center;
+ margin-top: 2em;
+}
+/* line 802, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content .not-found .message {
+ font-size: 1.2em;
+ margin-top: 0.5em;
+}
+/* line 808, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content ul.articles {
+ padding: 0;
+}
+/* line 810, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content ul.articles li {
+ list-style: none;
+}
+/* line 815, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content .articles .article {
+ margin-bottom: 40px;
+}
+/* line 819, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content .articles .article .article-title {
+ font-weight: bold;
+ font-size: 1.42857em;
+ line-height: 1.45em;
+ color: black;
+ margin-bottom: 0.5em;
+}
+/* line 131, ../../../sass/sass/_custom.scss */
+.blog-list #content #blog-list-content .articles .article .article-title a {
+ color: inherit;
+}
+/* line 827, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content .articles .article .excerpt {
+ font-size: 1.14286em;
+ line-height: 1.6875em;
+ margin-top: 0.5em;
+}
+/* line 833, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content ul.rating-blocks li {
+ vertical-align: middle;
+ padding: 0;
+ display: -moz-inline-block;
+ display: inline-block;
+ color: transparent;
+ overflow: hidden;
+ width: 12px;
+ height: 12px;
+ background-color: #948b7a;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ -ms-border-radius: 2px;
+ -o-border-radius: 2px;
+ border-radius: 2px;
+ margin-right: -1px;
+}
+/* line 845, ../../../sass/sass/blog.scss */
+.blog-list #content #blog-list-content ul.rating-blocks li.filled {
+ background-color: #4a453d;
+}
+/* line 856, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first #header {
+ z-index: 2;
+}
+/* line 859, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .region-wrap {
+ z-index: 2;
+ position: relative;
+ padding-left: 1em;
+ padding-right: 1em;
+}
+/* line 867, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first #nav-ribbon {
+ margin-top: 1em;
+ z-index: 2;
+ margin-left: -20px;
+}
+/* line 872, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .hover-overlay {
+ color: white;
+ z-index: 1;
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: #91908f;
+ background-color: rgba(0, 0, 0, 0.5);
+ visibility: hidden;
+ opacity: 0;
+ -webkit-transition: all 0.3s ease;
+ -webkit-transition-delay: 0s;
+ -moz-transition: all 0.3s ease 0s;
+ -o-transition: all 0.3s ease 0s;
+ transition: all 0.3s ease 0s;
+}
+/* line 885, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .hover-overlay .region-wrap {
+ padding-left: 3.3em;
+ padding-top: 8em;
+ padding-right: 3.3em;
+}
+/* line 891, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .hover-overlay .region-wrap h3 {
+ margin-bottom: 0;
+}
+/* line 894, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .hover-overlay .region-wrap .user-info h3 {
+ margin-top: 0;
+}
+/* line 897, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .hover-overlay .region-wrap ul {
+ margin: 0;
+ padding: 0;
+}
+/* line 900, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .hover-overlay .region-wrap ul li {
+ list-style: none;
+}
+/* line 905, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .hover-overlay a {
+ color: white;
+}
+/* line 909, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .post-question {
+ z-index: 2;
+ padding-left: 1em;
+ padding-right: 1em;
+ overflow: hidden;
+ width: auto;
+}
+/* line 917, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .post-question .question {
+ width: 60%;
+ border: 1px solid #c2b59e;
+ background-color: #918e8c;
+ background-color: rgba(0, 0, 0, 0.5);
+}
+/* line 923, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first .post-question .submit {
+ float: right;
+ width: 30%;
+ border: none;
+}
+/* line 929, ../../../sass/sass/blog.scss */
+.blog-list #sidebar-first:hover .hover-overlay {
+ visibility: visible;
+ opacity: 1;
+}
+
+/* line 936, ../../../sass/sass/blog.scss */
+body.blog-index {
+ color: white;
+}
+/* line 938, ../../../sass/sass/blog.scss */
+body.blog-index #main {
+ position: relative;
+}
+/* line 940, ../../../sass/sass/blog.scss */
+body.blog-index #main .background {
+ z-index: -1000;
+ background: url(../../images/back_main.jpg) no-repeat 80%;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
+/* line 949, ../../../sass/sass/blog.scss */
+body.blog-index #main #login {
+ position: absolute;
+ top: 15px;
+ right: -250px;
+}
+/* line 954, ../../../sass/sass/blog.scss */
+body.blog-index #main .post-question {
+ margin-top: 270px;
+}
+/* line 956, ../../../sass/sass/blog.scss */
+body.blog-index #main .post-question .question {
+ background-color: white;
+ border: 1px solid #d0d1d1;
+ color: black;
+ width: 400px;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question.placeholder {
+ color: #d0d1d1;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question:focus.placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question.input-placeholder {
+ color: #d0d1d1;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question:focus.input-placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question:-moz-placeholder {
+ color: #d0d1d1;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question:focus:-moz-placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question::-webkit-input-placeholder {
+ color: #d0d1d1;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question:focus::-webkit-input-placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question::-moz-placeholder {
+ color: #d0d1d1;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question:focus::-moz-placeholder {
+ color: transparent;
+}
+/* line 65, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question:-ms-input-placeholder {
+ color: #d0d1d1;
+}
+/* line 68, ../../../sass/sass/_custom.scss */
+body.blog-index #main .post-question .question:focus:-ms-input-placeholder {
+ color: transparent;
+}
+/* line 964, ../../../sass/sass/blog.scss */
+body.blog-index #main .post-question .submit {
+ width: 84px;
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+ border: none;
+}
+/* line 969, ../../../sass/sass/blog.scss */
+body.blog-index #main .post-question .question, body.blog-index #main .post-question .submit {
+ font-size: 1.14286em;
+ line-height: 1.25em;
+ vertical-align: 2px;
+}
+/* line 974, ../../../sass/sass/blog.scss */
+body.blog-index #main #logo {
+ margin-top: 65px;
+ /*margin-left:120px;*/
+ width: 100%;
+ text-align: center;
+}
+/* line 979, ../../../sass/sass/blog.scss */
+body.blog-index #main #copyright {
+ position: fixed;
+ bottom: 75px;
+ left: 75px;
+}
+
+.blog-list #content #blog-list-content ul.articles .excerpt ol li{
+ list-style: decimal;
+}
diff --git a/97suifangqa/apps/indicator/static/css/new_delete_index.css b/97suifangqa/apps/indicator/static/css/new_delete_index.css index fde8168..635f327 100644 --- a/97suifangqa/apps/indicator/static/css/new_delete_index.css +++ b/97suifangqa/apps/indicator/static/css/new_delete_index.css @@ -3,9 +3,9 @@ float: left; position: relative; z-index: 999; - width: 865px; + width: 900px; height: 85px; - margin-left: 457px; + margin-left: 320px; } #login_container .logged-in { float: right; @@ -55,8 +55,9 @@ margin-top: 10px; position: absolute; z-index: 999; - width: 168px; - height: 91px; + width: 170px; + height: 28px; + margin-left:-20px; } #login.logged-in .drop-down-menu .text-pointer { background: url("../images/login-menu-popup-pointer.png") no-repeat scroll 0 0 transparent; @@ -98,6 +99,7 @@ #new_delete_container { float: left; margin-left: 457px; + margin-top:-11px; position: relative; /* position: absolute; @@ -110,11 +112,15 @@ } .new_delete_title .content { float: left; - font-weight: bold; + font-weight: normal; font-size: 20px; - color: #4A4A4A; + color: #a8a8a8; height: 26px; line-height: 26px; + margin-bottom: 10px; + cursor: default; + margin-top: -2px; + } .new_delete_title .search { float: right; @@ -125,45 +131,69 @@ } .new_delete_title .search input { float: left; - height: 20px; + height: 30px; line-height: normal; - width: 127px; - border: 1px solid #CACACA; + width: 150px; + border: 1px solid #d9d9d9; background-color: #FFFFFF; - padding: 0; - border-radius: 2px; + padding-bottom:3px; + border-radius: 3px; color: #000000; position: relative; top: 2px; - margin-right: 2px; + margin-left:-50px; + font-weight: normal; + margin-top: -7px; + +} +.new_delete_title .search input:focus { + border-color:#99cc33; + outline:0; } .new_delete_title .search input::-moz-placeholder { - color: #9D9D9D; - font-weight: bold; + color: #72717; + font-weight: normal; +} +.new_delete_title .search input::placeholder { + color: #727171; + font-weight: normal; +} +.new_delete_title .search input::-webkit-placeholder { + color: #727171; + font-weight: normal; } .new_delete_title .search img { float: right; position: relative; top: 2px; cursor: pointer; + margin-top: -7px; + } .index_navigation { - margin: 10px 0; + margin-top: 10px; + margin-bottom: 6px; + width: 705px; } .index_navigation .index_type { float: left; - width: 77px; - height: 22px; + width: 90px; + height: 28px; line-height: 22px; text-align: center; - border: 1px solid #B5B5B5; - border-radius: 2px; - margin-right: 9px; + border: 1px solid #d9d9d9; + border-radius: 3px; + margin-right: 8.6px; + margin-top: 2px; + margin-bottom: 4px; + padding-top: 6px; + font-size: 15px; } .index_navigation .index_type a { color: #7E7E7E; cursor: pointer; text-decoration: none; + margin-bottom:-10px; } /* .index_navigation #index_all { @@ -186,10 +216,11 @@ float: left; width: 302px; height: 437px; - border: 1px solid #b6b6b6; + border: 1px solid #d9d9d9; z-index: 1; position: relative; padding: 6px 12px 0 12px; + border-radius: 3px; } .show_indexes .add_concerned_icon { float: left; @@ -234,16 +265,22 @@ } .index_line { margin-top: 3px; + height: 23px; + border-radius: 3px; + padding-left: 5px; + padding-top:2px; + padding-bottom:2px; } .index_line .index_name, .index_line .index_category { float: left; - font-size: 14px; + font-size: 15px; width: 45px; height: 20px; - line-height: 20px; - color: #4A4A4A; - font-weight: bold; - cursor: pointer; + line-height: 1.6em; + color: #909090; + font-weight: normal; + cursor: default; + } .index_lines .add .icon { width: 20px; @@ -265,7 +302,9 @@ left: 260px; } .index_lines .add, .index_lines .minus { - background: #8FC31F; + background: #8fc21f; + height: 23px; + margin-bottom:3px; } .index_line .index_name { width: 185px; @@ -298,12 +337,21 @@ } .all_condition .index_all_letter div { float: left; - color: #8F8F8F; - font-size: 15px; - margin-right: 7px; + color: #b3b3b2; + font-size: 16px; + margin-right: 8px; + margin-top:3px; cursor: pointer; + font-weight: normal; + /* letter-spacing: 2px; */ + border-color: #b3b3b3 + +} +.all_condition .index_all_letter .disabled { + cursor: default; + color: #D9D9D9; } -.all_condition .index_all_letter .letter_selected{ +.all_condition .index_all_letter .letter_selected { color: #99CC33; } .index_letter_container { @@ -318,7 +366,7 @@ height: 32px; line-height: 32px; font-weight: bold; - font-size: 32px; + font-size: 22px; color: #4A4A4A; border-bottom: 1px solid #BFBFBF; } @@ -343,21 +391,26 @@ margin-bottom: 10px; } .link_container .status_link { - width: 694px; + width: 105px; height: 37px; line-height: 37px; - border: 1px solid #B5B5B5; - border-radius: 2px; + border-radius: 3px; /* background-color: #F7F7F7; */ - background-color: #F3F3F1; + background-color: #99cc33; text-align: center; + float: right; + font-color:white; +} + +.link_container .status_link:hover{ + background-color:#93C430; + cursor: default; } + .link_container .status_link a { - color: #4A4A4A; + color: white; text-decoration: none; - font-weight: bold; - font-size: 19px; - letter-spacing: 1px; + font-size: 16px; cursor: pointer; } diff --git a/97suifangqa/apps/indicator/static/css/normalize.css b/97suifangqa/apps/indicator/static/css/normalize.css index ab1eadb..f9916ec 100644 --- a/97suifangqa/apps/indicator/static/css/normalize.css +++ b/97suifangqa/apps/indicator/static/css/normalize.css @@ -565,6 +565,8 @@ input[type="submit"] { /* 2 */ } + + /* line 574, ../../../sass/sass/normalize.scss */ .button, button, @@ -586,9 +588,11 @@ input[type="reset"] { color: white; padding-left: 0.8em; padding-right: 0.8em; - height: 2.1em; - line-height: 2.1em; + padding-bottom: 0.5em; + height: 3em; + line-height: 1.5em; vertical-align: middle; + font-size: 16px; } /* line 588, ../../../sass/sass/normalize.scss */ .button:hover, @@ -648,8 +652,8 @@ a.button:visited { /* line 619, ../../../sass/sass/normalize.scss */ input[type="text"] { - background-color: #8b8885; - border: 1px solid white; + background-color: white; + -webkit-box-shadow: 0px 0px 2px white; -moz-box-shadow: 0px 0px 2px white; box-shadow: 0px 0px 2px white; @@ -658,12 +662,18 @@ input[type="text"] { padding-top: 0; padding-bottom: 0; line-height: 1.95em; - height: 1.95em; + height: 29px; color: white; + font-size:15px; } +input[type="text"]:focus { + border-color:#99cc33; + outline:0; +} + /* line 65, ../../../sass/sass/_custom.scss */ input[type="text"].placeholder { - color: #eeeeee; + color: #a6a6a6; } /* line 68, ../../../sass/sass/_custom.scss */ input[type="text"]:focus.placeholder { @@ -671,7 +681,7 @@ input[type="text"]:focus.placeholder { } /* line 65, ../../../sass/sass/_custom.scss */ input[type="text"].input-placeholder { - color: #eeeeee; + color: #a6a6a6; } /* line 68, ../../../sass/sass/_custom.scss */ input[type="text"]:focus.input-placeholder { @@ -679,7 +689,7 @@ input[type="text"]:focus.input-placeholder { } /* line 65, ../../../sass/sass/_custom.scss */ input[type="text"]:-moz-placeholder { - color: #eeeeee; + color: #a6a6a6; } /* line 68, ../../../sass/sass/_custom.scss */ input[type="text"]:focus:-moz-placeholder { @@ -687,7 +697,7 @@ input[type="text"]:focus:-moz-placeholder { } /* line 65, ../../../sass/sass/_custom.scss */ input[type="text"]::-webkit-input-placeholder { - color: #eeeeee; + color: #a6a6a6; } /* line 68, ../../../sass/sass/_custom.scss */ input[type="text"]:focus::-webkit-input-placeholder { @@ -695,7 +705,7 @@ input[type="text"]:focus::-webkit-input-placeholder { } /* line 65, ../../../sass/sass/_custom.scss */ input[type="text"]::-moz-placeholder { - color: #eeeeee; + color: #a6a6a6; } /* line 68, ../../../sass/sass/_custom.scss */ input[type="text"]:focus::-moz-placeholder { @@ -703,7 +713,7 @@ input[type="text"]:focus::-moz-placeholder { } /* line 65, ../../../sass/sass/_custom.scss */ input[type="text"]:-ms-input-placeholder { - color: #eeeeee; + color: #a6a6a6; } /* line 68, ../../../sass/sass/_custom.scss */ input[type="text"]:focus:-ms-input-placeholder { diff --git a/97suifangqa/apps/indicator/static/css/sheet_default.css b/97suifangqa/apps/indicator/static/css/sheet_default.css index 82d8fbb..22e5afd 100644 --- a/97suifangqa/apps/indicator/static/css/sheet_default.css +++ b/97suifangqa/apps/indicator/static/css/sheet_default.css @@ -24,9 +24,10 @@ input[type="radio"]:checked + label { #login_container { float: left; position: relative; - width: 865px; + z-index: 999; + width: 900px; height: 85px; - margin-left: 457px; + margin-left: 320px; } #login_container .logged-in { float: right; @@ -67,7 +68,7 @@ input[type="radio"]:checked + label { line-height: 1em; } #login.logged-in .drop-down-menu { - background-color: #FFFFFF; + background-color: #FFFFFF; border: 1px solid #C9C9C9; border-radius: 2px 2px 2px 2px; box-shadow: 0 0 10px rgba(85, 85, 85, 0.5); @@ -76,8 +77,9 @@ input[type="radio"]:checked + label { margin-top: 10px; position: absolute; z-index: 999; - width: 168px; - height: 91px; + width: 170px; + height: 28px; + margin-left:-20px; } #login.logged-in .drop-down-menu .text-pointer { background: url("../images/login-menu-popup-pointer.png") no-repeat scroll 0 0 transparent; @@ -131,10 +133,12 @@ input[type="radio"]:checked + label { width: 696px; } .index_title { - color: #4a4a4a; + color: #a8a8a8; font-size: 20px; - letter-spacing: 2px; - font-weight: bold; + font-weight: normal; + font-size:1.4em; + margin-bottom:10px; + margin-top:-10px; } .index_sub_title { margin-top: 9px; @@ -178,14 +182,17 @@ input[type="radio"]:checked + label { float: left; } .detail_card_info .card_title .collapse_btn { - width: 80px; - height: 23px; + width: 100px; + height: 35px; line-height: 23px; font-size: 14px; vertical-align: baseline; position: relative; bottom: -10px; float: right; + margin-top:-12px; + padding-top:0.3em; + font-size: 15px; } .detail_card_info .search_data_div { margin-top: 9px; @@ -194,10 +201,36 @@ input[type="radio"]:checked + label { } .detail_card_info .search_data_div input[type='button'] { width: 100px; - height: 23px; line-height: 23px; float: left; + text-align: center; + padding-right:20px; + padding-top:5px; + height: 35px; + font-size: 15px; + border-radius: 3px; + border-color: #d9d9d9; + font-color:#7e7e7e; + margin-right:5px; +} + +.detail_card_info .search_data_div input[type='button']:hover{ + cursor: pointer; + -webkit-appearance: none; + background-color: #99cc33; + border: 1px solid #f3f2f0; + -webkit-box-shadow: 0px 0px 2px white; + -moz-box-shadow: 0px 0px 2px white; + box-shadow: 0px 0px 2px white; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + border-radius: 3px; + color: white; + } + .detail_card_info .search_data_div .shift_date { margin-left: 4px; } @@ -216,20 +249,28 @@ input[type="radio"]:checked + label { } .detail_card_info .search_data_div .datepicker_container .datepicker { background: #FFFFFF; - border: 1px solid #9C9C9C; + border: 1px solid #d9d9d9; color: #B9B9B9; - width: 117px; - height: 17px; - line-height: 17px; + width: 110px; + height: 30px; position: relative; padding-top: 2px; padding-bottom: 2px; + padding-left:10px; + border-radius:3px; + margin-left: 5px; } +.detail_card_info .search_data_div .datepicker_container .datepicker:focus{ + border-color: #99cc33; + outline:0; +} + .detail_card_info .search_data_div .datepicker_container .ui-datepicker-trigger { position: absolute; top: 2px; right: 8px; cursor: pointer; + margin-top: 6px; } .detail_card_info .chart { height: 400px; @@ -243,19 +284,23 @@ input[type="radio"]:checked + label { .detail_card_info .table_div table tr td { border: 1px solid #CACACA; text-align: center; + height: 40px; } .detail_card_info .table_div table .first_line { background: #99CC33; - height: 29px; + height: 35px; color: #FFFFFF; + font-size:16px; } .detail_card_info .table_div table .state .normal { - background-color: #B8DB70; + color:inherit; padding: 2px; } .detail_card_info .table_div table .state .abnormal { - background-color: #FFB3B3; - padding: 2px; + border-radius: 3px; + margin:3px 0 3px 0; + height: 35px; + color:#99cc33; } .detail_card_info .table_div table .state .unknown { background-color: #B3D9FF; @@ -269,19 +314,31 @@ input[type="radio"]:checked + label { width: 107px; height: 24px; line-height: 24px; + color:#7d7d7d; + background-color: white; + font-size:15px; + margin:5px 19px 5px 0; + border-color:white; } .detail_card_info .see_more .see_more_btn:disabled { - background-color: #CCCCCC; + color:#7d7d7d; + background-color: white; + font-size:15px; + margin:5px 19px 5px 0; + border-color:white; } .index_card { width: 328px; height: 434px; border: 1px solid #CACACA; margin-top: 9px; - border-radius: 2px; + border-radius: 3px; padding: 5px 5px 0 8px; position: relative; } + + + /* recommended indicator's card */ #index_status_container .recommended { width: 326px; @@ -291,21 +348,24 @@ input[type="radio"]:checked + label { .index_card_fir { float: left; } + .index_card_sec { float: right; } .index_card .card_title { height: 40px; line-height: 40px; - color: #7D7D7D; + /*color: #7D7D7D;*/ font-weight: bold; font-size: 18px; + border-radius:5px; } .index_card .refer_range { color: #4B4B4B; } .index_card .refer_range .refer_text { margin-right: 5px; + margin-bottom:10px; } .index_card .refer_range .refer_value { margin-right: 5px; @@ -316,7 +376,7 @@ input[type="radio"]:checked + label { margin-top: 7px; } .index_card .edit_data .explain_icon { - margin-right: 2px; + margin-right: 5px; float: right; } .index_card .edit_data .small_edit_icon { @@ -382,16 +442,30 @@ input[type="radio"]:checked + label { } .index_card .editing_data .data .data_input { width: 165px; - height: 17px; + height: 26px; + border: 1px solid #d9d9d9; line-height: 17px; padding-top: 2px; padding-bottom: 2px; margin-right: 8px; + margin-top:-6px; + border-radius:3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + font-size:14px; + line-height: 20px; + vertical-align: middle; } +.index_card .editing_data .data .data_input:focus { + border: 1px solid #99cc33; +} + .index_card .editing_data .data_unit { float: left; height: 25px; line-height: 25px; + margin-top:0px; } .index_card .editing_data .date .datepicker_container { width: 148px; @@ -400,24 +474,32 @@ input[type="radio"]:checked + label { margin-top: 5px; } .index_card .editing_data .date .datepicker_container .datepicker { - background: #FFFFFF; - border: 1px solid #9C9C9C; + background: white; + border: 1px solid #d9d9d9; color: #B9B9B9; - width: 131px; - height: 17px; + width: 165px; + height: 26px; line-height: 17px; position: relative; padding-top: 2px; padding-bottom: 2px; + margin-top:0px; + border-radius:3px; } .index_card .editing_data .date .datepicker_container .ui-datepicker-trigger { position: absolute; top: 2px; right: 8px; + margin-top:5px; + margin-right:-30px; cursor: pointer; } + +.index_card .editing_data .date .datepicker_container .datepicker:focus { + border-color:#99cc33; +} .index_card .editing_data .date .datepicker_container .valid { - border: 2px solid green; + color: #000; } .index_card .editing_data .date .datepicker_container .invalid { border: 2px solid red; @@ -426,9 +508,9 @@ input[type="radio"]:checked + label { .index_card .editing_data .cancel_edit_icon { float: right; background:url(../images/cancel_edit.png) no-repeat; - width: 23px; - height: 23px; - margin-right: 3px; + width: 24px; + height: 24px; + margin-right: 5px; cursor: pointer; } .index_card .editing_data .confirm_edit_icon { @@ -436,6 +518,7 @@ input[type="radio"]:checked + label { background:url(../images/confirm_edit.png) no-repeat; width: 23px; height: 23px; + margin-right:10px; cursor: pointer; } @@ -451,7 +534,7 @@ input[type="radio"]:checked + label { height: 85px; width: 85px; float: left; - margin: 45px 0 0 135px; + margin: 45px 0 0 120px; cursor: pointer; } .index_card .edit_icon_container .curve_icon { @@ -459,14 +542,17 @@ input[type="radio"]:checked + label { height: 125px; width: 105px; float: left; + margin-left: 15px; } .index_card .edit_icon_container .edit_text { - color: #4B4B4B; + color: #8E8E8E; text-align: center; height: 20px; line-height: 20px; - margin-top: 11px; + margin-top: 20px; margin-bottom: 100px; + margin-right: 5px; + font-size:15px } .index_card .chart { @@ -488,6 +574,11 @@ input[type="radio"]:checked + label { cursor: pointer; text-decoration: none; } + +.index_card .card_bottom .understand_index a:hover, .index_card .card_bottom .simulation_sheet a:hover, .index_card .card_bottom .detail_history a:hover { + color: #99cc33; +} + .index_card .card_bottom .understand_index { width: 120px; } @@ -503,6 +594,8 @@ input[type="radio"]:checked + label { right: 0; margin: 5px 5px 0 0; cursor: pointer; + margin-top:10px; + margin-right:10px; } .index_card .card_delete_hover { background: url('../images/closed_hover.png') no-repeat; @@ -511,7 +604,7 @@ input[type="radio"]:checked + label { position: absolute; top: -3px; right: -2px; - margin: 5px 5px 0 0; + margin: 10px 10px 0 0; cursor: pointer; } .act_card_container { @@ -535,6 +628,8 @@ input[type="radio"]:checked + label { letter-spacing: 1px; cursor: pointer; } + + .move_div_2_left { float: left; } diff --git a/97suifangqa/apps/indicator/static/css/sidebar.css b/97suifangqa/apps/indicator/static/css/sidebar.css index 8df3a1a..c5d3be9 100644 --- a/97suifangqa/apps/indicator/static/css/sidebar.css +++ b/97suifangqa/apps/indicator/static/css/sidebar.css @@ -5,7 +5,7 @@ padding: 1.5em 0; position: absolute; z-index: 10; - width: 420px; + /*width: 420px;*/ height: 1020px; background-color: #F3F3F1; } @@ -79,8 +79,8 @@ /* 对比容器样式 */ #compare_container { - margin-top: 26px; - padding-left: 18px; + margin-top: -7px; + padding-left: 27px; width: 383px; } #compare_container .post-question .searchdiv .question { @@ -91,13 +91,14 @@ } #compare_container .post-question .searchdiv .submit { width: 72px; - height: 31px; + height: 35px; border: 1px solid #cce79a; vertical-align: baseline; float: right; + } #compare_container .similar_container { - margin-top: 14px; + margin-top: 0px; margin-left:15px; } .vertical_bar_component { @@ -156,6 +157,16 @@ position: absolute; z-index: 100; } + +#sidebar_container .submit{ + margin-left: 40px; + margin-top: -5px; + width: 330px; + height: 45px; + line-height: 1em; + padding-top:0.5em; +} + #compare_container .similar_container .similar_content { margin-left: 15px; float: left; @@ -168,7 +179,6 @@ } #compare_container .similar_container .similar_content .specifix_content { background: url("../images/dialog-default.png") no-repeat; - height: 47px; width: 343px; margin-left: -10px; margin-bottom: 35px; @@ -184,24 +194,22 @@ padding-left: 25px; font-size: 15px; } -#compare_container .compare_btn { +/*compare_container .compare_btn { border: 1px solid #7da625; width: 380px; height: 38px; border-radius: 3px; margin-top: 8px; cursor: pointer; -} -#compare_container .compare_btn .compare_btn_in{ - border: 1px solid #b8db71; - border-bottom: none; - background: #8bb830; +}*/ +#compare_btn_in{ + background: #99cc33; background: -webkit-gradient(linear, left top, left bottom, from(#99cc33), to(#8bb830)); background: -webkit-linear-gradient(top, #99cc33, #8bb830); background: -moz-linear-gradient(top, #99cc33, #8bb830); background: -ms-linear-gradient(top, #99cc33, #8bb830); background: -o-linear-gradient(top, #99cc33, #8bb830); - width: 378px; + width: 300px; height: 36px; line-height: 36px; color: #FFF; @@ -216,8 +224,9 @@ background: #8AB82E; box-shadow: 0 0 10px rgba(85 85 85 0.5) inset; } -#compare_container .logo_container { - margin-top: 30px; - text-align: center; +#sidebar_container .logo_container { + margin-top: 20px; + margin-left:115px; + } diff --git a/97suifangqa/apps/indicator/static/images/addicon.png b/97suifangqa/apps/indicator/static/images/addicon.png Binary files differindex 6ebf5eb..96a2c65 100644 --- a/97suifangqa/apps/indicator/static/images/addicon.png +++ b/97suifangqa/apps/indicator/static/images/addicon.png diff --git a/97suifangqa/apps/indicator/static/images/cancel_edit.png b/97suifangqa/apps/indicator/static/images/cancel_edit.png Binary files differindex 1cd9303..9b2530e 100644 --- a/97suifangqa/apps/indicator/static/images/cancel_edit.png +++ b/97suifangqa/apps/indicator/static/images/cancel_edit.png diff --git a/97suifangqa/apps/indicator/static/images/confirm_edit.png b/97suifangqa/apps/indicator/static/images/confirm_edit.png Binary files differindex 31f2658..2702737 100644 --- a/97suifangqa/apps/indicator/static/images/confirm_edit.png +++ b/97suifangqa/apps/indicator/static/images/confirm_edit.png diff --git a/97suifangqa/apps/indicator/static/images/last_edit_data.png b/97suifangqa/apps/indicator/static/images/last_edit_data.png Binary files differindex 7d13181..1e615fe 100644 --- a/97suifangqa/apps/indicator/static/images/last_edit_data.png +++ b/97suifangqa/apps/indicator/static/images/last_edit_data.png diff --git a/97suifangqa/apps/indicator/static/images/minusicon.png b/97suifangqa/apps/indicator/static/images/minusicon.png Binary files differindex 997a034..42851ff 100644 --- a/97suifangqa/apps/indicator/static/images/minusicon.png +++ b/97suifangqa/apps/indicator/static/images/minusicon.png diff --git a/97suifangqa/apps/indicator/static/images/pen.png b/97suifangqa/apps/indicator/static/images/pen.png Binary files differindex 18aafdf..09b855b 100644 --- a/97suifangqa/apps/indicator/static/images/pen.png +++ b/97suifangqa/apps/indicator/static/images/pen.png diff --git a/97suifangqa/apps/indicator/static/images/pen_large.png b/97suifangqa/apps/indicator/static/images/pen_large.png Binary files differindex ec75b6b..779684c 100644 --- a/97suifangqa/apps/indicator/static/images/pen_large.png +++ b/97suifangqa/apps/indicator/static/images/pen_large.png diff --git a/97suifangqa/apps/indicator/static/images/search.png b/97suifangqa/apps/indicator/static/images/search.png Binary files differindex 303f228..29ea9b9 100644 --- a/97suifangqa/apps/indicator/static/images/search.png +++ b/97suifangqa/apps/indicator/static/images/search.png diff --git a/97suifangqa/apps/indicator/static/images/sheet/AFP.jpg b/97suifangqa/apps/indicator/static/images/sheet/AFP.jpg Binary files differnew file mode 100644 index 0000000..527f207 --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/AFP.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/PCR.jpg b/97suifangqa/apps/indicator/static/images/sheet/PCR.jpg Binary files differnew file mode 100644 index 0000000..6e76089 --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/PCR.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/PT.jpg b/97suifangqa/apps/indicator/static/images/sheet/PT.jpg Binary files differnew file mode 100644 index 0000000..6085e53 --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/PT.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/gene.jpg b/97suifangqa/apps/indicator/static/images/sheet/gene.jpg Binary files differnew file mode 100644 index 0000000..224c592 --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/gene.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/两对半.jpg b/97suifangqa/apps/indicator/static/images/sheet/两对半.jpg Binary files differnew file mode 100644 index 0000000..1f2c2bc --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/两对半.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/肝功能.jpg b/97suifangqa/apps/indicator/static/images/sheet/肝功能.jpg Binary files differnew file mode 100644 index 0000000..fa1144c --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/肝功能.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/肝穿刺表格形式二1.jpg b/97suifangqa/apps/indicator/static/images/sheet/肝穿刺表格形式二1.jpg Binary files differnew file mode 100644 index 0000000..3680408 --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/肝穿刺表格形式二1.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/肝脏硬度.jpg b/97suifangqa/apps/indicator/static/images/sheet/肝脏硬度.jpg Binary files differnew file mode 100644 index 0000000..3b1c8ee --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/肝脏硬度.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/血细胞.jpg b/97suifangqa/apps/indicator/static/images/sheet/血细胞.jpg Binary files differnew file mode 100644 index 0000000..a87265b --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/血细胞.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/表格1.jpg b/97suifangqa/apps/indicator/static/images/sheet/表格1.jpg Binary files differnew file mode 100644 index 0000000..de00072 --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/表格1.jpg diff --git a/97suifangqa/apps/indicator/static/images/sheet/表格5.jpg b/97suifangqa/apps/indicator/static/images/sheet/表格5.jpg Binary files differnew file mode 100644 index 0000000..deaadc2 --- /dev/null +++ b/97suifangqa/apps/indicator/static/images/sheet/表格5.jpg diff --git a/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js b/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js index d4ccdf5..898e904 100644 --- a/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js +++ b/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js @@ -21,8 +21,21 @@ $(document).ready(function(){ maxDate: 0 // 0->today, 1->tomorrow }); + // delete record {{{ // delete button $("#delete_btn").bind("click", function(){ + var this_edit_data_div = $(this).closest(".edit_data"); + var this_delete_prompt_div = this_edit_data_div.siblings(".delete_prompt"); + this_delete_prompt_div.show(); + return false; + }); + // cancel delete button + $("#cancel_delete_btn").bind("click", function(){ + $(this).closest(".delete_prompt").hide(); + return false; + }); + // confirm delete button + $("#confirm_delete_btn").bind("click", function(){ // delete record (ajax) var time = moment().valueOf(); $.ajax({ @@ -51,13 +64,16 @@ $(document).ready(function(){ }); return false; }); + // }}} // edit button $("#edit_btn").bind("click", function(){ var this_edit_data_div = $(this).closest(".edit_data"); var this_editing_data_div = this_edit_data_div.siblings(".editing_data"); - this_editing_data_div.show(); + var this_delete_prompt_div = this_edit_data_div.siblings(".delete_prompt"); + this_delete_prompt_div.hide(); this_edit_data_div.hide(); + this_editing_data_div.show(); return false; }); diff --git a/97suifangqa/apps/indicator/static/javascripts/new_delete_index.js b/97suifangqa/apps/indicator/static/javascripts/new_delete_index.js index e216f09..635e9c7 100644 --- a/97suifangqa/apps/indicator/static/javascripts/new_delete_index.js +++ b/97suifangqa/apps/indicator/static/javascripts/new_delete_index.js @@ -22,6 +22,16 @@ $(document).ready(function(){ } ); + // 'all_condition' letter selectors {{{ + // disable all letter selectors + $(".index_all_letter .letter").addClass("disabled"); + $(".index_letter_container .letter_section").each(function() { + var l = $(this).attr('id').replace('sec_', ''); + //console.log(l); + $(".index_all_letter #"+l).removeClass("disabled"); + }); + // }}} + // login control kit {{{ $(".drop-down-area").bind("click", function(){ var drop_down_menu = $(".drop-down-menu"); @@ -144,8 +154,9 @@ $(document).ready(function(){ $(".letter_selected").removeClass("letter_selected"); $(this).addClass("letter_selected"); var container = $(".index_letter_container"); - var letterClass = $(this).text(); - var scrollTo = $("."+letterClass); + var letterClass = $(this).attr('id'); + //console.log(letterClass); + var scrollTo = $("#sec_"+letterClass); container.scrollTop(scrollTo.offset().top - container.offset().top + container.scrollTop()); select_letter = letterClass; return false; diff --git a/97suifangqa/apps/indicator/templates/indicator/NewDeleteIndex.html b/97suifangqa/apps/indicator/templates/indicator/NewDeleteIndex.html index 24d8078..9651a93 100644 --- a/97suifangqa/apps/indicator/templates/indicator/NewDeleteIndex.html +++ b/97suifangqa/apps/indicator/templates/indicator/NewDeleteIndex.html @@ -3,7 +3,7 @@ {% load dict_get %} {% block title %} -指标状态 | 随访工具 | 97 随访 +指标状态 | 随访工具 | 医时代 {% endblock %} {% block css %} @@ -39,17 +39,17 @@ <!-- TODO --> <div id="login_container"> <div class="logged-in" id="login"> - <img class="user-photo" alt="" src="{% static "images/userPhoto.jpg" %}"> - <span class="number-block green-block user-level">6</span> + <!--img class="user-photo" alt="" src="{% static "images/userPhoto.jpg" %}"> + <span class="number-block green-block user-level">6</span--> <span class="drop-down-area"> - <span class="user-name">username</span> + <span class="user-name">isuifangqa</span> <img class="drop-down-menu-button" alt="" src="{% static "images/icon_down.png" %}"> </span> <div class="drop-down-menu" tabindex="0" onblur="javascript:alert('blur');" onfocus="javascript:alert('focus')"> <div class="text-pointer"></div> <ul class="links"> - <li><a href="javascript:void(0)">修改密码</a></li> - <li><a href="javascript:void(0)">完善信息</a></li> + <!--li><a href="javascript:void(0)">修改密码</a></li> + <li><a href="javascript:void(0)">完善信息</a></li--> <li class="last"><a href="javascript:void(0)">退出</a></li> </ul> </div> @@ -66,7 +66,7 @@ <div class="new_delete_title"> <div class="content">添加或删除关注指标</div> <div class="search"> - <input type="text" value="" placeholder="直接搜索指标" id="search_kw" /> + <input type="text" name="q" placeholder="直接找寻指标" id="search_kw" value="{{ q }}"/> <img id="search_btn" src="{% static "images/search.png" %}"> </div> <div style="clear: both;"></div> @@ -77,7 +77,7 @@ <div id="index_all" class="index_type {% if page_condition == "all" %}selected{% endif %}"> <a href="?tab=all">所有指标</a> </div> - <!-- 指标类别,页面只能容纳 7 个 --> + <!-- 指标类别,一行只能容纳 7 个按钮 --> {% for cat in categories %} <div class="index_type {% if selected_catid == cat.id %}selected{% endif %}"> <a href="?tab={{ cat.id }}">{{ cat.name }}</a> @@ -93,32 +93,32 @@ <div class="all_condition" style="display: {% if page_condition == "all" %}block{% else %}none{% endif %};"> <div class="index_all_title">所有指标</div> <div class="index_all_letter"> - <div>A</div> - <div>B</div> - <div>C</div> - <div>D</div> - <div>E</div> - <div>F</div> - <div>G</div> - <div>H</div> - <div>I</div> - <div>J</div> - <div>K</div> - <div>L</div> - <div>M</div> - <div>N</div> - <div>O</div> - <div>P</div> - <div>Q</div> - <div>R</div> - <div>S</div> - <div>T</div> - <div>U</div> - <div>V</div> - <div>W</div> - <div>X</div> - <div>Y</div> - <div>Z</div> + <div class="letter" id="A">A</div> + <div class="letter" id="B">B</div> + <div class="letter" id="C">C</div> + <div class="letter" id="D">D</div> + <div class="letter" id="E">E</div> + <div class="letter" id="F">F</div> + <div class="letter" id="G">G</div> + <div class="letter" id="H">H</div> + <div class="letter" id="I">I</div> + <div class="letter" id="J">J</div> + <div class="letter" id="K">K</div> + <div class="letter" id="L">L</div> + <div class="letter" id="M">M</div> + <div class="letter" id="N">N</div> + <div class="letter" id="O">O</div> + <div class="letter" id="P">P</div> + <div class="letter" id="Q">Q</div> + <div class="letter" id="R">R</div> + <div class="letter" id="S">S</div> + <div class="letter" id="T">T</div> + <div class="letter" id="U">U</div> + <div class="letter" id="V">V</div> + <div class="letter" id="W">W</div> + <div class="letter" id="X">X</div> + <div class="letter" id="Y">Y</div> + <div class="letter" id="Z">Z</div> </div> <!-- end: index_all_letter --> <div style="clear:both;"></div> {# display all indicators if in 'all' condition #} @@ -127,21 +127,21 @@ <div class="index_letter_container"> {# display all indicators by letter index #} {% for l in letters %} - {% with l_inds=indicators|dict_get:l %} - {% if l_inds|length >= 1 %} - <div class="index_lines {{ l|upper }} to_add"> - <div class="letter_title">{{ l|upper }}</div> - {% for ind in l_inds %} - <div class="index_line" index_id="{{ ind|dict_get:"id" }}"> - <div class="index_name">{{ ind|dict_get:"name" }}</div> - <div class="index_category"></div> - <div class="icon"></div> - <div style="clear:both"></div> - </div> - {% endfor %} - </div> - {% endif %} - {% endwith %} + {% with l_inds=indicators|dict_get:l %} + {% if l_inds|length >= 1 %} + <div class="index_lines to_add letter_section" id="sec_{{ l|upper }}"> + <div class="letter_title">{{ l|upper }}</div> + {% for ind in l_inds %} + <div class="index_line" index_id="{{ ind|dict_get:"id" }}"> + <div class="index_name">{{ ind|dict_get:"name" }}</div> + <div class="index_category"></div> + <div class="icon"></div> + <div style="clear:both"></div> + </div> + {% endfor %} + </div> + {% endif %} + {% endwith %} {% endfor %} {# end: display all indicators #} </div> <!-- end: index_letter_container --> {% endif %} {# end: page_condition == all #} @@ -154,7 +154,7 @@ <div class="index_title_container"> <div class="index_title">{{ selected_category.name }}</div> <div class="example_sheet"> - <a href="javascript:void(0)">仿真化验单</a> + <a href="{{ selected_category.description }}" class="thickbox" target="_blank">仿真化验单</a> </div> <div style="clear:both;"></div> </div> @@ -250,7 +250,7 @@ <div class="link_container"> <div class="status_link"> - <a href="{% url indicator_status %}">查看指标状态</a> + <a href="{% url indicator_status %}">完成并返回</a> </div> </div> {% endblock page %} diff --git a/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html b/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html index 5a6659f..362083b 100644 --- a/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html +++ b/97suifangqa/apps/indicator/templates/indicator/SheetDefault.html @@ -4,7 +4,7 @@ {% load divisible_by %} {% block title %} -指标状态 | 随访工具 | 97 随访 +指标状态 | 随访工具 | 医时代 {% endblock %} {% block css %} @@ -274,6 +274,9 @@ {% elif ind|dict_get:"dataType" == DATA_TYPES|dict_get:"PM_TYPE" %} {# PM_TYPE #} {# TODO #} + {% elif ind|dict_get:"dataType" == DATA_TYPES|dict_get:"KIND_TYPE" %} + {# KIND_TYPE #} + {# TODO #} {% else %} {# unknown TYPE #} {% endif %} {# end: DATA_TYPES #} @@ -289,17 +292,17 @@ <!-- TODO --> <div id="login_container"> <div class="logged-in" id="login"> - <img class="user-photo" alt="user_photo" src="{% static "images/userPhoto.jpg" %}" /> - <span class="number-block green-block user-level">6</span> + <!--img class="user-photo" alt="user_photo" src="{% static "images/userPhoto.jpg" %}" /> + <span class="number-block green-block user-level">6</span--> <span class="drop-down-area"> - <span class="user-name">username</span> - <img class="drop-down-menu-button" alt="" src="{% static "images/icon_down.png" %}" /> + <span class="user-name">isuifangqa</span> + <!--img class="drop-down-menu-button" alt="" src="{% static "images/icon_down.png" %}" /--> </span> <div class="drop-down-menu" tabindex="0" onblur="javascript:alert('blur');" onfocus="javascript:alert('focus')"> <div class="text-pointer"></div> <ul class="links"> - <li><a href="javascript:void(0)">修改密码</a></li> - <li><a href="javascript:void(0)">完善信息</a></li> + <!--li><a href="javascript:void(0)">修改密码</a></li> + <li><a href="javascript:void(0)">完善信息</a></li--> <li class="last"><a href="javascript:void(0)">退出</a></li> </ul> </div> @@ -308,7 +311,7 @@ <div id="right_container"> <div id="index_status_container"> - <div class="index_title">指标状态</div> + <div class="index_title">随访医学指标</div> {% comment %} <!-- 这里需要后端读取cookie,来判断用户是否已经点击大叉。 @@ -330,7 +333,7 @@ <div class="refer_range"> <span class="refer_text">{{ ind|dict_get:"ref_text" }}</span> <span class="refer_value">{{ ind|dict_get:"ref_value"|safe }}</span> - <span class="data_unit">{% if ind|dict_get:"std_unit_symbol" %}({{ ind|dict_get:"std_unit_symbol" }}){% endif %}</span> + <span class="data_unit">{% if ind|dict_get:"std_unit_symbol"%}{{ ind|dict_get:"std_unit_symbol"|safe}}{% endif %}</span> </div> <div class="edit_data"> @@ -342,7 +345,7 @@ <div class="last_edit_data" style="display: block;"> {% endif %} <span class="data_value">{{ ind|dict_get:"last_record"|dict_get:"value_html"|safe }}</span> - <span class="data_unit">{% if ind|dict_get:"std_unit_symbol" %}({{ ind|dict_get:"std_unit_symbol" }}){% endif %}</span> + <span class="data_unit">{% if ind|dict_get:"std_unit_symbol" %}{{ ind|dict_get:"std_unit_symbol" }}{% endif %}</span> </div> <img class="small_edit_icon" alt="edit_icon" src="{% static "images/pen.png" %}" /> <!-- explain_icon --> @@ -397,14 +400,18 @@ <input type="radio" id="plus_r" name="pm_data" value="+" /> <label for="plus_r">阳性(+)</label> </div> + {% elif ind|dict_get:"dataType" == DATA_TYPES|dict_get:"KIND_TYPE" %} + {# KIND_TYPE #} + TODO {% else %} {# UNKNOWN TYPE #} ERROR: unknown data type {% endif %} </div> - <div class="data_unit">{% if ind|dict_get:"std_unit_symbol" %}({{ ind|dict_get:"std_unit_symbol" }}){% endif %}</div> - <div class="confirm_edit_icon"></div> + <div class="data_unit">{% if ind|dict_get:"std_unit_symbol" %}{{ ind|dict_get:"std_unit_symbol" }}{% endif %}</div> <div class="cancel_edit_icon"></div> + <div class="confirm_edit_icon"></div> + <div style="clear:both;"></div> <div class="date"> <div class="datepicker_container"> @@ -435,7 +442,7 @@ <div class="card_bottom"> <div class="understand_index"><a class="thickbox" href="{% url indicator_indexdesc %}?card_id={{ ind|dict_get:"id" }}&url_type=html&no_title=true&TB_iframe=true&height=367&width=630">了解该指标</a></div> <!-- TODO --> - <div class="simulation_sheet"><a href="{% static "images/demo_sheet.png" %}" class="thickbox">仿真化验单</a></div> + <div class="simulation_sheet"><a href="http://image.97suifang.com/media/imgs/2013/10/21/%E4%B8%A4%E5%AF%B9%E5%8D%8A.jpg" class="thickbox">仿真化验单</a></div> <div class="detail_history"> <a href="javascript:void(0)">详细历史记录</a> </div> @@ -450,7 +457,7 @@ width参数为弹出层页面宽度+2, card_id参数为 "卡片id" {% endcomment %} - <a class="card_delete_icon card_delete thickbox" href="{% url indicator_deletecardtip %}?card_id={{ ind|dict_get:"id" }}&url_type=html&no_title=true&TB_iframe=true&height=166&width=630"></a> + <a class="card_delete_icon card_delete thickbox" href="{% url indicator_deletecardtip %}?card_id={{ ind|dict_get:"id" }}&url_type=html&no_title=true&TB_iframe=true&height=180&width=650"></a> </div> <!-- end: index_card --> {% endfor %} {# end: indicators #} diff --git a/97suifangqa/apps/indicator/templates/indicator/SideBar.html b/97suifangqa/apps/indicator/templates/indicator/SideBar.html index 95ad4e9..a545c94 100644 --- a/97suifangqa/apps/indicator/templates/indicator/SideBar.html +++ b/97suifangqa/apps/indicator/templates/indicator/SideBar.html @@ -2,12 +2,13 @@ {% load static from staticfiles %} {% block title %} -边栏 | 随访工具 | 97 随访 +边栏 | 随访工具 | 医时代 {% endblock %} {% block css %} <link rel="stylesheet" type="text/css" href="{% static "css/normalize.css" %}"/> <link rel="stylesheet" type="text/css" href="{% static "css/sidebar.css" %}"/> + <link rel="stylesheet" type="text/css" href="{% static "css/nav.css" %}"/> {% endblock %} {% block scripts %} @@ -16,13 +17,32 @@ {% block page %} <div id="sidebar_container"> + <!-- ====================== navigation ====================== --> - <div id="nav_container"> + <nav id="nav-ribbon" role="navigation"> + <div class="controls-wrap"> + <div class="head-background"></div> + <div class="links-wrap"> + <ul class="links inline"> + <li class="first"><a href="/blog/index" target="_blank">返回首页</a></li> + <!--li><a href="{% url list_blogs %}">知识库</a></li--> + <li><a href="/indicator/status" target="_blank">随访工具</a></li> + <!--li class="last"><a href="">我的花费</a></li--> + </ul> + </div> + <div class="tail">导航</div> + <div class="tail-cut"></div> + </div> +</nav> + + + + <!--div id="nav_container"> <div class="head-background"></div> <div class="hidden_navs"> <ul> - <li><a href="javascript:void(0)">首页</a></li> - <li><a href="javascript:void(0)">医学知识</a></li> + <li><a href="/blog">首页</a></li> + <li><a href="/indicator/status">随访工具</a></li> </ul> </div> <div class="default_nav"> @@ -30,37 +50,57 @@ <a href="javascript:void(0)">导航</a> </div> <div class="tail-cut"></div> - <div class="curr_nav">随访工具</div> - </div> + <!--div class="curr_nav">随访工具</div--> + <!--/div> </div> - <div class="clear"></div> + <div class="clear"></div--> <!-- ====================== compare ====================== --> <div id="compare_container"> - <div class="post-question"> + <!--div class="post-question"> <form action="" class="searchdiv" method="get"> <input type="text" value="" class="question" placeholder="在这里搜索关键词" name="q"> - <input type="submit" class="submit" value="提问"> + <input type="submit" class="submit" value="搜 索"> </form> - </div> + </div--> <div class="similar_container"> - <div class="vertical_bar_component"> + <!--div class="vertical_bar_component"> <img src="{% static "images/gradient_bar.png" %}" /> - </div> - <div class="similar_content"> + </div--> + <h3 style="font-szie:20px;margin-bottom:5px;">为您推荐临床治疗经验:</h3> + <div class="related-questions"> + <a href="/blog/2/" target="_blank">e抗原阳性慢乙肝患者接受聚乙二醇干扰素alfa治疗前哪些起始因素可以预测未来疗效好与坏</a><br><br> + <span>Gastroenterology 胃肠病学 推荐指数:78%</span> + </div> + + <div class="related-questions"> + <a href="">聚乙二醇干扰素alfa-2a治疗时,病毒和e抗原到底是谁更重要?还是应该结合地去看?</a><br><br> + <span>Hepatology 肝脏病学 推荐指数:74%</span> + </div> + + <div class="related-questions"> + <a href="/blog/3/" target="_blank">用聚乙二醇干扰素治疗B型与C型e抗原阳性慢乙肝患者时,哪些患者乙肝e抗原血清学转换几率低?和疗程和剂量有哪些关系?</a><br><br> + <span>Hepatology 肝脏病学 推荐指数:70%</span> + </div> + + </div> + + <!--div class="similar_content"> <div class="similar_title">经比对,下文中的被研究患者与您很像:</div> - <div class="specifix_content" id="specifix_content1"><div class="specifix_text">有 80% 的患者有感到头疼</div></div> + <div class="specifix_content" id="specifix_content1"><div class="specifix_text">聚乙二醇干扰素alfa-2a治疗e抗原(HBeAg)阳性慢乙肝患者时,e抗原与病毒(DNA)预测疗效</div></div> <div class="specifix_content" id="specifix_content2"><div class="specifix_text">有 10% 的患者有感到头疼并且也感觉到肌疼</div></div> <div class="specifix_content" id="specifix_content3"><div class="specifix_text">有 20% 的患者ALT到达过正常值</div></div> <div class="specifix_content" id="specifix_content4"><div class="specifix_text">有 3% 的患者有感到肌疼</div></div> + </div--> + </div> + <div class="clear"></div> + + <div> + <a href="/blog" target="_blank"><input type="submit" value="推荐更多" class="submit"></a> </div> - </div> - <div class="clear"></div> - <div class="compare_btn"> - <div class="compare_btn_in">比对文献</div> - </div> + <div class="logo_container"> - <img src="{% static "images/slilogo.png" %}" /> + <a href="../../blog/index" target="_blank"><img src="{% static "images/slilogo.png" %}" /></a> </div> </div> diff --git a/97suifangqa/apps/indicator/templates/indicator/index.html b/97suifangqa/apps/indicator/templates/indicator/index.html index 408ce67..57af738 100644 --- a/97suifangqa/apps/indicator/templates/indicator/index.html +++ b/97suifangqa/apps/indicator/templates/indicator/index.html @@ -2,7 +2,7 @@ {% load static from staticfiles %} {% block title %} -首页 | 随访工具 | 97 随访 +首页 | 随访工具 | 医时代 {% endblock %} {% block body %} diff --git a/97suifangqa/apps/indicator/templates/indicator/nav-ribbon.html b/97suifangqa/apps/indicator/templates/indicator/nav-ribbon.html new file mode 100644 index 0000000..bf8d690 --- /dev/null +++ b/97suifangqa/apps/indicator/templates/indicator/nav-ribbon.html @@ -0,0 +1,15 @@ +<nav id="nav-ribbon" role="navigation">
+ <div class="controls-wrap">
+ <div class="head-background"></div>
+ <div class="links-wrap">
+ <ul class="links inline">
+ <li class="first"><a href="/blog">首页</a></li>
+ <!--li><a href="{% url list_blogs %}">知识库</a></li-->
+ <li><a href="/indicator/status">随访工具</a></li>
+ <!--li class="last"><a href="">我的花费</a></li-->
+ </ul>
+ </div>
+ <div class="tail">导航</div>
+ <div class="tail-cut"></div>
+ </div>
+</nav>
\ No newline at end of file diff --git a/97suifangqa/apps/indicator/templates/indicator/popup/DeleteCardTip.html b/97suifangqa/apps/indicator/templates/indicator/popup/DeleteCardTip.html index 4bdac43..9859e0d 100644 --- a/97suifangqa/apps/indicator/templates/indicator/popup/DeleteCardTip.html +++ b/97suifangqa/apps/indicator/templates/indicator/popup/DeleteCardTip.html @@ -2,7 +2,7 @@ {% load static from staticfiles %} {% block title %} -取消关注卡片提示 | 随访工具 | 97 随访 +取消关注卡片提示 | 随访工具 | 医时代 {% endblock %} {% block css %} diff --git a/97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html b/97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html index efe8588..e310fab 100644 --- a/97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html +++ b/97suifangqa/apps/indicator/templates/indicator/popup/EditHistoryData.html @@ -3,7 +3,7 @@ {% load dict_get %} {% block title %} -编辑历史数据 | 随访工具 | 97 随访 +编辑历史数据 | 随访工具 | 医时代 {% endblock %} {% block css %} @@ -41,7 +41,8 @@ 'FLOAT_TYPE': '{{ indicator_obj.FLOAT_TYPE }}', 'RANGE_TYPE': '{{ indicator_obj.RANGE_TYPE }}', 'FLOAT_RANGE_TYPE': '{{ indicator_obj.FLOAT_RANGE_TYPE }}', - 'PM_TYPE': '{{ indicator_obj.PM_TYPE }}' + 'PM_TYPE': '{{ indicator_obj.PM_TYPE }}', + 'KIND_TYPE': '{{ indicator_obj.KIND_TYPE }}' }; var data_type = '{{ indicator_obj.dataType }}'; // indicator record @@ -64,7 +65,7 @@ <div class="refer_range"> <span class="refer_text">{{ indicator_dict|dict_get:"ref_text" }}</span> <span class="refer_value">{{ indicator_dict|dict_get:"ref_value"|safe }}</span> - <span class="data_unit">{% if indicator_dict|dict_get:"std_unit_symbol" %}({{ indicator_dict|dict_get:"std_unit_symbol" }}){% endif %}</span> + <span class="data_unit">{% if indicator_dict|dict_get:"std_unit_symbol" %}{{ indicator_dict|dict_get:"std_unit_symbol" }}{% endif %}</span> </div> <div class="edit_data"> <div class="date"> @@ -73,8 +74,8 @@ </div> <div class="data"> <span class="prompt">结果</span> - <span class="data_value">{{ record_dict|dict_get:"value_html"|safe }}</span> - <span class="data_unit">{% if record_dict|dict_get:"unit_symbol" %}({{ record_dict|dict_get:"unit_symbol" }}){% endif %}</span> + <span class="data_value">{{ record_dict|dict_get:"value_html"|safe }} </span> + <span class="data_unit">{% if record_dict|dict_get:"unit_symbol" %}{{ record_dict|dict_get:"unit_symbol" }}{% endif %}</span> </div> <div class="state"> <span class="prompt">状态</span> @@ -91,7 +92,19 @@ </div> <input type="button" id="edit_btn" value="修改记录" /> <input type="button" id="delete_btn" value="删除记录" /> + <div style="clear:both;"></div> </div> + + <div class="delete_prompt" style="display:none;"> + <div class="prompt_btns" id="cancel_delete_btn"> + <img alt="cancel_delete" src="{% static "images/cancel_edit.png" %}" /> + </div> + <div class="prompt_btns" id="confirm_delete_btn"> + <img alt="confirm_delete" src="{% static "images/confirm_edit.png" %}" /> + </div> + <div class="prompt">确认删除该记录?</div> + </div> + <div class="editing_data"> {% csrf_token %} <div class="date"> @@ -102,6 +115,7 @@ </div> </div> <div class="data data_type_{{ indicator_obj.dataType }}"> + <div class="prompt">修改记录</div> {% if indicator_obj.dataType == indicator_obj.INTEGER_TYPE %} {# INTEGER_TYPE #} @@ -123,12 +137,15 @@ <input type="radio" id="plus_r" name="pm_data" value="+" /> <label for="plus_r">阳性(+)</label> </div> + {% elif indicator_obj.dataType == indicator_obj.KIND_TYPE %} + {# KIND_TYPE #} + TODO {% else %} {# UNKNOWN TYPE #} ERROR: unknown data type {% endif %} </div> - <div class="data_unit">{% if record_dict|dict_get:"unit_symbol" %}({{ record_dict|dict_get:"unit_symbol" }}){% endif %}</div> + <div class="data_unit">{% if record_dict|dict_get:"unit_symbol" %}{{ record_dict|dict_get:"unit_symbol" }}{% endif %}</div> <div class="reason"> <div class="prompt">修改原因</div> <input class="reason_input to_validate" type="text" value="" /> diff --git a/97suifangqa/apps/indicator/templates/indicator/popup/IndexDesc.html b/97suifangqa/apps/indicator/templates/indicator/popup/IndexDesc.html index 0d3f62c..0b5f708 100644 --- a/97suifangqa/apps/indicator/templates/indicator/popup/IndexDesc.html +++ b/97suifangqa/apps/indicator/templates/indicator/popup/IndexDesc.html @@ -2,7 +2,7 @@ {% load static from staticfiles %} {% block title %} -指标注释 | 随访工具 | 97 随访 +指标注释 | 随访工具 | 医时代 {% endblock %} {% block css %} @@ -68,6 +68,18 @@ {% block page %} <div id="index_desc_container"> + <!-- 直接使用 indicator 的 description 信息 --> + <div class="index_desc_title_line"> + <div class="index_desc_title"> + {{ indicator.name }} + </div> + <div class="index_desc_close"></div> + </div> + <div class="index_desc_content"> + {{ indicator.description|safe }} + </div> + <!-- 使用与 indicator 关联的 annotation 来提供详情 --> + {% comment %} <div class="index_desc_title_line"> <div class="index_desc_title"> {% if annotation_not_found %} @@ -85,6 +97,7 @@ {{ annotation.detail|safe }} {% endif %} </div> + {% endcomment %} <div class="collection" id="collection_btn"> {% if is_collected %} 点击取消收藏 (已有{{ collected_times }}人收藏) @@ -92,9 +105,9 @@ 收藏该注释 (已有{{ collected_times }}人收藏) {% endif %} </div> - <div class="go_library"> + <!--div class="go_library"> <input type="button" class="go_library_btn" value="前往医学知识库" /> - </div> + </div--> </div> {% endblock page %} diff --git a/97suifangqa/apps/indicator/templates/indicator/show_indicator.html b/97suifangqa/apps/indicator/templates/indicator/show_indicator.html index 0ecd027..ea70b26 100644 --- a/97suifangqa/apps/indicator/templates/indicator/show_indicator.html +++ b/97suifangqa/apps/indicator/templates/indicator/show_indicator.html @@ -32,6 +32,10 @@ <td>{{ object.addByUser.username }}</td> </tr> <tr> + <td>type:</td> + <td>{{ object.type }}</td> + </tr> + <tr> <td>categories_name:</td> <td> {% for c in object.categories.all %} diff --git a/97suifangqa/apps/indicator/templates/indicator/show_record.html b/97suifangqa/apps/indicator/templates/indicator/show_record.html index 49c7918..14a3671 100644 --- a/97suifangqa/apps/indicator/templates/indicator/show_record.html +++ b/97suifangqa/apps/indicator/templates/indicator/show_record.html @@ -44,6 +44,10 @@ <td>{{ object.val_min }}</td> </tr> <tr> + <td>kind:</td> + <td>{{ object.kind }}</td> + </tr> + <tr> <td>notes:</td> <td>{{ object.notes }}</td> </tr> diff --git a/97suifangqa/apps/indicator/tools.py b/97suifangqa/apps/indicator/tools.py index 1a9e6ab..781a843 100644 --- a/97suifangqa/apps/indicator/tools.py +++ b/97suifangqa/apps/indicator/tools.py @@ -15,6 +15,25 @@ import re import datetime +# types of recommended indicators, and weights {{{ +RI_TYPES = { + 'ANNOTATION_COLLECTED': u'ANN_CL', + 'BLOG_CATCHED': u'BLG_CT', + 'BLOG_COLLECTED': u'BLG_CL', + 'OTHER': u'OTHER', + 'ERROR': u'ERROR', # no 'RelatedIndicator' data +} +RI_WEIGHTS = { + RI_TYPES['ANNOTATION_COLLECTED']: 4.0, + RI_TYPES['BLOG_CATCHED']: 3.0, + RI_TYPES['BLOG_COLLECTED']: 2.0, + RI_TYPES['OTHER']: 1.0, + RI_TYPES['ERROR']: 0.0, +} +# }}} + + + # follow_indicator {{{ def follow_indicator(user_id, indicator_id): """ @@ -23,6 +42,10 @@ def follow_indicator(user_id, indicator_id): try: user = get_object_or_404(User, id=user_id) indicator = im.Indicator.objects.get(id=indicator_id) + # check the type of indicator + if indicator.type != im.Indicator.NORMAL_TYPE: + return False + # ui, created = im.UserIndicator.objects.get_or_create(user=user) ui.followedIndicators.add(indicator) # to remove the indicator from 'followedHistories' if exists @@ -55,7 +78,7 @@ def unfollow_indicator(user_id, indicator_id): # get_indicator {{{ -def get_indicator(category_id="all", startswith="all"): +def get_indicator(category_id="all", startswith="all", type="all"): """ 根据指定的 category_id 和 startswith 获取 indicator 返回一个 dict @@ -69,17 +92,23 @@ def get_indicator(category_id="all", startswith="all"): _idict = {} if category_id == 'all': - iqueryset = im.Indicator.objects.all() + if type == 'all': + iqueryset = im.Indicator.objects.all() + else: + iqueryset = im.Indicator.objects.filter(type=type) else: try: cid = int(category_id) cate = im.IndicatorCategory.objects.get(id=cid) - iqueryset = cate.indicators.all() + if type == 'all': + iqueryset = cate.indicators.all() + else: + iqueryset = cate.indicators.filter(type=type) except ValueError: - raise ValueError(u'category_id 不是整数型') + raise ValueError(u'Error: category_id 不是整数型') return _idict except im.IndicatorCategory.DoesNotExist: - raise ValueError(u'id=%s 的 IndicatorCategory 不存在' + raise ValueError(u'Error: IndicatorCategory(id=%s) 不存在' % cid) return _idict @@ -116,7 +145,7 @@ def get_followed_indicator(user_id, category_id="all", startswith="all"): cid = int(category_id) iqueryset = iqueryset.filter(categories__id=cid) except ValueError: - raise ValueError(u'category_id 不是整数型') + raise ValueError(u'Error: category_id 不是整数型') return _idict if startswith == 'all': @@ -140,6 +169,8 @@ def get_unfollowed_indicator(user_id, category_id="all", startswith="all"): """ 获取未关注的指标 返回 dict, 格式与 get_indicator() 一致 + + 只考虑 NORMAL_TYPE 的指标 """ u = User.objects.get(id=user_id) @@ -147,13 +178,15 @@ def get_unfollowed_indicator(user_id, category_id="all", startswith="all"): ui.save() _idict = {} # XXX: if 'exclude(followed_indicators=ui)' OK?? - iqueryset = im.Indicator.objects.exclude(followed_indicators=ui) + iqueryset = im.Indicator.objects.\ + filter(type=im.Indicator.NORMAL_TYPE).\ + exclude(followed_indicators=ui) if not category_id == 'all': try: cid = int(category_id) iqueryset = iqueryset.filter(categories__id=cid) except ValueError: - raise ValueError(u'category_id 不是整数型') + raise ValueError(u'Error: category_id 不是整数型') return _idict if startswith == 'all': @@ -448,24 +481,6 @@ def add_recordhistory(user_id, record_id, reason, created_at=None): # }}} -# types of recommended indicators, and weights {{{ -RI_TYPES = { - 'ANNOTATION_COLLECTED': u'ANN_CL', - 'BLOG_CATCHED': u'BLG_CT', - 'BLOG_COLLECTED': u'BLG_CL', - 'OTHER': u'OTHER', - 'ERROR': u'ERROR', # no 'RelatedIndicator' data -} -RI_WEIGHTS = { - RI_TYPES['ANNOTATION_COLLECTED']: 4.0, - RI_TYPES['BLOG_CATCHED']: 3.0, - RI_TYPES['BLOG_COLLECTED']: 2.0, - RI_TYPES['OTHER']: 1.0, - RI_TYPES['ERROR']: 0.0, -} -# }}} - - # calc_indicator_weight {{{ def calc_indicator_weight(user_id, indicator_id): """ @@ -533,11 +548,13 @@ def recommend_indicator(user_id, number=1, auto_follow=False): """ user_id = int(user_id) number = int(number) - # get unfollowed indicators + ## get unfollowed indicators (only 'NORMAL_TYPE' indicators) u = User.objects.get(id=user_id) ui, created = im.UserIndicator.objects.get_or_create(user=u) # XXX: is 'exclude(followed_indicators=ui)' OK?? - uf_ind_qs = im.Indicator.objects.exclude(followed_indicators=ui) + uf_ind_qs = im.Indicator.objects.\ + filter(type=im.Indicator.NORMAL_TYPE).\ + exclude(followed_indicators=ui) # calc weight for each unfollowed indicator weights = [] for ind in uf_ind_qs: @@ -567,7 +584,12 @@ def recommend_indicator(user_id, number=1, auto_follow=False): # format_data {{{ -def format_data(indicator_obj, value=None, val_max=None, val_min=None, type="html"): +def format_data(indicator_obj, + value=None, + val_max=None, + val_min=None, + kind=None, + type="html"): """ format given data according to the dataType of given Indicator, make it proper for django templates @@ -688,6 +710,13 @@ def format_data(indicator_obj, value=None, val_max=None, val_min=None, type="htm else: value_str = u'%s %s %s' % (val_min_str, range_sym_text, val_max_str) + elif kind is not None: + # KIND_TYPE + if (dataType == ind.KIND_TYPE) and\ + isinstance(kind, im.ValueKind): + value_str = u'%s' % kind.name + else: + value_str = u'' else: # other type?? return None diff --git a/97suifangqa/apps/indicator/urls.py b/97suifangqa/apps/indicator/urls.py index fe0fcdb..4c30d44 100644 --- a/97suifangqa/apps/indicator/urls.py +++ b/97suifangqa/apps/indicator/urls.py @@ -158,6 +158,12 @@ urlpatterns += patterns('indicator.views', ## recommend indicator url(r'^recommend/indicator/(?P<number>\d+)/$', 'recommend_indicator_view', name='recommend_indicator'), +) + + +## for forms.py (not updated) +""" +urlpatterns += patterns('indicator.views_forms', ## add/edit category url(r'^add/category/$', 'add_edit_category', name='add_category'), @@ -188,7 +194,7 @@ urlpatterns += patterns('indicator.views', 'add_recordhistory_view', name='add_recordhistory_view'), ) - +""" urlpatterns += patterns('', ## done diff --git a/97suifangqa/apps/indicator/views.py b/97suifangqa/apps/indicator/views.py index d317277..5f1d5d2 100644 --- a/97suifangqa/apps/indicator/views.py +++ b/97suifangqa/apps/indicator/views.py @@ -5,6 +5,7 @@ apps/indicator views """ +from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, Http404 from django.shortcuts import render, get_object_or_404 @@ -16,7 +17,6 @@ from django.template import RequestContext from haystack.query import SearchQuerySet from indicator import models as im -from indicator.forms import * from indicator.tools import * from sciblog import models as sm @@ -37,6 +37,8 @@ except ImportError: +########################################################### + def get_indicator_view(request, **kwargs): idict = get_indicator(**kwargs) return HttpResponse("%s" % idict) @@ -88,308 +90,6 @@ def get_record_view(request, indicator_id, date_range, **kwargs): # }}} - -########################################################### -###### forms ###### - -## add_edit_category # {{{ -@login_required -def add_edit_category(request, category_id=None, template='indicator/simple.html'): - """ - add/edit category: 'models.IndicatorCategory' - for 'staff' or 'normal user' - """ - # get or create model instance - if category_id: - category_id = int(category_id) - category = get_object_or_404(im.IndicatorCategory, - id=category_id) - action = 'Edit' - # check the user - # 'staff' can edit all data; - # normal users can only edit their own. - if category.addByUser != request.user and ( - not request.user.is_staff): - return HttpResponseForbidden() - else: - category = im.IndicatorCategory(addByUser=request.user) - action = 'Add' - - if request.method == 'POST': - form = IndicatorCategoryForm(request.POST, instance=category) - if form.is_valid(): - # form posted and valid - # save form to create/update the model instance - form.save() - # redirect url, avoid page reload/refresh - return HttpResponseRedirect('/indicator/done/') - else: - # form with data of the specified instance - form = IndicatorCategoryForm(instance=category) - - return render(request, template, { - 'object': 'IndicatorCategory', - 'action': action, - 'form': form, - }) -# }}} - - -# add_edit_indicator # {{{ -@login_required -def add_edit_indicator(request, indicator_id=None, template='indicator/simple.html'): - """ - add/edit indicator: 'models.Indicator' - for 'staff' or 'normal user' - """ - if indicator_id: - indicator_id = int(indicator_id) - indicator = get_object_or_404(im.Indicator, - id=indicator_id) - action = 'Edit' - # check the user - # 'staff' can edit all data; - # normal users can only edit their own. - if indicator.addByUser != request.user and ( - not request.user.is_staff): - return HttpResponseForbidden() - else: - indicator = im.Indicator(addByUser=request.user) - action = 'Add' - - if request.method == 'POST': - form = IndicatorForm(request.POST, instance=indicator) - if form.is_valid(): - # form posted and valid - form.save() - # redirect url, avoid page reload/refresh - return HttpResponseRedirect('/indicator/done/') - else: - # form with instance - form = IndicatorForm(instance=indicator) - - return render(request, template, { - 'object': 'Indicator', - 'action': action, - 'form': form, - }) -# }}} - - -## add_edit_unit {{{ -@login_required -def add_edit_unit(request, unit_id=None, template='indicator/simple.html'): - """ - add unit for indicator - """ - if unit_id: - unit_id = int(unit_id) - unit = get_object_or_404(im.Unit, id=unit_id) - action = 'Edit' - # check the user - # 'staff' can edit all data; - # normal users can only edit their own. - if unit.addByUser != request.user and ( - not request.user.is_staff): - return HttpResponseForbidden() - else: - unit = im.Unit(addByUser=request.user) - action = 'Add' - - if request.method == 'POST': - form = UnitForm(request.POST, instance=unit) - if form.is_valid(): - # form posted and valid - form.save() - # redirect url, avoid page reload/refresh - return HttpResponseRedirect('/indicator/done/') - else: - # form with instance - form = UnitForm(instance=unit) - - return render(request, template, { - 'object': 'Unit', - 'action': action, - 'form': form, - }) -# }}} - - -## add_edit_confine {{{ -@login_required -def add_edit_confine(request, confine_id=None, template='indicator/simple.html'): - """ - InnateConfine - add confines for indicator - """ - if confine_id: - confine_id = int(confine_id) - confine = get_object_or_404(im.InnateConfine, id=confine_id) - action = 'Edit' - # check the user - # 'staff' can edit all data; - # normal users can only edit their own. - if confine.addByUser != request.user and ( - not request.user.is_staff): - return HttpResponseForbidden() - else: - confine = im.InnateConfine(addByUser=request.user) - action = 'Add' - - if request.method == 'POST': - form = InnateConfineForm(request.POST, instance=confine) - if form.is_valid(): - # form posted and valid - form.save() - # redirect url, avoid page reload/refresh - return HttpResponseRedirect('/indicator/done/') - else: - # form with instance - form = InnateConfineForm(instance=confine) - - return render(request, template, { - 'object': 'InnateConfine', - 'action': action, - 'form': form, - }) -# }}} - - -## add_edit_record {{{ -@login_required -def add_edit_record(request, record_id=None, template='indicator/simple.html'): - """ - add/edit 'IndicatorRecord' - - staff 能自由地修改所有的记录,并且无需填写"修改原因"; - 普通用户只能修改自己的记录,而且必须填写"修改原因" -> RecordHistory - - TODO: - * 当用户选择好"indicator"后,重新筛选"unit",只提供与"indicator" - 对应的"unit"供选择; - * 对"普通用户"增加限制,修改数据"记录"时必须同时提交"修改原因", - 对应模型"RecordHistory"。 - """ - if record_id: - record_id = int(record_id) - record = get_object_or_404(im.IndicatorRecord, id=record_id) - action = 'Edit' - # check the user - if request.user.is_staff: - # 'staff' can edit all data; - pass - elif request.user == record.user: - # user modify the record - return HttpResponse("Not finished yet ...") - #return modify_record(request, record_id) - else: - return HttpResponseForbidden() - else: - record = im.IndicatorRecord(user=request.user) - action = 'Add' - - if request.method == 'POST': - form = IndicatorRecordForm(request.POST, instance=record) - if form.is_valid(): - #raise ValueError - form.save() - # redirect url, avoid page reload/refresh - return HttpResponseRedirect('/indicator/done/') - else: - # form with instance - form = IndicatorRecordForm(instance=record) - - return render(request, template, { - 'object': 'IndicatorRecord', - 'action': action, - 'form': form, - }) -# }}} - - -## modify_record {{{ -@login_required -def modify_record(request, record_id=None, template='indicator/simple.html'): - """ - modify an existing IndicatorRecord - - TODO: - a new 'RecordHistory' is added to record the modification reason - and backup the original data - """ - if record_id: - record_id = int(record_id) - record = get_object_or_404(im.IndicatorRecord, id=record_id) - action = 'Edit' - # check the user - if request.user.is_staff: - # 'staff' can edit all data; - return add_edit_record(request, record_id) - elif request.user == record.user: - # user modify the record - action = 'Modify' - pass - else: - return HttpResponseForbidden() - else: - return add_edit_record(request) - - if request.method == 'POST': - form = IndicatorRecordForm(request.POST, instance=record) - if form.is_valid(): - # form posted and valid - # TODO - raise ValueError(u"该功能尚未完整实现") - form.save() - # redirect url, avoid page reload/refresh - return HttpResponseRedirect('/indicator/done/') - else: - # form with instance - form = IndicatorRecordForm(instance=record) - - return render(request, template, { - 'object': 'IndicatorRecord', - 'action': action, - 'form': form, - }) -## }}} - - -## add_recordhistory_view {{{ -@login_required -def add_recordhistory_view(request, record_id, template='indicator/simple.html'): - """ - add 'RecordHistory' for a record by given - - 'staff' should use the 'admin' interface. - """ - record_id = int(record_id) - record = get_object_or_404(im.IndicatorRecord, id=record_id) - recordhistory = im.RecordHistory(indicatorRecord=record) - action = 'Add' - # check the user - if request.user != record.user: - return HttpResponseForbidden() - - if request.method == 'POST': - form = RecordHistoryForm(request.POST, instance=recordhistory) - if form.is_valid(): - # form posted and valid - form.save() - # redirect url, avoid page reload/refresh - return HttpResponseRedirect('/indicator/done/') - else: - # form with instance - form = RecordHistoryForm(instance=recordhistory) - - return render(request, template, { - 'object': 'RecordHistory', - 'action': action, - 'form': form, - }) -# }}} - - ########################################################### ###### indicator UI pages ###### # indicator/index.html {{{ @@ -425,7 +125,7 @@ def indicator_status(request): * how to deal with non-standard units """ # period between two recommendation of indicators (default 40 days) - recommend_period = 40 + recommend_period = getattr(settings, 'INDICATOR_RECOMMEND_PERIOD', 40) # template = 'indicator/SheetDefault.html' letters = map(chr, range(ord('a'), ord('z')+1)) @@ -526,7 +226,7 @@ def indicator_status(request): ind_obj = get_object_or_404(im.Indicator, id=ind['id']) # check if 'indicator.is_ready()' if not ind_obj.is_ready(): - raise ValueError(u"Indicator id=%s is NOT ready yet!" + raise ValueError(u"Error: Indicator id=%s is NOT ready yet!" % ind_obj.id) # the indicator is ready dataType = ind_obj.dataType @@ -557,6 +257,13 @@ def indicator_status(request): # std_unit ind['std_unit_name'] = u"" ind['std_unit_symbol'] = u"" + elif dataType == ind_obj.KIND_TYPE: + # KIND_TYPE + ind['ref_text'] = u"参考值" + ind['ref_value'] = confine.get('kind_norm').get('name') + ind['math_range_html'] = None + ind['std_unit_name'] = u"" + ind['std_unit_symbol'] = u"" else: ind['ref_text'] = u"参考" ind['ref_value'] = None @@ -592,6 +299,10 @@ def indicator_status(request): type="html") else: value_html = None + elif dataType == ind_obj.KIND_TYPE: + # KIND_TYPE + value_html = format_data(ind_obj, + kind=last_record.kind, type="html") else: # unknow value_html = None @@ -607,11 +318,12 @@ def indicator_status(request): # dataType DATA_TYPES = { - 'INTEGER_TYPE': im.Indicator.INTEGER_TYPE, - 'FLOAT_TYPE': im.Indicator.FLOAT_TYPE, - 'RANGE_TYPE': im.Indicator.RANGE_TYPE, + 'INTEGER_TYPE': im.Indicator.INTEGER_TYPE, + 'FLOAT_TYPE': im.Indicator.FLOAT_TYPE, + 'RANGE_TYPE': im.Indicator.RANGE_TYPE, 'FLOAT_RANGE_TYPE': im.Indicator.FLOAT_RANGE_TYPE, - 'PM_TYPE': im.Indicator.PM_TYPE, + 'PM_TYPE': im.Indicator.PM_TYPE, + 'KIND_TYPE': im.Indicator.KIND_TYPE, } # datatypes of indicators (for js) datatypes = {} @@ -628,11 +340,12 @@ def indicator_status(request): # confines confine = ind_obj.get_confine() confines['id%d'%id] = { - 'human_min': confine.get('human_min'), - 'human_max': confine.get('human_max'), - 'math_min': confine.get('math_min'), - 'math_max': confine.get('math_max'), - 'val_norm': confine.get('val_norm'), + 'human_min': confine.get('human_min'), + 'human_max': confine.get('human_max'), + 'math_min': confine.get('math_min'), + 'math_max': confine.get('math_max'), + 'val_norm': confine.get('val_norm'), + 'kind_name': confine.get('kind_norm').get('name', None), 'math_range_html': ind['math_range_html'], } @@ -664,9 +377,8 @@ def indicator_fanduf(request): template = 'indicator/NewDeleteIndex.html' letters = map(chr, range(ord('a'), ord('z')+1)) - # get 7 categories (page can only contains 1+7 categories) - categories = im.IndicatorCategory.objects.all().\ - order_by('id')[:7] + # get categories + categories = im.IndicatorCategory.objects.all().order_by('id') # set default value for 'selected_cat*' selected_catid = None selected_category = None @@ -692,9 +404,11 @@ def indicator_fanduf(request): selected_category = get_object_or_404( im.IndicatorCategory, id=selected_catid) page_condition = "category" - # get indicators of the category + # get indicators of the category (only 'NORMAL_TYPE') + # order by 'pinyin' indicators = selected_category.indicators.\ - all().order_by('pinyin') + filter(type=im.Indicator.NORMAL_TYPE).\ + order_by('pinyin') # page_condition: "search" # can override the above 'category' if 'tab' & 'kw' both exist if 'kw' in request.GET: @@ -730,7 +444,9 @@ def indicator_fanduf(request): # all indicators if page_condition == "all": # get indicators, P[inyin] dict format - indicators = get_indicator() + indicators = get_indicator( + type=im.Indicator.NORMAL_TYPE, + category_id="all", startswith="all") # get followed indicator, P[inyin] dict format followed_indicators_pdict = get_followed_indicator(request.user.id) @@ -818,12 +534,13 @@ def indicator_edithistorydata(request): # generate 'indicator_dict' and 'record_dict' # {{{ # check if 'indicator.is_ready()' if not ind_obj.is_ready(): - print u"Indicator id=%s is NOT ready yet!" % ind_obj.id + print u"Error: Indicator id=%s is NOT ready yet!" % ind_obj.id # the indicator is ready dataType = ind_obj.dataType # confine confine = ind_obj.get_confine() confine_val_norm = confine.get('val_norm') + confine_kind_norm_name = confine.get('kind_norm').get('name') confine_human_min = confine.get('human_min') confine_human_max = confine.get('human_max') confine_math_min = confine.get('math_min') @@ -833,6 +550,7 @@ def indicator_edithistorydata(request): # record data record_data_std = record_obj.get_data_std() record_value = record_data_std['value'] + record_kind_name = record_data_std.get('kind').get('name') record_val_min = record_data_std['val_min'] record_val_max = record_data_std['val_max'] record_unit_name = record_data_std.get('unit').get('name') @@ -892,6 +610,15 @@ def indicator_edithistorydata(request): type="html") record_value_text = format_data(ind_obj, value=record_value, type="text") + elif dataType == im.Indicator.KIND_TYPE: + # KIND_TYPE + ref_text = u"参考值" + ref_value = confine_kind_norm_name + confine_math_range_html = None + std_unit_name = None + std_unit_symbol = None + record_value_html = record_kind_name + record_value_text = record_kind_name else: ref_text = u"参考" ref_value = None @@ -909,6 +636,7 @@ def indicator_edithistorydata(request): 'math_min': confine_math_min, 'math_max': confine_math_max, 'val_norm': confine_val_norm, + 'kind_norm_name': confine_kind_norm_name, 'math_range_html': confine_math_range_html, } ind_dict = { @@ -922,6 +650,7 @@ def indicator_edithistorydata(request): 'value_html': record_value_html, 'value_text': record_value_text, 'value': record_value, + 'kind_name': record_kind_name, 'val_min': record_val_min, 'val_max': record_val_max, 'unit_name': record_unit_name, @@ -980,7 +709,7 @@ def indicator_indexdesc(request): annotation = related_annotations[0].annotation collected_times = len(annotation.collected_by.all()) is_collected = annotation.is_collected_by(request.user) - # TODO + ## TODO #annotation_url = annotation.get_absolute_url() else: annotation_not_found = True @@ -1100,6 +829,8 @@ def ajax_add_record(request): value=value, val_min=val_min, val_max=val_max, + # TODO: 'KIND_TYPE' support to be implemented + kind=None, notes=u"" ) if new_record.is_valid(): @@ -1348,6 +1079,9 @@ def ajax_get_card_data_chart(request): elif dataType == im.Indicator.PM_TYPE: # TODO pass + elif dataType == im.Indicator.KIND_TYPE: + # TODO + pass else: print u'Error: unknow dataType' data = {'failed': True} @@ -1511,6 +1245,10 @@ def ajax_get_card_data_table(request): # TODO r['value_html'] = "" pass + elif dataType == im.Indicator.KIND_TYPE: + # TODO + r['value_html'] = "" + pass else: print u'Error: unknow dataType' data = {'failed': True} @@ -1548,8 +1286,10 @@ def ajax_search_indicators(request): 'error_string': 'blank_keyword'} else: # TODO: howto order_by() by 'pinyin' + # XXX: only return 'NORMAL_TYPE' indicators sqs = SearchQuerySet().models(im.Indicator).\ - filter(content=search_kw) + filter(content=search_kw).\ + filter(type=im.Indicator.NORMAL_TYPE) if sqs: # search result not empty inds_unsort = [ind.dump() |