├── .gitignore ├── INSTALL.md ├── README.md ├── __init__.py ├── conf ├── Framework.sql ├── apache.conf ├── app.js └── conf.py ├── config.json ├── core ├── .no_timestamps ├── README.md ├── __init__.py ├── doctype │ ├── __init__.py │ ├── bulk_email │ │ ├── README.md │ │ ├── __init__.py │ │ ├── bulk_email.py │ │ └── bulk_email.txt │ ├── comment │ │ ├── README.md │ │ ├── __init__.py │ │ ├── comment.py │ │ ├── comment.txt │ │ └── test_comment.py │ ├── communication │ │ ├── README.md │ │ ├── __init__.py │ │ ├── communication.js │ │ ├── communication.py │ │ └── communication.txt │ ├── control_panel │ │ ├── README.md │ │ ├── __init__.py │ │ ├── control_panel.py │ │ └── control_panel.txt │ ├── custom_field │ │ ├── README.md │ │ ├── __init__.py │ │ ├── custom_field.js │ │ ├── custom_field.py │ │ └── custom_field.txt │ ├── custom_script │ │ ├── README.md │ │ ├── __init__.py │ │ ├── custom_script.py │ │ └── custom_script.txt │ ├── customize_form │ │ ├── README.md │ │ ├── __init__.py │ │ ├── customize_form.js │ │ ├── customize_form.py │ │ └── customize_form.txt │ ├── customize_form_field │ │ ├── __init__.py │ │ ├── customize_form_field.py │ │ └── customize_form_field.txt │ ├── default_home_page │ │ ├── __init__.py │ │ ├── default_home_page.py │ │ └── default_home_page.txt │ ├── defaultvalue │ │ ├── README.md │ │ ├── __init__.py │ │ ├── defaultvalue.py │ │ └── defaultvalue.txt │ ├── docfield │ │ ├── README.md │ │ ├── __init__.py │ │ ├── docfield.py │ │ └── docfield.txt │ ├── docperm │ │ ├── README.md │ │ ├── __init__.py │ │ ├── docperm.py │ │ └── docperm.txt │ ├── doctype │ │ ├── README.md │ │ ├── __init__.py │ │ ├── doctype.js │ │ ├── doctype.py │ │ ├── doctype.txt │ │ └── doctype_template.py │ ├── event │ │ ├── README.md │ │ ├── __init__.py │ │ ├── event.js │ │ ├── event.py │ │ ├── event.txt │ │ └── event_calendar.js │ ├── event_role │ │ ├── README.md │ │ ├── __init__.py │ │ ├── event_role.py │ │ └── event_role.txt │ ├── event_user │ │ ├── README.md │ │ ├── __init__.py │ │ ├── event_user.py │ │ └── event_user.txt │ ├── file_data │ │ ├── README.md │ │ ├── __init__.py │ │ ├── file_data.py │ │ └── file_data.txt │ ├── letter_head │ │ ├── README.md │ │ ├── __init__.py │ │ ├── letter_head.js │ │ ├── letter_head.py │ │ ├── letter_head.txt │ │ └── test_letter_head.py │ ├── module_def │ │ ├── README.md │ │ ├── __init__.py │ │ ├── module_def.py │ │ └── module_def.txt │ ├── notification_count │ │ ├── __init__.py │ │ ├── notification_count.py │ │ └── notification_count.txt │ ├── page │ │ ├── README.md │ │ ├── __init__.py │ │ ├── page.py │ │ └── page.txt │ ├── page_role │ │ ├── README.md │ │ ├── __init__.py │ │ ├── page_role.py │ │ └── page_role.txt │ ├── patch_log │ │ ├── README.md │ │ ├── __init__.py │ │ ├── patch_log.py │ │ └── patch_log.txt │ ├── print_format │ │ ├── README.md │ │ ├── __init__.py │ │ ├── print_format.js │ │ ├── print_format.py │ │ ├── print_format.txt │ │ └── styles │ │ │ ├── classic.css │ │ │ ├── modern.css │ │ │ └── standard.css │ ├── profile │ │ ├── README.md │ │ ├── __init__.py │ │ ├── profile.css │ │ ├── profile.js │ │ ├── profile.py │ │ ├── profile.txt │ │ └── test_profile.py │ ├── property_setter │ │ ├── README.md │ │ ├── __init__.py │ │ ├── property_setter.js │ │ ├── property_setter.py │ │ └── property_setter.txt │ ├── report │ │ ├── README.md │ │ ├── __init__.py │ │ ├── report.js │ │ ├── report.py │ │ └── report.txt │ ├── role │ │ ├── README.md │ │ ├── __init__.py │ │ ├── role.js │ │ ├── role.py │ │ ├── role.txt │ │ └── test_role.py │ ├── scheduler_log │ │ ├── README.md │ │ ├── __init__.py │ │ ├── scheduler_log.py │ │ └── scheduler_log.txt │ ├── tag │ │ ├── __init__.py │ │ ├── tag.py │ │ └── tag.txt │ ├── todo │ │ ├── README.md │ │ ├── __init__.py │ │ ├── todo.py │ │ └── todo.txt │ ├── userrole │ │ ├── README.md │ │ ├── __init__.py │ │ ├── userrole.py │ │ └── userrole.txt │ ├── workflow │ │ ├── README.md │ │ ├── __init__.py │ │ ├── workflow.js │ │ ├── workflow.py │ │ └── workflow.txt │ ├── workflow_action │ │ ├── README.md │ │ ├── __init__.py │ │ ├── workflow_action.py │ │ └── workflow_action.txt │ ├── workflow_document_state │ │ ├── README.md │ │ ├── __init__.py │ │ ├── workflow_document_state.py │ │ └── workflow_document_state.txt │ ├── workflow_state │ │ ├── README.md │ │ ├── __init__.py │ │ ├── test_workflow_state.py │ │ ├── workflow_state.py │ │ └── workflow_state.txt │ └── workflow_transition │ │ ├── README.md │ │ ├── __init__.py │ │ ├── workflow_transition.py │ │ └── workflow_transition.txt ├── page │ ├── __init__.py │ ├── data_import_tool │ │ ├── README.md │ │ ├── __init__.py │ │ ├── data_import_tool.css │ │ ├── data_import_tool.js │ │ ├── data_import_tool.py │ │ └── data_import_tool.txt │ ├── desktop │ │ ├── README.md │ │ ├── __init__.py │ │ ├── desktop.css │ │ ├── desktop.html │ │ ├── desktop.js │ │ └── desktop.txt │ ├── finder │ │ ├── __init__.py │ │ ├── finder.js │ │ ├── finder.py │ │ └── finder.txt │ ├── messages │ │ ├── README.md │ │ ├── __init__.py │ │ ├── messages.css │ │ ├── messages.html │ │ ├── messages.js │ │ ├── messages.py │ │ └── messages.txt │ ├── modules_setup │ │ ├── README.md │ │ ├── __init__.py │ │ ├── modules_setup.js │ │ ├── modules_setup.py │ │ └── modules_setup.txt │ ├── permission_manager │ │ ├── README.md │ │ ├── __init__.py │ │ ├── permission_manager.js │ │ ├── permission_manager.py │ │ └── permission_manager.txt │ ├── todo │ │ ├── README.md │ │ ├── __init__.py │ │ ├── todo.css │ │ ├── todo.js │ │ ├── todo.py │ │ └── todo.txt │ └── user_properties │ │ ├── README.md │ │ ├── __init__.py │ │ ├── user_properties.js │ │ ├── user_properties.py │ │ └── user_properties.txt └── report │ ├── __init__.py │ └── todo │ ├── __init__.py │ ├── todo.py │ └── todo.txt ├── data └── GeoIP.dat ├── license.txt ├── public ├── build.json ├── css │ ├── bootstrap.css │ ├── common.css │ ├── font-awesome.css │ ├── font │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── forms.css │ ├── nprogress.css │ ├── prism.css │ ├── tag-it.css │ ├── tree_grid.css │ └── typeahead.css ├── html │ └── app.html ├── images │ ├── icons │ │ ├── accept.gif │ │ ├── application.gif │ │ ├── arrow_down.gif │ │ ├── arrow_up.gif │ │ ├── bullet_arrow_down.png │ │ ├── close.gif │ │ ├── collapse.gif │ │ ├── error.gif │ │ ├── expand.gif │ │ ├── folder.gif │ │ ├── glyphicons-halflings-white.png │ │ ├── glyphicons-halflings.png │ │ ├── help.png │ │ ├── icons.png │ │ ├── lightbulb.gif │ │ ├── link.png │ │ ├── minus.gif │ │ ├── page.png │ │ ├── paperclip.gif │ │ ├── plus.gif │ │ ├── resultset_first.gif │ │ ├── resultset_last.gif │ │ ├── resultset_next.gif │ │ ├── resultset_previous.gif │ │ ├── sort_asc.gif │ │ ├── sort_desc.gif │ │ └── wntoolbar-icons.png │ └── ui │ │ ├── avatar.png │ │ ├── button-load.gif │ │ ├── cancelled.png │ │ ├── drag-handle.png │ │ ├── field.jpg │ │ ├── navbarsep.png │ │ ├── ripped-border.png │ │ ├── spinner.gif │ │ ├── sprinkles.png │ │ ├── submitted.png │ │ ├── vote_down.gif │ │ └── vote_up.gif └── js │ ├── legacy │ ├── clientscriptAPI.js │ ├── datatype.js │ ├── datetime.js │ ├── dom.js │ ├── form.js │ ├── globals.js │ ├── handler.js │ ├── layout.js │ ├── loaders.js │ ├── printElement.js │ └── print_format.js │ ├── lib │ ├── README.md │ ├── beautify-html.js │ ├── bootstrap.min.js │ ├── center_image.js │ ├── downloadify │ │ ├── download.png │ │ ├── downloadify.min.js │ │ ├── downloadify.swf │ │ └── swfobject.js │ ├── flot │ │ ├── excanvas.js │ │ ├── excanvas.min.js │ │ ├── jquery.colorhelpers.js │ │ ├── jquery.flot.crosshair.js │ │ ├── jquery.flot.downsample.js │ │ ├── jquery.flot.fillbetween.js │ │ ├── jquery.flot.image.js │ │ ├── jquery.flot.js │ │ ├── jquery.flot.navigate.js │ │ ├── jquery.flot.pie.js │ │ ├── jquery.flot.resize.js │ │ ├── jquery.flot.selection.js │ │ ├── jquery.flot.stack.js │ │ ├── jquery.flot.symbol.js │ │ └── jquery.flot.threshold.js │ ├── fullcalendar │ │ ├── fullcalendar.css │ │ ├── fullcalendar.js │ │ ├── fullcalendar.min.js │ │ ├── fullcalendar.print.css │ │ └── gcal.js │ ├── jQuery.Gantt │ │ ├── README.md │ │ ├── css │ │ │ └── style.css │ │ ├── img │ │ │ ├── grid.png │ │ │ ├── icon_sprite.png │ │ │ ├── loader_bg.png │ │ │ └── slider_handle.png │ │ ├── index.html │ │ └── js │ │ │ ├── dataDays.js │ │ │ ├── dataDaysEnh.js │ │ │ ├── dataHours.js │ │ │ ├── jquery-1.7.min.js │ │ │ ├── jquery.cookie.js │ │ │ ├── jquery.fn.gantt.js │ │ │ └── jquery.fn.gantt.min.js │ ├── jquery │ │ ├── bootstrap_theme │ │ │ ├── images │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ ├── ui-bg_glass_75_ffffff_1x400.png │ │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ │ ├── ui-bg_inset-soft_95_fef1ec_1x100.png │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ └── ui-icons_f6cf3b_256x240.png │ │ │ ├── jquery-ui.css │ │ │ └── jquery-ui.selected.css │ │ ├── jquery.hotkeys.js │ │ ├── jquery.min.js │ │ ├── jquery.ui.min.js │ │ ├── jquery.ui.slider.min.js │ │ ├── jquery.ui.sliderAccess.js │ │ ├── jquery.ui.timepicker-addon.css │ │ ├── jquery.ui.timepicker-addon.js │ │ ├── qunit.css │ │ └── qunit.js │ ├── jscolor │ │ ├── arrow.gif │ │ ├── cross.gif │ │ ├── demo.html │ │ ├── hs.png │ │ ├── hv.png │ │ └── jscolor.js │ ├── json2.js │ ├── markdown.js │ ├── nprogress.js │ ├── prettydate.js │ ├── prism.js │ ├── slickgrid │ │ ├── images │ │ │ ├── actions.gif │ │ │ ├── ajax-loader-small.gif │ │ │ ├── arrow_redo.png │ │ │ ├── arrow_right_peppermint.png │ │ │ ├── arrow_right_spearmint.png │ │ │ ├── arrow_undo.png │ │ │ ├── bullet_blue.png │ │ │ ├── bullet_star.png │ │ │ ├── bullet_toggle_minus.png │ │ │ ├── bullet_toggle_plus.png │ │ │ ├── calendar.gif │ │ │ ├── collapse.gif │ │ │ ├── comment_yellow.gif │ │ │ ├── down.gif │ │ │ ├── drag-handle.png │ │ │ ├── editor-helper-bg.gif │ │ │ ├── expand.gif │ │ │ ├── header-bg.gif │ │ │ ├── header-columns-bg.gif │ │ │ ├── header-columns-over-bg.gif │ │ │ ├── help.png │ │ │ ├── info.gif │ │ │ ├── listview.gif │ │ │ ├── pencil.gif │ │ │ ├── row-over-bg.gif │ │ │ ├── sort-asc.gif │ │ │ ├── sort-asc.png │ │ │ ├── sort-desc.gif │ │ │ ├── sort-desc.png │ │ │ ├── stripes.png │ │ │ ├── tag_red.png │ │ │ ├── tick.png │ │ │ ├── user_identity.gif │ │ │ └── user_identity_plus.gif │ │ ├── jquery.event.drag.js │ │ ├── plugins │ │ │ ├── slick.autotooltips.js │ │ │ ├── slick.cellcopymanager.js │ │ │ ├── slick.cellexternalcopymanager.js │ │ │ ├── slick.cellrangedecorator.js │ │ │ ├── slick.cellrangeselector.js │ │ │ ├── slick.cellselectionmodel.js │ │ │ ├── slick.checkboxselectcolumn.js │ │ │ ├── slick.headerbuttons.css │ │ │ ├── slick.headerbuttons.js │ │ │ ├── slick.headermenu.css │ │ │ ├── slick.headermenu.js │ │ │ ├── slick.rowmovemanager.js │ │ │ └── slick.rowselectionmodel.js │ │ ├── slick-default-theme.css │ │ ├── slick.core.js │ │ ├── slick.dataview.js │ │ ├── slick.editors.js │ │ ├── slick.grid.css │ │ ├── slick.grid.js │ │ └── slick.groupitemmetadataprovider.js │ ├── sprintf.js │ ├── tag-it.min.js │ └── typeahead.js │ └── wn │ ├── app.js │ ├── assets.js │ ├── class.js │ ├── defaults.js │ ├── dom.js │ ├── form │ ├── assign_to.js │ ├── attachments.js │ ├── comments.js │ ├── control.js │ ├── dashboard.js │ ├── footer.js │ ├── formatters.js │ ├── grid.js │ ├── infobar.js │ ├── layout.js │ ├── link_selector.js │ ├── linked_with.js │ ├── script_manager.js │ ├── toolbar.js │ └── workflow.js │ ├── misc │ ├── datetime.js │ ├── number_format.js │ ├── tests │ │ └── test_number_format.js │ ├── tools.js │ ├── user.js │ └── utils.js │ ├── model │ ├── create_new.js │ ├── doclist.js │ ├── meta.js │ ├── model.js │ ├── perm.js │ ├── sync.js │ └── workflow.js │ ├── print │ └── print_table.js │ ├── provide.js │ ├── request.js │ ├── router.js │ ├── translate.js │ ├── ui │ ├── appframe.js │ ├── button.js │ ├── dialog.js │ ├── editor.js │ ├── field_group.js │ ├── filters.js │ ├── iconbar.js │ ├── listing.js │ ├── messages.js │ ├── search.js │ ├── tags.js │ ├── toolbar │ │ ├── bookmarks.js │ │ ├── new.js │ │ ├── recent.js │ │ ├── report.js │ │ ├── search.js │ │ ├── selector_dialog.js │ │ └── toolbar.js │ └── tree.js │ ├── upload.js │ ├── views │ ├── calendar.js │ ├── communication.js │ ├── container.js │ ├── doclistview.js │ ├── formview.js │ ├── ganttview.js │ ├── grid_report.js │ ├── listview.js │ ├── moduleview.js │ ├── pageview.js │ ├── query_report.js │ ├── reportview.js │ ├── sidebar_stats.js │ └── test_runner.js │ └── website │ └── editable.js ├── pythonrc.py ├── requirements.txt ├── webnotes ├── .no_timestamps ├── __init__.py ├── app.py ├── auth.py ├── boot.py ├── build.py ├── client.py ├── country_info.json ├── country_info.py ├── db.py ├── defaults.py ├── handler.py ├── install_lib │ ├── __init__.py │ ├── install.py │ └── setup_public_folder.py ├── memc.py ├── middlewares.py ├── model │ ├── __init__.py │ ├── bean.py │ ├── code.py │ ├── controller.py │ ├── create_new.py │ ├── db_schema.py │ ├── doc.py │ ├── docfield.py │ ├── doclist.py │ ├── doctype.py │ ├── mapper.py │ ├── meta.py │ ├── rename_doc.py │ ├── sync.py │ ├── utils.py │ └── workflow.py ├── modules │ ├── __init__.py │ ├── export_file.py │ ├── import_file.py │ ├── patch_handler.py │ └── utils.py ├── plugins.py ├── profile.py ├── sessions.py ├── test_runner.py ├── tests │ ├── __init__.py │ ├── test_db.py │ ├── test_defaults.py │ ├── test_email.py │ ├── test_fmt_money.py │ ├── test_geo_ip.py │ └── test_nested_set.py ├── translate.py ├── utils │ ├── __init__.py │ ├── backups.py │ ├── datautils.py │ ├── dateutils.py │ ├── email_lib │ │ ├── __init__.py │ │ ├── bulk.py │ │ ├── html2text.py │ │ ├── receive.py │ │ └── smtp.py │ ├── file_lock.py │ ├── file_manager.py │ ├── minify.py │ ├── nestedset.py │ └── scheduler.py ├── webutils.py └── widgets │ ├── __init__.py │ ├── calendar.py │ ├── event.py │ ├── form │ ├── __init__.py │ ├── assign_to.py │ ├── load.py │ ├── run_method.py │ ├── save.py │ ├── test_form.py │ └── utils.py │ ├── moduleview.py │ ├── page.py │ ├── page_body.py │ ├── query_builder.py │ ├── query_report.py │ ├── report_dump.py │ ├── reportview.py │ ├── search.py │ └── tags.py ├── website ├── README.md ├── __init__.py ├── css │ └── website.css ├── doctype │ ├── __init__.py │ ├── about_us_settings │ │ ├── README.md │ │ ├── __init__.py │ │ ├── about_us_settings.py │ │ ├── about_us_settings.txt │ │ └── templates │ │ │ ├── __init__.py │ │ │ └── pages │ │ │ ├── __init__.py │ │ │ ├── about.html │ │ │ └── about.py │ ├── about_us_team_member │ │ ├── README.md │ │ ├── __init__.py │ │ ├── about_us_team_member.py │ │ └── about_us_team_member.txt │ ├── blog_category │ │ ├── README.md │ │ ├── __init__.py │ │ ├── blog_category.py │ │ └── blog_category.txt │ ├── blog_post │ │ ├── README.md │ │ ├── __init__.py │ │ ├── blog_post.js │ │ ├── blog_post.py │ │ ├── blog_post.txt │ │ └── templates │ │ │ ├── __init__.py │ │ │ ├── generators │ │ │ ├── __init__.py │ │ │ ├── blog_post.html │ │ │ └── blog_post.py │ │ │ ├── includes │ │ │ ├── __init__.py │ │ │ ├── blog.css │ │ │ ├── blog.js │ │ │ ├── blog_footer.html │ │ │ ├── blog_subscribe.html │ │ │ └── blogger.html │ │ │ └── pages │ │ │ ├── __init__.py │ │ │ ├── blog.html │ │ │ └── blog.py │ ├── blog_settings │ │ ├── README.md │ │ ├── __init__.py │ │ ├── blog_settings.py │ │ └── blog_settings.txt │ ├── blogger │ │ ├── README.md │ │ ├── __init__.py │ │ ├── blogger.py │ │ ├── blogger.txt │ │ └── templates │ │ │ ├── __init__.py │ │ │ └── pages │ │ │ ├── __init__.py │ │ │ ├── writers.html │ │ │ └── writers.py │ ├── company_history │ │ ├── README.md │ │ ├── __init__.py │ │ ├── company_history.py │ │ └── company_history.txt │ ├── contact_us_settings │ │ ├── README.md │ │ ├── __init__.py │ │ ├── contact_us_settings.py │ │ ├── contact_us_settings.txt │ │ └── templates │ │ │ ├── __init__.py │ │ │ ├── includes │ │ │ └── contact.js │ │ │ └── pages │ │ │ ├── __init__.py │ │ │ ├── contact.html │ │ │ └── contact.py │ ├── style_settings │ │ ├── README.md │ │ ├── __init__.py │ │ ├── style_settings.js │ │ ├── style_settings.py │ │ ├── style_settings.txt │ │ └── templates │ │ │ ├── __init__.py │ │ │ └── pages │ │ │ ├── __init__.py │ │ │ ├── wn-web.css │ │ │ └── wn_web.py │ ├── table_of_contents │ │ ├── __init__.py │ │ ├── table_of_contents.py │ │ └── table_of_contents.txt │ ├── top_bar_item │ │ ├── README.md │ │ ├── __init__.py │ │ ├── top_bar_item.py │ │ └── top_bar_item.txt │ ├── web_page │ │ ├── README.md │ │ ├── __init__.py │ │ ├── templates │ │ │ ├── __init__.py │ │ │ └── generators │ │ │ │ ├── __init__.py │ │ │ │ ├── web_page.html │ │ │ │ └── web_page.py │ │ ├── web_page.js │ │ ├── web_page.py │ │ └── web_page.txt │ ├── website_script │ │ ├── README.md │ │ ├── __init__.py │ │ ├── templates │ │ │ ├── __init__.py │ │ │ └── pages │ │ │ │ ├── __init__.py │ │ │ │ ├── wn-web.js │ │ │ │ └── wn_web.py │ │ ├── website_script.py │ │ └── website_script.txt │ ├── website_settings │ │ ├── README.md │ │ ├── __init__.py │ │ ├── website_settings.js │ │ ├── website_settings.py │ │ └── website_settings.txt │ ├── website_sitemap │ │ ├── __init__.py │ │ ├── website_sitemap.py │ │ └── website_sitemap.txt │ ├── website_sitemap_config │ │ ├── __init__.py │ │ ├── website_sitemap_config.py │ │ └── website_sitemap_config.txt │ ├── website_slideshow │ │ ├── README.md │ │ ├── __init__.py │ │ ├── templates │ │ │ └── includes │ │ │ │ └── slideshow.html │ │ ├── website_slideshow.js │ │ ├── website_slideshow.py │ │ └── website_slideshow.txt │ └── website_slideshow_item │ │ ├── README.md │ │ ├── __init__.py │ │ ├── website_slideshow_item.py │ │ └── website_slideshow_item.txt ├── js │ └── website.js ├── page │ ├── __init__.py │ └── website_home │ │ ├── __init__.py │ │ ├── website_home.js │ │ └── website_home.txt └── templates │ ├── __init__.py │ ├── base.html │ ├── includes │ ├── __init__.py │ ├── comment.html │ ├── comments.html │ ├── comments.py │ ├── footer.html │ ├── login.js │ └── navbar.html │ └── pages │ ├── 404.html │ ├── __init__.py │ ├── error.html │ ├── error.py │ ├── login.html │ ├── message.html │ ├── message.py │ ├── print.html │ ├── print.py │ ├── rss.py │ ├── rss.xml │ ├── sitemap.py │ ├── sitemap.xml │ ├── update-password.html │ └── update_password.py └── wnf.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.py~ 3 | *.comp.js 4 | *.DS_Store 5 | locale 6 | .wnf-lang-status 7 | *.swp 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## wnframework 2 | 3 | Full-stack web application framework that uses Python/MySql on the server side and a tightly integrated client side library. Primarily built for erpnext. 4 | 5 | Projects: [erpnext](http://erpnext.org) | [webnotes/erpnext](https://github.com/webnotes/erpnext) 6 | 7 | ## Setup 8 | 9 | To start a new project, in the application root: 10 | 11 | Install: 12 | 13 | 1. Go to the project folder 14 | 1. Install webnotes and your app: 15 | 16 | $ git clone git@github.com:webnotes/wnframework lib 17 | $ git clone git@github.com:webnotes/[your app] app 18 | $ lib/wnf.py --make_conf 19 | $ lib/wnf.py --reinstall 20 | $ lib/wnf.py --build 21 | 22 | 1. Run development server: 23 | 24 | $ lib/wnf.py --serve 25 | 26 | 27 | enjoy! 28 | 29 | ## wnf.py 30 | 31 | `$ lib/wnf.py --help` for more info 32 | 33 | ## License 34 | 35 | wnframework is freely available to use under the MIT License 36 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/__init__.py -------------------------------------------------------------------------------- /conf/apache.conf: -------------------------------------------------------------------------------- 1 | # Sample httpd.conf extension ot start wnframework 2 | 3 | # Port on which you want to run wnframework 4 | Listen 8080 5 | NameVirtualHost *:8080 6 | 7 | ServerName localhost 8 | 9 | # your erpnext folder 10 | DocumentRoot /var/www/erpnext/public/ 11 | 12 | AddHandler cgi-script .cgi .xml .py 13 | AddType application/vnd.ms-fontobject .eot 14 | AddType font/ttf .ttf 15 | AddType font/otf .otf 16 | AddType application/x-font-woff .woff 17 | 18 | 19 | # directory specific options 20 | Options -Indexes +FollowSymLinks +ExecCGI 21 | 22 | # directory's index file 23 | DirectoryIndex web.py 24 | 25 | AllowOverride all 26 | Order Allow,Deny 27 | Allow from all 28 | 29 | # rewrite rule 30 | RewriteEngine on 31 | RewriteCond %{REQUEST_FILENAME} !-f 32 | RewriteCond %{REQUEST_FILENAME} !-d 33 | RewriteCond %{REQUEST_FILENAME} !-l 34 | RewriteRule ^([^/]+)$ /web.py?page=$1 [QSA,L] 35 | 36 | -------------------------------------------------------------------------------- /conf/app.js: -------------------------------------------------------------------------------- 1 | wn.app = { 2 | name: 'Yourapp', 3 | license: 'GNU/GPL - Usage Condition: All "yourapp" branding must be kept as it is', 4 | source: 'https://github.com/webnotes/yourapp', 5 | publisher: 'Your Company', 6 | copyright: '© Your Company', 7 | version: window._version_number 8 | } 9 | 10 | // call startup when ready 11 | $(document).bind('ready', function() { 12 | startup(); 13 | }); 14 | 15 | $(document).bind('toolbar_setup', function() { 16 | $('.brand').html('yourbrand\ 17 | '); 18 | }); 19 | -------------------------------------------------------------------------------- /conf/conf.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | # app configuration 6 | 7 | # database config 8 | db_name = '%(db_name)s' 9 | db_password = '%(db_password)s' 10 | 11 | # user attachments stored in 12 | files_path = 'public/files' 13 | public_path = 'public' 14 | 15 | # max file attachment size (default 1MB) 16 | max_file_size = 1000000 17 | 18 | # max email size in bytes 19 | max_email_size = 0 20 | 21 | # total pop session timeout in seconds 22 | pop_timeout = 0 23 | 24 | # generate schema (.txt files) 25 | developer_mode = 0 26 | 27 | # clear cache on refresh 28 | auto_cache_clear = 0 29 | 30 | # email logs to admin (beta) 31 | admin_email_notification = 0 32 | 33 | # user timezone 34 | user_timezone = 'Asia/Calcutta' 35 | 36 | # dump backups here 37 | backup_path = 'public/backups' 38 | 39 | # outgoing mail settings 40 | mail_server = None 41 | mail_login = None 42 | mail_password = None 43 | mail_port = None 44 | use_ssl = None 45 | auto_email_id = None 46 | 47 | # logging settings 48 | log_file_name = 'logs/error_log.txt' 49 | debug_log_dbs = [] 50 | log_level = 'logging.INFO' 51 | log_file_size = 5000 52 | log_file_backup_count = 5 53 | 54 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "base_template": "lib/website/templates/base.html", 3 | "framework_version": "3.13.7", 4 | "modules": { 5 | "Calendar": { 6 | "color": "#2980b9", 7 | "icon": "icon-calendar", 8 | "label": "Calendar", 9 | "link": "Calendar/Event", 10 | "type": "view" 11 | }, 12 | "Finder": { 13 | "color": "#14C7DE", 14 | "icon": "icon-folder-open", 15 | "label": "Finder", 16 | "link": "finder", 17 | "type": "page" 18 | }, 19 | "Messages": { 20 | "color": "#9b59b6", 21 | "icon": "icon-comments", 22 | "label": "Messages", 23 | "link": "messages", 24 | "type": "page" 25 | }, 26 | "To Do": { 27 | "color": "#f1c40f", 28 | "icon": "icon-check", 29 | "label": "To Do", 30 | "link": "todo", 31 | "type": "page" 32 | }, 33 | "Website": { 34 | "color": "#16a085", 35 | "icon": "icon-globe", 36 | "link": "website-home", 37 | "type": "module" 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /core/.no_timestamps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/core/.no_timestamps -------------------------------------------------------------------------------- /core/README.md: -------------------------------------------------------------------------------- 1 | Core module contains the models required for the basic functioning of wnframework including DocType, Profile (user), Role and others. -------------------------------------------------------------------------------- /core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals -------------------------------------------------------------------------------- /core/doctype/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/bulk_email/README.md: -------------------------------------------------------------------------------- 1 | Emails to be sent asynchronously via the scheduler. Emails remain in Bulk Email for a month before they are deleted (to check mail quotas) -------------------------------------------------------------------------------- /core/doctype/bulk_email/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/bulk_email/bulk_email.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/comment/README.md: -------------------------------------------------------------------------------- 1 | Comments added on Forms, Blogs and other places -------------------------------------------------------------------------------- /core/doctype/comment/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/communication/README.md: -------------------------------------------------------------------------------- 1 | Email or message sent or received from a contact and other DocTypes. `receive.py` will create a communication when a mail is received in the mailbox. -------------------------------------------------------------------------------- /core/doctype/communication/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/doctype/communication/communication.js: -------------------------------------------------------------------------------- 1 | cur_frm.cscript.onload = function(doc) { 2 | cur_frm.fields_dict.user.get_query = function() { 3 | return { 4 | query: "core.doctype.communication.communication.get_user" 5 | } 6 | }; 7 | 8 | if(doc.content) 9 | doc.content = wn.utils.remove_script_and_style(doc.content); 10 | } -------------------------------------------------------------------------------- /core/doctype/control_panel/README.md: -------------------------------------------------------------------------------- 1 | (deprecated) Single DocType where global variables used to be stored. -------------------------------------------------------------------------------- /core/doctype/control_panel/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/control_panel/control_panel.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | from webnotes import form, msgprint 8 | import webnotes.defaults 9 | 10 | class DocType: 11 | def __init__(self, doc, doclist): 12 | self.doc = doc 13 | self.doclist = doclist 14 | 15 | def on_update(self): 16 | # clear cache on save 17 | webnotes.cache().delete_value('time_zone') 18 | webnotes.clear_cache() 19 | -------------------------------------------------------------------------------- /core/doctype/custom_field/README.md: -------------------------------------------------------------------------------- 1 | Custom Field added by the user (not part of DocType but part of table). Custom fields are automatically added to the DocType when they are loaded as metadata. -------------------------------------------------------------------------------- /core/doctype/custom_field/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/custom_script/README.md: -------------------------------------------------------------------------------- 1 | Client or server script appended to standard DocType code. 2 | 3 | For client: 4 | 5 | - Code is appended to the js code. 6 | - Best practice is to declare additional methods beginning with prefix `custom_` e.g. `custom_validate` to standard events. 7 | 8 | For server: 9 | 10 | - Script is appended to module code before DocType is `execute`d. 11 | - All class methods must be written with a tab -------------------------------------------------------------------------------- /core/doctype/custom_script/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/custom_script/custom_script.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | from __future__ import unicode_literals 4 | import webnotes 5 | from webnotes.utils import cstr 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl 10 | 11 | def autoname(self): 12 | self.doc.name = self.doc.dt + "-" + self.doc.script_type 13 | 14 | def on_update(self): 15 | webnotes.clear_cache(doctype=self.doc.dt) 16 | 17 | def on_trash(self): 18 | webnotes.clear_cache(doctype=self.doc.dt) 19 | 20 | def make_custom_server_script_file(doctype, script=None): 21 | import os 22 | from webnotes.plugins import get_path 23 | 24 | file_path = get_path(None, "DocType", doctype) 25 | if os.path.exists(file_path): 26 | raise IOError(file_path + " already exists") 27 | 28 | # create folder if not exists 29 | webnotes.create_folder(os.path.dirname(file_path)) 30 | 31 | # create file 32 | custom_script = """from __future__ import unicode_literals 33 | import webnotes 34 | from webnotes.utils import cint, cstr, flt 35 | from webnotes.model.doc import Document 36 | from webnotes.model.code import get_obj 37 | from webnotes import msgprint, _ 38 | 39 | class CustomDocType(DocType): 40 | {script}""".format(script=script or "\tpass") 41 | 42 | with open(file_path, "w") as f: 43 | f.write(custom_script.encode("utf-8")) -------------------------------------------------------------------------------- /core/doctype/customize_form/README.md: -------------------------------------------------------------------------------- 1 | Create a DocType like fields table and allow user to set field properties for which **Property Setter** will be created when updated. -------------------------------------------------------------------------------- /core/doctype/customize_form/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/customize_form_field/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/customize_form_field/customize_form_field.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/default_home_page/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/default_home_page/default_home_page.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/default_home_page/default_home_page.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-22 01:27:32", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:07", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "DocType", 11 | "istable": 1, 12 | "module": "Core", 13 | "name": "__common__" 14 | }, 15 | { 16 | "doctype": "DocField", 17 | "fieldtype": "Link", 18 | "in_list_view": 1, 19 | "name": "__common__", 20 | "oldfieldtype": "Link", 21 | "parent": "Default Home Page", 22 | "parentfield": "fields", 23 | "parenttype": "DocType", 24 | "permlevel": 0 25 | }, 26 | { 27 | "doctype": "DocType", 28 | "name": "Default Home Page" 29 | }, 30 | { 31 | "doctype": "DocField", 32 | "fieldname": "role", 33 | "label": "Role", 34 | "oldfieldname": "role", 35 | "options": "Role" 36 | }, 37 | { 38 | "doctype": "DocField", 39 | "fieldname": "home_page", 40 | "label": "Home Page", 41 | "oldfieldname": "home_page", 42 | "options": "Page" 43 | } 44 | ] -------------------------------------------------------------------------------- /core/doctype/defaultvalue/README.md: -------------------------------------------------------------------------------- 1 | Child table for **Profile** and **Role** where default keys and values are stored. They can also be created from the **User Properties** page. -------------------------------------------------------------------------------- /core/doctype/defaultvalue/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/defaultvalue/defaultvalue.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl 10 | 11 | def on_doctype_update(): 12 | if not webnotes.conn.sql("""show index from `tabDefaultValue` 13 | where Key_name="defaultvalue_parent_defkey_index" """): 14 | webnotes.conn.commit() 15 | webnotes.conn.sql("""alter table `tabDefaultValue` 16 | add index defaultvalue_parent_defkey_index(parent, defkey)""") -------------------------------------------------------------------------------- /core/doctype/defaultvalue/defaultvalue.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-22 01:27:32", 4 | "docstatus": 0, 5 | "modified": "2013-11-15 10:16:30", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "allow_copy": 0, 11 | "allow_email": 0, 12 | "allow_print": 0, 13 | "autoname": "DEF.######", 14 | "doctype": "DocType", 15 | "hide_heading": 0, 16 | "hide_toolbar": 0, 17 | "issingle": 0, 18 | "istable": 1, 19 | "module": "Core", 20 | "name": "__common__", 21 | "read_only": 0 22 | }, 23 | { 24 | "doctype": "DocField", 25 | "hidden": 0, 26 | "in_list_view": 1, 27 | "name": "__common__", 28 | "parent": "DefaultValue", 29 | "parentfield": "fields", 30 | "parenttype": "DocType", 31 | "permlevel": 0, 32 | "print_width": "200px", 33 | "search_index": 0, 34 | "width": "200px" 35 | }, 36 | { 37 | "doctype": "DocType", 38 | "name": "DefaultValue" 39 | }, 40 | { 41 | "doctype": "DocField", 42 | "fieldname": "defkey", 43 | "fieldtype": "Data", 44 | "label": "Key", 45 | "oldfieldname": "defkey", 46 | "oldfieldtype": "Data", 47 | "reqd": 1 48 | }, 49 | { 50 | "doctype": "DocField", 51 | "fieldname": "defvalue", 52 | "fieldtype": "Text", 53 | "label": "Value", 54 | "oldfieldname": "defvalue", 55 | "oldfieldtype": "Text", 56 | "reqd": 0 57 | } 58 | ] -------------------------------------------------------------------------------- /core/doctype/docfield/README.md: -------------------------------------------------------------------------------- 1 | Represents a field of a DocType analogous to a table column in the database. DocFields represent the properties both the model and the view and hence may or may not have database columns associated (for example, Section Break does not have any column associated.) 2 | 3 | See Standard Field Types -------------------------------------------------------------------------------- /core/doctype/docfield/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/docfield/docfield.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/docperm/README.md: -------------------------------------------------------------------------------- 1 | Defines a permission rule for a DocType. The permission rule is set for a Role and a level and has permission for read, write, create, submit, cancel, amend and report. 2 | 3 | #### Match 4 | 5 | If a fieldname is set in `match` property, then the rule will only apply for those records that have a value for that fieldname which is one of the user's default values (user properties). 6 | 7 | This is used to restrict users to view records belonging to a company in case of a multi-company system where the `company` field is present in most forms. -------------------------------------------------------------------------------- /core/doctype/docperm/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/docperm/docperm.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/doctype/README.md: -------------------------------------------------------------------------------- 1 | DocType is the basic building block of an application and encompasses all the three elements i.e. model, view and controller. It represents a: 2 | 3 | - Table in the database 4 | - Form in the application 5 | - Controller (class) to execute business logic 6 | 7 | #### Single Type 8 | 9 | DocTypes can be of "Single" type where they do not represent a table, and only one instance is maintained. This can be used where the DocType is required only for its view features or to store some configurations in one place. 10 | 11 | #### Child Tables 12 | 13 | DocTypes can be child tables of other DocTypes. In such cases, they must defined `parent`, `parenttype` and `parentfield` properties to uniquely identify its placement. 14 | 15 | In the parent DocType, the position of a child in the field sequence is defined by the `Table` field type. -------------------------------------------------------------------------------- /core/doctype/doctype/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/doctype/doctype.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | // ------------- 5 | // Menu Display 6 | // ------------- 7 | 8 | $(cur_frm.wrapper).on("grid-row-render", function(e, grid_row) { 9 | if(grid_row.doc && grid_row.doc.fieldtype=="Section Break") { 10 | $(grid_row.row).css({"font-weight": "bold"}); 11 | } 12 | }) 13 | 14 | cur_frm.cscript.allow_attach = function(doc, cdt, cdn) { 15 | if(doc.allow_attach) { 16 | unhide_field('max_attachments'); 17 | } else { 18 | hide_field('max_attachments'); 19 | } 20 | } 21 | 22 | cur_frm.cscript.onload = function(doc, cdt, cdn) { 23 | this.allow_attach(doc, cdt, cdn); 24 | } 25 | 26 | cur_frm.cscript.refresh = function(doc, cdt, cdn) { 27 | if(in_list(user_roles, 'System Manager') && !in_list(user_roles, 'Administrator')) { 28 | // make the document read-only 29 | cur_frm.perm = [[1,0,0]] 30 | 31 | // make help heading 32 | msgprint('Cannot Edit DocType directly: \ 33 | To edit DocType properties, \ 34 | create / update Custom Field, \ 35 | Custom Script \ 36 | and Property Setter') 37 | } 38 | } 39 | 40 | cur_frm.cscript.validate = function(doc, cdt, cdn) { 41 | doc.server_code_compiled = null; 42 | } -------------------------------------------------------------------------------- /core/doctype/doctype/doctype_template.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/event/README.md: -------------------------------------------------------------------------------- 1 | Calendar Event -------------------------------------------------------------------------------- /core/doctype/event/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/event/event.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | cur_frm.cscript.repeat_on = function(doc, cdt, cdn) { 5 | if(doc.repeat_on==="Every Day") { 6 | $.each(["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"], function(i,v) { 7 | cur_frm.set_value(v, 1); 8 | }) 9 | } 10 | } 11 | 12 | cur_frm.cscript.refresh = function(doc, cdt, cdn) { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /core/doctype/event/event_calendar.js: -------------------------------------------------------------------------------- 1 | wn.views.calendar["Event"] = { 2 | field_map: { 3 | "start": "starts_on", 4 | "end": "ends_on", 5 | "id": "name", 6 | "allDay": "all_day", 7 | "title": "subject", 8 | "status": "event_type", 9 | }, 10 | style_map: { 11 | "Public": "success", 12 | "Private": "info" 13 | }, 14 | get_events_method: "core.doctype.event.event.get_events" 15 | } -------------------------------------------------------------------------------- /core/doctype/event_role/README.md: -------------------------------------------------------------------------------- 1 | Role with which the event is shared. -------------------------------------------------------------------------------- /core/doctype/event_role/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/event_role/event_role.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/event_role/event_role.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-22 01:27:33", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:08", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "__EVR.#####", 11 | "doctype": "DocType", 12 | "istable": 1, 13 | "module": "Core", 14 | "name": "__common__" 15 | }, 16 | { 17 | "doctype": "DocField", 18 | "fieldname": "role", 19 | "fieldtype": "Link", 20 | "in_list_view": 1, 21 | "label": "Role", 22 | "name": "__common__", 23 | "oldfieldname": "role", 24 | "oldfieldtype": "Link", 25 | "options": "Role", 26 | "parent": "Event Role", 27 | "parentfield": "fields", 28 | "parenttype": "DocType", 29 | "permlevel": 0, 30 | "print_width": "240px", 31 | "width": "240px" 32 | }, 33 | { 34 | "doctype": "DocType", 35 | "name": "Event Role" 36 | }, 37 | { 38 | "doctype": "DocField" 39 | } 40 | ] -------------------------------------------------------------------------------- /core/doctype/event_user/README.md: -------------------------------------------------------------------------------- 1 | Profile (user) with whom the parent Event is shared. -------------------------------------------------------------------------------- /core/doctype/event_user/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/event_user/event_user.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/event_user/event_user.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-22 01:27:33", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:08", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "EVP.#####", 11 | "doctype": "DocType", 12 | "istable": 1, 13 | "module": "Core", 14 | "name": "__common__" 15 | }, 16 | { 17 | "doctype": "DocField", 18 | "fieldname": "person", 19 | "fieldtype": "Select", 20 | "in_list_view": 1, 21 | "label": "Person", 22 | "name": "__common__", 23 | "oldfieldname": "person", 24 | "oldfieldtype": "Select", 25 | "options": "link:Profile", 26 | "parent": "Event User", 27 | "parentfield": "fields", 28 | "parenttype": "DocType", 29 | "permlevel": 0, 30 | "print_width": "240px", 31 | "search_index": 1, 32 | "width": "240px" 33 | }, 34 | { 35 | "doctype": "DocType", 36 | "name": "Event User" 37 | }, 38 | { 39 | "doctype": "DocField" 40 | } 41 | ] -------------------------------------------------------------------------------- /core/doctype/file_data/README.md: -------------------------------------------------------------------------------- 1 | File record and its relation to document to which the file is attached. 2 | 3 | This is appened to the form as `docinfo` when a document is loaded. -------------------------------------------------------------------------------- /core/doctype/file_data/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/letter_head/README.md: -------------------------------------------------------------------------------- 1 | Standard letter head to be dynamically prepended to a Print Format -------------------------------------------------------------------------------- /core/doctype/letter_head/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/letter_head/letter_head.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | cur_frm.cscript.refresh = function(doc) { 5 | cur_frm.set_intro(""); 6 | if(doc.__islocal) { 7 | cur_frm.set_intro(wn._("Step 1: Set the name and save.")); 8 | } else if(!cur_frm.doc.content) { 9 | cur_frm.set_intro(wn._("Step 2: Set Letterhead content.")); 10 | } 11 | } -------------------------------------------------------------------------------- /core/doctype/letter_head/letter_head.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | 8 | class DocType: 9 | def __init__(self, doc, doclist=[]): 10 | self.doc = doc 11 | self.doclist = doclist 12 | 13 | def validate(self): 14 | self.set_as_default() 15 | 16 | # clear the cache so that the new letter head is uploaded 17 | webnotes.clear_cache() 18 | 19 | def set_as_default(self): 20 | from webnotes.utils import set_default 21 | if not self.doc.is_default: 22 | if not webnotes.conn.sql("""select count(*) from `tabLetter Head` where ifnull(is_default,0)=1"""): 23 | self.doc.is_default = 1 24 | if self.doc.is_default: 25 | webnotes.conn.sql("update `tabLetter Head` set is_default=0 where name != %s", 26 | self.doc.name) 27 | set_default('letter_head', self.doc.name) 28 | 29 | # update control panel - so it loads new letter directly 30 | webnotes.conn.set_value('Control Panel', None, 'letter_head', self.doc.content) -------------------------------------------------------------------------------- /core/doctype/letter_head/test_letter_head.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | test_records = [] -------------------------------------------------------------------------------- /core/doctype/module_def/README.md: -------------------------------------------------------------------------------- 1 | Module of the application (e.g. Core, Accounts etc.) -------------------------------------------------------------------------------- /core/doctype/module_def/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/module_def/module_def.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/module_def/module_def.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-01-10 16:34:03", 4 | "docstatus": 0, 5 | "modified": "2013-07-05 14:46:33", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "allow_rename": 1, 11 | "autoname": "field:module_name", 12 | "doctype": "DocType", 13 | "icon": "icon-sitemap", 14 | "module": "Core", 15 | "name": "__common__" 16 | }, 17 | { 18 | "doctype": "DocField", 19 | "fieldname": "module_name", 20 | "fieldtype": "Data", 21 | "label": "Module Name", 22 | "name": "__common__", 23 | "oldfieldname": "module_name", 24 | "oldfieldtype": "Data", 25 | "parent": "Module Def", 26 | "parentfield": "fields", 27 | "parenttype": "DocType", 28 | "permlevel": 0 29 | }, 30 | { 31 | "amend": 0, 32 | "cancel": 1, 33 | "create": 1, 34 | "doctype": "DocPerm", 35 | "name": "__common__", 36 | "parent": "Module Def", 37 | "parentfield": "permissions", 38 | "parenttype": "DocType", 39 | "permlevel": 0, 40 | "read": 1, 41 | "report": 1, 42 | "role": "Administrator", 43 | "submit": 0, 44 | "write": 1 45 | }, 46 | { 47 | "doctype": "DocType", 48 | "name": "Module Def" 49 | }, 50 | { 51 | "doctype": "DocField" 52 | }, 53 | { 54 | "doctype": "DocPerm" 55 | } 56 | ] -------------------------------------------------------------------------------- /core/doctype/notification_count/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/core/doctype/notification_count/__init__.py -------------------------------------------------------------------------------- /core/doctype/notification_count/notification_count.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-11-18 05:31:03", 4 | "docstatus": 0, 5 | "modified": "2013-11-18 06:26:35", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "DocType", 11 | "document_type": "Other", 12 | "module": "Core", 13 | "name": "__common__" 14 | }, 15 | { 16 | "doctype": "DocField", 17 | "name": "__common__", 18 | "parent": "Notification Count", 19 | "parentfield": "fields", 20 | "parenttype": "DocType", 21 | "permlevel": 0 22 | }, 23 | { 24 | "doctype": "DocType", 25 | "name": "Notification Count" 26 | }, 27 | { 28 | "doctype": "DocField", 29 | "fieldname": "for_doctype", 30 | "fieldtype": "Data", 31 | "label": "For DocType", 32 | "search_index": 1 33 | }, 34 | { 35 | "doctype": "DocField", 36 | "fieldname": "count", 37 | "fieldtype": "Int", 38 | "label": "Count" 39 | }, 40 | { 41 | "doctype": "DocField", 42 | "fieldname": "open_count", 43 | "fieldtype": "Int", 44 | "label": "Open Count" 45 | } 46 | ] -------------------------------------------------------------------------------- /core/doctype/page/README.md: -------------------------------------------------------------------------------- 1 | A page (view) in the application. A page is made to define custom user interfaces and contains server side and client side code. Standard events are attached to the page and called when the page is loaded, shown etc. -------------------------------------------------------------------------------- /core/doctype/page/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/page_role/README.md: -------------------------------------------------------------------------------- 1 | Role that has access to parent Page -------------------------------------------------------------------------------- /core/doctype/page_role/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/page_role/page_role.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/page_role/page_role.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-22 01:27:34", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:11", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "allow_copy": 0, 11 | "allow_email": 0, 12 | "allow_print": 0, 13 | "autoname": "PR.######", 14 | "doctype": "DocType", 15 | "hide_heading": 0, 16 | "hide_toolbar": 0, 17 | "issingle": 0, 18 | "istable": 1, 19 | "module": "Core", 20 | "name": "__common__", 21 | "read_only": 0 22 | }, 23 | { 24 | "doctype": "DocField", 25 | "fieldname": "role", 26 | "fieldtype": "Link", 27 | "hidden": 0, 28 | "in_list_view": 1, 29 | "label": "Role", 30 | "name": "__common__", 31 | "oldfieldname": "role", 32 | "oldfieldtype": "Link", 33 | "options": "Role", 34 | "parent": "Page Role", 35 | "parentfield": "fields", 36 | "parenttype": "DocType", 37 | "permlevel": 0, 38 | "reqd": 0, 39 | "search_index": 0 40 | }, 41 | { 42 | "doctype": "DocType", 43 | "name": "Page Role" 44 | }, 45 | { 46 | "doctype": "DocField" 47 | } 48 | ] -------------------------------------------------------------------------------- /core/doctype/patch_log/README.md: -------------------------------------------------------------------------------- 1 | Log of patch executed. Used by `patch_handler` to check if a particular patch is executed or not. -------------------------------------------------------------------------------- /core/doctype/patch_log/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/doctype/patch_log/patch_log.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/patch_log/patch_log.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-01-17 11:36:45", 4 | "docstatus": 0, 5 | "modified": "2013-10-03 17:39:09", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "PATCHLOG.#####", 11 | "description": "List of patches executed", 12 | "doctype": "DocType", 13 | "document_type": "System", 14 | "icon": "icon-cog", 15 | "module": "Core", 16 | "name": "__common__" 17 | }, 18 | { 19 | "doctype": "DocField", 20 | "fieldname": "patch", 21 | "fieldtype": "Data", 22 | "label": "Patch", 23 | "name": "__common__", 24 | "parent": "Patch Log", 25 | "parentfield": "fields", 26 | "parenttype": "DocType", 27 | "permlevel": 0 28 | }, 29 | { 30 | "doctype": "DocPerm", 31 | "name": "__common__", 32 | "parent": "Patch Log", 33 | "parentfield": "permissions", 34 | "parenttype": "DocType", 35 | "permlevel": 0, 36 | "read": 1, 37 | "report": 1, 38 | "role": "Administrator" 39 | }, 40 | { 41 | "doctype": "DocType", 42 | "name": "Patch Log" 43 | }, 44 | { 45 | "doctype": "DocField" 46 | }, 47 | { 48 | "doctype": "DocPerm" 49 | } 50 | ] -------------------------------------------------------------------------------- /core/doctype/print_format/README.md: -------------------------------------------------------------------------------- 1 | A custom Print Format for a DocType. This can be of type Server or Client 2 | 3 | Client Print Formats: 4 | 5 | - Dynamic parts are written in Javascript inside `script` tags and have access to application API 6 | 7 | Server Print Formats: 8 | 9 | - Written as Jinja2 templates. -------------------------------------------------------------------------------- /core/doctype/print_format/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/print_format/print_format.js: -------------------------------------------------------------------------------- 1 | cur_frm.cscript.refresh = function(doc, dt, dn) { 2 | if(user!="Administrator") { 3 | if(doc.standard == 'Yes') { 4 | cur_frm.toggle_enable(["html", "doc_type", "module"], false); 5 | cur_frm.disable_save(); 6 | } 7 | 8 | cur_frm.toggle_enable("standard", false); 9 | } 10 | } -------------------------------------------------------------------------------- /core/doctype/profile/README.md: -------------------------------------------------------------------------------- 1 | Profile represents a user in the system. User privileges are based on the Roles assigned by the UserRoles DocType. -------------------------------------------------------------------------------- /core/doctype/profile/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/profile/profile.css: -------------------------------------------------------------------------------- 1 | .user-role { 2 | padding: 5px; 3 | width: 45%; 4 | float: left; 5 | } 6 | 7 | table.user-perm { 8 | border-collapse: collapse; 9 | } 10 | 11 | table.user-perm td, table.user-perm th { 12 | padding: 5px; 13 | text-align: center; 14 | border-bottom: 1px solid #aaa; 15 | min-width: 30px; 16 | } 17 | -------------------------------------------------------------------------------- /core/doctype/property_setter/README.md: -------------------------------------------------------------------------------- 1 | Overrides standard DocType, DocField properties. The standard application is configured with properties for forms and fields (like, whether they are hidden or not). These can be overridden by a System Manager who can configure DocTypes based on custom requirements. -------------------------------------------------------------------------------- /core/doctype/property_setter/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/property_setter/property_setter.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | $.extend(cur_frm.cscript, { 5 | validate: function(doc) { 6 | if(doc.property_type=='Check' && !in_list(['0','1'], doc.value)) { 7 | msgprint('Value for a check field can be either 0 or 1'); 8 | validated = false; 9 | } 10 | } 11 | }) -------------------------------------------------------------------------------- /core/doctype/report/README.md: -------------------------------------------------------------------------------- 1 | Standard / Custom report. Reports can be of types Query Report or Script Report. -------------------------------------------------------------------------------- /core/doctype/report/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/report/report.js: -------------------------------------------------------------------------------- 1 | cur_frm.cscript.refresh = function(doc) { 2 | cur_frm.add_custom_button("Show Report", function() { 3 | switch(doc.report_type) { 4 | case "Report Builder": 5 | wn.set_route("Report", doc.name); 6 | break; 7 | case "Query Report": 8 | wn.set_route("query-report", doc.name); 9 | break; 10 | case "Script Report": 11 | wn.set_route("query-report", doc.name); 12 | break; 13 | } 14 | }, "icon-table") 15 | 16 | cur_frm.set_intro(""); 17 | switch(doc.report_type) { 18 | case "Report Builder": 19 | cur_frm.set_intro(wn._("Report Builder reports are managed directly by the report builder. Nothing to do.")); 20 | break; 21 | case "Query Report": 22 | cur_frm.set_intro(wn._("Write a SELECT query. Note result is not paged (all data is sent in one go).") 23 | + wn._("To format columns, give column labels in the query.") + "
" 24 | + wn._("[Label]:[Field Type]/[Options]:[Width]") + "

" 25 | + wn._("Example:") + "
" 26 | + "Employee:Link/Employee:200" + "
" 27 | + "Rate:Currency:120" + "
") 28 | break; 29 | case "Script Report": 30 | cur_frm.set_intro(wn._("Write a Python file in the same folder where this is saved and return column and result.")) 31 | break; 32 | } 33 | } -------------------------------------------------------------------------------- /core/doctype/role/README.md: -------------------------------------------------------------------------------- 1 | Roles are be assigned to users and permissions on DocTypes are defined on Roles. Standard roles are "Administrator" (developer), "Guest" and "System Manager" (system, user, permission administrator) -------------------------------------------------------------------------------- /core/doctype/role/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/role/role.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | cur_frm.cscript.refresh = function(doc) { 5 | cur_frm.add_custom_button("Permission Manager", function() { 6 | wn.route_options = {"role": doc.name}; 7 | wn.set_route("permission-manager"); 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /core/doctype/role/role.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/role/role.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-01-08 15:50:01", 4 | "docstatus": 0, 5 | "modified": "2013-07-05 14:53:26", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "allow_copy": 0, 11 | "allow_email": 0, 12 | "allow_print": 0, 13 | "allow_rename": 1, 14 | "autoname": "field:role_name", 15 | "doctype": "DocType", 16 | "hide_heading": 0, 17 | "hide_toolbar": 0, 18 | "icon": "icon-bookmark", 19 | "issingle": 0, 20 | "istable": 0, 21 | "module": "Core", 22 | "name": "__common__", 23 | "read_only": 0 24 | }, 25 | { 26 | "doctype": "DocField", 27 | "fieldname": "role_name", 28 | "fieldtype": "Data", 29 | "label": "Role Name", 30 | "name": "__common__", 31 | "oldfieldname": "role_name", 32 | "oldfieldtype": "Data", 33 | "parent": "Role", 34 | "parentfield": "fields", 35 | "parenttype": "DocType", 36 | "permlevel": 0, 37 | "reqd": 1 38 | }, 39 | { 40 | "cancel": 0, 41 | "create": 1, 42 | "doctype": "DocPerm", 43 | "name": "__common__", 44 | "parent": "Role", 45 | "parentfield": "permissions", 46 | "parenttype": "DocType", 47 | "permlevel": 0, 48 | "read": 1, 49 | "report": 1, 50 | "submit": 0, 51 | "write": 1 52 | }, 53 | { 54 | "doctype": "DocType", 55 | "name": "Role" 56 | }, 57 | { 58 | "doctype": "DocField" 59 | }, 60 | { 61 | "amend": 0, 62 | "doctype": "DocPerm", 63 | "role": "System Manager" 64 | }, 65 | { 66 | "doctype": "DocPerm", 67 | "role": "Administrator" 68 | } 69 | ] -------------------------------------------------------------------------------- /core/doctype/role/test_role.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | test_records = [[{"role_name":"_Test Role"}], [{"role_name":"_Test Role 2"}]] -------------------------------------------------------------------------------- /core/doctype/scheduler_log/README.md: -------------------------------------------------------------------------------- 1 | Log exceptions (errors) raised when executing the scheduler. -------------------------------------------------------------------------------- /core/doctype/scheduler_log/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/doctype/scheduler_log/scheduler_log.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/scheduler_log/scheduler_log.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-01-16 13:09:40", 4 | "docstatus": 0, 5 | "modified": "2013-07-05 14:54:45", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "SCHLOG.#####", 11 | "description": "Log of Scheduler Errors", 12 | "doctype": "DocType", 13 | "document_type": "System", 14 | "icon": "icon-warning-sign", 15 | "module": "Core", 16 | "name": "__common__" 17 | }, 18 | { 19 | "doctype": "DocField", 20 | "name": "__common__", 21 | "parent": "Scheduler Log", 22 | "parentfield": "fields", 23 | "parenttype": "DocType", 24 | "permlevel": 0 25 | }, 26 | { 27 | "cancel": 1, 28 | "create": 1, 29 | "doctype": "DocPerm", 30 | "name": "__common__", 31 | "parent": "Scheduler Log", 32 | "parentfield": "permissions", 33 | "parenttype": "DocType", 34 | "permlevel": 0, 35 | "read": 1, 36 | "report": 1, 37 | "role": "System Manager", 38 | "submit": 0, 39 | "write": 1 40 | }, 41 | { 42 | "doctype": "DocType", 43 | "name": "Scheduler Log" 44 | }, 45 | { 46 | "doctype": "DocField", 47 | "fieldname": "method", 48 | "fieldtype": "Data", 49 | "in_list_view": 1, 50 | "label": "Method" 51 | }, 52 | { 53 | "doctype": "DocField", 54 | "fieldname": "error", 55 | "fieldtype": "Text", 56 | "label": "Error" 57 | }, 58 | { 59 | "doctype": "DocPerm" 60 | } 61 | ] -------------------------------------------------------------------------------- /core/doctype/tag/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/tag/tag.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/tag/tag.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2012-07-09 11:17:17", 4 | "docstatus": 0, 5 | "modified": "2013-07-05 14:57:22", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "field:tag_name", 11 | "doctype": "DocType", 12 | "icon": "icon-tag", 13 | "module": "Core", 14 | "name": "__common__", 15 | "name_case": "Title Case" 16 | }, 17 | { 18 | "doctype": "DocField", 19 | "fieldname": "tag_name", 20 | "fieldtype": "Data", 21 | "label": "Tag Name", 22 | "name": "__common__", 23 | "oldfieldname": "tag_name", 24 | "oldfieldtype": "Data", 25 | "parent": "Tag", 26 | "parentfield": "fields", 27 | "parenttype": "DocType", 28 | "permlevel": 0 29 | }, 30 | { 31 | "create": 1, 32 | "doctype": "DocPerm", 33 | "name": "__common__", 34 | "parent": "Tag", 35 | "parentfield": "permissions", 36 | "parenttype": "DocType", 37 | "permlevel": 0, 38 | "read": 1, 39 | "role": "System Manager", 40 | "write": 1 41 | }, 42 | { 43 | "doctype": "DocType", 44 | "name": "Tag" 45 | }, 46 | { 47 | "doctype": "DocField" 48 | }, 49 | { 50 | "doctype": "DocPerm" 51 | } 52 | ] -------------------------------------------------------------------------------- /core/doctype/todo/README.md: -------------------------------------------------------------------------------- 1 | To do or assignment. -------------------------------------------------------------------------------- /core/doctype/todo/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/todo/todo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/userrole/README.md: -------------------------------------------------------------------------------- 1 | Role belonging to parent Profile -------------------------------------------------------------------------------- /core/doctype/userrole/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/doctype/userrole/userrole.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | from webnotes.utils import cint 7 | 8 | class DocType: 9 | def __init__(self, d, dl): 10 | self.doc, self.doclist = d, dl 11 | 12 | def validate(self): 13 | if cint(self.doc.fields.get("__islocal")) and webnotes.conn.exists("UserRole", { 14 | "parent": self.doc.parent, "role": self.doc.role}): 15 | webnotes.msgprint("Role Already Exists", raise_exception=True) 16 | -------------------------------------------------------------------------------- /core/doctype/userrole/userrole.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-06 11:30:13", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:25", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "allow_copy": 0, 11 | "allow_email": 0, 12 | "allow_print": 0, 13 | "autoname": "UR.#####", 14 | "doctype": "DocType", 15 | "hide_heading": 0, 16 | "hide_toolbar": 0, 17 | "issingle": 0, 18 | "istable": 1, 19 | "module": "Core", 20 | "name": "__common__", 21 | "read_only": 0 22 | }, 23 | { 24 | "doctype": "DocField", 25 | "fieldname": "role", 26 | "fieldtype": "Link", 27 | "hidden": 0, 28 | "in_list_view": 1, 29 | "label": "Role", 30 | "name": "__common__", 31 | "oldfieldname": "role", 32 | "oldfieldtype": "Link", 33 | "options": "Role", 34 | "parent": "UserRole", 35 | "parentfield": "fields", 36 | "parenttype": "DocType", 37 | "permlevel": 0, 38 | "print_width": "200px", 39 | "reqd": 0, 40 | "search_index": 0, 41 | "width": "200px" 42 | }, 43 | { 44 | "doctype": "DocType", 45 | "name": "UserRole" 46 | }, 47 | { 48 | "doctype": "DocField" 49 | } 50 | ] -------------------------------------------------------------------------------- /core/doctype/workflow/README.md: -------------------------------------------------------------------------------- 1 | Custom Workflow master for a particular DocType -------------------------------------------------------------------------------- /core/doctype/workflow/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/doctype/workflow/workflow.js: -------------------------------------------------------------------------------- 1 | wn.provide("wn.core") 2 | 3 | wn.core.Workflow = wn.ui.form.Controller.extend({ 4 | refresh: function(doc) { 5 | this.frm.set_intro(""); 6 | if(doc.is_active) { 7 | this.frm.set_intro("This Workflow is active."); 8 | } 9 | this.load_document_type(doc); 10 | }, 11 | document_type: function(doc) { 12 | this.load_document_type(doc); 13 | }, 14 | load_document_type: function(doc) { 15 | var me = this; 16 | if(doc.document_type && !locals.DocType[doc.document_type]) { 17 | wn.model.with_doctype(doc.document_type, function() { 18 | me.update_field_options(); 19 | }); 20 | } 21 | }, 22 | update_field_options: function() { 23 | var fields = $.map(wn.model.get("DocField", { 24 | parent: this.frm.doc.document_type, 25 | fieldtype: ["not in", wn.model.no_value_type] 26 | }), 27 | function(d) { return d.fieldname; }); 28 | wn.meta.get_docfield("Workflow Document State", "update_field", this.frm.doc.name).options 29 | = [""].concat(fields); 30 | } 31 | }); 32 | 33 | cur_frm.cscript = new wn.core.Workflow({frm:cur_frm}); -------------------------------------------------------------------------------- /core/doctype/workflow_action/README.md: -------------------------------------------------------------------------------- 1 | User action master. e.g. "Approve", "Reject", "Review" etc. in Workflow Transition. -------------------------------------------------------------------------------- /core/doctype/workflow_action/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/doctype/workflow_action/workflow_action.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/workflow_action/workflow_action.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2012-12-28 10:49:56", 4 | "docstatus": 0, 5 | "modified": "2013-07-05 15:03:56", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "field:workflow_action_name", 11 | "description": "Workflow Action Master", 12 | "doctype": "DocType", 13 | "icon": "icon-flag", 14 | "module": "Core", 15 | "name": "__common__" 16 | }, 17 | { 18 | "doctype": "DocField", 19 | "fieldname": "workflow_action_name", 20 | "fieldtype": "Data", 21 | "label": "Workflow Action Name", 22 | "name": "__common__", 23 | "parent": "Workflow Action", 24 | "parentfield": "fields", 25 | "parenttype": "DocType", 26 | "permlevel": 0, 27 | "reqd": 1 28 | }, 29 | { 30 | "cancel": 1, 31 | "create": 1, 32 | "doctype": "DocPerm", 33 | "name": "__common__", 34 | "parent": "Workflow Action", 35 | "parentfield": "permissions", 36 | "parenttype": "DocType", 37 | "permlevel": 0, 38 | "read": 1, 39 | "role": "System Manager", 40 | "write": 1 41 | }, 42 | { 43 | "doctype": "DocType", 44 | "name": "Workflow Action" 45 | }, 46 | { 47 | "doctype": "DocField" 48 | }, 49 | { 50 | "doctype": "DocPerm" 51 | } 52 | ] -------------------------------------------------------------------------------- /core/doctype/workflow_document_state/README.md: -------------------------------------------------------------------------------- 1 | All possible "Workflow States" of the parent Workflow and the roles that are allowed to edit the states. -------------------------------------------------------------------------------- /core/doctype/workflow_document_state/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/doctype/workflow_document_state/workflow_document_state.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/workflow_state/README.md: -------------------------------------------------------------------------------- 1 | Workflow State Master e.g. "Approved", "Rejected" etc. -------------------------------------------------------------------------------- /core/doctype/workflow_state/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/doctype/workflow_state/test_workflow_state.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | test_records = [] -------------------------------------------------------------------------------- /core/doctype/workflow_state/workflow_state.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/workflow_transition/README.md: -------------------------------------------------------------------------------- 1 | Possible Transitions of the parent Workflow (e.g. from "Draft" to "Approved") and the actions related to it. -------------------------------------------------------------------------------- /core/doctype/workflow_transition/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/doctype/workflow_transition/workflow_transition.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /core/doctype/workflow_transition/workflow_transition.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-22 01:27:36", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:25", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "description": "Defines actions on states and the next step and allowed roles.", 11 | "doctype": "DocType", 12 | "istable": 1, 13 | "module": "Core", 14 | "name": "__common__" 15 | }, 16 | { 17 | "doctype": "DocField", 18 | "fieldtype": "Link", 19 | "in_list_view": 1, 20 | "name": "__common__", 21 | "parent": "Workflow Transition", 22 | "parentfield": "fields", 23 | "parenttype": "DocType", 24 | "permlevel": 0, 25 | "print_width": "200px", 26 | "reqd": 1, 27 | "width": "200px" 28 | }, 29 | { 30 | "doctype": "DocType", 31 | "name": "Workflow Transition" 32 | }, 33 | { 34 | "doctype": "DocField", 35 | "fieldname": "state", 36 | "label": "State", 37 | "options": "Workflow State" 38 | }, 39 | { 40 | "doctype": "DocField", 41 | "fieldname": "action", 42 | "label": "Action", 43 | "options": "Workflow Action" 44 | }, 45 | { 46 | "doctype": "DocField", 47 | "fieldname": "next_state", 48 | "label": "Next State", 49 | "options": "Workflow State" 50 | }, 51 | { 52 | "doctype": "DocField", 53 | "fieldname": "allowed", 54 | "label": "Allowed", 55 | "options": "Role" 56 | } 57 | ] -------------------------------------------------------------------------------- /core/page/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/page/data_import_tool/README.md: -------------------------------------------------------------------------------- 1 | Bulk import / update of data via file upload in CSV. -------------------------------------------------------------------------------- /core/page/data_import_tool/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /core/page/data_import_tool/data_import_tool.css: -------------------------------------------------------------------------------- 1 | .float-column { 2 | width: 40%; 3 | float: left; 4 | margin-right: 9%; 5 | } -------------------------------------------------------------------------------- /core/page/data_import_tool/data_import_tool.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2012-06-14 15:07:25", 4 | "docstatus": 0, 5 | "modified": "2013-07-11 14:41:54", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-upload", 12 | "module": "Core", 13 | "name": "__common__", 14 | "page_name": "Data Import Tool", 15 | "standard": "Yes", 16 | "title": "Data Import Tool" 17 | }, 18 | { 19 | "doctype": "Page Role", 20 | "name": "__common__", 21 | "parent": "data-import-tool", 22 | "parentfield": "roles", 23 | "parenttype": "Page", 24 | "role": "System Manager" 25 | }, 26 | { 27 | "doctype": "Page", 28 | "name": "data-import-tool" 29 | }, 30 | { 31 | "doctype": "Page Role" 32 | } 33 | ] -------------------------------------------------------------------------------- /core/page/desktop/README.md: -------------------------------------------------------------------------------- 1 | First screen after login. Array of module icons based on permission. -------------------------------------------------------------------------------- /core/page/desktop/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/page/desktop/desktop.html: -------------------------------------------------------------------------------- 1 |
3 |
4 |
5 |
6 |
7 | -------------------------------------------------------------------------------- /core/page/desktop/desktop.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-14 17:37:37", 4 | "docstatus": 0, 5 | "modified": "2013-07-11 14:41:56", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-th", 12 | "module": "Core", 13 | "name": "__common__", 14 | "page_name": "desktop", 15 | "standard": "Yes", 16 | "title": "Desktop" 17 | }, 18 | { 19 | "doctype": "Page Role", 20 | "name": "__common__", 21 | "parent": "desktop", 22 | "parentfield": "roles", 23 | "parenttype": "Page", 24 | "role": "All" 25 | }, 26 | { 27 | "doctype": "Page", 28 | "name": "desktop" 29 | }, 30 | { 31 | "doctype": "Page Role" 32 | } 33 | ] -------------------------------------------------------------------------------- /core/page/finder/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/core/page/finder/__init__.py -------------------------------------------------------------------------------- /core/page/finder/finder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/core/page/finder/finder.py -------------------------------------------------------------------------------- /core/page/finder/finder.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-09-06 11:53:22", 4 | "docstatus": 0, 5 | "modified": "2013-09-06 16:33:10", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-folder-open", 12 | "module": "Core", 13 | "name": "__common__", 14 | "page_name": "Finder", 15 | "standard": "Yes", 16 | "title": "Finder" 17 | }, 18 | { 19 | "doctype": "Page Role", 20 | "name": "__common__", 21 | "parent": "finder", 22 | "parentfield": "roles", 23 | "parenttype": "Page", 24 | "role": "All" 25 | }, 26 | { 27 | "doctype": "Page", 28 | "name": "finder" 29 | }, 30 | { 31 | "doctype": "Page Role" 32 | } 33 | ] -------------------------------------------------------------------------------- /core/page/messages/README.md: -------------------------------------------------------------------------------- 1 | Chat-like interface with list of messages, updates by various users, transactions. -------------------------------------------------------------------------------- /core/page/messages/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/page/messages/messages.css: -------------------------------------------------------------------------------- 1 | #message-post-text { 2 | } 3 | 4 | #message-list { 5 | } 6 | 7 | .message { 8 | padding: 7px; 9 | padding-left: 17px; 10 | border-bottom: 1px solid #ccc; 11 | } 12 | 13 | .message-mark { 14 | margin-left: -17px; 15 | width: 9px; 16 | position: absolute; 17 | height: 30px; 18 | } 19 | 20 | .message .help { 21 | margin-bottom: 0px; 22 | padding-bottom: 0px; 23 | color: #888; 24 | font-size: 11px; 25 | } 26 | 27 | .message-other { 28 | } 29 | 30 | .message-self { 31 | background-color: #eee; 32 | } -------------------------------------------------------------------------------- /core/page/messages/messages.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/core/page/messages/messages.html -------------------------------------------------------------------------------- /core/page/messages/messages.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2012-06-14 18:44:56", 4 | "docstatus": 0, 5 | "modified": "2013-07-11 14:43:32", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-envelope", 12 | "module": "Core", 13 | "name": "__common__", 14 | "page_name": "messages", 15 | "standard": "Yes", 16 | "title": "Messages" 17 | }, 18 | { 19 | "doctype": "Page Role", 20 | "name": "__common__", 21 | "parent": "messages", 22 | "parentfield": "roles", 23 | "parenttype": "Page", 24 | "role": "All" 25 | }, 26 | { 27 | "doctype": "Page", 28 | "name": "messages" 29 | }, 30 | { 31 | "doctype": "Page Role" 32 | } 33 | ] -------------------------------------------------------------------------------- /core/page/modules_setup/README.md: -------------------------------------------------------------------------------- 1 | Interface to show / hide modules. -------------------------------------------------------------------------------- /core/page/modules_setup/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/page/modules_setup/modules_setup.js: -------------------------------------------------------------------------------- 1 | 2 | wn.pages['modules_setup'].onload = function(wrapper) { 3 | wn.ui.make_app_page({ 4 | parent: wrapper, 5 | title: 'Show or Hide Modules', 6 | single_column: true 7 | }); 8 | 9 | wrapper.appframe.set_title_right("Update", function() { 10 | wn.modules_setup.update(this); 11 | }) 12 | 13 | $('
Select modules to be shown.
').appendTo($(wrapper).find(".layout-main")); 14 | $('
').appendTo($(wrapper).find(".layout-main")); 15 | 16 | wn.modules_setup.refresh_page(); 17 | } 18 | 19 | wn.modules_setup = { 20 | refresh_page: function() { 21 | $('#modules-list').empty(); 22 | 23 | $.each(keys(wn.modules).sort(), function(i, m) { 24 | if(m!="Setup") { 25 | var $chk = $("") 26 | .prependTo($('

'+m+'

').appendTo("#modules-list")); 27 | if(!wn.boot.hidden_modules || wn.boot.hidden_modules.indexOf(m)==-1) { 28 | $chk.prop("checked", true); 29 | } 30 | } 31 | }); 32 | }, 33 | update: function(btn) { 34 | var ml = []; 35 | $('#modules-list [data-module]:checkbox:not(:checked)').each(function() { 36 | ml.push($(this).attr('data-module')); 37 | }); 38 | 39 | return wn.call({ 40 | method: 'core.page.modules_setup.modules_setup.update', 41 | args: { 42 | ml: ml 43 | }, 44 | callback: function(r) { 45 | if(r.exc) msgprint("There were errors.") 46 | }, 47 | btn: btn 48 | }); 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /core/page/modules_setup/modules_setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | @webnotes.whitelist() 8 | def update(ml): 9 | """update modules""" 10 | webnotes.conn.set_global('hidden_modules', ml) 11 | webnotes.msgprint('Updated') 12 | webnotes.clear_cache() -------------------------------------------------------------------------------- /core/page/modules_setup/modules_setup.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2012-10-04 18:45:29", 4 | "docstatus": 0, 5 | "modified": "2013-07-11 14:43:37", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-cog", 12 | "module": "Core", 13 | "name": "__common__", 14 | "page_name": "modules_setup", 15 | "standard": "Yes", 16 | "title": "Modules Setup" 17 | }, 18 | { 19 | "doctype": "Page Role", 20 | "name": "__common__", 21 | "parent": "modules_setup", 22 | "parentfield": "roles", 23 | "parenttype": "Page", 24 | "role": "System Manager" 25 | }, 26 | { 27 | "doctype": "Page", 28 | "name": "modules_setup" 29 | }, 30 | { 31 | "doctype": "Page Role" 32 | } 33 | ] -------------------------------------------------------------------------------- /core/page/permission_manager/README.md: -------------------------------------------------------------------------------- 1 | Interface for easy browsing and setting of user permissions (DocPerm) on DocTypes. -------------------------------------------------------------------------------- /core/page/permission_manager/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/page/permission_manager/permission_manager.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-01-01 11:00:01", 4 | "docstatus": 0, 5 | "modified": "2013-07-11 14:43:42", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-lock", 12 | "module": "Core", 13 | "name": "__common__", 14 | "page_name": "Permission Manager", 15 | "standard": "Yes", 16 | "title": "Permission Manager" 17 | }, 18 | { 19 | "doctype": "Page Role", 20 | "name": "__common__", 21 | "parent": "permission-manager", 22 | "parentfield": "roles", 23 | "parenttype": "Page", 24 | "role": "System Manager" 25 | }, 26 | { 27 | "doctype": "Page", 28 | "name": "permission-manager" 29 | }, 30 | { 31 | "doctype": "Page Role" 32 | } 33 | ] -------------------------------------------------------------------------------- /core/page/todo/README.md: -------------------------------------------------------------------------------- 1 | To do application. Allows user to add, list, edit to-dos / assignments. -------------------------------------------------------------------------------- /core/page/todo/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/page/todo/todo.css: -------------------------------------------------------------------------------- 1 | .todoitem { 2 | padding-left: 21px; 3 | padding-bottom: 3px; 4 | clear: both; 5 | } 6 | 7 | .todoitem div { 8 | float: left; 9 | display: inline-block; 10 | padding: 3px; 11 | } 12 | 13 | .todoitem .label { 14 | width: 50px; 15 | margin-right: 11px; 16 | margin-top: 3px; 17 | text-align: center; 18 | } 19 | 20 | .todoitem .todo-date { 21 | margin-top: -2px; 22 | margin-right: 7px; 23 | color: #aaa; 24 | } 25 | 26 | .todoitem .close { 27 | margin-left: 5px; 28 | font-size: 17px; 29 | } 30 | 31 | .todoitem .close-span { 32 | float: right; 33 | } 34 | 35 | .todo-separator { 36 | border-bottom: 1px solid #DEB85F; 37 | margin-bottom: 5px; 38 | clear: both; 39 | } 40 | 41 | .todo-layout { 42 | background-color: #FFFDC9; 43 | min-height: 300px; 44 | } 45 | 46 | .todoitem .popup-on-click { 47 | margin: 0px 6px; 48 | } -------------------------------------------------------------------------------- /core/page/todo/todo.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-04-09 11:45:31", 4 | "docstatus": 0, 5 | "modified": "2013-07-11 14:44:45", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-check", 12 | "module": "Core", 13 | "name": "__common__", 14 | "page_name": "todo", 15 | "standard": "Yes", 16 | "title": "To Do" 17 | }, 18 | { 19 | "doctype": "Page Role", 20 | "name": "__common__", 21 | "parent": "todo", 22 | "parentfield": "roles", 23 | "parenttype": "Page", 24 | "role": "All" 25 | }, 26 | { 27 | "doctype": "Page", 28 | "name": "todo" 29 | }, 30 | { 31 | "doctype": "Page Role" 32 | } 33 | ] -------------------------------------------------------------------------------- /core/page/user_properties/README.md: -------------------------------------------------------------------------------- 1 | Interface to set user defaults (DefaultValue). -------------------------------------------------------------------------------- /core/page/user_properties/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/page/user_properties/user_properties.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-01-01 18:50:55", 4 | "docstatus": 0, 5 | "modified": "2013-07-11 14:45:20", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-user", 12 | "module": "Core", 13 | "name": "__common__", 14 | "page_name": "user-properties", 15 | "standard": "Yes", 16 | "title": "User Properties" 17 | }, 18 | { 19 | "doctype": "Page Role", 20 | "name": "__common__", 21 | "parent": "user-properties", 22 | "parentfield": "roles", 23 | "parenttype": "Page", 24 | "role": "System Manager" 25 | }, 26 | { 27 | "doctype": "Page", 28 | "name": "user-properties" 29 | }, 30 | { 31 | "doctype": "Page Role" 32 | } 33 | ] -------------------------------------------------------------------------------- /core/report/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/report/todo/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | -------------------------------------------------------------------------------- /core/report/todo/todo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | from webnotes.widgets.reportview import execute as runreport 7 | from webnotes.utils import getdate 8 | 9 | def execute(filters=None): 10 | priority_map = {"High": 3, "Medium": 2, "Low": 1} 11 | 12 | todo_list = runreport(doctype="ToDo", fields=["name", "date", "description", 13 | "priority", "reference_type", "reference_name", "assigned_by", "owner"], 14 | filters=[["ToDo", "checked", "!=", 1]]) 15 | 16 | todo_list.sort(key=lambda todo: (priority_map.get(todo.priority, 0), 17 | todo.date and getdate(todo.date) or getdate("1900-01-01")), reverse=True) 18 | 19 | columns = ["ID:Link/ToDo:90", "Priority::60", "Date:Date", "Description::150", 20 | "Assigned To/Owner:Data:120", "Assigned By:Data:120", "Reference::200"] 21 | 22 | result = [] 23 | for todo in todo_list: 24 | if todo.owner==webnotes.session.user or todo.assigned_by==webnotes.session.user: 25 | if todo.reference_type: 26 | todo.reference = """%s: %s""" % (todo.reference_type, 27 | todo.reference_name, todo.reference_type, todo.reference_name) 28 | else: 29 | todo.reference = None 30 | result.append([todo.name, todo.priority, todo.date, todo.description, 31 | todo.owner, todo.assigned_by, todo.reference]) 32 | 33 | return columns, result 34 | 35 | -------------------------------------------------------------------------------- /core/report/todo/todo.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-25 14:26:30", 4 | "docstatus": 0, 5 | "modified": "2013-02-25 14:26:51", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Report", 11 | "is_standard": "Yes", 12 | "name": "__common__", 13 | "ref_doctype": "ToDo", 14 | "report_name": "ToDo", 15 | "report_type": "Script Report" 16 | }, 17 | { 18 | "doctype": "Report", 19 | "name": "ToDo" 20 | } 21 | ] -------------------------------------------------------------------------------- /data/GeoIP.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/data/GeoIP.dat -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012 Web Notes Technologies Pvt. Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /public/css/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/css/font/FontAwesome.otf -------------------------------------------------------------------------------- /public/css/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/css/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/css/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/css/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/css/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/css/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/css/tree_grid.css: -------------------------------------------------------------------------------- 1 | .cell-title { 2 | font-weight: bold; 3 | } 4 | 5 | .cell-effort-driven { 6 | text-align: center; 7 | } 8 | 9 | .toggle { 10 | height: 9px; 11 | width: 9px; 12 | display: inline-block; 13 | } 14 | 15 | .toggle.expand { 16 | background: url("../lib/images/icons/expand.gif") no-repeat center center; 17 | } 18 | 19 | .toggle.collapse { 20 | background: url("../lib/images/icons/collapse.gif") no-repeat center center; 21 | } -------------------------------------------------------------------------------- /public/css/typeahead.css: -------------------------------------------------------------------------------- 1 | .typeahead, 2 | .tt-query, 3 | .tt-hint { 4 | } 5 | 6 | .tt-hint { 7 | color: #999; 8 | } 9 | 10 | .tt-dropdown-menu { 11 | width: 100%; 12 | margin-top: 3px; 13 | padding: 3px 0; 14 | background-color: #fff; 15 | border: 1px solid #ccc; 16 | border: 1px solid rgba(0, 0, 0, 0.2); 17 | -webkit-border-radius: 8px; 18 | -moz-border-radius: 8px; 19 | border-radius: 8px; 20 | -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); 21 | -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); 22 | box-shadow: 0 5px 10px rgba(0,0,0,.2); 23 | } 24 | 25 | .tt-suggestion { 26 | padding: 3px 20px; 27 | } 28 | 29 | .tt-suggestion.tt-is-under-cursor { 30 | color: #fff; 31 | background-color: #0097cf; 32 | } 33 | 34 | .tt-suggestion.tt-is-under-cursor .text-muted { 35 | color: #ddd; 36 | } 37 | 38 | .input-group input.tt-query { 39 | border-top-left-radius: 4px !important; 40 | border-bottom-left-radius: 4px !important; 41 | } 42 | 43 | .tt-suggestion p { 44 | margin: 0; 45 | } 46 | -------------------------------------------------------------------------------- /public/html/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ERPNext 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
%(splash)s
13 |
14 |
15 |
16 | 17 | 18 | 19 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /public/images/icons/accept.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/accept.gif -------------------------------------------------------------------------------- /public/images/icons/application.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/application.gif -------------------------------------------------------------------------------- /public/images/icons/arrow_down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/arrow_down.gif -------------------------------------------------------------------------------- /public/images/icons/arrow_up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/arrow_up.gif -------------------------------------------------------------------------------- /public/images/icons/bullet_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/bullet_arrow_down.png -------------------------------------------------------------------------------- /public/images/icons/close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/close.gif -------------------------------------------------------------------------------- /public/images/icons/collapse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/collapse.gif -------------------------------------------------------------------------------- /public/images/icons/error.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/error.gif -------------------------------------------------------------------------------- /public/images/icons/expand.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/expand.gif -------------------------------------------------------------------------------- /public/images/icons/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/folder.gif -------------------------------------------------------------------------------- /public/images/icons/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /public/images/icons/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/glyphicons-halflings.png -------------------------------------------------------------------------------- /public/images/icons/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/help.png -------------------------------------------------------------------------------- /public/images/icons/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/icons.png -------------------------------------------------------------------------------- /public/images/icons/lightbulb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/lightbulb.gif -------------------------------------------------------------------------------- /public/images/icons/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/link.png -------------------------------------------------------------------------------- /public/images/icons/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/minus.gif -------------------------------------------------------------------------------- /public/images/icons/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/page.png -------------------------------------------------------------------------------- /public/images/icons/paperclip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/paperclip.gif -------------------------------------------------------------------------------- /public/images/icons/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/plus.gif -------------------------------------------------------------------------------- /public/images/icons/resultset_first.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/resultset_first.gif -------------------------------------------------------------------------------- /public/images/icons/resultset_last.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/resultset_last.gif -------------------------------------------------------------------------------- /public/images/icons/resultset_next.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/resultset_next.gif -------------------------------------------------------------------------------- /public/images/icons/resultset_previous.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/resultset_previous.gif -------------------------------------------------------------------------------- /public/images/icons/sort_asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/sort_asc.gif -------------------------------------------------------------------------------- /public/images/icons/sort_desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/sort_desc.gif -------------------------------------------------------------------------------- /public/images/icons/wntoolbar-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/icons/wntoolbar-icons.png -------------------------------------------------------------------------------- /public/images/ui/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/avatar.png -------------------------------------------------------------------------------- /public/images/ui/button-load.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/button-load.gif -------------------------------------------------------------------------------- /public/images/ui/cancelled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/cancelled.png -------------------------------------------------------------------------------- /public/images/ui/drag-handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/drag-handle.png -------------------------------------------------------------------------------- /public/images/ui/field.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/field.jpg -------------------------------------------------------------------------------- /public/images/ui/navbarsep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/navbarsep.png -------------------------------------------------------------------------------- /public/images/ui/ripped-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/ripped-border.png -------------------------------------------------------------------------------- /public/images/ui/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/spinner.gif -------------------------------------------------------------------------------- /public/images/ui/sprinkles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/sprinkles.png -------------------------------------------------------------------------------- /public/images/ui/submitted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/submitted.png -------------------------------------------------------------------------------- /public/images/ui/vote_down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/vote_down.gif -------------------------------------------------------------------------------- /public/images/ui/vote_up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/images/ui/vote_up.gif -------------------------------------------------------------------------------- /public/js/legacy/globals.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | wn.provide('wn.widgets.form'); 5 | wn.provide('wn.widgets.report'); 6 | wn.provide('wn.utils'); 7 | wn.provide('wn.model'); 8 | wn.provide('wn.profile'); 9 | wn.provide('wn.session'); 10 | wn.provide('_f'); 11 | wn.provide('_p'); 12 | wn.provide('_r'); 13 | wn.provide('_startup_data') 14 | wn.provide('locals') 15 | wn.provide('locals.DocType') 16 | 17 | // setup custom binding for history 18 | wn.settings.no_history = 1; 19 | 20 | // constants 21 | var NEWLINE = '\n'; 22 | 23 | // user 24 | var profile=null; 25 | var user=null; 26 | var user_defaults=null; 27 | var user_roles=null; 28 | var user_fullname=null; 29 | var user_email=null; 30 | var user_img = {}; 31 | 32 | var pscript = {}; 33 | 34 | // Name Spaces 35 | // ============ 36 | 37 | // form 38 | var _f = {}; 39 | var _p = {}; 40 | var _r = {}; 41 | var FILTER_SEP = '\1'; 42 | 43 | // API globals 44 | var frms={}; 45 | var cur_frm=null; 46 | var pscript = {}; 47 | -------------------------------------------------------------------------------- /public/js/legacy/loaders.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | function loadreport(dt, rep_name, onload) { 5 | if(rep_name) 6 | wn.set_route('Report', dt, rep_name); 7 | else 8 | wn.set_route('Report', dt); 9 | } 10 | 11 | function loaddoc(doctype, name, onload) { 12 | wn.model.with_doctype(doctype, function() { 13 | if(locals.DocType[doctype].in_dialog) { 14 | _f.edit_record(doctype, name); 15 | } else { 16 | wn.set_route('Form', doctype, name); 17 | } 18 | }) 19 | } 20 | var load_doc = loaddoc; 21 | 22 | function new_doc(doctype, in_form) { 23 | wn.model.with_doctype(doctype, function() { 24 | var new_name = wn.model.make_new_doc_and_get_name(doctype); 25 | wn.set_route("Form", doctype, new_name); 26 | }) 27 | } 28 | var newdoc = new_doc; 29 | 30 | var pscript={}; 31 | function loadpage(page_name, call_back, no_history) { 32 | wn.set_route(page_name); 33 | } 34 | 35 | function loaddocbrowser(dt) { 36 | wn.set_route('List', dt); 37 | } 38 | -------------------------------------------------------------------------------- /public/js/lib/README.md: -------------------------------------------------------------------------------- 1 | # 3rd party libraries 2 | 3 | Import / Upgrade Guide 4 | 5 | ## JQuery UI 6 | 7 | Download modules 8 | 9 | - core 10 | - interactions 11 | - autocomplete 12 | - datepicker 13 | 14 | ## JQuery UI Bootstrap theme 15 | 16 | Changes images urls 17 | 18 | - from: url(images 19 | - to: url(../lib/js/lib/jquery/bootstrap_theme/images 20 | 21 | ## JQuery Gantt 22 | 23 | Not a very mature project. Please check css / js after updating -------------------------------------------------------------------------------- /public/js/lib/downloadify/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/downloadify/download.png -------------------------------------------------------------------------------- /public/js/lib/downloadify/downloadify.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/downloadify/downloadify.swf -------------------------------------------------------------------------------- /public/js/lib/jQuery.Gantt/README.md: -------------------------------------------------------------------------------- 1 | [Demo and Documentation](http://taitems.github.com/jQuery.Gantt/) 2 | ============== 3 | 4 | jQuery Gantt Chart is a simple chart that implements gantt functionality as 5 | a jQuery component. 6 | 7 | It's able to: 8 | 9 | - Read json data 10 | - Paging results 11 | - Display different colours for each task 12 | - Display short description as hints 13 | - Mark holidays 14 | 15 | Plugin was tested and should work on: 16 | 17 | - Firefox 4+ 18 | - Chrome 13+ 19 | - Safari 5+ 20 | - Opera 9+ 21 | - IE 8+ 22 | 23 | Distributed under an MIT license. -------------------------------------------------------------------------------- /public/js/lib/jQuery.Gantt/img/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jQuery.Gantt/img/grid.png -------------------------------------------------------------------------------- /public/js/lib/jQuery.Gantt/img/icon_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jQuery.Gantt/img/icon_sprite.png -------------------------------------------------------------------------------- /public/js/lib/jQuery.Gantt/img/loader_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jQuery.Gantt/img/loader_bg.png -------------------------------------------------------------------------------- /public/js/lib/jQuery.Gantt/img/slider_handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jQuery.Gantt/img/slider_handle.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_75_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-bg_glass_75_ffffff_1x400.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-bg_inset-soft_95_fef1ec_1x100.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /public/js/lib/jquery/bootstrap_theme/images/ui-icons_f6cf3b_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jquery/bootstrap_theme/images/ui-icons_f6cf3b_256x240.png -------------------------------------------------------------------------------- /public/js/lib/jquery/jquery.ui.timepicker-addon.css: -------------------------------------------------------------------------------- 1 | .ui-timepicker-div { border-top: 1px solid #aaa; } 2 | .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } 3 | .ui-timepicker-div dl { text-align: left; padding: 0px 10px; } 4 | .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } 5 | .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } 6 | .ui-timepicker-div td { font-size: 90%; } 7 | .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } 8 | .ui-slider-horizontal { 9 | margin-left: 5px; 10 | margin-top: 5px; 11 | } -------------------------------------------------------------------------------- /public/js/lib/jscolor/arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jscolor/arrow.gif -------------------------------------------------------------------------------- /public/js/lib/jscolor/cross.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jscolor/cross.gif -------------------------------------------------------------------------------- /public/js/lib/jscolor/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | jscolor demo 4 | 5 | 6 | 7 | 8 | 9 | Click here: 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/js/lib/jscolor/hs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jscolor/hs.png -------------------------------------------------------------------------------- /public/js/lib/jscolor/hv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/jscolor/hv.png -------------------------------------------------------------------------------- /public/js/lib/prettydate.js: -------------------------------------------------------------------------------- 1 | /* 2 | * JavaScript Pretty Date 3 | * Copyright (c) 2011 John Resig (ejohn.org) 4 | * Licensed under the MIT and GPL licenses. 5 | */ 6 | 7 | // Takes an ISO time and returns a string representing how 8 | // long ago the date represents. 9 | function prettyDate(time){ 10 | if(!time) return '' 11 | var date = new Date((time || "").replace(/-/g,"/").replace(/[TZ]/g," ").replace(/\.[0-9]*/, "")), 12 | diff = (((new Date()).getTime() - date.getTime()) / 1000), 13 | day_diff = Math.floor(diff / 86400); 14 | 15 | if ( isNaN(day_diff) || day_diff < 0 ) 16 | return ''; 17 | 18 | return day_diff == 0 && ( 19 | diff < 60 && "just now" || 20 | diff < 120 && "1 minute ago" || 21 | diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" || 22 | diff < 7200 && "1 hour ago" || 23 | diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") || 24 | day_diff == 1 && "Yesterday" || 25 | day_diff < 7 && day_diff + " days ago" || 26 | day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago" || 27 | day_diff < 365 && Math.ceil( day_diff / 30) + " months ago" || 28 | "> " + Math.floor( day_diff / 365 ) + " year(s) ago"; 29 | } 30 | 31 | // If jQuery is included in the page, adds a jQuery plugin to handle it as well 32 | if ( typeof jQuery != "undefined" ) 33 | jQuery.fn.prettyDate = function(){ 34 | return this.each(function(){ 35 | var date = prettyDate(this.title); 36 | if ( date ) 37 | jQuery(this).text( date ); 38 | }); 39 | }; 40 | -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/actions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/actions.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/ajax-loader-small.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/ajax-loader-small.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/arrow_redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/arrow_redo.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/arrow_right_peppermint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/arrow_right_peppermint.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/arrow_right_spearmint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/arrow_right_spearmint.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/arrow_undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/arrow_undo.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/bullet_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/bullet_blue.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/bullet_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/bullet_star.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/bullet_toggle_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/bullet_toggle_minus.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/bullet_toggle_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/bullet_toggle_plus.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/calendar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/calendar.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/collapse.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/collapse.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/comment_yellow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/comment_yellow.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/down.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/drag-handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/drag-handle.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/editor-helper-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/editor-helper-bg.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/expand.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/expand.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/header-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/header-bg.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/header-columns-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/header-columns-bg.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/header-columns-over-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/header-columns-over-bg.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/help.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/info.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/info.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/listview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/listview.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/pencil.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/pencil.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/row-over-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/row-over-bg.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/sort-asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/sort-asc.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/sort-asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/sort-asc.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/sort-desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/sort-desc.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/sort-desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/sort-desc.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/stripes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/stripes.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/tag_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/tag_red.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/tick.png -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/user_identity.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/user_identity.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/images/user_identity_plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/public/js/lib/slickgrid/images/user_identity_plus.gif -------------------------------------------------------------------------------- /public/js/lib/slickgrid/plugins/slick.autotooltips.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | // register namespace 3 | $.extend(true, window, { 4 | "Slick": { 5 | "AutoTooltips": AutoTooltips 6 | } 7 | }); 8 | 9 | 10 | function AutoTooltips(options) { 11 | var _grid; 12 | var _self = this; 13 | var _defaults = { 14 | maxToolTipLength: null 15 | }; 16 | 17 | function init(grid) { 18 | options = $.extend(true, {}, _defaults, options); 19 | _grid = grid; 20 | _grid.onMouseEnter.subscribe(handleMouseEnter); 21 | } 22 | 23 | function destroy() { 24 | _grid.onMouseEnter.unsubscribe(handleMouseEnter); 25 | } 26 | 27 | function handleMouseEnter(e, args) { 28 | var cell = _grid.getCellFromEvent(e); 29 | if (cell) { 30 | var node = _grid.getCellNode(cell.row, cell.cell); 31 | if ($(node).innerWidth() < node.scrollWidth) { 32 | var text = $.trim($(node).text()); 33 | if (options.maxToolTipLength && text.length > options.maxToolTipLength) { 34 | text = text.substr(0, options.maxToolTipLength - 3) + "..."; 35 | } 36 | $(node).attr("title", text); 37 | } else { 38 | $(node).attr("title", ""); 39 | } 40 | } 41 | } 42 | 43 | $.extend(this, { 44 | "init": init, 45 | "destroy": destroy 46 | }); 47 | } 48 | })(jQuery); -------------------------------------------------------------------------------- /public/js/lib/slickgrid/plugins/slick.headerbuttons.css: -------------------------------------------------------------------------------- 1 | .slick-column-name { 2 | /** 3 | * This makes all "float:right" elements after it that spill over to the next line 4 | * display way below the lower boundary of the column thus hiding them. 5 | */ 6 | display: inline-block; 7 | float: left; 8 | margin-bottom: 100px; 9 | } 10 | 11 | .slick-header-button { 12 | display: inline-block; 13 | float: right; 14 | vertical-align: top; 15 | margin: 1px; 16 | /** 17 | * This makes all "float:right" elements after it that spill over to the next line 18 | * display way below the lower boundary of the column thus hiding them. 19 | */ 20 | margin-bottom: 100px; 21 | height: 15px; 22 | width: 15px; 23 | background-repeat: no-repeat; 24 | background-position: center center; 25 | cursor: pointer; 26 | } 27 | 28 | .slick-header-button-hidden { 29 | width: 0; 30 | 31 | -webkit-transition: 0.2s width; 32 | -ms-transition: 0.2s width; 33 | transition: 0.2s width; 34 | } 35 | 36 | .slick-header-column:hover > .slick-header-button { 37 | width: 15px; 38 | } -------------------------------------------------------------------------------- /public/js/lib/slickgrid/plugins/slick.headermenu.css: -------------------------------------------------------------------------------- 1 | /* Menu button */ 2 | .slick-header-menubutton { 3 | position: absolute; 4 | right: 0; 5 | top: 0; 6 | bottom: 0; 7 | width: 14px; 8 | background-repeat: no-repeat; 9 | background-position: left center; 10 | cursor: pointer; 11 | 12 | display: none; 13 | border-left: thin ridge silver; 14 | } 15 | 16 | .slick-header-column:hover > .slick-header-menubutton, 17 | .slick-header-column-active .slick-header-menubutton { 18 | display: inline-block; 19 | } 20 | 21 | /* Menu */ 22 | .slick-header-menu { 23 | position: absolute; 24 | display: inline-block; 25 | margin: 0; 26 | padding: 2px; 27 | cursor: default; 28 | } 29 | 30 | 31 | /* Menu items */ 32 | .slick-header-menuitem { 33 | list-style: none; 34 | margin: 0; 35 | padding: 0; 36 | cursor: pointer; 37 | } 38 | 39 | .slick-header-menuicon { 40 | display: inline-block; 41 | width: 16px; 42 | height: 16px; 43 | vertical-align: middle; 44 | margin-right: 4px; 45 | background-repeat: no-repeat; 46 | background-position: center center; 47 | } 48 | 49 | .slick-header-menucontent { 50 | display: inline-block; 51 | vertical-align: middle; 52 | } 53 | 54 | 55 | /* Disabled */ 56 | .slick-header-menuitem-disabled { 57 | color: silver; 58 | } 59 | -------------------------------------------------------------------------------- /public/js/wn/defaults.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | wn.defaults = { 5 | get_user_default: function(key) { 6 | var d = wn.boot.profile.defaults[key]; 7 | if($.isArray(d)) d = d[0]; 8 | return d; 9 | }, 10 | get_user_defaults: function(key) { 11 | var d = wn.boot.profile.defaults[key]; 12 | if(!$.isArray(d)) d = [d]; 13 | return d; 14 | }, 15 | get_global_default: function(key) { 16 | var d = sys_defaults[key]; 17 | if($.isArray(d)) d = d[0]; 18 | return d; 19 | }, 20 | get_global_defaults: function(key) { 21 | var d = sys_defaults[key]; 22 | if(!$.isArray(d)) d = [d]; 23 | return d; 24 | }, 25 | set_default: function(key, value, callback) { 26 | if(typeof value=="string") 27 | value = JSON.stringify(value); 28 | 29 | wn.boot.profile.defaults[key] = value; 30 | return wn.call({ 31 | method: "webnotes.client.set_default", 32 | args: { 33 | key: key, 34 | value: value 35 | }, 36 | callback: callback || function(r) {} 37 | }); 38 | }, 39 | get_default: function(key) { 40 | var value = wn.boot.profile.defaults[key]; 41 | if(value) { 42 | try { 43 | return JSON.parse(value) 44 | } catch(e) { 45 | return value; 46 | } 47 | } 48 | }, 49 | } -------------------------------------------------------------------------------- /public/js/wn/misc/datetime.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | wn.provide('wn.datetime'); 5 | 6 | var double_digit = function(d) { 7 | if(cint(d)<10) { 8 | return "0" + cint(d); 9 | } else { 10 | return d + ""; 11 | } 12 | } 13 | 14 | 15 | $.extend(wn.datetime, { 16 | validate: function(v) { 17 | if(!v) return; 18 | 19 | var time_part = ""; 20 | if(v.indexOf(" ")!=-1) { 21 | var tmp = v.split(" "); 22 | v = tmp[0]; 23 | time_part = " " + tmp[1]; 24 | } 25 | 26 | var parts = $.map(v.split('-'), function(part) { return cint(part) ? part : null; }); 27 | if(parts.length!=3) { 28 | return null; 29 | } 30 | var test_date = new Date(parts[0], parts[1]-1, parts[2]); 31 | if(test_date.getFullYear() !=parts[0] 32 | || (test_date.getMonth() + 1) != parts[1] 33 | || test_date.getDate() != parts[2]) 34 | return null; 35 | 36 | return v + time_part; 37 | }, 38 | now_datetime: function() { 39 | return wn.datetime.get_datetime_as_string(new Date()); 40 | }, 41 | now_time: function() { 42 | var d = new Date(); 43 | return [double_digit(d.getHours()), double_digit(d.getMinutes()), double_digit(d.getSeconds())].join(":") 44 | }, 45 | get_datetime_as_string: function(d) { 46 | if(!d) return null; 47 | return [d.getFullYear(), double_digit(d.getMonth()+1), double_digit(d.getDate())].join("-") + " " 48 | + [double_digit(d.getHours()), double_digit(d.getMinutes()), double_digit(d.getSeconds())].join(":"); 49 | } 50 | }); -------------------------------------------------------------------------------- /public/js/wn/provide.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | // provide a namespace 5 | if(!window.wn)wn = {} 6 | wn.provide = function(namespace) { 7 | // docs: create a namespace // 8 | var nsl = namespace.split('.'); 9 | var parent = window; 10 | for(var i=0; i
").appendTo($(wrapper).find(".layout-main")); 14 | 15 | var route = wn.get_route(); 16 | if(route.length < 2) { 17 | msgprint("To run a test add the module name in the route after 'test-runner/'. \ 18 | For example, #test-runner/lib/js/wn/test_app.js"); 19 | return; 20 | } 21 | 22 | wn.require("lib/js/lib/jquery/qunit.js"); 23 | wn.require("lib/js/lib/jquery/qunit.css"); 24 | 25 | QUnit.load(); 26 | 27 | wn.require(route.splice(1).join("/")); 28 | } -------------------------------------------------------------------------------- /public/js/wn/website/editable.js: -------------------------------------------------------------------------------- 1 | wn.make_editable = function(editor, doctype, name, fieldname) { 2 | wn.require("js/editor.min.js"); 3 | 4 | WebPageEditor = bsEditor.extend({ 5 | onhide: function(action) { 6 | this._super(action); 7 | this.toggle_edit_mode(false); 8 | }, 9 | setup_editor: function(editor) { 10 | this._super(editor); 11 | this.toggle_edit_mode(false); 12 | }, 13 | toggle_edit_mode: function(bool) { 14 | var me = this; 15 | this._super(bool); 16 | 17 | if(!bool) { 18 | var $edit_btn = $(repl('
  • Edit %(doctype)s
  • \ 19 |
  • ', {doctype: doctype})) 20 | .prependTo($("#website-post-login ul.dropdown-menu")); 21 | 22 | $edit_btn.find("a") 23 | .on("click", function() { 24 | me.toggle_edit_mode(true); 25 | $edit_btn.remove(); 26 | return false; 27 | }); 28 | } 29 | } 30 | }); 31 | 32 | bseditor = new WebPageEditor({ 33 | editor: editor, 34 | onsave: function(bseditor) { 35 | wn.call({ 36 | type: "POST", 37 | method: "webnotes.client.set_value", 38 | args: { 39 | doctype: doctype, 40 | name: name, 41 | fieldname: fieldname, 42 | value: bseditor.get_value() 43 | }, 44 | callback: function(r) { 45 | wn.msgprint(r.exc ? "Error" : "Saved"); 46 | if(!r.exc) 47 | editor.html(r.message[0][fieldname]); 48 | } 49 | }); 50 | } 51 | }); 52 | }; -------------------------------------------------------------------------------- /pythonrc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.7 2 | 3 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 4 | # MIT License. See license.txt 5 | 6 | from __future__ import unicode_literals 7 | 8 | import os, sys 9 | sys.path = [".", "lib", "app"] + sys.path 10 | 11 | import webnotes 12 | webnotes.connect(site=os.environ.get("site")) 13 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | chardet 2 | cssmin 3 | dropbox 4 | google-api-python-client 5 | gunicorn 6 | httplib2 7 | jinja2 8 | markdown2 9 | markupsafe 10 | mysql-python==1.2.4 11 | pygeoip 12 | python-dateutil 13 | python-memcached 14 | pytz==2013d 15 | requests 16 | six 17 | slugify 18 | termcolor 19 | werkzeug 20 | semantic_version 21 | gitpython==0.3.2.RC1 22 | -------------------------------------------------------------------------------- /webnotes/.no_timestamps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/webnotes/.no_timestamps -------------------------------------------------------------------------------- /webnotes/country_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # all country info 5 | from __future__ import unicode_literals 6 | 7 | import os, json, webnotes 8 | 9 | def get_country_info(country=None): 10 | data = get_all() 11 | data = webnotes._dict(data.get(country, {})) 12 | if not 'date_format' in data: 13 | data.date_format = "dd-mm-yyyy" 14 | 15 | return data 16 | 17 | def get_all(): 18 | with open(os.path.join(os.path.dirname(__file__), "country_info.json"), "r") as local_info: 19 | all_data = json.loads(local_info.read()) 20 | return all_data 21 | 22 | @webnotes.whitelist() 23 | def get_country_timezone_info(): 24 | import pytz 25 | return { 26 | "country_info": get_all(), 27 | "all_timezones": pytz.all_timezones 28 | } 29 | 30 | def update(): 31 | with open(os.path.join(os.path.dirname(__file__), "currency_info.json"), "r") as nformats: 32 | nformats = json.loads(nformats.read()) 33 | 34 | all_data = get_all() 35 | 36 | for country in all_data: 37 | data = all_data[country] 38 | data["number_format"] = nformats.get(data.get("currency", "default"), 39 | nformats.get("default"))["display"] 40 | 41 | print all_data 42 | 43 | with open(os.path.join(os.path.dirname(__file__), "country_info.json"), "w") as local_info: 44 | local_info.write(json.dumps(all_data, indent=1)) 45 | -------------------------------------------------------------------------------- /webnotes/install_lib/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals -------------------------------------------------------------------------------- /webnotes/install_lib/setup_public_folder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # make public folders 5 | 6 | from __future__ import unicode_literals 7 | import os 8 | import webnotes 9 | 10 | def make(site=None): 11 | """make public folder symlinks if missing""" 12 | from webnotes.utils import get_site_base_path, get_base_path, get_path 13 | 14 | webnotes.init(site=site) 15 | 16 | site_path = get_site_base_path() if site else get_base_path() 17 | 18 | # setup standard folders 19 | for param in (("public_path", "public"), ("backup_path", "public/backups"), ("files_path", "public/files")): 20 | path = os.path.join(site_path, webnotes.conf.get(param[0], param[1])) 21 | if not os.path.exists(path): 22 | os.mkdir(path) 23 | 24 | # setup js and css folders 25 | if not site: 26 | for folder in ("js", "css"): 27 | path = get_path(webnotes.conf.get("public_path", "public"), folder) 28 | if not os.path.exists(path): 29 | os.mkdir(path) 30 | 31 | os.chdir(webnotes.conf.get("public_path", "public")) 32 | symlinks = [ 33 | ["app", "../app/public"], 34 | ["lib", "../lib/public"], 35 | ] 36 | 37 | for link in symlinks: 38 | if not os.path.exists(link[0]) and os.path.exists(link[1]): 39 | os.symlink(link[1], link[0]) 40 | 41 | os.chdir("..") 42 | -------------------------------------------------------------------------------- /webnotes/memc.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | from __future__ import unicode_literals 4 | 5 | import memcache 6 | from webnotes import conf 7 | 8 | class MClient(memcache.Client): 9 | """memcache client that will automatically prefix conf.db_name""" 10 | def n(self, key): 11 | return (conf.db_name + ":" + key.replace(" ", "_")).encode('utf-8') 12 | 13 | def set_value(self, key, val): 14 | self.set(self.n(key), val) 15 | 16 | def get_value(self, key, builder=None): 17 | if builder and conf.get("auto_cache_clear") or False: 18 | return builder() 19 | 20 | val = self.get(self.n(key)) 21 | if not val and builder: 22 | val = builder() 23 | self.set_value(key, val) 24 | return val 25 | 26 | def delete_value(self, key): 27 | self.delete(self.n(key)) 28 | -------------------------------------------------------------------------------- /webnotes/middlewares.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | import webnotes 4 | import os 5 | 6 | from werkzeug.wsgi import SharedDataMiddleware 7 | from webnotes.utils import get_site_name, get_site_path, get_site_base_path, get_path, cstr 8 | 9 | class StaticDataMiddleware(SharedDataMiddleware): 10 | def __call__(self, environ, start_response): 11 | self.environ = environ 12 | return super(StaticDataMiddleware, self).__call__(environ, start_response) 13 | 14 | def get_directory_loader(self, directory): 15 | def loader(path): 16 | import conf 17 | path = cstr(path) 18 | fail = True 19 | if hasattr(conf, 'sites_dir'): 20 | site = get_site_name(self.environ.get('HTTP_HOST')) 21 | possible_site_path = get_path(directory, path, base=os.path.join(conf.sites_dir, site)) 22 | if os.path.isfile(possible_site_path): 23 | path = possible_site_path 24 | fail = False 25 | 26 | if fail and os.path.isfile(get_path(directory, path)): 27 | path = get_path(directory, path) 28 | fail = False 29 | 30 | if fail: 31 | return None, None 32 | return os.path.basename(path), self._opener(path) 33 | return loader 34 | -------------------------------------------------------------------------------- /webnotes/model/workflow.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | def get_workflow_name(doctype): 8 | if getattr(webnotes.local, "workflow_names", None) is None: 9 | webnotes.local.workflow_names = {} 10 | 11 | if doctype not in webnotes.local.workflow_names: 12 | workflow_name = webnotes.conn.get_value("Workflow", {"document_type": doctype, 13 | "is_active": "1"}, "name") 14 | 15 | # no active? get default workflow 16 | if not workflow_name: 17 | workflow_name = webnotes.conn.get_value("Workflow", {"document_type": doctype}, 18 | "name") 19 | 20 | webnotes.local.workflow_names[doctype] = workflow_name 21 | 22 | return webnotes.local.workflow_names[doctype] 23 | 24 | def get_default_state(doctype): 25 | workflow_name = get_workflow_name(doctype) 26 | return webnotes.conn.get_value("Workflow Document State", {"parent": workflow_name, 27 | "idx":1}, "state") 28 | 29 | def get_state_fieldname(doctype): 30 | workflow_name = get_workflow_name(doctype) 31 | return webnotes.conn.get_value("Workflow", workflow_name, "workflow_state_field") 32 | -------------------------------------------------------------------------------- /webnotes/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | 6 | def insert_test_data(doctype, sort_fn=None): 7 | import webnotes.model 8 | data = get_test_doclist(doctype) 9 | if sort_fn: 10 | data = sorted(data, key=sort_fn) 11 | 12 | for doclist in data: 13 | webnotes.insert(doclist) 14 | 15 | def get_test_doclist(doctype, name=None): 16 | """get test doclist, collection of doclists""" 17 | import os, webnotes 18 | from webnotes import conf 19 | from webnotes.modules.utils import peval_doclist 20 | from webnotes.modules import scrub 21 | 22 | doctype = scrub(doctype) 23 | doctype_path = os.path.join(os.path.dirname(os.path.abspath(conf.__file__)), 24 | conf.test_data_path, doctype) 25 | 26 | if name: 27 | with open(os.path.join(doctype_path, scrub(name) + '.txt'), 'r') as txtfile: 28 | doclist = peval_doclist(txtfile.read()) 29 | 30 | return doclist 31 | 32 | else: 33 | all_doclists = [] 34 | for fname in filter(lambda n: n.endswith('.txt'), os.listdir(doctype_path)): 35 | with open(os.path.join(doctype_path, scrub(fname)), 'r') as txtfile: 36 | all_doclists.append(peval_doclist(txtfile.read())) 37 | 38 | return all_doclists 39 | -------------------------------------------------------------------------------- /webnotes/tests/test_db.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import unittest 6 | import webnotes 7 | from webnotes.test_runner import make_test_records 8 | 9 | class TestDB(unittest.TestCase): 10 | def test_get_value(self): 11 | from webnotes.utils import now_datetime 12 | import time 13 | webnotes.conn.sql("""delete from `tabProfile` where name not in ('Administrator', 'Guest')""") 14 | 15 | now = now_datetime() 16 | 17 | self.assertEquals(webnotes.conn.get_value("Profile", {"name": ["=", "Administrator"]}), "Administrator") 18 | self.assertEquals(webnotes.conn.get_value("Profile", {"name": ["like", "Admin%"]}), "Administrator") 19 | self.assertEquals(webnotes.conn.get_value("Profile", {"name": ["!=", "Guest"]}), "Administrator") 20 | self.assertEquals(webnotes.conn.get_value("Profile", {"modified": ["<", now]}), "Administrator") 21 | self.assertEquals(webnotes.conn.get_value("Profile", {"modified": ["<=", now]}), "Administrator") 22 | 23 | time.sleep(2) 24 | if "Profile" in webnotes.test_objects: 25 | del webnotes.test_objects["Profile"] 26 | make_test_records("Profile") 27 | 28 | self.assertEquals("test1@example.com", webnotes.conn.get_value("Profile", {"modified": [">", now]})) 29 | self.assertEquals("test1@example.com", webnotes.conn.get_value("Profile", {"modified": [">=", now]})) 30 | 31 | -------------------------------------------------------------------------------- /webnotes/tests/test_geo_ip.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | import webnotes 5 | import unittest 6 | 7 | class TestGeoIP(unittest.TestCase): 8 | def test_geo_ip(self): 9 | from webnotes.sessions import get_geo_ip_country 10 | self.assertEquals(get_geo_ip_country("223.29.223.255"), "India") 11 | self.assertEquals(get_geo_ip_country("4.18.32.80"), "United States") 12 | self.assertEquals(get_geo_ip_country("217.194.147.25"), "United States") -------------------------------------------------------------------------------- /webnotes/utils/file_lock.py: -------------------------------------------------------------------------------- 1 | import os 2 | from time import time 3 | from webnotes.utils import get_site_path 4 | 5 | class LockTimeoutError(Exception): 6 | pass 7 | 8 | def create_lock(name): 9 | lock_path = get_lock_path(name) 10 | if not check_lock(lock_path): 11 | return touch_file(lock_path) 12 | else: 13 | return False 14 | 15 | def touch_file(path): 16 | with open(path, 'a'): 17 | os.utime(path, None) 18 | return True 19 | 20 | def check_lock(path): 21 | if not os.path.exists(path): 22 | return False 23 | if time() - os.path.getmtime(path) > 600: 24 | raise LockTimeoutError(path) 25 | return True 26 | 27 | def delete_lock(name): 28 | lock_path = get_lock_path(name) 29 | try: 30 | os.remove(lock_path) 31 | except OSError: 32 | pass 33 | return True 34 | 35 | def get_lock_path(name): 36 | name = name.lower() 37 | lock_path = get_site_path(name + '.lock') 38 | return lock_path 39 | -------------------------------------------------------------------------------- /webnotes/widgets/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /webnotes/widgets/calendar.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | 6 | import webnotes 7 | from webnotes import _ 8 | import json 9 | 10 | @webnotes.whitelist() 11 | def update_event(args, field_map): 12 | args = webnotes._dict(json.loads(args)) 13 | field_map = webnotes._dict(json.loads(field_map)) 14 | w = webnotes.bean(args.doctype, args.name) 15 | w.doc.fields[field_map.start] = args[field_map.start] 16 | w.doc.fields[field_map.end] = args[field_map.end] 17 | w.save() 18 | 19 | -------------------------------------------------------------------------------- /webnotes/widgets/form/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | -------------------------------------------------------------------------------- /webnotes/widgets/form/test_form.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes, unittest 6 | 7 | from webnotes.widgets.form.utils import get_linked_docs 8 | 9 | class TestForm(unittest.TestCase): 10 | def test_linked_with(self): 11 | results = get_linked_docs("Role", "System Manager") 12 | self.assertTrue("Profile" in results) 13 | self.assertTrue("DocType" in results) 14 | 15 | if __name__=="__main__": 16 | webnotes.connect() 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /webnotes/widgets/page_body.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | redirect_template = ''' 6 | 7 | 8 | %s 9 | 10 | 11 | Redirecting... 12 | 13 | ''' -------------------------------------------------------------------------------- /website/README.md: -------------------------------------------------------------------------------- 1 | Module for website management. 2 | 3 | Contains: 4 | 5 | - DocTypes for Web Page, Blogs 6 | - Templates 7 | - Settings 8 | - Generators for Item, Blog Post, Item Group -------------------------------------------------------------------------------- /website/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | install_docs = [ 3 | {"doctype":"Role", "role_name":"Blogger", "name":"Blogger"}, 4 | {"doctype":"Role", "role_name":"Website Manager", "name":"Website Manager"}, 5 | ] 6 | 7 | import webnotes 8 | -------------------------------------------------------------------------------- /website/doctype/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/doctype/about_us_settings/README.md: -------------------------------------------------------------------------------- 1 | Configuration for "About" page in the website that shows company, history and team. -------------------------------------------------------------------------------- /website/doctype/about_us_settings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/about_us_settings/__init__.py -------------------------------------------------------------------------------- /website/doctype/about_us_settings/about_us_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl 12 | 13 | def on_update(self): 14 | from webnotes.webutils import clear_cache 15 | clear_cache("about") 16 | 17 | def get_args(): 18 | obj = webnotes.get_obj("About Us Settings") 19 | return { 20 | "obj": obj 21 | } -------------------------------------------------------------------------------- /website/doctype/about_us_settings/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/about_us_settings/templates/__init__.py -------------------------------------------------------------------------------- /website/doctype/about_us_settings/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/about_us_settings/templates/pages/__init__.py -------------------------------------------------------------------------------- /website/doctype/about_us_settings/templates/pages/about.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | def get_context(): 8 | return { 9 | "obj": webnotes.bean("About Us Settings", "About Us Settings").get_controller() 10 | } -------------------------------------------------------------------------------- /website/doctype/about_us_team_member/README.md: -------------------------------------------------------------------------------- 1 | Details of team member for About Us page. -------------------------------------------------------------------------------- /website/doctype/about_us_team_member/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/about_us_team_member/__init__.py -------------------------------------------------------------------------------- /website/doctype/about_us_team_member/about_us_team_member.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /website/doctype/about_us_team_member/about_us_team_member.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-03-07 11:55:11", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:03", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "DocType", 11 | "istable": 1, 12 | "module": "Website", 13 | "name": "__common__" 14 | }, 15 | { 16 | "doctype": "DocField", 17 | "in_list_view": 1, 18 | "name": "__common__", 19 | "parent": "About Us Team Member", 20 | "parentfield": "fields", 21 | "parenttype": "DocType", 22 | "permlevel": 0 23 | }, 24 | { 25 | "doctype": "DocType", 26 | "name": "About Us Team Member" 27 | }, 28 | { 29 | "doctype": "DocField", 30 | "fieldname": "full_name", 31 | "fieldtype": "Data", 32 | "label": "Full Name", 33 | "reqd": 1, 34 | "width": "150px" 35 | }, 36 | { 37 | "doctype": "DocField", 38 | "fieldname": "image_link", 39 | "fieldtype": "Select", 40 | "label": "Image Link", 41 | "options": "attach_files:", 42 | "width": "150px" 43 | }, 44 | { 45 | "doctype": "DocField", 46 | "fieldname": "bio", 47 | "fieldtype": "Small Text", 48 | "label": "Bio", 49 | "reqd": 1, 50 | "width": "200px" 51 | } 52 | ] -------------------------------------------------------------------------------- /website/doctype/blog_category/README.md: -------------------------------------------------------------------------------- 1 | Blog category. -------------------------------------------------------------------------------- /website/doctype/blog_category/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blog_category/__init__.py -------------------------------------------------------------------------------- /website/doctype/blog_category/blog_category.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl 12 | 13 | def on_update(self): 14 | # for blog footer 15 | from webnotes.webutils import clear_cache 16 | clear_cache() 17 | -------------------------------------------------------------------------------- /website/doctype/blog_category/blog_category.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-03-08 09:41:11", 4 | "docstatus": 0, 5 | "modified": "2013-07-05 14:27:02", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "field:category_name", 11 | "doctype": "DocType", 12 | "document_type": "Master", 13 | "icon": "icon-tag", 14 | "module": "Website", 15 | "name": "__common__" 16 | }, 17 | { 18 | "doctype": "DocField", 19 | "fieldname": "category_name", 20 | "fieldtype": "Data", 21 | "label": "Category Name", 22 | "name": "__common__", 23 | "parent": "Blog Category", 24 | "parentfield": "fields", 25 | "parenttype": "DocType", 26 | "permlevel": 0, 27 | "reqd": 1 28 | }, 29 | { 30 | "doctype": "DocPerm", 31 | "name": "__common__", 32 | "parent": "Blog Category", 33 | "parentfield": "permissions", 34 | "parenttype": "DocType", 35 | "permlevel": 0, 36 | "read": 1 37 | }, 38 | { 39 | "doctype": "DocType", 40 | "name": "Blog Category" 41 | }, 42 | { 43 | "doctype": "DocField" 44 | }, 45 | { 46 | "cancel": 1, 47 | "create": 1, 48 | "doctype": "DocPerm", 49 | "role": "Website Manager", 50 | "write": 1 51 | }, 52 | { 53 | "doctype": "DocPerm", 54 | "role": "Blogger" 55 | } 56 | ] -------------------------------------------------------------------------------- /website/doctype/blog_post/README.md: -------------------------------------------------------------------------------- 1 | Blog post for "Blogs" section of website. -------------------------------------------------------------------------------- /website/doctype/blog_post/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blog_post/__init__.py -------------------------------------------------------------------------------- /website/doctype/blog_post/blog_post.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | cur_frm.cscript.refresh = function(doc) { 5 | if(!doc.__islocal && doc.published) { 6 | if(!doc.email_sent) { 7 | cur_frm.add_custom_button('Email Subscribers', function() { 8 | $c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) { 9 | cur_frm.refresh(); 10 | }); 11 | }); 12 | } 13 | 14 | cur_frm.appframe.add_button("View In Website", function() { 15 | window.open(doc.page_name); 16 | }, "icon-globe"); 17 | } 18 | } -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blog_post/templates/__init__.py -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/generators/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blog_post/templates/generators/__init__.py -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/generators/blog_post.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | 3 | {% block content %} 4 |
    5 |

    {{ title }}

    6 | 7 | 8 |
    9 | / 10 | {{ updated }}
    11 |
    12 |
    13 | {{ content }} 14 |
    15 | 16 | {% if blogger_info %} 17 |
    18 | {% include "lib/website/doctype/blog_post/templates/includes/blogger.html" %} 19 | {% endif %} 20 |
    21 |

    Comments

    22 | {% include 'lib/website/templates/includes/comments.html' %} 23 |
    24 | 34 | {% include 'lib/website/doctype/blog_post/templates/includes/blog_footer.html' %} 35 | {% endblock %} -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/generators/blog_post.py: -------------------------------------------------------------------------------- 1 | doctype = "Blog Post" 2 | condition_field = "published" -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/includes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blog_post/templates/includes/__init__.py -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/includes/blog.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/includes/blog_footer.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | {% if categories %} 4 |
    Explore posts by categories
    5 | 10 |

    11 | {% endif %} 12 |

    Show posts by everyone. Meet the writers of this blog

    13 |
    14 | -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/includes/blog_subscribe.html: -------------------------------------------------------------------------------- 1 |

    Subscribe

    2 |
    3 |

    4 | 5 |

    6 |

    7 | 8 | RSS Feed 9 |

    -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/includes/blogger.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 5 |
    6 |
    7 |
    8 |

    {{ blogger_info.full_name }}

    9 |

    {{ blogger_info.bio }}

    10 |

    11 | All Posts By {{ blogger_info.full_name }}

    12 |
    13 |
    -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blog_post/templates/pages/__init__.py -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/pages/blog.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | 3 | {% block javascript %} 4 | 7 | {% endblock %} 8 | 9 | {% block css %} 10 | 13 | {% endblock %} 14 | 15 | {% set title="Blog" %} 16 | 17 | {% block content %} 18 |
    19 |

    {{ blog_title }}

    20 | {% if blog_introduction %} 21 |

    {{ blog_introduction }}

    22 | {% endif %} 23 | 24 |
    25 |
    26 |
    27 |
    28 |
    29 | 30 |
    31 |
    32 | 34 |
    35 |
    36 | {% include 'lib/website/doctype/blog_post/templates/includes/blog_footer.html' %} 37 | {% endblock %} -------------------------------------------------------------------------------- /website/doctype/blog_post/templates/pages/blog.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | def get_context(): 8 | return webnotes.doc("Blog Settings", "Blog Settings").fields -------------------------------------------------------------------------------- /website/doctype/blog_settings/README.md: -------------------------------------------------------------------------------- 1 | Blog titles and introduction texts. -------------------------------------------------------------------------------- /website/doctype/blog_settings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blog_settings/__init__.py -------------------------------------------------------------------------------- /website/doctype/blog_settings/blog_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl 12 | 13 | def on_update(self): 14 | from webnotes.webutils import clear_cache 15 | clear_cache("blog") 16 | clear_cache("writers") -------------------------------------------------------------------------------- /website/doctype/blog_settings/blog_settings.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-03-11 17:48:16", 4 | "docstatus": 0, 5 | "modified": "2013-07-05 14:27:31", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "description": "Blog Settings", 11 | "doctype": "DocType", 12 | "icon": "icon-cog", 13 | "issingle": 1, 14 | "module": "Website", 15 | "name": "__common__" 16 | }, 17 | { 18 | "doctype": "DocField", 19 | "name": "__common__", 20 | "parent": "Blog Settings", 21 | "parentfield": "fields", 22 | "parenttype": "DocType", 23 | "permlevel": 0 24 | }, 25 | { 26 | "create": 1, 27 | "doctype": "DocPerm", 28 | "name": "__common__", 29 | "parent": "Blog Settings", 30 | "parentfield": "permissions", 31 | "parenttype": "DocType", 32 | "permlevel": 0, 33 | "read": 1, 34 | "role": "Website Manager", 35 | "write": 1 36 | }, 37 | { 38 | "doctype": "DocType", 39 | "name": "Blog Settings" 40 | }, 41 | { 42 | "doctype": "DocField", 43 | "fieldname": "blog_title", 44 | "fieldtype": "Data", 45 | "label": "Blog Title" 46 | }, 47 | { 48 | "doctype": "DocField", 49 | "fieldname": "blog_introduction", 50 | "fieldtype": "Small Text", 51 | "label": "Blog Introduction" 52 | }, 53 | { 54 | "doctype": "DocField", 55 | "fieldname": "writers_introduction", 56 | "fieldtype": "Small Text", 57 | "label": "Writers Introduction" 58 | }, 59 | { 60 | "doctype": "DocPerm" 61 | } 62 | ] -------------------------------------------------------------------------------- /website/doctype/blogger/README.md: -------------------------------------------------------------------------------- 1 | Profile of blog writer in "Blog" section. -------------------------------------------------------------------------------- /website/doctype/blogger/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blogger/__init__.py -------------------------------------------------------------------------------- /website/doctype/blogger/blogger.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | from webnotes import _ 9 | 10 | class DocType: 11 | def __init__(self, d, dl): 12 | self.doc, self.doclist = d, dl 13 | 14 | def on_update(self): 15 | "if profile is set, then update all older blogs" 16 | 17 | from website.doctype.blog_post.blog_post import clear_blog_cache 18 | clear_blog_cache() 19 | 20 | if self.doc.profile: 21 | for blog in webnotes.conn.sql_list("""select name from `tabBlog Post` where owner=%s 22 | and ifnull(blogger,'')=''""", self.doc.profile): 23 | b = webnotes.bean("Blog Post", blog) 24 | b.doc.blogger = self.doc.name 25 | b.save() -------------------------------------------------------------------------------- /website/doctype/blogger/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blogger/templates/__init__.py -------------------------------------------------------------------------------- /website/doctype/blogger/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/blogger/templates/pages/__init__.py -------------------------------------------------------------------------------- /website/doctype/blogger/templates/pages/writers.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | 3 | {% set title="Blog Writers" %} 4 | 5 | {% block content %} 6 |
    7 |

    Blog Writers

    8 | {% if writers_introduction %} 9 |

    {{ writers_introduction }}

    10 | {% endif %} 11 |
    12 | {% for blogger_info in bloggers %} 13 | {% include "lib/website/doctype/blog_post/templates/includes/blogger.html" %} 14 | {% if not loop.last %}
    {% endif %} 15 | {% endfor %} 16 |
    17 | {% include 'lib/website/doctype/blog_post/templates/includes/blog_footer.html' %} 18 | {% endblock %} -------------------------------------------------------------------------------- /website/doctype/blogger/templates/pages/writers.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | def get_context(): 8 | bloggers = webnotes.conn.sql("""select * from `tabBlogger` 9 | where ifnull(posts,0) > 0 and ifnull(disabled,0)=0 10 | order by posts desc""", as_dict=1) 11 | 12 | args = { 13 | "bloggers": bloggers, 14 | "texts": { 15 | "all_posts_by": "All posts by" 16 | }, 17 | "categories": webnotes.conn.sql_list("select name from `tabBlog Category` order by name") 18 | } 19 | 20 | args.update(webnotes.doc("Blog Settings", "Blog Settings").fields) 21 | return args -------------------------------------------------------------------------------- /website/doctype/company_history/README.md: -------------------------------------------------------------------------------- 1 | Company history detail for "About Us" section. -------------------------------------------------------------------------------- /website/doctype/company_history/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/company_history/__init__.py -------------------------------------------------------------------------------- /website/doctype/company_history/company_history.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /website/doctype/company_history/company_history.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-22 01:28:08", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:06", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "DocType", 11 | "istable": 1, 12 | "module": "Website", 13 | "name": "__common__" 14 | }, 15 | { 16 | "doctype": "DocField", 17 | "in_list_view": 1, 18 | "name": "__common__", 19 | "parent": "Company History", 20 | "parentfield": "fields", 21 | "parenttype": "DocType", 22 | "permlevel": 0 23 | }, 24 | { 25 | "doctype": "DocType", 26 | "name": "Company History" 27 | }, 28 | { 29 | "doctype": "DocField", 30 | "fieldname": "year", 31 | "fieldtype": "Data", 32 | "label": "Year" 33 | }, 34 | { 35 | "doctype": "DocField", 36 | "fieldname": "highlight", 37 | "fieldtype": "Text", 38 | "label": "Highlight", 39 | "print_width": "300px", 40 | "width": "300px" 41 | } 42 | ] -------------------------------------------------------------------------------- /website/doctype/contact_us_settings/README.md: -------------------------------------------------------------------------------- 1 | Settings, introduction for "Contact Us" section. -------------------------------------------------------------------------------- /website/doctype/contact_us_settings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/contact_us_settings/__init__.py -------------------------------------------------------------------------------- /website/doctype/contact_us_settings/contact_us_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl 12 | 13 | def on_update(self): 14 | from webnotes.webutils import clear_cache 15 | clear_cache("contact") -------------------------------------------------------------------------------- /website/doctype/contact_us_settings/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/contact_us_settings/templates/__init__.py -------------------------------------------------------------------------------- /website/doctype/contact_us_settings/templates/includes/contact.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | $(document).ready(function() { 5 | 6 | $('.btn-send').click(function() { 7 | var email = $('[name="email"]').val(); 8 | var message = $('[name="message"]').val(); 9 | 10 | if(!(email && message)) { 11 | msgprint("Please enter both your email and message so that we \ 12 | can get back to you. Thanks!"); 13 | return false; 14 | } 15 | 16 | if(!valid_email(email)) { 17 | msgprint("You seem to have written your name instead of your email. \ 18 | Please enter a valid email address so that we can get back."); 19 | $('[name="email"]').focus(); 20 | return false; 21 | } 22 | 23 | $("#contact-alert").toggle(false); 24 | wn.send_message({ 25 | subject: $('[name="subject"]').val(), 26 | sender: email, 27 | message: message, 28 | callback: function(r) { 29 | if(r.status==="okay") { 30 | msgprint(r.message || "Thank you for your message.") 31 | } else { 32 | msgprint("There were errors"); 33 | console.log(r.exc); 34 | } 35 | $(':input').val(''); 36 | } 37 | }, this); 38 | return false; 39 | }); 40 | 41 | }); 42 | 43 | var msgprint = function(txt) { 44 | if(txt) $("#contact-alert").html(txt).toggle(true); 45 | } 46 | -------------------------------------------------------------------------------- /website/doctype/contact_us_settings/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/contact_us_settings/templates/pages/__init__.py -------------------------------------------------------------------------------- /website/doctype/style_settings/README.md: -------------------------------------------------------------------------------- 1 | Style settings for website. Includes settings for: 2 | 3 | - Site colours (background, toolbars) 4 | - Fonts (family and size) 5 | - Background (image if any) 6 | - Custom CSS -------------------------------------------------------------------------------- /website/doctype/style_settings/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/doctype/style_settings/style_settings.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | 5 | cur_frm.cscript.onload_post_render = function() { 6 | wn.require('lib/public/js/lib/jscolor/jscolor.js'); 7 | $.each(["background_color", "page_background", "page_text", "page_links", 8 | "top_bar_background", "top_bar_foreground", "page_headings"], function(i, v) { 9 | $(cur_frm.fields_dict[v].input).addClass('color'); 10 | }) 11 | jscolor.bind(); 12 | } -------------------------------------------------------------------------------- /website/doctype/style_settings/style_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | from webnotes.utils import cint, cstr 8 | from webnotes import _ 9 | 10 | class DocType: 11 | def __init__(self, d, dl): 12 | self.doc, self.doclist = d, dl 13 | 14 | def validate(self): 15 | """make custom css""" 16 | self.validate_colors() 17 | 18 | def validate_colors(self): 19 | if (self.doc.page_background or self.doc.page_text) and \ 20 | self.doc.page_background==self.doc.page_text: 21 | webnotes.msgprint(_("Page text and background is same color. Please change."), 22 | raise_exception=1) 23 | 24 | if (self.doc.top_bar_background or self.doc.top_bar_foreground) and \ 25 | self.doc.top_bar_background==self.doc.top_bar_foreground: 26 | webnotes.msgprint(_("Top Bar text and background is same color. Please change."), 27 | raise_exception=1) 28 | 29 | def on_update(self): 30 | """clear cache""" 31 | from webnotes.sessions import clear_cache 32 | clear_cache('Guest') 33 | 34 | from webnotes.webutils import clear_cache 35 | clear_cache() 36 | -------------------------------------------------------------------------------- /website/doctype/style_settings/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/style_settings/templates/__init__.py -------------------------------------------------------------------------------- /website/doctype/style_settings/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/style_settings/templates/pages/__init__.py -------------------------------------------------------------------------------- /website/doctype/table_of_contents/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/table_of_contents/__init__.py -------------------------------------------------------------------------------- /website/doctype/table_of_contents/table_of_contents.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /website/doctype/table_of_contents/table_of_contents.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-11-11 15:19:27", 4 | "docstatus": 0, 5 | "modified": "2013-11-11 17:50:45", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "TOC-.#####", 11 | "doctype": "DocType", 12 | "document_type": "Other", 13 | "istable": 1, 14 | "module": "Website", 15 | "name": "__common__" 16 | }, 17 | { 18 | "doctype": "DocField", 19 | "fieldname": "web_page", 20 | "fieldtype": "Link", 21 | "in_list_view": 1, 22 | "label": "Web Page", 23 | "name": "__common__", 24 | "options": "Web Page", 25 | "parent": "Table of Contents", 26 | "parentfield": "fields", 27 | "parenttype": "DocType", 28 | "permlevel": 0, 29 | "reqd": 1 30 | }, 31 | { 32 | "doctype": "DocType", 33 | "name": "Table of Contents" 34 | }, 35 | { 36 | "doctype": "DocField" 37 | } 38 | ] -------------------------------------------------------------------------------- /website/doctype/top_bar_item/README.md: -------------------------------------------------------------------------------- 1 | Link in the header or footer of the website. -------------------------------------------------------------------------------- /website/doctype/top_bar_item/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/doctype/top_bar_item/top_bar_item.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | class DocType: 8 | def __init__(self, d, dl): 9 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /website/doctype/top_bar_item/top_bar_item.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-02-22 01:28:08", 4 | "docstatus": 0, 5 | "modified": "2013-10-10 15:09:57", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "DocType", 11 | "istable": 1, 12 | "module": "Website", 13 | "name": "__common__" 14 | }, 15 | { 16 | "doctype": "DocField", 17 | "in_list_view": 1, 18 | "name": "__common__", 19 | "parent": "Top Bar Item", 20 | "parentfield": "fields", 21 | "parenttype": "DocType", 22 | "permlevel": 0 23 | }, 24 | { 25 | "doctype": "DocType", 26 | "name": "Top Bar Item" 27 | }, 28 | { 29 | "doctype": "DocField", 30 | "fieldname": "label", 31 | "fieldtype": "Data", 32 | "label": "Label", 33 | "print_width": "120px", 34 | "width": "120px" 35 | }, 36 | { 37 | "description": "If you set this, this Item will come in a drop-down under the selected parent.", 38 | "doctype": "DocField", 39 | "fieldname": "parent_label", 40 | "fieldtype": "Select", 41 | "label": "Parent Label" 42 | }, 43 | { 44 | "description": "Link to the page you want to open", 45 | "doctype": "DocField", 46 | "fieldname": "url", 47 | "fieldtype": "Data", 48 | "label": "URL", 49 | "print_width": "200px", 50 | "width": "200px" 51 | }, 52 | { 53 | "description": "Select target = \"_blank\" to open in a new page.", 54 | "doctype": "DocField", 55 | "fieldname": "target", 56 | "fieldtype": "Select", 57 | "label": "Target", 58 | "options": "\ntarget = \"_blank\"" 59 | } 60 | ] -------------------------------------------------------------------------------- /website/doctype/web_page/README.md: -------------------------------------------------------------------------------- 1 | Static (HTML / JS / CSS) page created by the user for the website. -------------------------------------------------------------------------------- /website/doctype/web_page/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/doctype/web_page/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/web_page/templates/__init__.py -------------------------------------------------------------------------------- /website/doctype/web_page/templates/generators/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/web_page/templates/generators/__init__.py -------------------------------------------------------------------------------- /website/doctype/web_page/templates/generators/web_page.py: -------------------------------------------------------------------------------- 1 | doctype = "Web Page" 2 | condition_field = "published" -------------------------------------------------------------------------------- /website/doctype/web_page/web_page.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | $.extend(cur_frm.cscript, { 5 | layout: function(doc) { 6 | if(!doc.__islocal) { 7 | if(doc.insert_code) { 8 | if(!doc.javascript) { 9 | cur_frm.set_value("javascript", '$(function() { });'); 10 | } 11 | } 12 | if(doc.insert_style) { 13 | if(!doc.css) { 14 | cur_frm.set_value("css", '#page-'+doc.name+' { }'); 15 | } 16 | } 17 | } 18 | }, 19 | onload: function() { 20 | // set query! 21 | cur_frm.set_query("web_page", "toc", function() { 22 | return {"filters": {"name": ["!=", cur_frm.doc.name]}}; 23 | }); 24 | }, 25 | refresh: function(doc) { 26 | cur_frm.cscript.layout(doc); 27 | if(!doc.__islocal && doc.published) { 28 | cur_frm.appframe.add_button("View In Website", function() { 29 | window.open(doc.page_name); 30 | }, "icon-globe"); 31 | } 32 | }, 33 | insert_style: function(doc) { 34 | cur_frm.cscript.layout(doc); 35 | }, 36 | insert_code: function(doc) { 37 | cur_frm.cscript.layout(doc); 38 | } 39 | }); -------------------------------------------------------------------------------- /website/doctype/website_script/README.md: -------------------------------------------------------------------------------- 1 | Custom javascript to be appended at the end of the page. Used to include 3rd party tracking / analytics tools. -------------------------------------------------------------------------------- /website/doctype/website_script/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/website_script/__init__.py -------------------------------------------------------------------------------- /website/doctype/website_script/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/website_script/templates/__init__.py -------------------------------------------------------------------------------- /website/doctype/website_script/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/website_script/templates/pages/__init__.py -------------------------------------------------------------------------------- /website/doctype/website_script/templates/pages/wn-web.js: -------------------------------------------------------------------------------- 1 | {% if javascript -%}{{ javascript }}{%- endif %} 2 | 3 | {% if google_analytics_id -%} 4 | // Google Analytics template 5 | window._gaq = window._gaq || []; 6 | window._gaq.push(['_setAccount', '{{ google_analytics_id }}']); 7 | window._gaq.push(['_trackPageview']); 8 | 9 | (function() { 10 | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 11 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 12 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 13 | })(); 14 | {%- endif %} -------------------------------------------------------------------------------- /website/doctype/website_script/templates/pages/wn_web.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | 7 | no_sitemap = True 8 | 9 | def get_context(): 10 | """returns web startup script""" 11 | return { 12 | "javascript": webnotes.conn.get_value('Website Script', None, 'javascript'), 13 | "google_analytics_id": webnotes.conn.get_value("Website Settings", "Website Settings", "google_analytics_id") 14 | } -------------------------------------------------------------------------------- /website/doctype/website_script/website_script.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl 12 | 13 | def on_update(self): 14 | """clear cache""" 15 | from webnotes.sessions import clear_cache 16 | clear_cache('Guest') 17 | 18 | from webnotes.webutils import clear_cache 19 | clear_cache() -------------------------------------------------------------------------------- /website/doctype/website_script/website_script.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2012-12-27 11:51:24", 4 | "docstatus": 0, 5 | "modified": "2013-07-05 15:02:48", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "description": "Script to attach to all web pages.", 11 | "doctype": "DocType", 12 | "document_type": "Other", 13 | "icon": "icon-code", 14 | "issingle": 1, 15 | "module": "Website", 16 | "name": "__common__" 17 | }, 18 | { 19 | "doctype": "DocField", 20 | "fieldname": "javascript", 21 | "fieldtype": "Code", 22 | "label": "Javascript", 23 | "name": "__common__", 24 | "options": "Javascript", 25 | "parent": "Website Script", 26 | "parentfield": "fields", 27 | "parenttype": "DocType", 28 | "permlevel": 0 29 | }, 30 | { 31 | "create": 1, 32 | "doctype": "DocPerm", 33 | "name": "__common__", 34 | "parent": "Website Script", 35 | "parentfield": "permissions", 36 | "parenttype": "DocType", 37 | "permlevel": 0, 38 | "read": 1, 39 | "role": "Website Manager", 40 | "write": 1 41 | }, 42 | { 43 | "doctype": "DocType", 44 | "name": "Website Script" 45 | }, 46 | { 47 | "doctype": "DocField" 48 | }, 49 | { 50 | "doctype": "DocPerm" 51 | } 52 | ] -------------------------------------------------------------------------------- /website/doctype/website_settings/README.md: -------------------------------------------------------------------------------- 1 | Overall website settings. Including banners, items appearing in the top and bottom menus, tracking code for Google Analytics etc. -------------------------------------------------------------------------------- /website/doctype/website_settings/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/doctype/website_sitemap/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/website_sitemap/__init__.py -------------------------------------------------------------------------------- /website/doctype/website_sitemap/website_sitemap.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl 12 | 13 | def add_to_sitemap(options): 14 | doc = webnotes.doc({"doctype":"Website Sitemap"}) 15 | for key in ("page_name", "docname", "page_or_generator", "lastmod"): 16 | doc.fields[key] = options.get(key) 17 | if not doc.page_name: 18 | doc.page_name = options.link_name 19 | doc.name = doc.page_name 20 | doc.website_sitemap_config = options.link_name 21 | doc.insert() 22 | -------------------------------------------------------------------------------- /website/doctype/website_sitemap/website_sitemap.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-11-18 15:38:40", 4 | "docstatus": 0, 5 | "modified": "2013-11-18 18:37:30", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "autoname": "field:page_name", 11 | "doctype": "DocType", 12 | "module": "Website", 13 | "name": "__common__" 14 | }, 15 | { 16 | "doctype": "DocField", 17 | "name": "__common__", 18 | "parent": "Website Sitemap", 19 | "parentfield": "fields", 20 | "parenttype": "DocType", 21 | "permlevel": 0 22 | }, 23 | { 24 | "doctype": "DocType", 25 | "name": "Website Sitemap" 26 | }, 27 | { 28 | "doctype": "DocField", 29 | "fieldname": "page_or_generator", 30 | "fieldtype": "Select", 31 | "label": "Page or Generator", 32 | "options": "Page\nGenerator", 33 | "read_only": 1 34 | }, 35 | { 36 | "doctype": "DocField", 37 | "fieldname": "page_name", 38 | "fieldtype": "Data", 39 | "label": "Page Name", 40 | "read_only": 1 41 | }, 42 | { 43 | "doctype": "DocField", 44 | "fieldname": "docname", 45 | "fieldtype": "Data", 46 | "label": "Docname", 47 | "read_only": 1 48 | }, 49 | { 50 | "doctype": "DocField", 51 | "fieldname": "lastmod", 52 | "fieldtype": "Data", 53 | "label": "Lastmod" 54 | }, 55 | { 56 | "doctype": "DocField", 57 | "fieldname": "website_sitemap_config", 58 | "fieldtype": "Link", 59 | "label": "Website Sitemap Config", 60 | "options": "Website Sitemap Config" 61 | } 62 | ] -------------------------------------------------------------------------------- /website/doctype/website_sitemap_config/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/website_sitemap_config/__init__.py -------------------------------------------------------------------------------- /website/doctype/website_slideshow/README.md: -------------------------------------------------------------------------------- 1 | Image slide show for Web Page, Product (Item) page, Item Group page. -------------------------------------------------------------------------------- /website/doctype/website_slideshow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/website_slideshow/__init__.py -------------------------------------------------------------------------------- /website/doctype/website_slideshow/templates/includes/slideshow.html: -------------------------------------------------------------------------------- 1 | {% if slideshow %} 2 | {{ slideshow_header }} 3 | 4 | 5 | 37 | 38 | 39 | {% endif %} 40 | -------------------------------------------------------------------------------- /website/doctype/website_slideshow/website_slideshow.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | // MIT License. See license.txt 3 | 4 | cur_frm.cscript.refresh = function(doc) { 5 | cur_frm.set_intro(""); 6 | if(doc.__islocal) { 7 | cur_frm.set_intro("First set the name and save the record."); 8 | } 9 | else { 10 | cur_frm.set_intro("Attach files / urls and add in table."); 11 | } 12 | } -------------------------------------------------------------------------------- /website/doctype/website_slideshow/website_slideshow.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl 12 | 13 | def on_update(self): 14 | # a slide show can be in use and any change in it should get reflected 15 | from webnotes.webutils import clear_cache 16 | clear_cache() 17 | 18 | def get_slideshow(obj): 19 | slideshow = webnotes.bean("Website Slideshow", obj.doc.slideshow) 20 | obj.slides = slideshow.doclist.get({"doctype":"Website Slideshow Item"}) 21 | obj.doc.slideshow_header = slideshow.doc.header or "" -------------------------------------------------------------------------------- /website/doctype/website_slideshow_item/README.md: -------------------------------------------------------------------------------- 1 | Slide (image) details for Website Slideshow. -------------------------------------------------------------------------------- /website/doctype/website_slideshow_item/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/doctype/website_slideshow_item/__init__.py -------------------------------------------------------------------------------- /website/doctype/website_slideshow_item/website_slideshow_item.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | # For license information, please see license.txt 5 | 6 | from __future__ import unicode_literals 7 | import webnotes 8 | 9 | class DocType: 10 | def __init__(self, d, dl): 11 | self.doc, self.doclist = d, dl -------------------------------------------------------------------------------- /website/doctype/website_slideshow_item/website_slideshow_item.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2013-03-07 12:26:33", 4 | "docstatus": 0, 5 | "modified": "2013-07-10 14:54:25", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "allow_attach": 0, 11 | "doctype": "DocType", 12 | "istable": 1, 13 | "max_attachments": 10, 14 | "module": "Website", 15 | "name": "__common__" 16 | }, 17 | { 18 | "doctype": "DocField", 19 | "in_list_view": 1, 20 | "name": "__common__", 21 | "parent": "Website Slideshow Item", 22 | "parentfield": "fields", 23 | "parenttype": "DocType", 24 | "permlevel": 0 25 | }, 26 | { 27 | "doctype": "DocType", 28 | "name": "Website Slideshow Item" 29 | }, 30 | { 31 | "doctype": "DocField", 32 | "fieldname": "image", 33 | "fieldtype": "Select", 34 | "label": "Image", 35 | "options": "attach_files:" 36 | }, 37 | { 38 | "doctype": "DocField", 39 | "fieldname": "heading", 40 | "fieldtype": "Data", 41 | "label": "Heading", 42 | "print_width": "200px", 43 | "width": "200px" 44 | }, 45 | { 46 | "doctype": "DocField", 47 | "fieldname": "description", 48 | "fieldtype": "Text", 49 | "label": "Description", 50 | "print_width": "200px", 51 | "width": "200px" 52 | } 53 | ] -------------------------------------------------------------------------------- /website/page/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/page/website_home/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/page/website_home/website_home.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "creation": "2012-02-21 13:23:51", 4 | "docstatus": 0, 5 | "modified": "2013-07-11 14:45:29", 6 | "modified_by": "Administrator", 7 | "owner": "Administrator" 8 | }, 9 | { 10 | "doctype": "Page", 11 | "icon": "icon-th", 12 | "module": "Website", 13 | "name": "__common__", 14 | "page_name": "website-home", 15 | "standard": "Yes", 16 | "title": "Website Home" 17 | }, 18 | { 19 | "doctype": "Page", 20 | "name": "website-home" 21 | } 22 | ] -------------------------------------------------------------------------------- /website/templates/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/templates/includes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webnotes/wnframework/eb02134b5f132abde64513a2529301adb3d5a053/website/templates/includes/__init__.py -------------------------------------------------------------------------------- /website/templates/includes/comment.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | {{ comment.comment_by_fullname }} / 4 | {{ comment.creation|global_date_format }}: 5 |
    6 |

    {{ comment.comment|markdown }}

    8 |
    9 |
    -------------------------------------------------------------------------------- /website/templates/pages/404.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | 3 | {% set title="Not Found" %} 4 | 5 | {% block content %} 6 |
    7 |
    8 |
    9 | Page missing or moved 10 |
    11 |
    12 |

    We are very sorry for this, but the page you are looking for is missing 13 | (this could be because of a typo in the address) or moved.

    14 |
    15 |
    16 |
    17 | {% endblock %} -------------------------------------------------------------------------------- /website/templates/pages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | -------------------------------------------------------------------------------- /website/templates/pages/error.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | 3 | {% set title="Error" %} 4 | 5 | {% block content %} 6 |
    7 |
    8 |
    9 | Oops, a server error has occured 10 |
    11 |
    12 |
    %(error)s
    13 |
    14 |
    15 |
    16 | {% endblock %} -------------------------------------------------------------------------------- /website/templates/pages/error.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | 6 | no_cache = True -------------------------------------------------------------------------------- /website/templates/pages/message.html: -------------------------------------------------------------------------------- 1 | {% extends base_template %} 2 | 3 | {% set title=webnotes.local.message_title %} 4 | 5 | {% block content %} 6 |
    7 |
    8 |
    9 | {{ title }} 10 |
    11 |
    12 |

    {{ webnotes.local.message }}

    13 |
    14 |
    15 |
    16 | {% endblock %} -------------------------------------------------------------------------------- /website/templates/pages/message.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | 6 | no_cache = True -------------------------------------------------------------------------------- /website/templates/pages/print.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Print Format 7 | 8 | 11 | 12 | 13 | {{ body }} 14 | 15 | {%- if comment -%} 16 | 17 | {%- endif -%} 18 | -------------------------------------------------------------------------------- /website/templates/pages/print.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | 6 | no_cache = True 7 | 8 | def get_context(): 9 | from core.doctype.print_format.print_format import get_args 10 | return get_args() -------------------------------------------------------------------------------- /website/templates/pages/rss.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | import webnotes 6 | import os, urllib 7 | from webnotes.utils import escape_html, get_request_site_address, now, cstr 8 | 9 | no_cache = True 10 | 11 | def get_context(): 12 | """generate rss feed""" 13 | 14 | host = get_request_site_address() 15 | 16 | blog_list = webnotes.conn.sql("""\ 17 | select page_name as name, published_on, modified, title, content from `tabBlog Post` 18 | where ifnull(published,0)=1 19 | order by published_on desc limit 20""", as_dict=1) 20 | 21 | for blog in blog_list: 22 | blog.link = cstr(urllib.quote((host + '/' + blog.name + '.html').encode("utf-8"))) 23 | blog.content = escape_html(blog.content or "") 24 | 25 | if blog_list: 26 | modified = max((blog['modified'] for blog in blog_list)) 27 | else: 28 | modified = now() 29 | 30 | ws = webnotes.doc('Website Settings', 'Website Settings') 31 | 32 | context = { 33 | 'title': ws.title_prefix, 34 | 'description': ws.description or ((ws.title_prefix or "") + ' Blog'), 35 | 'modified': modified, 36 | 'items': blog_list, 37 | 'link': host + '/blog' 38 | } 39 | 40 | # print context 41 | return context 42 | -------------------------------------------------------------------------------- /website/templates/pages/rss.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ title }} 5 | {{ description }} 6 | {{ link }} 7 | {{ modified }} 8 | {{ modified }} 9 | 1800 10 | {% for i in items %} 11 | {{ i.title }} 12 | {{ i.content }} 13 | {{ i.link }} 14 | {{ i.name }} 15 | {{ i.published_on }} 16 | {% endfor %} 17 | 18 | -------------------------------------------------------------------------------- /website/templates/pages/sitemap.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | 6 | import urllib 7 | import webnotes 8 | import webnotes.webutils 9 | from webnotes.utils import get_request_site_address 10 | 11 | no_cache = 1 12 | no_sitemap = 1 13 | 14 | def get_context(): 15 | """generate the sitemap XML""" 16 | host = get_request_site_address() 17 | links = [] 18 | for l in webnotes.conn.sql("""select `tabWebsite Sitemap`.page_name, `tabWebsite Sitemap`.lastmod 19 | from `tabWebsite Sitemap`, `tabWebsite Sitemap Config` 20 | where 21 | `tabWebsite Sitemap`.website_sitemap_config = `tabWebsite Sitemap Config`.name 22 | and ifnull(`tabWebsite Sitemap Config`.no_sitemap, 0)=0""", 23 | as_dict=True): 24 | links.append({ 25 | "loc": urllib.basejoin(host, urllib.quote(l.page_name.encode("utf-8"))), 26 | "lastmod": l.lastmod 27 | }) 28 | 29 | return {"links":links} 30 | -------------------------------------------------------------------------------- /website/templates/pages/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% for link in links %}{{ link.loc }}{{ link.lastmod }} 4 | {% endfor %} 5 | -------------------------------------------------------------------------------- /website/templates/pages/update_password.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors 2 | # MIT License. See license.txt 3 | 4 | from __future__ import unicode_literals 5 | 6 | no_sitemap = True --------------------------------------------------------------------------------