├── .gitignore ├── LICENSE ├── README.md ├── analytic-module ├── R │ ├── CheckConnection.R │ ├── ComputeAnswererRecommendations.R │ ├── ComputeAuthorities.R │ ├── ComputeSatisfactionProbabilities.R │ ├── RelatedQuestions.R │ ├── answerer-recommendation │ │ ├── DESCRIPTION │ │ ├── R │ │ │ ├── ComputeBM25F.R │ │ │ ├── GetAnswers.R │ │ │ ├── GetQuestions.R │ │ │ ├── GetUserProfiles.R │ │ │ ├── InferUQA.R │ │ │ └── TrainUQA.R │ │ ├── inst │ │ │ ├── testData │ │ │ │ ├── phiParams.csv │ │ │ │ ├── psiParams.csv │ │ │ │ ├── thetaParams.csv │ │ │ │ └── topicWordAssignments.csv │ │ │ └── unitTests │ │ │ │ └── test_ComputePerplexity.R │ │ └── tests │ │ │ └── runTests.R │ ├── authority │ │ ├── DESCRIPTION │ │ ├── R │ │ │ ├── GetQuestionAcceptedAnswerAuthor.R │ │ │ ├── GetQuestionAuthor.R │ │ │ ├── GetQuestionsFromDB.R │ │ │ ├── GetTagsFromDB.R │ │ │ ├── GetUsersFromDB.R │ │ │ ├── UpdateAuthorityTable.R │ │ │ └── functions.R │ │ ├── inst │ │ │ ├── testData │ │ │ │ └── sqlite.db │ │ │ └── unitTests │ │ │ │ └── test_ComputeUsersAuthoritiesForTag.R │ │ └── tests │ │ │ └── runTests.R │ ├── common │ │ ├── ReadDBConfiguration.R │ │ └── TestPackage.R │ ├── related-questions │ │ ├── DESCRIPTION │ │ ├── R │ │ │ ├── DatabaseAccessFunctions.R │ │ │ └── functions.R │ │ ├── inst │ │ │ ├── testData │ │ │ │ └── test │ │ │ ├── trigger.words │ │ │ └── unitTests │ │ │ │ └── test_RQ.R │ │ └── tests │ │ │ └── runTests.R │ └── satisfaction │ │ ├── DESCRIPTION │ │ ├── R │ │ └── ModelTraining.R │ │ ├── inst │ │ ├── sql │ │ │ ├── AvgAnsDownsForTag.sql │ │ │ ├── AvgAnsNumForTag.sql │ │ │ ├── AvgAnsNumForUser.sql │ │ │ ├── AvgAnsNumPerHourForTag.sql │ │ │ ├── AvgAnsUpsForTag.sql │ │ │ ├── MemberDuration.sql │ │ │ ├── NumAnsAccepted.sql │ │ │ ├── NumAnsReceived.sql │ │ │ ├── PostingTime.sql │ │ │ ├── Satisfied.sql │ │ │ └── UserRating.sql │ │ ├── testData │ │ │ ├── d1.csv │ │ │ ├── d10.csv │ │ │ ├── d2.csv │ │ │ ├── d3.csv │ │ │ ├── d4.csv │ │ │ ├── d5.csv │ │ │ ├── d6.csv │ │ │ ├── d7.csv │ │ │ ├── d8.csv │ │ │ ├── d9.csv │ │ │ ├── data.csv │ │ │ └── data_original.csv │ │ └── unitTests │ │ │ └── test_ModelTraining.R │ │ └── tests │ │ └── runTests.R └── bin │ ├── make_execs.sh │ ├── run_tests.sh │ └── setup_timer.sh └── qa-engine ├── INSTALL ├── LICENSE ├── __init__.py ├── analytics ├── __init__.py └── models.py ├── cron ├── README ├── send_email_alerts └── send_email_alerts_virtualenv ├── forum ├── __init__.py ├── actions │ ├── __init__.py │ ├── meta.py │ ├── node.py │ ├── page.py │ └── user.py ├── admin.py ├── authentication │ ├── __init__.py │ └── base.py ├── badges │ ├── __init__.py │ └── base.py ├── context.py ├── feed.py ├── forms │ ├── __init__.py │ ├── admin.py │ ├── auth.py │ ├── general.py │ └── qanda.py ├── http_responses.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ ├── base_command.py │ │ ├── checkinstall.py │ │ ├── create_extended_user.py │ │ ├── create_subscriptions.py │ │ ├── maintaindb.py │ │ ├── message_to_everyone.py │ │ ├── module_command.py │ │ ├── sample_command.py │ │ └── send_email_alerts.py ├── markdownext │ ├── __init__.py │ ├── mdx_limitedsyntax.py │ ├── mdx_settingsparser.py │ └── mdx_urlize.py ├── middleware │ ├── __init__.py │ ├── admin_messages.py │ ├── anon_user.py │ ├── cancel.py │ ├── extended_user.py │ └── request_utils.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto__add_likedcomment__del_field_repute_positive__del_field_repute_ne.py │ ├── 0003_repute_changes.py │ ├── 0004_auto__del_field_repute_negative__del_field_repute_positive__del_field_.py │ ├── 0005_fill_accepted_by_field.py │ ├── 0006_auto__add_node__add_field_vote_node__add_field_comment_node__add_field.py │ ├── 0007_q_and_a_to_node.py │ ├── 0008_auto__add_noderevision__del_field_vote_object_id__del_field_vote_conte.py │ ├── 0009_convert_revisions.py │ ├── 0010_auto__del_questionrevision__del_answerrevision__del_field_answer_vote_.py │ ├── 0011_auto__add_field_node_active_revision.py │ ├── 0012_set_active_revision.py │ ├── 0013_auto__del_anonymousquestion__del_anonymousanswer__add_anonymousnode.py │ ├── 0014_auto__add_field_question_accepted_answer.py │ ├── 0015_accepted_answer_changes.py │ ├── 0016_auto__del_field_question_answer_accepted__chg_field_question_node_ptr.py │ ├── 0017_auto__add_field_repute_node__add_field_repute_canceled.py │ ├── 0018_comments_to_node.py │ ├── 0019_auto__del_likedcomment__del_comment__add_field_node_abs_parent__chg_fi.py │ ├── 0020_create_absolute_parents.py │ ├── 0021_create_new_pg_fts_triggers.py │ ├── 0022_auto__add_actionrepute__add_action__add_favoritenode__del_field_node_v.py │ ├── 0023_flaten_node_inheritance_create_actions.py │ ├── 0024_auto__del_repute__del_vote__del_answer__del_flaggeditem__del_anonymous.py │ ├── 0025_auto__add_field_node_extra_action__add_field_node_deleted__add_field_n.py │ ├── 0026_reset_deleted_and_lastedited_flags.py │ ├── 0027_auto__del_activity.py │ ├── 0028_auto__add_field_action_canceled_ip__add_field_actionrepute_date.py │ ├── 0029_repute_dates.py │ ├── 0030_auto__chg_field_action_extra__chg_field_keyvalue_value.py │ ├── 0031_alter_pickle_storage.py │ ├── 0032_auto__del_field_user_hide_ignored_questions__del_field_user_questions_.py │ ├── 0033_auto__add_flag__add_vote__add_field_badge_cls__del_unique_badge_type_n.py │ ├── 0034_new_badge_and_award.py │ ├── 0035_auto__del_field_award_object_id__del_field_award_content_type__add_uni.py │ ├── 0036_auto__add_nodestate__chg_field_award_action__add_field_node_state_stri.py │ ├── 0037_fill_node_state.py │ ├── 0038_auto__del_field_node_wiki__del_field_node_deleted__del_field_node_extr.py │ ├── 0039_auto__del_field_tag_deleted__del_field_tag_deleted_by__del_field_tag_d.py │ ├── 0040_auto__chg_field_nodestate_action__add_field_node_extra.py │ ├── 0041_action_ip_fixes.py │ ├── 0042_auto__add_userproperty.py │ ├── 0043_auto__add_field_subscriptionsettings_send_digest__add_field_action_rea.py │ ├── 0044_markdown_cache_migration.py │ ├── 0045_auto__add_openidassociation__add_openidnonce__add_field_tag_created_at.py │ ├── 0046_set_tag_dates.py │ ├── 0047_auto__del_field_subscriptionsettings_questions_asked__del_field_subscr.py │ ├── 0048_zero_count_tags_fix.py │ └── __init__.py ├── models │ ├── __init__.py │ ├── action.py │ ├── answer.py │ ├── base.py │ ├── comment.py │ ├── meta.py │ ├── node.py │ ├── page.py │ ├── question.py │ ├── tag.py │ ├── tests │ │ ├── __init__.py │ │ ├── fixtures │ │ │ └── users │ │ └── test_user.py │ ├── user.py │ └── utils.py ├── modules │ ├── __init__.py │ ├── decorators.py │ ├── template_loader.py │ ├── ui.py │ └── ui_objects.py ├── registry.py ├── settings │ ├── __init__.py │ ├── about.py │ ├── accept.py │ ├── base.py │ ├── basic.py │ ├── email.py │ ├── extkeys.py │ ├── faq.py │ ├── form.py │ ├── forms.py │ ├── minrep.py │ ├── moderation.py │ ├── repgain.py │ ├── sidebar.py │ ├── static.py │ ├── upload.py │ ├── urls.py │ ├── users.py │ ├── view.py │ └── voting.py ├── sitemap.py ├── skins │ ├── README │ ├── __init__.py │ ├── common │ │ └── media │ │ │ └── README │ └── default │ │ ├── media │ │ ├── images │ │ │ ├── blue-up-arrow-h18px.png │ │ │ ├── box-arrow.gif │ │ │ ├── bullet_green.gif │ │ │ ├── by-sa-88x31.png │ │ │ ├── cc-88x31.png │ │ │ ├── cc-wiki.png │ │ │ ├── close-small-dark.png │ │ │ ├── close-small-hover.png │ │ │ ├── close-small.png │ │ │ ├── comment-delete-hover.png │ │ │ ├── comment-delete.png │ │ │ ├── comment-edit-hover.png │ │ │ ├── comment-edit.png │ │ │ ├── comment-like-on.png │ │ │ ├── comment-like.png │ │ │ ├── convert-hover.png │ │ │ ├── convert-off.png │ │ │ ├── dash.gif │ │ │ ├── djangomade124x25_grey.gif │ │ │ ├── dot-g.gif │ │ │ ├── dot-list.gif │ │ │ ├── edit.png │ │ │ ├── expander-arrow-hide.gif │ │ │ ├── expander-arrow-show.gif │ │ │ ├── favicon.gif │ │ │ ├── favicon.ico │ │ │ ├── feed-icon-small.png │ │ │ ├── gray-up-arrow-h18px.png │ │ │ ├── grippie.png │ │ │ ├── indicator.gif │ │ │ ├── logo.gif │ │ │ ├── logo.png │ │ │ ├── logo1.png │ │ │ ├── logo2.png │ │ │ ├── medala.gif │ │ │ ├── medala_on.gif │ │ │ ├── new.gif │ │ │ ├── nophoto.png │ │ │ ├── openid.gif │ │ │ ├── openid │ │ │ │ ├── aol.gif │ │ │ │ ├── aol.png │ │ │ │ ├── blogger.ico │ │ │ │ ├── blogger.png │ │ │ │ ├── claimid.ico │ │ │ │ ├── claimid.png │ │ │ │ ├── facebook.gif │ │ │ │ ├── flickr.ico │ │ │ │ ├── flickr.png │ │ │ │ ├── google.gif │ │ │ │ ├── livejournal.ico │ │ │ │ ├── livejournal.png │ │ │ │ ├── myopenid.ico │ │ │ │ ├── myopenid.png │ │ │ │ ├── myopenid_big.png │ │ │ │ ├── openid-inputicon.gif │ │ │ │ ├── openid.gif │ │ │ │ ├── technorati.ico │ │ │ │ ├── technorati.png │ │ │ │ ├── twitter.png │ │ │ │ ├── verisign.ico │ │ │ │ ├── verisign.png │ │ │ │ ├── vidoop.ico │ │ │ │ ├── wordpress.ico │ │ │ │ ├── wordpress.png │ │ │ │ └── yahoo.gif │ │ │ ├── quest-bg.gif │ │ │ ├── user-sprite.png │ │ │ ├── vote-accepted-on.png │ │ │ ├── vote-accepted.png │ │ │ ├── vote-arrow-down-on.png │ │ │ ├── vote-arrow-down.png │ │ │ ├── vote-arrow-up-on.png │ │ │ ├── vote-arrow-up.png │ │ │ ├── vote-favorite-off.png │ │ │ ├── vote-favorite-on.png │ │ │ ├── webfaction.png │ │ │ └── wiki.png │ │ ├── js │ │ │ ├── compress.bat │ │ │ ├── effects.core.min.js │ │ │ ├── excanvas.min.js │ │ │ ├── flot-build.bat │ │ │ ├── jquery-1.2.6.js │ │ │ ├── jquery-1.2.6.min.js │ │ │ ├── jquery.ajaxfileupload.js │ │ │ ├── jquery.flot.js │ │ │ ├── jquery.flot.min.js │ │ │ ├── jquery.form.js │ │ │ ├── jquery.i18n.js │ │ │ ├── jquery.openid.js │ │ │ ├── jquery.validate.pack.js │ │ │ ├── osqa.admin.js │ │ │ ├── osqa.ask.js │ │ │ ├── osqa.main.js │ │ │ ├── osqa.main.min.js │ │ │ ├── osqa.question.js │ │ │ ├── se_hilite.js │ │ │ ├── se_hilite_src.js │ │ │ ├── ui.core.js │ │ │ ├── ui.core.min.js │ │ │ ├── ui.datepicker.js │ │ │ ├── ui.datepicker.min.js │ │ │ └── wmd │ │ │ │ ├── images │ │ │ │ ├── bg-fill.png │ │ │ │ ├── bg.png │ │ │ │ ├── blockquote.png │ │ │ │ ├── bold.png │ │ │ │ ├── code.png │ │ │ │ ├── h1.png │ │ │ │ ├── hr.png │ │ │ │ ├── img.png │ │ │ │ ├── italic.png │ │ │ │ ├── link.png │ │ │ │ ├── ol.png │ │ │ │ ├── redo.png │ │ │ │ ├── separator.png │ │ │ │ ├── ul.png │ │ │ │ ├── undo.png │ │ │ │ ├── wmd-buttons.png │ │ │ │ ├── wmd-buttons.psd │ │ │ │ ├── wmd-on.png │ │ │ │ └── wmd.png │ │ │ │ ├── showdown-min.js │ │ │ │ ├── showdown.js │ │ │ │ ├── wmd-min.js │ │ │ │ ├── wmd-test.html │ │ │ │ ├── wmd.css │ │ │ │ └── wmd.js │ │ └── style │ │ │ ├── admin.css │ │ │ ├── auth.css │ │ │ ├── default.css │ │ │ ├── djstyle_admin.css │ │ │ ├── jquery.autocomplete.css │ │ │ ├── markdown_help.css │ │ │ ├── openid.css │ │ │ ├── prettify.css │ │ │ ├── style.css │ │ │ └── user.css │ │ └── templates │ │ ├── 401.html │ │ ├── 403.html │ │ ├── 404.html │ │ ├── 500.html │ │ ├── 503.html │ │ ├── account_settings.html │ │ ├── answer_edit.html │ │ ├── answer_edit_tips.html │ │ ├── ask.html │ │ ├── auth │ │ ├── auth_settings.html │ │ ├── complete.html │ │ ├── mail_already_validated.html │ │ ├── mail_validation.html │ │ ├── signin.html │ │ ├── temp_login_email.html │ │ ├── temp_login_request.html │ │ └── welcome_email.html │ │ ├── badge.html │ │ ├── badges.html │ │ ├── base.html │ │ ├── base_content.html │ │ ├── close.html │ │ ├── email_base.html │ │ ├── feedback.html │ │ ├── feeds │ │ ├── rss_answer_title.html │ │ ├── rss_description.html │ │ └── rss_title.html │ │ ├── footer.html │ │ ├── header.html │ │ ├── index.html │ │ ├── logout.html │ │ ├── markdown_help.html │ │ ├── node │ │ ├── accept_button.html │ │ ├── award_points.html │ │ ├── comments.html │ │ ├── contributors_info.html │ │ ├── convert_to_comment.html │ │ ├── convert_to_question.html │ │ ├── favorite_mark.html │ │ ├── flagged_item.html │ │ ├── permanent_link.html │ │ ├── post_controls.html │ │ ├── report.html │ │ ├── reviser_info.html │ │ ├── revision.html │ │ ├── vote_buttons.html │ │ └── wiki_symbol.html │ │ ├── notarobot.html │ │ ├── notifications │ │ ├── answeraccepted.html │ │ ├── base.html │ │ ├── base_text.html │ │ ├── digest.html │ │ ├── feedback.html │ │ ├── newanswer.html │ │ ├── newcomment.html │ │ ├── newmember.html │ │ └── newquestion.html │ │ ├── opensearch.html │ │ ├── osqaadmin │ │ ├── base.html │ │ ├── createuser.html │ │ ├── dashboard.html │ │ ├── djstyle_base.html │ │ ├── edit_page.html │ │ ├── flagged_posts.html │ │ ├── graph.html │ │ ├── index.html │ │ ├── mail_test.html │ │ ├── maintenance.html │ │ ├── moderation.html │ │ ├── nodeman.html │ │ ├── set.html │ │ ├── static_pages.html │ │ ├── statistics.html │ │ └── test_email_settings.html │ │ ├── page.html │ │ ├── pagesize.html │ │ ├── paginator.html │ │ ├── paginator │ │ ├── page_numbers.html │ │ ├── page_sizes.html │ │ └── sort_tabs.html │ │ ├── privacy.html │ │ ├── question.html │ │ ├── question_edit.html │ │ ├── question_edit_tips.html │ │ ├── question_list │ │ ├── count.html │ │ ├── item.html │ │ ├── related_tags.html │ │ ├── sort_tabs.html │ │ ├── subscription_item.html │ │ ├── tag_selector.html │ │ └── title.html │ │ ├── question_retag.html │ │ ├── question_summary_list_roll.html │ │ ├── questions.html │ │ ├── reopen.html │ │ ├── revisions.html │ │ ├── search.html │ │ ├── sidebar │ │ ├── markdown_help.html │ │ ├── recent_awards.html │ │ ├── recent_tags.html │ │ └── user_blocks.html │ │ ├── static.html │ │ ├── subscription_status.html │ │ ├── tag_selector.html │ │ ├── tags.html │ │ ├── user.html │ │ └── users │ │ ├── activity.html │ │ ├── edit.html │ │ ├── info.html │ │ ├── karma_bonus.html │ │ ├── menu.html │ │ ├── online_users.html │ │ ├── preferences.html │ │ ├── questions.html │ │ ├── recent.html │ │ ├── reputation.html │ │ ├── signature.html │ │ ├── stats.html │ │ ├── subscriptions.html │ │ ├── subscriptions_management.html │ │ ├── subscriptions_settings.html │ │ ├── suspend_user.html │ │ ├── tabs.html │ │ ├── users.html │ │ └── votes.html ├── startup.py ├── subscriptions.py ├── templatetags │ ├── __init__.py │ ├── email_tags.py │ ├── extra_filters.py │ ├── extra_tags.py │ ├── general_sidebar_tags.py │ ├── node_tags.py │ ├── question_list_tags.py │ ├── smart_if.py │ ├── ui_registry.py │ └── user_tags.py ├── upfiles │ ├── README │ └── logo.png ├── urls.py ├── user_messages │ ├── __init__.py │ └── context_processors.py ├── utils │ ├── __init__.py │ ├── decorators.py │ ├── diff.py │ ├── djangofix.py │ ├── html.py │ ├── html2text.py │ ├── lists.py │ ├── mail.py │ ├── pagination.py │ ├── time.py │ └── userlinking.py └── views │ ├── __init__.py │ ├── admin.py │ ├── auth.py │ ├── commands.py │ ├── decorators.py │ ├── meta.py │ ├── readers.py │ ├── users.py │ ├── vars.py │ └── writers.py ├── forum_modules ├── __init__.py ├── akismet │ ├── __init__.py │ ├── lib │ │ ├── __init__.py │ │ └── akismet.py │ ├── settings.py │ ├── startup.py │ └── templates │ │ └── foundspam.html ├── default_badges │ ├── __init__.py │ ├── badges.py │ └── settings.py ├── exporter │ ├── __init__.py │ ├── backups │ │ └── README │ ├── commands.py │ ├── exporter.py │ ├── forms.py │ ├── importer.py │ ├── mappings.py │ ├── orm.py │ ├── settings.py │ ├── startup.py │ ├── templates │ │ ├── exporter.html │ │ ├── importer.html │ │ └── running.html │ ├── tmp │ │ └── README │ ├── urls.py │ └── views.py ├── facebookauth │ ├── __init__.py │ ├── authentication.py │ ├── settings.py │ ├── templates │ │ ├── button.html │ │ └── xd_receiver.html │ ├── urls.py │ └── views.py ├── localauth │ ├── __init__.py │ ├── authentication.py │ ├── forms.py │ ├── templates │ │ └── loginform.html │ ├── urls.py │ └── views.py ├── oauthauth │ ├── __init__.py │ ├── authentication.py │ ├── consumer.py │ ├── lib │ │ ├── __init__.py │ │ └── oauth.py │ └── settings.py ├── openidauth │ ├── __init__.py │ ├── authentication.py │ ├── consumer.py │ ├── models.py │ ├── settings.py │ ├── store.py │ └── templates │ │ └── openidurl.html ├── pgfulltext │ ├── __init__.py │ ├── handlers.py │ ├── pg_fts_install.sql │ ├── settings.py │ └── startup.py ├── project_badges │ ├── __init__.py │ ├── badges.py │ └── settings.py ├── recaptcha │ ├── __init__.py │ ├── formfield.py │ ├── handlers.py │ ├── lib │ │ ├── __init__.py │ │ └── captcha.py │ └── settings.py ├── robotstxt │ ├── __init__.py │ ├── settings.py │ ├── templates │ │ └── robots.txt │ └── urls.py ├── sphinxfulltext │ ├── README.txt │ ├── __init__.py │ ├── dependencies.py │ ├── handlers.py │ ├── models.py │ └── settings.py └── sximporter │ ├── __init__.py │ ├── importer.py │ ├── templates │ └── page.html │ ├── urls.py │ └── views.py ├── locale ├── bg │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── de │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── en │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── es │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── fr │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── l │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po ├── phrases.py ├── pt │ └── LC_MESSAGES │ │ ├── django.mo │ │ └── django.po └── zh_CN │ └── LC_MESSAGES │ ├── django.mo │ └── django.po ├── log └── README.TXT ├── manage.py ├── osqa.wsgi.dist ├── rmpyc ├── settings.py ├── settings_local.py.dist ├── tmp └── README └── urls.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.pyc 3 | # Package Files # 4 | *.jar 5 | *.war 6 | *.ear 7 | qa-engine/settings_local.py 8 | qa-engine/log/* 9 | qa-engine/cache/* 10 | qa-engine/build/* 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Intelligent Community Question Answering (iCQA) Framework 2 | ================= 3 | 4 | Fostering the Wisdom of Crowds 5 | ------------------------------ 6 | 7 | iCQA aims to provide the tools for maintaining and analysis of community Q&A services. It contains implementation of state-of-the-art methods and algorithms for mining the data generated by a typical Q&A site. 8 | 9 | 10 | Mailing list 11 | ------------ 12 | 13 | Have a question? Ask on our [mailing list](https://groups.google.com/d/forum/icqa)! 14 | 15 | icqa@googlegroups.com 16 | 17 | Documentation 18 | ---------------------- 19 | 20 | See our [wiki](https://github.com/CLLKazan/iCQA/wiki). 21 | 22 | Development 23 | ---------------------- 24 | 25 | The project has been developed by the people affiliated with the Computational Linguistics Laboratory at Kazan Federal University (Russia). However, we are open to collaboration. Feel free to join us! 26 | 27 | Continuous Integration 28 | ---------------------- 29 | 30 | See our [Jenkins CI server instance](http://cll.niimm.ksu.ru:8080/jenkins/job/iCQA). 31 | 32 | License 33 | --------------------- 34 | 35 | Licensed under the GNU General Public License version 3 (GPLv3) ; 36 | you may not use this work except in compliance with the License. 37 | You may obtain a copy of the License in the LICENSE file, or at: 38 | 39 | http://www.gnu.org/licenses/gpl.html -------------------------------------------------------------------------------- /analytic-module/R/CheckConnection.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | library("RMySQL") 4 | library("R.utils") 5 | # Loading auxiliary functions 6 | sourceDirectory(paste(Sys.getenv("CQA_HOME"), 7 | "/analytic-module/R/common", 8 | sep=""), pattern="*.R") 9 | db.configuration <- ReadDBConfiguration() 10 | mychannel <- 11 | dbConnect(MySQL(), user=db.configuration$user, 12 | host="localhost", password= db.configuration$password) 13 | results <- 14 | dbSendQuery(mychannel, 15 | paste("SELECT 1 FROM ", db.configuration$name, ".forum_node", sep="")) 16 | data <- fetch(results, n=-1) 17 | dbDisconnect(mychannel) 18 | -------------------------------------------------------------------------------- /analytic-module/R/ComputeAuthorities.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | # Script for computing authority score for all the users in 4 | # each category (tag) 5 | 6 | library("RMySQL") 7 | library("R.utils") 8 | library("igraph") 9 | 10 | # Loading auxiliary functions 11 | sourceDirectory(paste(Sys.getenv("CQA_HOME"), 12 | "/analytic-module/R/common", 13 | sep=""), pattern="*.R") 14 | sourceDirectory(paste(Sys.getenv("CQA_HOME"), 15 | "/analytic-module/R/authority/R", 16 | sep=""), pattern="*.R") 17 | 18 | # Creating connection to database 19 | db.configuration <- ReadDBConfiguration() 20 | mychannel <- 21 | dbConnect(MySQL(), user=db.configuration$user, dbname=db.configuration$name, 22 | host="localhost", password=db.configuration$password) 23 | 24 | # Retrieving all tags (categories) 25 | tags <- GetTagsFromDB(mychannel) 26 | 27 | lapply(tags, ComputeUsersAuthoritiesForTag, db.channel=mychannel) 28 | 29 | # Closing the connection 30 | dbDisconnect(mychannel) 31 | -------------------------------------------------------------------------------- /analytic-module/R/answerer-recommendation/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: qar 2 | Type: Package 3 | Depends: R (>= 2.0.0), plyr, RMySQL, R.utils, tm, Snowball, foreach, iterators, doMC 4 | License: GPL (http://www.gnu.org/copyleft/gpl.html) 5 | Suggests: RUnit 6 | Version: 0.1 7 | Description: None 8 | Title: Question Answerer Recommendation (Analytic Module For iCQA) 9 | Author: CLLKazan 10 | Maintainer: CLLKazan 11 | -------------------------------------------------------------------------------- /analytic-module/R/answerer-recommendation/R/GetAnswers.R: -------------------------------------------------------------------------------- 1 | GetAnswers <- function(db.channel) { 2 | # Retrieves answers from the given database connection 3 | # 4 | # Args: 5 | # db.channel: db connection object 6 | # 7 | # Returns: 8 | # Frame, containing answer data 9 | # 10 | require(RMySQL) 11 | results <- 12 | dbSendQuery(db.channel, 13 | "SELECT id, body, author_id FROM forum_node 14 | WHERE node_type='answer'") 15 | data <- fetch(results, n=-1) 16 | data$body <- gsub("<(.|\n)*?>","", data$body) 17 | data 18 | } 19 | -------------------------------------------------------------------------------- /analytic-module/R/answerer-recommendation/R/GetUserProfiles.R: -------------------------------------------------------------------------------- 1 | GetUserProfiles <- function(db.channel) { 2 | # Retrieves user profiles (related questions/answers per user) 3 | # from the given database connection 4 | # 5 | # Args: 6 | # db.channel: database connection object 7 | # 8 | # Returns: 9 | # Frame, containing user profile data 10 | require(RMySQL) 11 | questions <- 12 | dbSendQuery(db.channel, 13 | "SELECT t1.author_id as user_id, min(t2.tag_id) as tag_id, 14 | t1.body as post FROM forum_node t1 LEFT JOIN 15 | forum_node_tags t2 ON t1.id=t2.node_id 16 | WHERE t1.node_type = 'question' GROUP BY user_id") 17 | data <- fetch(questions, n=-1) 18 | answers <- 19 | dbSendQuery(db.channel, 20 | "SELECT t1.author_id as user_id, min(t2.tag_id) as tag_id, 21 | t1.body as post FROM forum_node t1 LEFT JOIN 22 | forum_node_tags t2 ON t1.parent_id=t2.node_id 23 | WHERE t1.node_type = 'answer' GROUP BY user_id") 24 | answer.data <- fetch(answers, n=-1) 25 | data <- rbind(data, answer.data) 26 | # Strips the HTML and LaTeX markups 27 | data$post <- gsub("<(.|\n)*?>","", data$post) 28 | data$post <- gsub("\\$.[^$]*\\$","", data$post) 29 | data$post <- gsub("[^[:alpha:] ,.!?-]", "", data$post) 30 | row.names(data) <- 1:length(data$user_id) 31 | data 32 | } -------------------------------------------------------------------------------- /analytic-module/R/answerer-recommendation/inst/testData/phiParams.csv: -------------------------------------------------------------------------------- 1 | "word_id" "topic_id" "phi" 2 | 1 1 0.66 3 | 2 1 0.33 4 | 2 2 0.33 5 | 3 2 0.66 6 | -------------------------------------------------------------------------------- /analytic-module/R/answerer-recommendation/inst/testData/psiParams.csv: -------------------------------------------------------------------------------- 1 | "category_id" "topic_id" "psi" 2 | 1 1 0.5 3 | 1 2 0.5 4 | 2 1 0.52 5 | 2 2 0.14 6 | -------------------------------------------------------------------------------- /analytic-module/R/answerer-recommendation/inst/testData/thetaParams.csv: -------------------------------------------------------------------------------- 1 | "user_id" "topic_id" "theta" 2 | 1 1 0.65 3 | 1 2 0.35 4 | -------------------------------------------------------------------------------- /analytic-module/R/answerer-recommendation/inst/testData/topicWordAssignments.csv: -------------------------------------------------------------------------------- 1 | "user_id" "word_id" "category_id" "topic_id" 2 | 1 1 1 1 3 | 1 2 2 2 4 | 1 3 1 2 5 | 1 3 1 2 6 | 1 1 2 1 7 | 1 2 1 1 8 | -------------------------------------------------------------------------------- /analytic-module/R/answerer-recommendation/tests/runTests.R: -------------------------------------------------------------------------------- 1 | require("qar") || stop("unable to load the required answerer-recommendation package") 2 | sourceDirectory(paste(Sys.getenv("CQA_HOME"), 3 | "/analytic-module/R/common", 4 | sep=""), pattern="TestPackage.R") 5 | testPackage("qar") 6 | -------------------------------------------------------------------------------- /analytic-module/R/authority/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: authority 2 | Type: Package 3 | Depends: R (>= 2.0.0), plyr, stringr, RMySQL, R.utils, igraph 4 | License: GPL (http://www.gnu.org/copyleft/gpl.html) 5 | Suggests: RUnit, RSQLite 6 | Version: 0.1 7 | Description: None 8 | Title: Analytic Module For iCQA 9 | Author: CLLKazan 10 | Maintainer: CLLKazan 11 | -------------------------------------------------------------------------------- /analytic-module/R/authority/R/GetQuestionAcceptedAnswerAuthor.R: -------------------------------------------------------------------------------- 1 | GetQuestionAcceptedAnswerAuthor <- function(db.channel, question.id) { 2 | # Retrieves accepted answer's author id for the given question 3 | # 4 | # Args: 5 | # db.channel: db connection object 6 | # question.id: question id 7 | # 8 | # Returns: 9 | # Accepted answer's author id if accepted answer exists, 10 | # NULL otherwise 11 | results <- 12 | dbSendQuery(db.channel, 13 | paste("SELECT author_id FROM forum_node ", 14 | "WHERE node_type='answer' AND state_string='(accepted)' AND parent_id=", 15 | question.id, sep="")) 16 | data <- fetch(results, n=-1) 17 | data$author_id 18 | } 19 | -------------------------------------------------------------------------------- /analytic-module/R/authority/R/GetQuestionAuthor.R: -------------------------------------------------------------------------------- 1 | GetQuestionAuthor <- function(db.channel, question.id) { 2 | # Retrieves author id for the given question 3 | # 4 | # Args: 5 | # db.channel: db connection object 6 | # question.id: question id 7 | # 8 | # Returns: 9 | # Author id 10 | results <- 11 | dbSendQuery(db.channel, 12 | paste("SELECT author_id FROM forum_node ", 13 | "WHERE id=", question.id, sep="")) 14 | data <- fetch(results, n=-1) 15 | data$author_id 16 | } 17 | -------------------------------------------------------------------------------- /analytic-module/R/authority/R/GetQuestionsFromDB.R: -------------------------------------------------------------------------------- 1 | GetQuestionsFromDB <- function(db.channel, tag.id) { 2 | # Retrieves questions with given tag from the given db 3 | # 4 | # Args: 5 | # db.channel: db connection object 6 | # tag.id: tag id 7 | # 8 | # Returns: 9 | # Vector, containing question id's 10 | results <- 11 | dbSendQuery(db.channel, 12 | paste("SELECT node_id FROM forum_node_tags ", 13 | "WHERE tag_id=", tag.id, sep="")) 14 | data <- fetch(results, n=-1) 15 | data$node_id 16 | } 17 | -------------------------------------------------------------------------------- /analytic-module/R/authority/R/GetTagsFromDB.R: -------------------------------------------------------------------------------- 1 | GetTagsFromDB <- function(db.channel) { 2 | # Retrieves tags from the given db 3 | # 4 | # Args: 5 | # db.channel: db connection object 6 | # 7 | # Returns: 8 | # Vector, containing tag id's 9 | results <- 10 | dbSendQuery(db.channel,"SELECT id FROM forum_tag") 11 | data <- fetch(results, n=-1) 12 | data$id 13 | } 14 | -------------------------------------------------------------------------------- /analytic-module/R/authority/R/GetUsersFromDB.R: -------------------------------------------------------------------------------- 1 | GetUsersFromDB <- function(db.channel) { 2 | # Retrieves users from the given db 3 | # 4 | # Args: 5 | # db.channel: db connection object 6 | # 7 | # Returns: 8 | # Vector, containing user id's 9 | results <- 10 | dbSendQuery(db.channel,"SELECT user_ptr_id FROM forum_user") 11 | data <- fetch(results, n=-1) 12 | data$user_ptr_id 13 | } 14 | -------------------------------------------------------------------------------- /analytic-module/R/authority/R/UpdateAuthorityTable.R: -------------------------------------------------------------------------------- 1 | UpdateAuthorityTable <- function(db.channel, user.id, tag.id, score, update=T) { 2 | # Updates the analytics_authority table with the given data 3 | # 4 | # Args: 5 | # db.channel: db connection object 6 | # user.id: user id 7 | # tag.id: tag id 8 | # score: authority score 9 | # update: update duplicate keys 10 | sql.statement <- sprintf("INSERT INTO analytics_authority 11 | (`user_id`, `tag_id`, `score`) VALUES (%d, %d, %f)", 12 | user.id, tag.id, score) 13 | if (update){ 14 | sql.statement <- paste(sql.statement, 15 | sprintf("ON DUPLICATE KEY UPDATE 16 | user_id=%d, tag_id=%d, score=%f", 17 | user.id, tag.id, score)) 18 | } 19 | 20 | res <- dbSendQuery(db.channel, sql.statement) 21 | dbGetRowsAffected(res) 22 | } 23 | -------------------------------------------------------------------------------- /analytic-module/R/authority/inst/testData/sqlite.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/analytic-module/R/authority/inst/testData/sqlite.db -------------------------------------------------------------------------------- /analytic-module/R/authority/inst/unitTests/test_ComputeUsersAuthoritiesForTag.R: -------------------------------------------------------------------------------- 1 | 2 | test_ComputeUsersAuthoritiesForTag <- function(){ 3 | require("RSQLite") 4 | db.name <- system.file("testData/sqlite.db", package="authority") 5 | mychannel <- dbConnect("SQLite", dbname = db.name) 6 | 7 | res <- dbSendQuery(mychannel, "DELETE FROM analytics_authority") 8 | tags <- GetTagsFromDB(mychannel) 9 | lapply(tags, ComputeUsersAuthoritiesForTag, db.channel=mychannel, update=F) 10 | 11 | results <- dbSendQuery(mychannel, 12 | "SELECT user_id, tag_id, score FROM analytics_authority") 13 | data <- fetch(results, n=-1) 14 | results <- dbSendQuery(mychannel, 15 | "SELECT user_id, tag_id, score FROM analytics_authority_test") 16 | data_original <- fetch(results, n=-1) 17 | 18 | dbDisconnect(mychannel) 19 | 20 | checkEquals(data,data_original) 21 | } 22 | -------------------------------------------------------------------------------- /analytic-module/R/authority/tests/runTests.R: -------------------------------------------------------------------------------- 1 | require("authority") || stop("unable to load authority") 2 | sourceDirectory(paste(Sys.getenv("CQA_HOME"), 3 | "/analytic-module/R/common", 4 | sep=""), pattern="TestPackage.R") 5 | testPackage("authority") 6 | -------------------------------------------------------------------------------- /analytic-module/R/common/ReadDBConfiguration.R: -------------------------------------------------------------------------------- 1 | ReadDBConfiguration <- function() { 2 | # Reads the database connection configuration parameters 3 | # from the OSQA settings' file 4 | # 5 | # Returns: 6 | # The database connection configuration parameters 7 | require(plyr) 8 | require(stringr) 9 | 10 | l <- readLines(paste(Sys.getenv("CQA_HOME"), 11 | "/qa-engine/settings_local.py", sep="")) 12 | 13 | found.line <- ldply(l, function(s) str_match(s, "DATABASE_NAME = '(.*)'")) 14 | database.name <- found.line[which(!is.na(found.line$V1)),]$V2 15 | 16 | found.line <- ldply(l, function(s) str_match(s, "DATABASE_USER = '(.*)'")) 17 | database.user <- found.line[which(!is.na(found.line$V1)),]$V2 18 | 19 | found.line <- ldply(l, function(s) str_match(s, "DATABASE_PASSWORD = '(.*)'")) 20 | database.password <- found.line[which(!is.na(found.line$V1)),]$V2 21 | 22 | db.configuration <- list(name = database.name, 23 | user = database.user, 24 | password = database.password) 25 | 26 | db.configuration 27 | } -------------------------------------------------------------------------------- /analytic-module/R/related-questions/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: related.questions 2 | Type: Package 3 | Depends: R (>= 2.0.0), plyr, stringr, RMySQL, R.utils, topicmodels, Snowball 4 | License: GPL (http://www.gnu.org/copyleft/gpl.html) 5 | Suggests: RUnit 6 | Version: 0.1 7 | Description: None 8 | Title: Analytic Module For iCQA 9 | Author: CLLKazan 10 | Maintainer: CLLKazan 11 | -------------------------------------------------------------------------------- /analytic-module/R/related-questions/inst/trigger.words: -------------------------------------------------------------------------------- 1 | recently 2 | yesterday 3 | recent 4 | tomorrow 5 | soon 6 | latest 7 | today 8 | tonight 9 | (past|last|this)\s+(year|month|week) 10 | -------------------------------------------------------------------------------- /analytic-module/R/related-questions/inst/unitTests/test_RQ.R: -------------------------------------------------------------------------------- 1 | 2 | test_GetQuestionsSimilarByTags <- function(){ 3 | questions <- read.table(system.file("testData/test", package="related.questions")) 4 | tags <- data.frame( 5 | c(1,1,1,2,2,3,3,3,4,4,5,5,5,6), 6 | c(1,2,3,2,3,4,5,6,2,7,1,7,2,4) 7 | ) 8 | names(tags) <- c("node_id","tag_id") 9 | cnd <- GetQuestionsSimilarByTags(questions[1,], questions[2:nrow(questions),], tags) 10 | checkEquals(cnd$id, 4) 11 | } 12 | 13 | test_ComputeFreshness <- function(){ 14 | tw <- "today|recent|(last|past)\\s+(year|month)" 15 | questions <- read.table(system.file("testData/test", package="related.questions"),as.is=T) 16 | freshness <- daply(questions, c("id"), ComputeFreshness, 17 | time.words.re=tw) 18 | names(freshness)<- c() 19 | checkEquals(freshness, c(1, 1, 0.001312335958, 1, 1, 1, 1, 1, 1, 1, 1, 20 | 0.0008873114463, 1, 1, 1, 0.0008920606601)) 21 | } 22 | -------------------------------------------------------------------------------- /analytic-module/R/related-questions/tests/runTests.R: -------------------------------------------------------------------------------- 1 | require("related.questions") || stop("unable to load related.questions") 2 | sourceDirectory(paste(Sys.getenv("CQA_HOME"), 3 | "/analytic-module/R/common", 4 | sep=""), pattern="TestPackage.R") 5 | testPackage("related.questions") 6 | -------------------------------------------------------------------------------- /analytic-module/R/satisfaction/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: satisfaction 2 | Type: Package 3 | Depends: R (>= 2.0.0), RMySQL, R.utils, RWeka 4 | License: GPL (http://www.gnu.org/copyleft/gpl.html) 5 | Suggests: RUnit 6 | Version: 0.1 7 | Description: None 8 | Title: Analytic Module For iCQA 9 | Author: CLLKazan 10 | Maintainer: CLLKazan 11 | -------------------------------------------------------------------------------- /analytic-module/R/satisfaction/inst/sql/AvgAnsDownsForTag.sql: -------------------------------------------------------------------------------- 1 | SELECT t1.q_id, AVG(ups) AS avg_ans_downs_tag FROM 2 | ( 3 | SELECT t1.id AS q_id, COUNT(t5.id) AS ups FROM 4 | forum_node AS t1, 5 | (SELECT tag_id,node_id FROM forum_node_tags GROUP BY node_id ORDER BY id) AS t2, 6 | forum_node_tags AS t3, 7 | forum_node AS t4, 8 | forum_action AS t5 9 | WHERE 10 | t1.id=t2.node_id AND 11 | t2.tag_id=t3.tag_id AND 12 | t3.node_id=t4.parent_id AND 13 | t4.node_type='answer' AND 14 | t4.id=t5.node_id AND 15 | t5.action_type='votedown' AND 16 | t5.action_date $tmpfile 5 | 6 | # add custom entries to crontab 7 | for file in $CQA_HOME/analytic-module/R/*.R; do 8 | echo "0 0 * * * $file" >> $tmpfile 9 | done 10 | #load crontab from file 11 | crontab $tmpfile 12 | 13 | # remove temporary file 14 | rm $tmpfile 15 | 16 | # restart crontab 17 | /etc/init.d/cron restart 18 | -------------------------------------------------------------------------------- /qa-engine/INSTALL: -------------------------------------------------------------------------------- 1 | For installation instruction go to: 2 | 3 | http://wiki.osqa.net/display/docs/Home 4 | 5 | The wiki contains many recipes to help you install on different hosting providers. -------------------------------------------------------------------------------- /qa-engine/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010. OSQA 2 | Some portions Copyright (c) 2009 Chen Gang 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | -------------------------------------------------------------------------------- /qa-engine/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/__init__.py -------------------------------------------------------------------------------- /qa-engine/analytics/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/analytics/__init__.py -------------------------------------------------------------------------------- /qa-engine/analytics/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from forum.models import Question 3 | 4 | class Satisfaction(models.Model): 5 | question = models.OneToOneField(Question) 6 | score = models.FloatField() 7 | -------------------------------------------------------------------------------- /qa-engine/cron/README: -------------------------------------------------------------------------------- 1 | this directory contains sample commands to be executed 2 | by cron 3 | 4 | files with names ending "virtuanenv" should work under Python virtualenv system 5 | other files - with standard unix setup 6 | -------------------------------------------------------------------------------- /qa-engine/cron/send_email_alerts: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | PYTHONPATH=/path/to/dir_above_osqa_site 3 | export PYTHONPATH 4 | PROJECT_ROOT=$PYTHONPATH/osqa_site 5 | /path/to/python $PROJECT_ROOT/manage.py send_email_alerts 6 | -------------------------------------------------------------------------------- /qa-engine/cron/send_email_alerts_virtualenv: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | WORKON_HOME=~/envs/osqa 4 | PROJECT_ROOT=~/webapps/osqa_server/projects/osqa/ 5 | 6 | # activate virtual environment 7 | . $WORKON_HOME/bin/activate 8 | 9 | cd $PROJECT_ROOT 10 | python manage.py send_email_alerts >> $PROJECT_ROOT/log/cron_mail.log 2>&1 11 | -------------------------------------------------------------------------------- /qa-engine/forum/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum/actions/__init__.py: -------------------------------------------------------------------------------- 1 | from meta import * 2 | from node import * 3 | from user import * 4 | from page import * -------------------------------------------------------------------------------- /qa-engine/forum/authentication/__init__.py: -------------------------------------------------------------------------------- 1 | import re 2 | import django.dispatch 3 | from forum.modules import get_modules_script_classes 4 | from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateContext 5 | 6 | class ConsumerAndContext: 7 | def __init__(self, id, consumer, context): 8 | self.id = id 9 | self._consumer = consumer 10 | 11 | if context: 12 | context.id = id 13 | self.context = context 14 | 15 | @property 16 | def consumer(self): 17 | return self._consumer() 18 | 19 | consumers = dict([ 20 | (re.sub('AuthConsumer$', '', name).lower(), cls) for name, cls 21 | in get_modules_script_classes('authentication', AuthenticationConsumer).items() 22 | if not re.search('AbstractAuthConsumer$', name) 23 | ]) 24 | 25 | contexts = dict([ 26 | (re.sub('AuthContext$', '', name).lower(), cls) for name, cls 27 | in get_modules_script_classes('authentication', ConsumerTemplateContext).items() 28 | ]) 29 | 30 | AUTH_PROVIDERS = dict([ 31 | (name, ConsumerAndContext(name, consumers[name], contexts.get(name, None))) for name in consumers.keys() 32 | ]) 33 | 34 | 35 | -------------------------------------------------------------------------------- /qa-engine/forum/authentication/base.py: -------------------------------------------------------------------------------- 1 | 2 | class AuthenticationConsumer(object): 3 | 4 | def prepare_authentication_request(self, request, redirect_to): 5 | raise NotImplementedError() 6 | 7 | def process_authentication_request(self, response): 8 | raise NotImplementedError() 9 | 10 | def get_user_data(self, key): 11 | raise NotImplementedError() 12 | 13 | 14 | class ConsumerTemplateContext(object): 15 | """ 16 | Class that provides information about a certain authentication provider context in the signin page. 17 | 18 | class attributes: 19 | 20 | mode - one of BIGICON, SMALLICON, FORM 21 | 22 | human_name - the human readable name of the provider 23 | 24 | extra_js - some providers require us to load extra javascript on the signin page for them to work, 25 | this is the place to add those files in the form of a list 26 | 27 | extra_css - same as extra_js but for css files 28 | """ 29 | mode = '' 30 | weight = 500 31 | human_name = '' 32 | extra_js = [] 33 | extra_css = [] 34 | show_to_logged_in_user = True 35 | 36 | @classmethod 37 | def readable_key(cls, key): 38 | return key.key 39 | 40 | class InvalidAuthentication(Exception): 41 | def __init__(self, message): 42 | self.message = message 43 | 44 | -------------------------------------------------------------------------------- /qa-engine/forum/badges/__init__.py: -------------------------------------------------------------------------------- 1 | from forum.modules import get_modules_script 2 | 3 | get_modules_script('badges') 4 | 5 | from base import BadgesMeta 6 | 7 | -------------------------------------------------------------------------------- /qa-engine/forum/context.py: -------------------------------------------------------------------------------- 1 | from forum import settings 2 | 3 | def application_settings(context): 4 | return {'settings': settings} 5 | 6 | def auth_processor(request): 7 | if hasattr(request, 'user'): 8 | user = request.user 9 | if user.is_authenticated(): 10 | messages = user.message_set.all() 11 | else: 12 | messages = None 13 | else: 14 | from django.contrib.auth.models import AnonymousUser 15 | user = AnonymousUser() 16 | messages = None 17 | 18 | from django.core.context_processors import PermWrapper 19 | return { 20 | 'user': user, 21 | 'messages': messages, 22 | 'perms': PermWrapper(user), 23 | } 24 | -------------------------------------------------------------------------------- /qa-engine/forum/forms/__init__.py: -------------------------------------------------------------------------------- 1 | from qanda import * 2 | from admin import * 3 | from auth import * 4 | from general import * 5 | -------------------------------------------------------------------------------- /qa-engine/forum/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/management/commands/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum/management/commands/base_command.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #encoding:utf-8 3 | #------------------------------------------------------------------------------- 4 | # Name: Award badges command 5 | # Purpose: This is a command file croning in background process regularly to 6 | # query database and award badges for user's special acitivities. 7 | # 8 | # Author: Mike, Sailing 9 | # 10 | # Created: 22/01/2009 11 | # Copyright: (c) Mike 2009 12 | # Licence: GPL V2 13 | #------------------------------------------------------------------------------- 14 | 15 | from datetime import datetime, date 16 | from django.core.management.base import NoArgsCommand 17 | from django.db import connection 18 | from django.shortcuts import get_object_or_404 19 | from django.contrib.contenttypes.models import ContentType 20 | 21 | from forum.models import * 22 | 23 | class BaseCommand(NoArgsCommand): 24 | def update_activities_auditted(self, cursor, activity_ids): 25 | # update processed rows to auditted 26 | if len(activity_ids): 27 | query = "UPDATE activity SET is_auditted = 1 WHERE id in (%s)"\ 28 | % ','.join('%s' % item for item in activity_ids) 29 | cursor.execute(query) 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /qa-engine/forum/management/commands/create_subscriptions.py: -------------------------------------------------------------------------------- 1 | from forum.models import User, SubscriptionSettings, QuestionSubscription 2 | from django.core.management.base import NoArgsCommand 3 | 4 | class Command(NoArgsCommand): 5 | def handle_noargs(self, **options): 6 | users = User.objects.all() 7 | for u in users: 8 | s = SubscriptionSettings(user=u) 9 | s.save() 10 | 11 | user_questions = u.questions.all() 12 | 13 | for q in user_questions: 14 | sub = QuestionSubscription(user=u, question=q) 15 | sub.save() -------------------------------------------------------------------------------- /qa-engine/forum/management/commands/message_to_everyone.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import NoArgsCommand 2 | from forum.models import User 3 | import sys 4 | 5 | class Command(NoArgsCommand): 6 | def handle_noargs(self, **options): 7 | msg = None 8 | if msg == None: 9 | print 'to run this command, please first edit the file %s' % __file__ 10 | sys.exit(1) 11 | for u in User.objects.all(): 12 | u.message_set.create(message = msg % u.username) 13 | -------------------------------------------------------------------------------- /qa-engine/forum/management/commands/module_command.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import BaseCommand, CommandError 2 | 3 | class Command(BaseCommand): 4 | 5 | def handle(self, *args, **options): 6 | 7 | for path in args: 8 | m = __import__('forum_modules.%s' % path, globals(), locals(), ['forum_modules']) 9 | 10 | if hasattr(m, 'run'): 11 | run = getattr(m, 'run') 12 | if callable(run): 13 | run() 14 | -------------------------------------------------------------------------------- /qa-engine/forum/management/commands/sample_command.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import NoArgsCommand 2 | from forum.models import Comment 3 | 4 | class Command(NoArgsCommand): 5 | def handle_noargs(self, **options): 6 | objs = Comment.objects.all() 7 | print objs -------------------------------------------------------------------------------- /qa-engine/forum/markdownext/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/markdownext/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum/markdownext/mdx_limitedsyntax.py: -------------------------------------------------------------------------------- 1 | import markdown 2 | from django.utils.safestring import mark_safe 3 | from django.utils.html import strip_tags 4 | from forum.utils.html import sanitize_html 5 | 6 | class LimitedSyntaxExtension(markdown.Extension): 7 | def extendMarkdown(self, md, md_globals): 8 | del md.inlinePatterns["image_reference"] 9 | 10 | def makeExtension(configs=None) : 11 | return LimitedSyntaxExtension(configs=configs) 12 | -------------------------------------------------------------------------------- /qa-engine/forum/markdownext/mdx_settingsparser.py: -------------------------------------------------------------------------------- 1 | from os import linesep 2 | from csv import reader, QUOTE_NONE 3 | import markdown 4 | from markdown import Extension 5 | from markdown.preprocessors import Preprocessor 6 | import re 7 | 8 | from forum import settings 9 | 10 | class SettingsExtension(markdown.Extension): 11 | def __init__(self, configs): 12 | self.configs = {} # settings.REP_TO_VOTE_UP} 13 | for key, value in configs: 14 | self.config[key] = value 15 | 16 | # self.extendMarkdown(markdown.Markdown()., config) 17 | 18 | def reset(self): 19 | pass 20 | 21 | def extendMarkdown(self, md, md_globals): 22 | md.registerExtension(self) 23 | self.parser = md.parser 24 | md.preprocessors.add('MinRep', SettingsPre(self), '_begin') 25 | 26 | SETTING_RE = re.compile(r'\|[A-Z_]+\|') 27 | 28 | def setting_rep_callback(m): 29 | setting_name = m.group(0).strip('|') 30 | if hasattr(settings, setting_name): 31 | return unicode(getattr(settings, setting_name)) 32 | else: 33 | return '' 34 | 35 | 36 | class SettingsPre(Preprocessor): 37 | def run(self, lines): 38 | new_lines = [] 39 | for line in lines: 40 | new_lines.append(SETTING_RE.sub(setting_rep_callback, line)) 41 | 42 | return new_lines 43 | 44 | 45 | def makeExtension(configs=None) : 46 | return SettingsExtension(configs=configs) -------------------------------------------------------------------------------- /qa-engine/forum/markdownext/mdx_urlize.py: -------------------------------------------------------------------------------- 1 | import markdown 2 | 3 | # Global Vars 4 | URLIZE_RE = '(%s)' % '|'.join([ 5 | r'<(?:f|ht)tps?://[^>]*>', 6 | r'\b(?:f|ht)tps?://[^)<>\s]+[^.,)<>\s]', 7 | r'\bwww\.[^)<>\s]+[^.,)<>\s]', 8 | r'[^(<\s]+\.(?:com|net|org)\b', 9 | ]) 10 | 11 | class UrlizePattern(markdown.inlinepatterns.Pattern): 12 | """ Return a link Element given an autolink (`http://example/com`). """ 13 | def handleMatch(self, m): 14 | url = m.group(2) 15 | 16 | if url.startswith('<'): 17 | url = url[1:-1] 18 | 19 | text = url 20 | 21 | if not url.split('://')[0] in ('http','https','ftp'): 22 | if '@' in url and not '/' in url: 23 | url = 'mailto:' + url 24 | else: 25 | url = 'http://' + url 26 | 27 | el = markdown.etree.Element("a") 28 | el.set('href', url) 29 | el.text = markdown.AtomicString(text) 30 | return el 31 | 32 | class UrlizeExtension(markdown.Extension): 33 | """ Urlize Extension for Python-Markdown. """ 34 | 35 | def extendMarkdown(self, md, md_globals): 36 | """ Replace autolink with UrlizePattern """ 37 | md.inlinePatterns['autolink'] = UrlizePattern(URLIZE_RE, md) 38 | 39 | def makeExtension(configs=None): 40 | return UrlizeExtension(configs=configs) 41 | 42 | if __name__ == "__main__": 43 | import doctest 44 | doctest.testmod() 45 | -------------------------------------------------------------------------------- /qa-engine/forum/middleware/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/middleware/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum/middleware/cancel.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponseRedirect 2 | from forum.forms import get_next_url 3 | import logging 4 | class CancelActionMiddleware(object): 5 | def process_view(self, request, view_func, view_args, view_kwargs): 6 | if 'cancel' in request.REQUEST: 7 | #todo use session messages for the anonymous users 8 | try: 9 | msg = getattr(view_func,'CANCEL_MESSAGE') 10 | except AttributeError: 11 | msg = 'action canceled' 12 | request.user.message_set.create(message=msg) 13 | return HttpResponseRedirect(get_next_url(request)) 14 | else: 15 | return None 16 | -------------------------------------------------------------------------------- /qa-engine/forum/middleware/extended_user.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth.middleware import AuthenticationMiddleware 2 | from django.contrib.auth import logout 3 | from forum.models.user import AnonymousUser 4 | from forum.views.auth import forward_suspended_user 5 | import logging 6 | 7 | class ExtendedUser(AuthenticationMiddleware): 8 | def process_request(self, request): 9 | super(ExtendedUser, self).process_request(request) 10 | if request.user.is_authenticated(): 11 | try: 12 | request.user = request.user.user 13 | 14 | if request.user.is_suspended(): 15 | user = request.user 16 | logout(request) 17 | return forward_suspended_user(request, user) 18 | 19 | return None 20 | except Exception, e: 21 | import traceback 22 | logging.error("Unable to convert auth_user %s to forum_user: \n%s" % ( 23 | request.user.id, traceback.format_exc() 24 | )) 25 | 26 | request.user = AnonymousUser() 27 | return None -------------------------------------------------------------------------------- /qa-engine/forum/middleware/request_utils.py: -------------------------------------------------------------------------------- 1 | from forum.settings import MAINTAINANCE_MODE, APP_LOGO, APP_TITLE 2 | 3 | from forum.http_responses import HttpResponseServiceUnavailable 4 | 5 | class RequestUtils(object): 6 | def process_request(self, request): 7 | if MAINTAINANCE_MODE.value is not None and isinstance(MAINTAINANCE_MODE.value.get('allow_ips', None), list): 8 | ip = request.META['REMOTE_ADDR'] 9 | 10 | if not ip in MAINTAINANCE_MODE.value['allow_ips']: 11 | return HttpResponseServiceUnavailable(MAINTAINANCE_MODE.value.get('message', '')) 12 | 13 | if request.session.get('redirect_POST_data', None): 14 | request.POST = request.session.pop('redirect_POST_data') 15 | request.META['REQUEST_METHOD'] = "POST" 16 | 17 | self.request = request 18 | return None -------------------------------------------------------------------------------- /qa-engine/forum/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | class ProgressBar(object): 4 | def __init__(self, full): 5 | self.full = full 6 | self.count = 0 7 | 8 | self.print_bar(0) 9 | 10 | def print_bar(self, progress): 11 | sys.stdout.write("[%s%s] %d%%\r" % ('=' * progress, ' ' * (100 - progress), progress)) 12 | sys.stdout.flush() 13 | 14 | def update(self): 15 | self.count += 1 16 | self.print_bar(int((float(self.count) / float(self.full)) * 100)) -------------------------------------------------------------------------------- /qa-engine/forum/models/__init__.py: -------------------------------------------------------------------------------- 1 | import forum.utils.djangofix 2 | from question import Question ,QuestionRevision, QuestionSubscription 3 | from answer import Answer, AnswerRevision 4 | from tag import Tag, MarkedTag 5 | from user import User, ValidationHash, AuthKeyUserAssociation, SubscriptionSettings 6 | from node import Node, NodeRevision, NodeState, NodeMetaClass 7 | from comment import Comment 8 | from action import Action, ActionRepute 9 | from meta import Vote, Flag, Badge, Award 10 | from utils import KeyValue 11 | from page import Page 12 | 13 | try: 14 | from south.modelsinspector import add_introspection_rules 15 | add_introspection_rules([], [r"^forum\.models\.\w+\.\w+"]) 16 | except: 17 | pass 18 | 19 | from base import * 20 | 21 | __all__ = [ 22 | 'Node', 'NodeRevision', 'NodeState', 23 | 'Question', 'QuestionSubscription', 'QuestionRevision', 24 | 'Answer', 'AnswerRevision', 25 | 'Tag', 'Comment', 'MarkedTag', 'Badge', 'Award', 26 | 'ValidationHash', 'AuthKeyUserAssociation', 'SubscriptionSettings', 'KeyValue', 'User', 27 | 'Action', 'ActionRepute', 'Vote', 'Flag', 'Page' 28 | ] 29 | 30 | 31 | from forum.modules import get_modules_script_classes 32 | 33 | for k, v in get_modules_script_classes('models', models.Model).items(): 34 | if not k in __all__: 35 | __all__.append(k) 36 | exec "%s = v" % k 37 | 38 | NodeMetaClass.setup_relations() 39 | BaseMetaClass.setup_denormalizes() 40 | -------------------------------------------------------------------------------- /qa-engine/forum/models/answer.py: -------------------------------------------------------------------------------- 1 | from base import * 2 | from django.utils.translation import ugettext as _ 3 | 4 | class Answer(Node): 5 | friendly_name = _("answer") 6 | 7 | class Meta(Node.Meta): 8 | proxy = True 9 | 10 | @property 11 | def accepted(self): 12 | return self.nis.accepted 13 | 14 | @property 15 | def headline(self): 16 | return self.question.headline 17 | 18 | def get_absolute_url(self): 19 | return '%s/%s' % (self.question.get_absolute_url(), self.id) 20 | 21 | 22 | class AnswerRevision(NodeRevision): 23 | class Meta: 24 | proxy = True -------------------------------------------------------------------------------- /qa-engine/forum/models/page.py: -------------------------------------------------------------------------------- 1 | from base import * 2 | from django.utils.translation import ugettext as _ 3 | 4 | class Page(Node): 5 | friendly_name = _("page") 6 | 7 | @property 8 | def published(self): 9 | return self.marked 10 | 11 | @property 12 | def html(self): 13 | return self._as_markdown(self.body) 14 | 15 | def save(self, *args, **kwargs): 16 | old_options = self._original_state.get('extra', None) 17 | 18 | super(Page, self).save(*args, **kwargs) 19 | 20 | registry = settings.STATIC_PAGE_REGISTRY 21 | 22 | if old_options: 23 | registry.pop(old_options.get('path', ''), None) 24 | 25 | registry[self.extra['path']] = self.id 26 | 27 | 28 | settings.STATIC_PAGE_REGISTRY.set_value(registry) 29 | 30 | @property 31 | def headline(self): 32 | if self.published: 33 | return self.title 34 | else: 35 | return _("[Unpublished] %s") % self.title 36 | 37 | @models.permalink 38 | def get_absolute_url(self): 39 | return ('static_page', (), {'path': self.extra['path']}) 40 | 41 | def activate_revision(self, user, revision, extensions=['urlize']): 42 | self.title = revision.title 43 | self.tagnames = revision.tagnames 44 | self.body = revision.body 45 | 46 | self.active_revision = revision 47 | self.update_last_activity(user) 48 | 49 | self.save() 50 | 51 | class Meta(Node.Meta): 52 | proxy = True 53 | 54 | 55 | -------------------------------------------------------------------------------- /qa-engine/forum/models/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/models/tests/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum/modules/ui.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class Registry(list): 4 | def add(self, item): 5 | for i, r in enumerate(self): 6 | if r.weight > item.weight: 7 | self.insert(i, item) 8 | return 9 | 10 | self.append(item) 11 | 12 | 13 | HEAD_CONTENT = 'HEAD_CONTENT' 14 | HEADER_LINKS = 'HEADER_LINKS' 15 | PAGE_TOP_TABS = 'PAGE_TOP_TABS' 16 | FOOTER_LINKS = 'FOOTER_LINKS' 17 | PROFILE_TABS = 'PROFILE_TABS' 18 | 19 | USER_MENU = 'USER_MENU' 20 | 21 | 22 | __CONTAINER = { 23 | HEAD_CONTENT: Registry(), 24 | HEADER_LINKS: Registry(), 25 | PAGE_TOP_TABS: Registry(), 26 | FOOTER_LINKS: Registry(), 27 | PROFILE_TABS: Registry(), 28 | 29 | USER_MENU: Registry(), 30 | } 31 | 32 | 33 | def register(registry, *ui_objects): 34 | if not registry in __CONTAINER: 35 | raise('unknown registry') 36 | 37 | for ui_object in ui_objects: 38 | __CONTAINER[registry].add(ui_object) 39 | 40 | def get_registry_by_name(name): 41 | name = name.upper() 42 | 43 | if not name in __CONTAINER: 44 | raise('unknown registry') 45 | 46 | return __CONTAINER[name] 47 | 48 | 49 | 50 | from ui_objects import * 51 | 52 | -------------------------------------------------------------------------------- /qa-engine/forum/settings/about.py: -------------------------------------------------------------------------------- 1 | from base import Setting, SettingSet 2 | from django.forms.widgets import Textarea 3 | 4 | PAGES_SET = SettingSet('about', 'About page', "Define the text in the about page. You can use markdown and some basic html tags.", 2000, True) 5 | 6 | ABOUT_PAGE_TEXT = Setting('ABOUT_PAGE_TEXT', 7 | u""" 8 | **Please customize this text in the administration area** 9 | 10 | Here you can **ask** and **answer** questions, **comment** 11 | and **vote** for the questions of others and their answers. Both questions and answers 12 | **can be revised** and improved. Questions can be **tagged** with 13 | the relevant keywords to simplify future access and organize the accumulated material. 14 | 15 | This Q&A site is moderated by its members, hopefully - including yourself! 16 | Moderation rights are gradually assigned to the site users based on the accumulated "**karma**" 17 | points. These points are added to the users account when others vote for his/her questions or answers. 18 | These points (very) roughly reflect the level of trust of the community. 19 | 20 | No points are necessary to ask or answer the questions - so please - join us! 21 | 22 | If you would like to find out more about this site - please see the **frequently asked questions** page. 23 | """, PAGES_SET, dict( 24 | label = "About page text", 25 | help_text = """ 26 | The about page. 27 | """, 28 | widget=Textarea(attrs={'rows': '20'}))) -------------------------------------------------------------------------------- /qa-engine/forum/settings/accept.py: -------------------------------------------------------------------------------- 1 | from base import Setting, SettingSet 2 | from django.forms.widgets import RadioSelect 3 | from django.utils.translation import ugettext_lazy as _ 4 | 5 | ACCEPT_SET = SettingSet('accept', _('Accepting answers'), _("Settings to tweak the behaviour of accepting answers."), 500) 6 | 7 | DISABLE_ACCEPTING_FEATURE = Setting('DISABLE_ACCEPTING_FEATURE', False, ACCEPT_SET, dict( 8 | label = _("Disallow answers to be accepted"), 9 | help_text = _("Disable accepting answers feature. If you re-enable it in the future, currently accepted answers will still be marked as accepted."), 10 | required=False)) 11 | 12 | MAXIMUM_ACCEPTED_ANSWERS = Setting('MAXIMUM_ACCEPTED_ANSWERS', 1, ACCEPT_SET, dict( 13 | label = _("Maximum accepted answers per question"), 14 | help_text = _("How many accepted answers are allowed per question. Use 0 for no limit."))) 15 | 16 | MAXIMUM_ACCEPTED_PER_USER = Setting('MAXIMUM_ACCEPTED_PER_USER', 1, ACCEPT_SET, dict( 17 | label = _("Maximum accepted answers per user/question"), 18 | help_text = _("If more than one accpeted answer is allowed, how many can be accepted per single user per question."))) 19 | 20 | USERS_CAN_ACCEPT_OWN = Setting('USERS_CAN_ACCEPT_OWN', False, ACCEPT_SET, dict( 21 | label = _("Users an accept own answer"), 22 | help_text = _("Are normal users allowed to accept their own answers.."), 23 | required=False)) 24 | 25 | 26 | -------------------------------------------------------------------------------- /qa-engine/forum/settings/extkeys.py: -------------------------------------------------------------------------------- 1 | from base import Setting, SettingSet 2 | from django.utils.translation import ugettext_lazy as _ 3 | 4 | EXT_KEYS_SET = SettingSet('extkeys', _('External Keys'), _("Keys for various external providers that your application may optionally use."), 100) 5 | 6 | GOOGLE_SITEMAP_CODE = Setting('GOOGLE_SITEMAP_CODE', '', EXT_KEYS_SET, dict( 7 | label = _("Google sitemap code"), 8 | help_text = _("This is the code you get when you register your site at Google webmaster central."), 9 | required=False)) 10 | 11 | GOOGLE_ANALYTICS_KEY = Setting('GOOGLE_ANALYTICS_KEY', '', EXT_KEYS_SET, dict( 12 | label = _("Google analytics key"), 13 | help_text = _("Your Google analytics key. You can get one at the Google analytics official website"), 14 | required=False)) 15 | 16 | -------------------------------------------------------------------------------- /qa-engine/forum/settings/moderation.py: -------------------------------------------------------------------------------- 1 | from base import Setting, SettingSet 2 | from forms import StringListWidget 3 | 4 | from django.utils.translation import ugettext_lazy as _ 5 | from django.forms.widgets import Textarea 6 | 7 | MODERATION_SET = SettingSet('moderation', _('Moderation settings'), _("Define the moderation workflow of your site"), 100) 8 | 9 | FLAG_TYPES = Setting('FLAG_TYPES', 10 | ["Spam", "Advertising", "Offensive, Abusive, or Inappropriate", "Content violates terms of use", "Copyright Violation", 11 | "Misleading", "Someone is not being nice", "Not relevant/off-topic", "Other"], 12 | MODERATION_SET, dict( 13 | label = _("Flag Reasons"), 14 | help_text = _("Create some flag reasons to use in the flag post popup."), 15 | widget=StringListWidget)) 16 | 17 | 18 | CLOSE_TYPES = Setting('CLOSE_TYPES', 19 | ["Duplicate Question", "Question is off-topic or not relevant", "Too subjective and argumentative", 20 | "The question is answered, right answer was accepted", "Problem is not reproducible or outdated", "Other"], 21 | MODERATION_SET, dict( 22 | label = _("Close Reasons"), 23 | help_text = _("Create some close reasons to use in the close question popup."), 24 | widget=StringListWidget)) 25 | -------------------------------------------------------------------------------- /qa-engine/forum/settings/upload.py: -------------------------------------------------------------------------------- 1 | import os.path 2 | from base import Setting, SettingSet 3 | from django.utils.translation import ugettext_lazy as _ 4 | 5 | UPLOAD_SET = SettingSet('paths', _('File upload settings'), _("File uploads related settings."), 600) 6 | 7 | UPFILES_FOLDER = Setting('UPFILES_FOLDER', os.path.join(os.path.dirname(os.path.dirname(__file__)),'upfiles'), UPLOAD_SET, dict( 8 | label = _("Uploaded files folder"), 9 | help_text = _("The filesystem path where uploaded files will be stored. Please note that this folder must exist."))) 10 | 11 | UPFILES_ALIAS = Setting('UPFILES_ALIAS', '/upfiles/', UPLOAD_SET, dict( 12 | label = _("Uploaded files alias"), 13 | help_text = _("The url alias for uploaded files. Notice that if you change this setting, you'll need to restart your site."))) 14 | 15 | ALLOW_MAX_FILE_SIZE = Setting('ALLOW_MAX_FILE_SIZE', 2.5, UPLOAD_SET, dict( 16 | label = _("Max file size"), 17 | help_text = _("The maximum allowed file size for uploads in mb."))) -------------------------------------------------------------------------------- /qa-engine/forum/settings/urls.py: -------------------------------------------------------------------------------- 1 | from base import Setting, SettingSet 2 | from django.utils.translation import ugettext as _ 3 | 4 | URLS_SET = SettingSet('urls', _('URL settings'), _("Some settings to tweak behaviour of site urls (experimental).")) 5 | 6 | ALLOW_UNICODE_IN_SLUGS = Setting('ALLOW_UNICODE_IN_SLUGS', False, URLS_SET, dict( 7 | label = _("Allow unicode in slugs"), 8 | help_text = _("Allow unicode/non-latin characters in urls."), 9 | required=False)) 10 | 11 | FORCE_SINGLE_URL = Setting('FORCE_SINGLE_URL', True, URLS_SET, dict( 12 | label = _("Force single url"), 13 | help_text = _("Redirect the request in case there is a mismatch between the slug in the url and the actual slug"), 14 | required=False)) 15 | 16 | -------------------------------------------------------------------------------- /qa-engine/forum/settings/view.py: -------------------------------------------------------------------------------- 1 | from base import Setting, SettingSet 2 | from django.utils.translation import ugettext_lazy as _ 3 | 4 | """ view settings """ 5 | VIEW_SET = SettingSet('view', _('View settings'), _("Set up how certain parts of the site are displayed."), 20) 6 | 7 | SUMMARY_LENGTH = Setting('SUMMARY_LENGTH', 300, VIEW_SET, dict( 8 | label = _("Summary Length"), 9 | help_text = _("The number of characters that are going to be displayed in order to get the content summary."))) 10 | 11 | RECENT_TAGS_SIZE = Setting('RECENT_TAGS_SIZE', 25, VIEW_SET, dict( 12 | label = _("Recent tags block size"), 13 | help_text = _("The number of tags to display in the recent tags block in the front page."))) 14 | 15 | RECENT_AWARD_SIZE = Setting('RECENT_AWARD_SIZE', 15, VIEW_SET, dict( 16 | label = _("Recent awards block size"), 17 | help_text = _("The number of awards to display in the recent awards block in the front page."))) 18 | 19 | LIMIT_RELATED_TAGS = Setting('LIMIT_RELATED_TAGS', 0, VIEW_SET, dict( 20 | label = _("Limit related tags block"), 21 | help_text = _("Limit related tags block size in questions list pages. Set to 0 to display all all tags."))) -------------------------------------------------------------------------------- /qa-engine/forum/skins/README: -------------------------------------------------------------------------------- 1 | this directory contains available skins 2 | 3 | 1) default - default skin with templates 4 | 2) common - this directory is to media directory common to all or many templates 5 | 6 | to create a new skin just create another directory under skins/ 7 | and start populating it with the directory structure as in 8 | default/templates - templates must be named the same way 9 | 10 | NO NEED TO CREATE ALL TEMPLATES/MEDIA FILES AT ONCE 11 | 12 | templates are resolved in the following way: 13 | * check in skin named as in settings.OSQA_DEFAULT_SKIN 14 | * then skin named 'default' 15 | 16 | media is resolved with one extra option 17 | * settings.OSQA_DEFAULT_SKIN 18 | * 'default' 19 | * 'common' 20 | 21 | media does not have to be composed of files named the same way as in default skin 22 | whatever media you link to from your templates - will be in operation 23 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/common/media/README: -------------------------------------------------------------------------------- 1 | directory for media common to all or many templates 2 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/blue-up-arrow-h18px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/blue-up-arrow-h18px.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/box-arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/box-arrow.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/bullet_green.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/bullet_green.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/by-sa-88x31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/by-sa-88x31.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/cc-88x31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/cc-88x31.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/cc-wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/cc-wiki.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/close-small-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/close-small-dark.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/close-small-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/close-small-hover.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/close-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/close-small.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/comment-delete-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/comment-delete-hover.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/comment-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/comment-delete.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/comment-edit-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/comment-edit-hover.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/comment-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/comment-edit.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/comment-like-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/comment-like-on.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/comment-like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/comment-like.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/convert-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/convert-hover.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/convert-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/convert-off.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/dash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/dash.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/djangomade124x25_grey.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/djangomade124x25_grey.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/dot-g.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/dot-g.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/dot-list.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/dot-list.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/edit.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/expander-arrow-hide.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/expander-arrow-hide.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/expander-arrow-show.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/expander-arrow-show.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/favicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/favicon.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/favicon.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/feed-icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/feed-icon-small.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/gray-up-arrow-h18px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/gray-up-arrow-h18px.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/grippie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/grippie.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/indicator.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/indicator.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/logo.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/logo.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/logo1.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/logo2.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/medala.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/medala.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/medala_on.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/medala_on.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/new.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/nophoto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/nophoto.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/aol.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/aol.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/aol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/aol.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/blogger.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/blogger.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/blogger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/blogger.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/claimid.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/claimid.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/claimid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/claimid.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/facebook.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/facebook.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/flickr.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/flickr.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/flickr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/flickr.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/google.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/google.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/livejournal.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/livejournal.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/livejournal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/livejournal.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/myopenid.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/myopenid.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/myopenid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/myopenid.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/myopenid_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/myopenid_big.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/openid-inputicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/openid-inputicon.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/openid.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/openid.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/technorati.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/technorati.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/technorati.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/technorati.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/twitter.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/verisign.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/verisign.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/verisign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/verisign.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/vidoop.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/vidoop.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/wordpress.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/wordpress.ico -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/wordpress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/wordpress.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/openid/yahoo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/openid/yahoo.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/quest-bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/quest-bg.gif -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/user-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/user-sprite.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/vote-accepted-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/vote-accepted-on.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/vote-accepted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/vote-accepted.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/vote-arrow-down-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/vote-arrow-down-on.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/vote-arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/vote-arrow-down.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/vote-arrow-up-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/vote-arrow-up-on.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/vote-arrow-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/vote-arrow-up.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/vote-favorite-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/vote-favorite-off.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/vote-favorite-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/vote-favorite-on.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/webfaction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/webfaction.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/images/wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/images/wiki.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/compress.bat: -------------------------------------------------------------------------------- 1 | java -jar yuicompressor-2.4.2.jar --type js --charset utf-8 osqa.main.js -o osqa.main.min.js 2 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/flot-build.bat: -------------------------------------------------------------------------------- 1 | java -jar yuicompressor-2.4.2.jar --type js --charset utf-8 jquery.flot.js -o jquery.flot.pack.js 2 | 3 | pause 4 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/jquery.validate.pack.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/jquery.validate.pack.js -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/osqa.question.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | $('div#editor_side_bar').hide(); 3 | 4 | $('#editor').focus(function(){ $('div#editor_side_bar').fadeIn('slow') }); 5 | $('#editor').blur(function(){ $('div#editor_side_bar').fadeOut('slow') }); 6 | }); 7 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/bg-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/bg-fill.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/bg.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/blockquote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/blockquote.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/bold.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/code.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/h1.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/hr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/hr.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/img.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/italic.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/link.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/ol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/ol.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/redo.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/separator.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/ul.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/ul.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/undo.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/wmd-buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/wmd-buttons.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/wmd-buttons.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/wmd-buttons.psd -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/wmd-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/wmd-on.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/js/wmd/images/wmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/js/wmd/images/wmd.png -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/style/admin.css: -------------------------------------------------------------------------------- 1 | #admin_form { 2 | border-spacing: 10px; 3 | } 4 | 5 | #admin_form input[type="text"], #admin_form input[type="submit"], #admin_form textarea, .string_list_widget_button { 6 | line-height: 22px; 7 | font-size: 140%; 8 | font-family: sans-serif; 9 | border: 1px solid #999; 10 | color: black; 11 | } 12 | 13 | #admin_form input[type="text"], #admin_form input[type="submit"], .string_list_widget_button { 14 | height: 28px; 15 | } 16 | 17 | #admin_form input[type="text"], #admin_form textarea { 18 | width: 550px; 19 | } 20 | 21 | #admin_form th { 22 | text-align: left; 23 | vertical-align: top; 24 | } 25 | 26 | #admin_form td { 27 | color: gray; 28 | } 29 | 30 | #admin_page_description { 31 | color: gray; 32 | padding-bottom: 20px; 33 | } 34 | 35 | .string_list_widget input[type=text] { 36 | width: 520px; 37 | } 38 | 39 | .string_list_widget_button { 40 | width: 28px; 41 | font-size: 20px; 42 | font-weight: bold; 43 | } 44 | 45 | .string_list_widget_button.add { 46 | position: relative; 47 | left: 554px; 48 | } 49 | 50 | table caption { 51 | font-size: 120%; 52 | padding: 3px 0; 53 | text-align: left; 54 | } -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/style/default.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/skins/default/media/style/default.css -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/style/djstyle_admin.css: -------------------------------------------------------------------------------- 1 | @import "jquery.autocomplete.css"; 2 | 3 | textarea { 4 | width: 100%; 5 | } 6 | 7 | input.longstring { 8 | width: 100%; 9 | } 10 | 11 | #admin_form tr th { 12 | white-space: nowrap; 13 | } 14 | 15 | #admin_form tr th a { 16 | font-size: 80%; 17 | } 18 | 19 | #admin_form tr th .sep { 20 | font-size: 80%; 21 | margin-left: 6px; 22 | margin-right: 6px; 23 | } 24 | 25 | #admin_form tr td:first-of-type { 26 | width: 100%; 27 | } 28 | 29 | .string-list-input { 30 | vertical-align: middle; 31 | } 32 | 33 | .string-list-input input { 34 | width: 600px; 35 | margin: 0px; 36 | } 37 | 38 | .string_list_widget_button { 39 | background:url("../img/admin/nav-bg.gif") repeat-x scroll center bottom #dcdcdc; 40 | border-color:#DDDDDD #AAAAAA #AAAAAA #DDDDDD; 41 | border-style:solid; 42 | border-width:1px; 43 | color:black; 44 | height: 20px; 45 | width: 20px; 46 | } 47 | 48 | .string_list_widget_button.add { 49 | position: relative; 50 | left: 612px; 51 | } 52 | 53 | .admin_message { 54 | background-color: #ffffe0; 55 | border: 3px double #b8860b; 56 | padding: 4px; 57 | } 58 | 59 | .ajax_indicator { 60 | background: transparent url('../images/indicator.gif') top left no-repeat; 61 | padding: 7px 25px; 62 | min-height: 24px; 63 | } -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/style/jquery.autocomplete.css: -------------------------------------------------------------------------------- 1 | .ac_results { 2 | padding: 0px; 3 | border: 1px solid black; 4 | background-color: white; 5 | overflow: hidden; 6 | z-index: 99999; 7 | text-align:left; 8 | } 9 | 10 | .ac_results ul { 11 | width: 100%; 12 | list-style-position: outside; 13 | list-style: none; 14 | padding: 0; 15 | margin: 0; 16 | } 17 | 18 | .ac_results li { 19 | margin: 0px; 20 | padding: 2px 5px; 21 | cursor: default; 22 | display: block; 23 | /* 24 | if width will be 100% horizontal scrollbar will apear 25 | when scroll mode will be used 26 | */ 27 | /*width: 100%;*/ 28 | font: menu; 29 | font-size: 12px; 30 | /* 31 | it is very important, if line-height not setted or setted 32 | in relative units scroll will be broken in firefox 33 | */ 34 | line-height: 16px; 35 | overflow: hidden; 36 | } 37 | 38 | .ac_loading { 39 | background: white url(../../media/images/indicator.gif) right center no-repeat; 40 | } 41 | 42 | .ac_odd { 43 | background-color: #E7F1F8; 44 | } 45 | 46 | .ac_over { 47 | background-color: #0A246A; 48 | color: white; 49 | } 50 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/style/markdown_help.css: -------------------------------------------------------------------------------- 1 | div.main-wrapper { 2 | /* 3 | margin: 30px auto; 4 | overflow:hidden; 5 | position:relative; 6 | */ 7 | } 8 | 9 | div.section { 10 | padding-top:30px; 11 | } 12 | 13 | h2.section-title { 14 | padding-top:10px; 15 | padding-left:10px; 16 | width:100%; 17 | background-color:#b6c4e2; 18 | } 19 | 20 | div.section-description { 21 | padding-top:20px; 22 | padding-bottom:10px; 23 | } 24 | 25 | table.section-example { 26 | padding-top:5px; 27 | padding-bottom:10px; 28 | width:100%; 29 | } 30 | 31 | table.section-example tr { 32 | } 33 | 34 | table.section-example tr td { 35 | background-color:#e5ebf8; 36 | 37 | padding:5px 5px 5px 5px; 38 | width:50%; 39 | 40 | text-align:left; 41 | 42 | border: 1px solid #ccc; 43 | -moz-border-radius:5px; 44 | -webkit-border-radius:5px; 45 | } 46 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/style/openid.css: -------------------------------------------------------------------------------- 1 | #openid_form { 2 | width: 470px; 3 | } 4 | #openid_form legend { 5 | font-weight: bold; 6 | } 7 | #openid_choice { 8 | display: none; 9 | } 10 | #openid_input_area { 11 | clear: both; 12 | padding: 10px; 13 | } 14 | #openid_btns, #openid_btns br { 15 | clear: both; 16 | } 17 | #openid_highlight { 18 | padding: 3px; 19 | background-color: #FFFCC9; 20 | float: left; 21 | } 22 | .openid_large_btn { 23 | width: 100px; 24 | height: 60px; 25 | border: 1px solid #DDD; 26 | margin: 3px; 27 | float: left; 28 | } 29 | .openid_small_btn { 30 | width: 24px; 31 | height: 24px; 32 | border: 1px solid #DDD; 33 | margin: 3px; 34 | float: left; 35 | } 36 | a.openid_large_btn:focus { 37 | outline: none; 38 | } 39 | a.openid_large_btn:focus 40 | { 41 | -moz-outline-style: none; 42 | } 43 | .openid_selected { 44 | border: 4px solid #DDD; 45 | } 46 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/media/style/prettify.css: -------------------------------------------------------------------------------- 1 | /* Pretty printing styles. Used with prettify.js. */ 2 | 3 | .str { color: #080; } 4 | .kwd { color: #008; } 5 | .com { color: #800; } 6 | .typ { color: #606; } 7 | .lit { color: #066; } 8 | .pun { color: #660; } 9 | .pln { color: #000; } 10 | .tag { color: #008; } 11 | .atn { color: #606; } 12 | .atv { color: #080; } 13 | .dec { color: #606; } 14 | pre.prettyprint { padding: 3px; border: 0px solid #888; } 15 | 16 | @media print { 17 | .str { color: #060; } 18 | .kwd { color: #006; font-weight: bold; } 19 | .com { color: #600; font-style: italic; } 20 | .typ { color: #404; font-weight: bold; } 21 | .lit { color: #044; } 22 | .pun { color: #440; } 23 | .pln { color: #000; } 24 | .tag { color: #006; font-weight: bold; } 25 | .atn { color: #404; } 26 | .atv { color: #060; } 27 | } 28 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/500.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | 3 | {% load i18n %} 4 | {% block title %}{% spaceless %}500 Error{% endspaceless %}{% endblock %} 5 | {% block forejs %} 6 | 12 | {% endblock %} 13 | {% block content %} 14 |
15 |

16 | 500 Server Error 17 |

18 | 19 |
20 |
21 |
22 |

{% trans "sorry, system error" %}

23 |
24 | {% trans "system error log is recorded, error will be fixed as soon as possible" %}
25 | {% trans "please report the error to the site administrators if you wish" %} 26 | 31 |
32 | 33 |
34 | {% endblock %} 35 | 36 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/503.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 4 | 5 | 6 | {% trans "System down for maintenance" %} 7 | 12 | 13 | 14 |
15 | 16 |

{{ app_title }}

17 |

{% trans "System down for maintenance" %}

18 |
19 | {{ message }} 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/answer_edit_tips.html: -------------------------------------------------------------------------------- 1 | 2 | {% load i18n general_sidebar_tags %} 3 |
4 |

{% trans "answer tips" %}

5 |
6 |
    7 |
  • {% trans "please make your answer relevant to this community" %} 8 |
  • 9 |
  • 10 | {% trans "try to give an answer, rather than engage into a discussion" %} 11 |
  • 12 |
  • 13 | {% trans "please try to provide details" %} 14 |
  • 15 |
  • 16 | {% trans "be clear and concise" %} 17 |
  • 18 |
19 | 22 |
23 |
24 | 25 | {% markdown_help %} 26 | 27 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/auth/mail_already_validated.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | 3 | {% load i18n %} 4 | {% block head %}{% endblock %} 5 | {% block title %}{% spaceless %}{% trans "This e-mail has already been validated" %}{% endspaceless %}{% endblock %} 6 | {% block content %} 7 | 8 |
9 | 10 |

{% blocktrans %}Already validated{% endblocktrans %}

11 | 12 |

{% blocktrans %}This e-mail has already been validated{% endblocktrans %}

13 | 14 |
15 | 16 | {% endblock %} 17 | 18 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/auth/mail_validation.html: -------------------------------------------------------------------------------- 1 | {% load i18n extra_tags email_tags %} 2 | 3 | {% declare %} 4 | prefix = settings.EMAIL_SUBJECT_PREFIX 5 | app_name = settings.APP_SHORT_NAME 6 | 7 | exclude_finetune = True 8 | {% enddeclare %} 9 | 10 | {% email %} 11 | {% subject %}{% blocktrans %}{{ prefix }} Your email validation link {{ app_name }}{% endblocktrans %}{% endsubject %} 12 | 13 | {% htmlcontent notifications/base.html %} 14 |

{% trans "Please use the following link to help us verify your email address:" %}

15 | 16 |

{% trans "Validate my email address" %}

17 | 18 |

{% trans "If the above link is not clickable, copy and paste this url into your web browser's address bar:" %}

19 | 20 |

{% fullurl auth_validate_email user=recipient.id,code=validation_code %}

21 | {% endhtmlcontent %} 22 | 23 | {% textcontent notifications/base_text.html %} 24 | {% trans "Copy and paste this url into your web browser's address bar to help us verify your email address:" %} 25 | 26 | {% fullurl auth_validate_email user=recipient.id,code=validation_code %} 27 | {% endtextcontent %} 28 | 29 | {% endemail %} 30 | 31 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/auth/temp_login_email.html: -------------------------------------------------------------------------------- 1 | {% load i18n extra_tags email_tags %} 2 | 3 | {% declare %} 4 | prefix = settings.EMAIL_SUBJECT_PREFIX 5 | app_name = settings.APP_SHORT_NAME 6 | 7 | exclude_finetune = True 8 | {% enddeclare %} 9 | 10 | {% email %} 11 | {% subject %}{% blocktrans %}{{ prefix }} Temporary login link{% endblocktrans %}{% endsubject %} 12 | 13 | {% htmlcontent notifications/base.html %} 14 |

15 | {% blocktrans %}The following link grants you a one time access to your account at {{ app_name }}.{% endblocktrans %} 16 |

17 |

{% trans "Go to your account" %}

18 | 19 |

{% trans "If the above link is not clickable, copy and paste this url into your web browser's address bar:" %}

20 | 21 |

{% fullurl auth_tempsignin user=recipient.id,code=temp_login_code %}

22 | {% endhtmlcontent %} 23 | 24 | {% textcontent notifications/base_text.html %} 25 | {% blocktrans %}The following url grants you a one time access to your account at {{ app_name }}.{% endblocktrans %} 26 | 27 | {% fullurl auth_tempsignin user=recipient.id,code=temp_login_code %} 28 | {% endtextcontent %} 29 | 30 | {% endemail %} 31 | 32 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/auth/temp_login_request.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% load i18n %} 4 | {% block head %}{% endblock %} 5 | {% block title %}{% spaceless %}{% trans "Request temporary login key" %}{% endspaceless %}{% endblock %} 6 | {% block content %} 7 |
{% trans "Account: request temporary login key" %}
8 |

{% blocktrans %} 9 | If you're experiencing problems accessing your account, or if you forgot your password, 10 | here you can request a temporary login key. Fill out your account email and we'll send you a temporary access link that 11 | will enable you to access your account. This token is valid only once and for a limited period of time. 12 | {% endblocktrans %}

13 |
14 | {% if form.errors %} 15 |
    16 | {% for error in form.errors %} 17 |
  • {{ error }}
  • 18 | {% endfor %} 19 |
20 | {% endif %} 21 |
22 |
    23 | {{form.as_ul}} 24 |
25 |
26 |
27 |
28 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/base.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | {% block page_center %} 3 | 4 | {% block full_width_banner %}{% endblock %} 5 | 6 |
7 | {% block site_width_banner %}{% endblock %} 8 | 9 |
10 |
11 | {% block content%} 12 | {% endblock%} 13 | 14 |
15 |
16 | {% block sidebar%} 17 | {% endblock%} 18 | 19 |
20 |
21 | {% block tail %} 22 | {% endblock %} 23 |
24 |
25 |
26 |
27 | {% endblock %} 28 | 29 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/close.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | 3 | {% load i18n %} 4 | {% load extra_tags %} 5 | {% load humanize %} 6 | {% block title %}{% spaceless %}{% trans "Close question" %}{% endspaceless %}{% endblock %} 7 | {% block forejs %} 8 | 13 | {% endblock %} 14 | {% block content %} 15 |
16 | {% trans "Close question" %} 17 |
18 |
19 |

{% trans "Close the question" %}: 20 | {{ question.get_question_title }} 21 |

22 | 23 |
24 |

25 | {% trans "Reasons" %}: {{ form.reason }} 26 |

27 |
28 | 29 | 30 | 31 |
32 | 33 |
34 |
35 | {% endblock %} 36 | 37 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/email_base.html: -------------------------------------------------------------------------------- 1 | {% load extra_filters %} 2 | {% load extra_tags %} 3 | {% load email_tags %} 4 | {% load i18n %} 5 | 6 | 7 | 8 | 29 | 30 | 31 | 32 | {{settings.APP_TITLE}} logo 33 | 34 |
35 |

{{ settings.APP_TITLE }}

36 |

37 |
38 |
39 |
40 | {% block content%} 41 | {% endblock%} 42 |
43 |
44 |
45 |
46 | 47 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/feeds/rss_answer_title.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans with obj.author.username as author %}Answer by {{ author }}{% endblocktrans %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/feeds/rss_description.html: -------------------------------------------------------------------------------- 1 | {{ obj.html|safe }} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/feeds/rss_title.html: -------------------------------------------------------------------------------- 1 | {{ obj.title|safe }} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/footer.html: -------------------------------------------------------------------------------- 1 | {% load extra_tags ui_registry i18n %} 2 | 3 | 4 |
5 | 8 |

9 | 10 | powered by iCQA 11 | 12 |

13 |
14 | 19 | 20 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "questions.html" %} 2 | 3 | {% load general_sidebar_tags %} 4 | {% load question_list_tags %} 5 | {% load i18n %} 6 | {% block fulltitle %}{{ settings.APP_TITLE }}{% endblock %} 7 | {% block sidebar %} 8 | {% if not request.user.is_authenticated %} 9 | {% if settings.SHOW_WELCOME_BOX %} 10 |
11 |

{% trans "welcome to " %}{{ settings.APP_SHORT_NAME }}

12 |
13 | {{ settings.APP_INTRO|safe }} 14 | 15 | 16 |
17 |
18 | {% endif %} 19 | {% endif %} 20 | {% include "question_list/count.html" %} 21 | {% sidebar_upper %} 22 | {% if request.user.is_authenticated %} 23 | {% tag_selector %} 24 | {% endif %} 25 | {% sidebar_lower %} 26 | {% recent_tags %} 27 | {% recent_awards %} 28 | {% endblock %} 29 | 30 | 31 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/logout.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | 3 | {% load extra_tags %} 4 | {% load humanize %} 5 | {% load i18n %} 6 | {% block title %}{% spaceless %}{% trans "Logout" %}{% endspaceless %}{% endblock %} 7 | {% block forejs %} 8 | 13 | {% endblock %} 14 | {% block content %} 15 |
16 | {% trans "Logout" %} 17 |
18 |
19 |

{% trans "As a registered user you can login with your OpenID, log out of the site or permanently remove your account." %}

20 | 21 |
22 | {% endblock %} 23 | 24 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/accept_button.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {% if can_accept %} 4 | 13 | 14 | {% else %} 15 | {% if answer.nis.accepted %} 16 | 19 | 20 | {% endif %} 21 | {% endif %} 22 | 23 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/award_points.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |

4 | {% blocktrans %} 5 | Award {{ awarded_user }} with reputation points. 6 | {% endblocktrans %} 7 |

8 | 9 |

10 | Points: 11 | 1 12 |

13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/contributors_info.html: -------------------------------------------------------------------------------- 1 | {% load extra_tags %} 2 |
3 |

4 | {{ node_verb }} 5 | {% diff_date node.added_at %} 6 |

7 | {% gravatar node.author 32 %} 8 |

{{ node.author.decorated_name }}
9 | {% get_score_badge node.author %}

10 |
11 | {% if node.last_edited %} 12 |
13 |

14 | 15 | {{ node.last_edited.verb }} 16 | {% diff_date node.last_edited.at %} 17 | 18 |

19 | {% ifnotequal node.author node.last_edited.by %} 20 | {% gravatar node.last_edited.by 32 %} 21 |

{{ node.last_edited.by.decorated_name }}
22 | {% get_score_badge node.last_edited.by %}

23 | {% endifnotequal %} 24 |
25 | {% endif %} 26 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/convert_to_comment.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |
4 |

{% trans "Place the comment under:" %}

5 | 10 |
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/convert_to_question.html: -------------------------------------------------------------------------------- 1 | {% extends "question_edit.html" %} 2 | {% load i18n %} 3 | {% block title %}{% trans "Convert to question" %}{% endblock %} 4 | {% block edittype %}{% trans "Convert to question" %}{% endblock %} 5 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/favorite_mark.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 6 |
7 | {% if favorite_count %}{{ favorite_count }}{% endif %} 8 |
9 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/flagged_item.html: -------------------------------------------------------------------------------- 1 | {% load extra_tags %} 2 |
3 | {{ action.describe|safe }} 4 | at 5 | {{ action.action_date }} 6 |
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/permanent_link.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {% spaceless %} 4 | 5 | 6 | 7 | 8 | 9 |
10 | {% endspaceless %} 11 | 12 | 20 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/post_controls.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% spaceless %} 3 | {% for control in controls %} 4 | 5 | {{ control.text }} 6 | 7 | {% ifnotequal controls|last control %} 8 | | 9 | {% endifnotequal %} 10 | {% endfor %} 11 | {% if menu|length %} 12 | | 13 | 14 | {% trans "more" %} ▼ 15 | 20 | 21 | {% endif %} 22 | {% endspaceless %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/report.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | {% trans "Please select a reason bellow or use the text box to input your own reason." %} 4 | 9 | 10 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/reviser_info.html: -------------------------------------------------------------------------------- 1 | {% load extra_tags %} 2 |
3 |

4 | {% diff_date revision.revised_at %} 5 |

6 | {% gravatar revision.author 32 %} 7 |

{{ revision.author.username }}
8 | {% get_score_badge revision.author %}

9 |
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/revision.html: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | {% if title %}

{{ title }}

{% endif %} 3 |
{{ html }}
4 | {% if tags %} 5 |
6 | {% for tag in tags %} 7 | 8 | {% endfor %} 9 |
10 | {% endif %} 11 | {% endspaceless %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/vote_buttons.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 6 |
8 | {{ post.score }} 9 |
10 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/node/wiki_symbol.html: -------------------------------------------------------------------------------- 1 | {% load i18n extra_tags %} 2 | {% spaceless %} 3 | {% if is_wiki %} 4 |
5 | {% blocktrans %}This {{ post_type }} is marked "community wiki".{% endblocktrans %} 6 | {% if can_edit %} 7 |
{% blocktrans %}Feel free to edit it.{% endblocktrans %} 8 | {% endif %} 9 |
10 | {% endif %} 11 | {% endspaceless %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/notarobot.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | {% load i18n %} 3 | {% block title %}{% spaceless %}{% trans "Please prove that you are a Human Being" %}{% endspaceless %}{% endblock %} 4 | {% block content %} 5 | {% comment %} this form is set up to be used in wizards {% endcomment %} 6 |
7 |
8 | {{form}} 9 |
10 | 11 | 12 | {{ previous_fields|safe }} 13 |
14 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/notifications/answeraccepted.html: -------------------------------------------------------------------------------- 1 | {% load i18n extra_tags email_tags %} 2 | 3 | {% declare %} 4 | prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) 5 | answer_author = html.mark_safe(answer.author.username) 6 | question = answer.question 7 | question_title = html.mark_safe(question.title) 8 | accepted_by = html.mark_safe(answer.nstate.accepted.by.username) 9 | accepted_by_link = html.objlink(answer.nstate.accepted.by, style=settings.EMAIL_ANCHOR_STYLE) 10 | answer_author_link = html.objlink(answer.author, style=settings.EMAIL_ANCHOR_STYLE) 11 | question_link = html.objlink(question, style=settings.EMAIL_ANCHOR_STYLE) 12 | {% enddeclare %} 13 | 14 | {% email %} 15 | {% subject %}{% blocktrans %}{{ prefix }} An answer to: {{ question_title }} has been accepted{% endblocktrans %}{% endsubject %} 16 | 17 | {% htmlcontent notifications/base.html %} 18 |

19 | {% blocktrans %} 20 | {{ accepted_by_link }} has just accepted {{ answer_author_link }}'s answer on his question 21 | {{ question_link }}. 22 | {% endblocktrans %} 23 |

24 | {% endhtmlcontent %} 25 | 26 | {% textcontent notifications/base_text.html %} 27 | {% blocktrans %} 28 | {{ accepted_by }} has just accepted {{ answer_author }}'s answer on his question 29 | "{{ question_title }}". 30 | {% endblocktrans %} 31 | {% endtextcontent %} 32 | 33 | {% endemail %} 34 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/notifications/base_text.html: -------------------------------------------------------------------------------- 1 | {% load extra_filters extra_tags i18n email_tags %} 2 | 3 | {% if not exclude_greeting %} 4 | {% trans "Hello" %} {{ recipient.username }}, 5 | {% endif %} 6 | 7 | {% block content %}{% endblock%} 8 | 9 | {% trans "Thanks" %}, 10 | {{settings.APP_SHORT_NAME}} 11 | 12 | {% if not exclude_finetune %} 13 | {% trans "P.S. You can always fine-tune which notifications you receive here:" %} 14 | {{ settings.APP_URL }}{% url user_subscriptions id=recipient.id,slug=recipient.username|slugify %} 15 | {% endif %} 16 | 17 | {{ settings.EMAIL_FOOTER_TEXT }} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/notifications/feedback.html: -------------------------------------------------------------------------------- 1 | {% load i18n extra_tags email_tags %} 2 | 3 | {% declare %} 4 | prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) 5 | app_name = html.mark_safe(settings.APP_SHORT_NAME) 6 | 7 | exclude_greeting = True 8 | exclude_finetune = True 9 | {% enddeclare %} 10 | 11 | {% email %} 12 | {% subject %}{% blocktrans %}{{ prefix }} Feedback message from {{ app_name }}{% endblocktrans %}{% endsubject %} 13 | 14 | {% htmlcontent notifications/base.html %} 15 |

16 | {% trans "Sender" %}:{% if name %}{{ name }}{% else %}{% trans "anonymous" %}{% endif %}
17 | {% trans "email" %}: {{ email }} 18 |
19 | ip: {{ ip }} 20 |

21 | 22 |
23 | {% trans "Message body:" %} {{ message }} 24 |
25 | 26 | {% endhtmlcontent %} 27 | 28 | {% textcontent notifications/base_text.html %} 29 | {% trans "Sender" %}: {% if name %}{{ name|safe }}{% else %}{% trans "anonymous" %}{% endif %} 30 | {% trans "email" %}: {{ email|safe }} 31 | ip: {{ ip }} 32 | 33 | {% trans "Message body:" %} {{ message|safe }} 34 | {% endtextcontent %} 35 | 36 | {% endemail %} 37 | 38 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/notifications/newmember.html: -------------------------------------------------------------------------------- 1 | {% load i18n extra_tags email_tags %} 2 | 3 | {% declare %} 4 | prefix = html.mark_safe(settings.EMAIL_SUBJECT_PREFIX) 5 | app_name = settings.APP_SHORT_NAME 6 | safe_app_name = html.mark_safe(settings.APP_SHORT_NAME) 7 | app_url = settings.APP_URL 8 | newmember_name = newmember.username 9 | safe_newmember_name = html.mark_safe(newmember.username) 10 | newmember_url = newmember.get_profile_url() 11 | newmember_link = html.objlink(newmember, style=settings.EMAIL_ANCHOR_STYLE) 12 | {% enddeclare %} 13 | 14 | {% email %} 15 | {% subject %}{% blocktrans %}{{ prefix }} {{ safe_newmember_name }} is a new member on {{ safe_app_name }}{% endblocktrans %}{% endsubject %} 16 | 17 | {% htmlcontent notifications/base.html %} 18 |

19 | {% blocktrans %} 20 | {{ newmember_link }} has just joined {{ app_name }}. 21 | View {{ newmember_name }}'s profile. 22 | {% endblocktrans %} 23 |

24 | {% endhtmlcontent %} 25 | 26 | {% textcontent notifications/base_text.html %} 27 | {% blocktrans %} 28 | {{ safe_newmember_name }} has just joined {{ safe_app_name }}. You can visit {{ safe_newmember_name }}'s profile using the following url: 29 | {{ app_url }}{{ newmember_url }} 30 | {% endblocktrans %} 31 | {% endtextcontent %} 32 | 33 | {% endemail %} 34 | 35 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/opensearch.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 4 | {{ settings.APP_SHORT_NAME }} {% trans "Search" %} 5 | {% trans "Search" %} {{ settings.APP_SHORT_NAME }} {% trans "using your browser." %} 6 | {{ settings.APP_KEYWORDS }} 7 | 8 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/createuser.html: -------------------------------------------------------------------------------- 1 | {% extends basetemplate %} 2 | 3 | {% load i18n %} 4 | {% load user_tags %} 5 | 6 | {% block subtitle %} 7 | {% trans "Create User" %} 8 | {% endblock %} 9 | {% block description %} 10 | {% trans "Quick creation of a new user" %} 11 | {% endblock %} 12 | 13 | {% block admincontent %} 14 |
15 | 16 | {{ form.as_table }} 17 | 18 |
19 |
20 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/flagged_posts.html: -------------------------------------------------------------------------------- 1 | {% extends basetemplate %} 2 | 3 | {% load i18n %} 4 | {% load user_tags %} 5 | 6 | {% block subtitle %}{% trans "Flagged Posts" %}{% endblock %} 7 | {% block pagename %}{% trans "Flagged Posts" %}{% endblock %} 8 | {% block description %}{% trans "This are the posts that have been flagged by users." %}{% endblock %} 9 | 10 | {% block admincontent %} 11 |
12 | 13 | 14 | 15 | 22 | 23 |
{% trans "Flagged Posts" %}
16 | 17 | {% for post in flagged_posts %} 18 | 19 | {% endfor %} 20 |
{% flagged_item post request.user %}
21 |
24 |
25 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/graph.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 8 | 9 |
{{ graph.caption }}
6 |
7 |
10 |
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/mail_test.html: -------------------------------------------------------------------------------- 1 | {% load i18n extra_tags email_tags %} 2 | 3 | {% declare %} 4 | prefix = settings.EMAIL_SUBJECT_PREFIX 5 | app_name = settings.APP_SHORT_NAME 6 | 7 | exclude_finetune = True 8 | {% enddeclare %} 9 | 10 | {% email %} 11 | {% subject %}{% blocktrans %}{{ prefix }} Your email settings are correct: {{ app_name }}{% endblocktrans %}{% endsubject %} 12 | 13 | {% htmlcontent notifications/base.html %} 14 | {% trans "If you see this content your E-Mail settings are correct." %} 15 | {% endhtmlcontent %} 16 | 17 | {% textcontent notifications/base_text.html %} 18 | {% trans "If you see this content your E-Mail settings are correct." %} 19 | {% endtextcontent %} 20 | 21 | {% endemail %} 22 | 23 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/maintenance.html: -------------------------------------------------------------------------------- 1 | {% extends basetemplate %} 2 | 3 | {% load i18n %} 4 | 5 | {% block subtitle %}{% trans "Maintenance mode" %}{% endblock %} 6 | {% block pagename %}{% trans "Maintenance mode" %}{% endblock %} 7 | {% block description %}{% trans "Maintainance mode allows you to close your site for maintainance, allowing only a predetermined set of ip addresses to access it normally." %}{% endblock %} 8 | 9 | {% block admincontent %} 10 |
11 | {% if in_maintenance %} 12 |

{% trans "Your site is currently running on maintenance mode." %}

13 |

{% trans "You can adjust the settings bellow" %}

14 | {% endif %} 15 | 16 | {{ form.as_table }} 17 |
18 | {% if in_maintenance %} 19 | 20 | 21 | {% else %} 22 | 23 | {% endif %} 24 |
25 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/set.html: -------------------------------------------------------------------------------- 1 | {% extends basetemplate %} 2 | 3 | {% load i18n extra_tags extra_filters %} 4 | 5 | {% block subtitle %}{{ form.set.title }}{% endblock %} 6 | {% block pagename %}{{ form.set.title }}{% endblock %} 7 | {% block description %}{{ form.set.description }}{% endblock %} 8 | 9 | {% block admincontent %} 10 |
11 | 12 | {{ form.as_table }} 13 | 14 | 15 | 24 | 25 |
16 | 17 | {% if form.set.can_preview %} 18 | 19 | {% if form.set.name|contained_in:unsaved %} 20 | 21 | {% endif %} 22 | {% endif %} 23 |
26 |
27 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/static_pages.html: -------------------------------------------------------------------------------- 1 | {% extends basetemplate %} 2 | 3 | {% load i18n %} 4 | 5 | {% block subtitle %}{% trans "Static pages" %}{% endblock %} 6 | {% block pagename %}{% trans "Static pages" %}{% endblock %} 7 | {% block description %}{% trans "Allows you to create a set of static pages" %}{% endblock %} 8 | 9 | {% block admincontent %} 10 |

{% trans "Select page to edit" %}

11 | 14 |
15 | 16 | 17 | 18 | {% for page in pages %} 19 | 20 | 21 | 22 | 23 | {% endfor %} 24 | 25 |
{% trans "Pages" %}
{{ page.headline }}{% trans "Edit" %}
26 |
27 | 28 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/statistics.html: -------------------------------------------------------------------------------- 1 | {% extends basetemplate %} 2 | 3 | {% load i18n %} 4 | {% load extra_tags %} 5 | 6 | {% block adminjs %} 7 | 8 | 9 | 23 | {% endblock %} 24 | 25 | {% block subtitle %}{% trans "Dashboard" %}{% endblock %} 26 | {% block pagename %}{% trans "Dashboard" %}{% endblock %} 27 | {% block description %}{% trans "Some simple graphics to help you get a notion of whats going on in your site." %}{% endblock %} 28 | 29 | {% block admincontent %} 30 | {% for graph in graphs %} 31 | {% include "osqaadmin/graph.html" %} 32 | {% endfor %} 33 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/osqaadmin/test_email_settings.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |

4 | {% blocktrans %} 5 | An attempt has been made to send email to 6 | {% endblocktrans %} {{ user.email }}. 7 |

8 | 9 |

10 | {% blocktrans %} 11 | Please, check your inbox and if you see the new test message your email STMP settings are correct. 12 | {% endblocktrans %} 13 |

14 | 15 |

16 | {% blocktrans %} 17 | If you do not see the new test message check your spam folder, and if you don't find it check your SMTP settings 18 | again. It might be useful to take a look at the log file. 19 | {% endblocktrans %} 20 |

-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends base %} 2 | {% load i18n markup node_tags general_sidebar_tags %} 3 | {% block title %}{% spaceless %}{{ page.title }}{% endspaceless %}{% endblock %} 4 | 5 | {% block content %} 6 |
{{ page.title }}
7 |
8 | {{ body }} 9 |
10 | {% if page.extra.comments %} 11 | {% comments page request.user %} 12 | {% endif %} 13 | {% endblock %} 14 | 15 | {% ifequal page.extra.template "sidebar" %} 16 | {% block sidebar %} 17 | {% sidebar_upper %} 18 | {% if page.extra.sidebar %} 19 | {% if page.extra.sidebar_wrap %}
{% endif %} 20 | {{ sidebar }} 21 | {% if page.extra.sidebar_wrap %}
{% endif %} 22 | {% endif %} 23 | {% sidebar_lower %} 24 | {% endblock %} 25 | {% endifequal %} 26 | 27 | 28 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/pagesize.html: -------------------------------------------------------------------------------- 1 | 2 | {% spaceless %} 3 | {% load i18n %} 4 | {% if is_paginated %} 5 |
6 | {% trans "posts per page" %} 7 | {% ifequal pagesize 10 %} 8 | 10 9 | {% else %} 10 | 10 11 | {% endifequal %} 12 | 13 | {% ifequal pagesize 30 %} 14 | 30 15 | {% else %} 16 | 30 17 | {% endifequal %} 18 | 19 | {% ifequal pagesize 50 %} 20 | 50 21 | {% else %} 22 | 50 23 | {% endifequal %} 24 |
25 | {% endif %} 26 | {% endspaceless %} 27 | 28 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/paginator/page_numbers.html: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | {% load i18n %} 3 | 4 |

5 | {% if has_previous %} 6 | « {% trans "previous" %} 7 | {% endif %} 8 | {% for range in page_numbers %} 9 | {% if range %} 10 | {% for num, url in range %} 11 | {% ifequal num current %} 12 | {{ num }} 13 | {% else %} 14 | {{ num }} 15 | {% endifequal %} 16 | {% endfor %} 17 | {% else %} 18 | ... 19 | {% endif %} 20 | {% endfor %} 21 | {% if has_next %} 22 | {% trans "next page" %} » 23 | {% endif %} 24 |

25 | {% endspaceless %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/paginator/page_sizes.html: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | {% load i18n %} 3 |
4 | {% trans "posts per page" %} 5 | {% for size, url in sizes %} 6 | {% ifequal size current %} 7 | {{ size }} 8 | {% else %} 9 | {{ size }} 10 | {% endifequal %} 11 | {% endfor %} 12 |
13 | {% endspaceless %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/paginator/sort_tabs.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% spaceless %} 3 |
4 | {% for name, label, url, descr in sorts %} 5 | {{ label }} 6 | {% endfor %} 7 | {% comment %} 8 | 9 | 10 | 11 | {% endcomment %} 12 |
13 | {% endspaceless %} 14 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/privacy.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | 3 | {% load extra_tags %} 4 | {% load i18n %} 5 | {% load humanize %} 6 | {% block title %}{% spaceless %}{% trans "Privacy policy" %}{% endspaceless %}{% endblock %} 7 | {% block forejs %} 8 | {% endblock %} 9 | {% block content %} 10 |
11 | {% trans "Privacy policy" %} 12 |
13 |
14 |

15 | {% trans "general message about privacy" %} 16 |

17 | 18 |

{% trans "Site Visitors" %}

19 |

20 | {% trans "what technical information is collected about visitors" %} 21 |

22 | 23 |

{% trans "Personal Information" %}

24 |

25 | {% trans "details on personal information policies" %} 26 |

27 | 28 |

{% trans "Other Services" %}

29 |

30 | {% trans "details on sharing data with third parties" %} 31 |

32 | 33 |

Cookies

34 |

35 | {% trans "cookie policy details" %} 36 |

37 |

{% trans "Policy Changes" %}

38 |

{% trans "how privacy policies can be changed" %} 39 |

40 |
41 | {% endblock %} 42 | 43 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/question_edit_tips.html: -------------------------------------------------------------------------------- 1 | 2 | {% load markup %} 3 | {% load i18n general_sidebar_tags %} 4 |
5 |

{% trans "Title Tips" %}

6 |
7 | {{ settings.QUESTION_TITLE_TIPS|markdown:"settingsparser" }} 8 | 11 |
12 |
13 | 14 | {% markdown_help %} 15 | 16 |
17 |

{% trans "What Are Tags" %}

18 |
19 | {{ settings.QUESTION_TAG_TIPS|markdown:"settingsparser" }} 20 |
21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/question_list/count.html: -------------------------------------------------------------------------------- 1 | {% spaceless %} 2 | {% load i18n humanize extra_tags %} 3 | {% declare %} 4 | answer_count = questions.children_count('answer') 5 | {% enddeclare %} 6 | 7 |
8 |
9 | {{ questions.paginator.count }}{{ list_description }} 10 |
11 | 12 | 13 | {% if answer_count %} 14 |
15 | {{ answer_count }}{% trans "answers" %} 16 |
17 | 18 | {% endif %} 19 | 20 |
21 |

22 | {{ questions.paginator.sort_description }} 23 |

24 |
25 |
26 | {% endspaceless %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/question_list/related_tags.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% load humanize %} 3 | 4 | {% if tags %} 5 |
6 |

{% trans "Related tags" %}

7 |
8 | {% for tag in tags %} 9 | 10 | × {{ tag.used_count|intcomma }} 11 |
12 | {% endfor %} 13 |
14 |
15 | {% endif %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/question_list/sort_tabs.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 9 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/question_list/subscription_item.html: -------------------------------------------------------------------------------- 1 | {% load i18n humanize extra_filters extra_tags user_tags %} 2 |
3 | 6 | 7 | 8 |
{% trans "Last checked" %} {% diff_date subscription.last_view %}
9 |
10 | 11 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/question_list/title.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |
4 | {% if searchtag %} 5 | {% trans "Found by tags" %} 6 | {% else %} 7 | {% if searchtitle %} 8 | {% if settings.USE_SPHINX_SEARCH %} 9 | {% trans "Search results" %} 10 | {% else %} 11 | {% trans "Found by title" %} 12 | {% endif %} 13 | {% else %} 14 | {% if is_unanswered %} 15 | {% trans "Unanswered questions" %} 16 | {% else %} 17 | {% if page_title %} 18 | {% trans page_title %} 19 | {% else %} 20 | {% trans "All Questions" %} 21 | {% endif %} 22 | {% endif %} 23 | {% endif %} 24 | {% endif %} 25 |
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/search.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block content %} 6 |
7 | {% blocktrans with settings.APP_SHORT_NAME as app_name %} 8 | Search in {{ app_name }} 9 | {% endblocktrans %} 10 |
11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 | 20 | 21 | 22 |
23 |
24 |
25 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/sidebar/markdown_help.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 |
3 |

{% trans "Markdown Basics" %}

4 |
    5 |
  • 6 | {% trans "*italic* or __italic__" %} 7 |
  • 8 |
  • 9 | {% trans "**bold** or __bold__" %} 10 |
  • 11 |
  • 12 | {% trans "link" %}:[{% trans "text" %}](http://url.com/ "{% trans "title" %}") 13 | 14 |
  • 15 | 16 |
  • 17 | {% trans "image" %}?![alt {% trans "text" %}](/path/img.jpg "{% trans "title" %}") 18 | 19 |
  • 20 |
  • 21 | {% trans "numbered list:" %} 22 | 1. Foo 23 | 2. Bar 24 |
  • 25 |
  • 26 | {% trans "to add a line break simply add two spaces to where you would like the new line to be." %} 27 |
  • 28 |
  • 29 | {% trans "basic HTML tags are also supported" %} 30 |
  • 31 |
32 | 35 |
36 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/sidebar/recent_awards.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |
4 |

{% trans "Recent awards" %}

5 |
6 | 15 | 16 |
17 |
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/sidebar/recent_tags.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |
4 |

{% trans "Recent tags" %}

5 |
6 |
7 | {% for tag in tags %} 8 | 9 | {% endfor %} 10 |
11 | 12 |
13 |
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/sidebar/user_blocks.html: -------------------------------------------------------------------------------- 1 | {% load markup %} 2 | 3 | {% if show %} 4 | {% if wrap %}
5 |
{% endif %} 6 | {{ content }} 7 | {% if wrap %}
8 |
{% endif %} 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/static.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | {% load i18n %} 3 | {% load markup %} 4 | {% block title %}{% spaceless %}{{ title }}{% endspaceless %}{% endblock %} 5 | 6 | {% block content %} 7 |
{{ title }}
8 |
9 | {{ content|markdown:"settingsparser" }} 10 |
11 | {% endblock %} 12 | 13 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/activity.html: -------------------------------------------------------------------------------- 1 | {% load extra_tags %} 2 | {% load humanize %} 3 | {% load extra_tags %} 4 | 5 |
6 |
7 | {{ describe }} 8 |
9 |
10 | {% diff_date action.action_date %} 11 |
12 |
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/karma_bonus.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
{% trans "Points" %}:
{% trans "Message" %}:
-------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/menu.html: -------------------------------------------------------------------------------- 1 | {% load i18n smart_if ui_registry %} 2 | 3 |
4 | {% trans "User tools" %} ▼ 5 |
    6 | {% loadregistry user_menu %}{% endloadregistry %} 7 |
8 |
9 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/preferences.html: -------------------------------------------------------------------------------- 1 | {% extends "user.html" %} 2 | {% load i18n %} 3 | {% load extra_tags %} 4 | 5 | {% block usercontent %} 6 |

{% trans "Preferences" %}

7 |
8 |
9 |

10 | {% trans "Here you can set some personal preferences." %} 11 |

12 | {{ form.errors }} 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 |
16 | {% trans "Navigation:" %} 17 |
{{ form.sticky_sorts }}{% trans "Allways remember the sort order I apply to the lists I view" %}
24 |
25 | 26 |
27 |
28 |
29 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/questions.html: -------------------------------------------------------------------------------- 1 | {% extends "user.html" %} 2 | 3 | {% load extra_tags %} 4 | {% load question_list_tags %} 5 | {% block usercontent %} 6 |
7 | {% for favorite in favorites %} 8 | {% question_list_item favorite.node favorite_count=yes signature_type=badges %} 9 | {% endfor %} 10 |
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/recent.html: -------------------------------------------------------------------------------- 1 | {% extends "user.html" %} 2 | 3 | {% load extra_tags %} 4 | {% load user_tags %} 5 | {% block usercontent %} 6 |
7 | {% for act in activities %} 8 | {% activity_item act request.user %} 9 | {% endfor %} 10 |
11 | {% endblock %} 12 | 13 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/subscriptions_management.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% load question_list_tags %} 3 | 4 |
5 |

6 | {% trans "Manage your current subscriptions" %} 7 | 8 | {% if auto %} 9 | {% trans "don't show auto-subscribe" %} 10 | {% else %} 11 | {% trans "show auto-subscribe" %} 12 | {% endif %} 13 | 14 |

15 | 16 | {% for subscription in subscriptions.paginator.page %} 17 | {% subscription_list_item subscription subscription.question %} 18 | {% endfor %} 19 | 20 |
{{ subscriptions.paginator.page_numbers }}
21 |
22 | 23 |
24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/tabs.html: -------------------------------------------------------------------------------- 1 | {% load extra_filters ui_registry i18n %} 2 | {% with view_user.username|slugify as user_slug %} 3 |
4 |
5 | {% loopregistry profile_tabs %}{% spaceless %} 6 | 7 | {{ tab_title }} 8 | 9 | {% endspaceless %}{% endloopregistry %} 10 |
11 |
12 | {% endwith %} 13 | -------------------------------------------------------------------------------- /qa-engine/forum/skins/default/templates/users/votes.html: -------------------------------------------------------------------------------- 1 | {% extends "user.html" %} 2 | 3 | {% load extra_tags %} 4 | {% load extra_filters %} 5 | {% load humanize %} 6 | {% load i18n %} 7 | 8 | {% block usercontent %} 9 |
10 | {% for vote in votes %} 11 |
12 |
{% diff_date vote.voted_at 3 %}
13 |
14 | {% ifequal vote.value 1 %} 15 | 16 | {% else %} 17 | 18 | {% endifequal %} 19 |
20 |
21 | {{ vote.node.headline }} 22 |
23 |
24 |
25 | {% endfor %} 26 |
27 | {% endblock %} 28 | 29 | -------------------------------------------------------------------------------- /qa-engine/forum/startup.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | sys.path.append(os.path.join(os.path.dirname(__file__),'markdownext')) 4 | 5 | from forum.modules import get_modules_script 6 | 7 | get_modules_script('settings') 8 | get_modules_script('startup') 9 | 10 | 11 | import forum.badges 12 | import forum.subscriptions 13 | import forum.registry 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /qa-engine/forum/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | splitter = re.compile(r'\s*=\s*') 4 | matcher = re.compile(r'^.+=.+$') 5 | 6 | def argument_parser(arguments): 7 | return dict(splitter.split(s) for s in arguments if matcher.match(s)) -------------------------------------------------------------------------------- /qa-engine/forum/templatetags/general_sidebar_tags.py: -------------------------------------------------------------------------------- 1 | from django import template 2 | from forum.models import Tag, Award 3 | from forum import settings 4 | 5 | from extra_filters import static_content 6 | 7 | register = template.Library() 8 | 9 | @register.inclusion_tag('sidebar/markdown_help.html') 10 | def markdown_help(): 11 | return {} 12 | 13 | @register.inclusion_tag('sidebar/recent_awards.html') 14 | def recent_awards(): 15 | return {'awards': Award.objects.order_by('-awarded_at')[:settings.RECENT_AWARD_SIZE]} 16 | 17 | @register.inclusion_tag('sidebar/user_blocks.html') 18 | def sidebar_upper(): 19 | return { 20 | 'show': settings.SIDEBAR_UPPER_SHOW, 21 | 'content': static_content(settings.SIDEBAR_UPPER_TEXT, settings.SIDEBAR_UPPER_RENDER_MODE), 22 | 'wrap': not settings.SIDEBAR_UPPER_DONT_WRAP, 23 | 'blockid': 'sidebar-upper' 24 | } 25 | 26 | @register.inclusion_tag('sidebar/user_blocks.html') 27 | def sidebar_lower(): 28 | return { 29 | 'show': settings.SIDEBAR_LOWER_SHOW, 30 | 'content': static_content(settings.SIDEBAR_LOWER_TEXT, settings.SIDEBAR_LOWER_RENDER_MODE), 31 | 'wrap': not settings.SIDEBAR_LOWER_DONT_WRAP, 32 | 'blockid': 'sidebar-lower' 33 | } 34 | 35 | @register.inclusion_tag('sidebar/recent_tags.html') 36 | def recent_tags(): 37 | return {'tags': Tag.active.order_by('-id')[:settings.RECENT_TAGS_SIZE]} 38 | 39 | -------------------------------------------------------------------------------- /qa-engine/forum/upfiles/README: -------------------------------------------------------------------------------- 1 | This directory is to contain uploaded images and other files 2 | must be writable by the webserver 3 | -------------------------------------------------------------------------------- /qa-engine/forum/upfiles/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/upfiles/logo.png -------------------------------------------------------------------------------- /qa-engine/forum/user_messages/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lightweight session-based messaging system. 3 | 4 | Time-stamp: <2009-03-10 19:22:29 carljm __init__.py> 5 | 6 | """ 7 | VERSION = (0, 1, 'pre') 8 | 9 | def create_message (request, message): 10 | """ 11 | Create a message in the current session. 12 | 13 | """ 14 | assert hasattr(request, 'session'), "django-session-messages requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'." 15 | 16 | try: 17 | request.session['messages'].append(message) 18 | except KeyError: 19 | request.session['messages'] = [message] 20 | 21 | def get_and_delete_messages (request, include_auth=False): 22 | """ 23 | Get and delete all messages for current session. 24 | 25 | Optionally also fetches user messages from django.contrib.auth. 26 | 27 | """ 28 | assert hasattr(request, 'session'), "django-session-messages requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'." 29 | 30 | messages = request.session.pop('messages', []) 31 | 32 | if include_auth and request.user.is_authenticated(): 33 | messages.extend(request.user.get_and_delete_messages()) 34 | 35 | return messages 36 | 37 | -------------------------------------------------------------------------------- /qa-engine/forum/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum/utils/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum/utils/decorators.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponse, HttpResponseForbidden, Http404 2 | from django.utils import simplejson 3 | 4 | def ajax_login_required(view_func): 5 | def wrap(request,*args,**kwargs): 6 | if request.user.is_authenticated(): 7 | return view_func(request,*args,**kwargs) 8 | else: 9 | json = simplejson.dumps({'login_required':True}) 10 | return HttpResponseForbidden(json,mimetype='application/json') 11 | return wrap 12 | 13 | def ajax_method(view_func): 14 | def wrap(request,*args,**kwargs): 15 | if not request.is_ajax(): 16 | raise Http404 17 | retval = view_func(request,*args,**kwargs) 18 | if isinstance(retval, HttpResponse): 19 | retval.mimetype = 'application/json' 20 | return retval 21 | else: 22 | json = simplejson.dumps(retval) 23 | return HttpResponse(json,mimetype='application/json') 24 | return wrap 25 | 26 | -------------------------------------------------------------------------------- /qa-engine/forum/utils/djangofix.py: -------------------------------------------------------------------------------- 1 | import re 2 | import urllib 3 | from forum.modules import decorate 4 | 5 | from django.template.defaultfilters import slugify 6 | from django.utils.safestring import mark_safe 7 | from django.utils.http import urlquote_plus 8 | 9 | slug_re = re.compile(r'\w+', re.UNICODE) 10 | 11 | @decorate(slugify) 12 | def imp_slugify(origin, value): 13 | if settings.ALLOW_UNICODE_IN_SLUGS: 14 | try: 15 | bits = slug_re.findall(value.lower()) 16 | return mark_safe("-".join(bits)) 17 | except: 18 | pass 19 | return origin(value) 20 | 21 | from forum import settings -------------------------------------------------------------------------------- /qa-engine/forum/utils/time.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | 3 | def one_day_from_now(): 4 | return datetime.datetime.now() + datetime.timedelta(days=1) 5 | -------------------------------------------------------------------------------- /qa-engine/forum/views/__init__.py: -------------------------------------------------------------------------------- 1 | import readers 2 | import writers 3 | import commands 4 | import users 5 | import meta 6 | import auth 7 | import admin 8 | 9 | #from forum.modules.decorators import decorate_all 10 | 11 | #decorate_all(readers) 12 | #decorate_all(writers) 13 | #decorate_all(commands) 14 | #decorate_all(users) 15 | #decorate_all(meta) 16 | #decorate_all(auth) 17 | #decorate_all(admin) 18 | -------------------------------------------------------------------------------- /qa-engine/forum/views/vars.py: -------------------------------------------------------------------------------- 1 | ON_SIGNIN_SESSION_ATTR = 'on_signin_url' 2 | PENDING_SUBMISSION_SESSION_ATTR = 'pending_submission_data' 3 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/akismet/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/akismet/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/akismet/lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/akismet/lib/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/akismet/settings.py: -------------------------------------------------------------------------------- 1 | from forum.settings.base import Setting 2 | from forum.settings.extkeys import EXT_KEYS_SET 3 | from forum.settings.minrep import MIN_REP_SET 4 | from django.utils.translation import ugettext_lazy as _ 5 | 6 | WORDPRESS_API_KEY = Setting('WORDPRESS_API_KEY', '', EXT_KEYS_SET, dict( 7 | label = _("WordPress API key"), 8 | help_text = _("Your WordPress API key. You can get one at http://wordpress.com/"), 9 | required=False)) 10 | 11 | REP_FOR_NO_SPAM_CHECK = Setting('REP_FOR_NO_SPAM_CHECK', 750, MIN_REP_SET, dict( 12 | label = _("Minimum reputation to not have your posts checked"), 13 | help_text = _("The minimum reputation a user must have so that when they post a question, answer or comment it is not checked for spam."))) 14 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/akismet/templates/foundspam.html: -------------------------------------------------------------------------------- 1 | {% extends "base_content.html" %} 2 | {% load i18n %} 3 | {% block title %}{% trans "Akismet message" %}{% endblock %} 4 | 5 | {% block content %} 6 |
7 | {% blocktrans %}Akismet believes your {{ action_name }} is spam.{% endblocktrans %} 8 |
9 |
10 | {% blocktrans %} 11 | We're sorry, but Akismet believes your {{ action_name }} is spam.
12 | If you believe this is an error, please contact the forum administrator. 13 | {% endblocktrans %} 14 | 15 | {% if captcha_form.recaptcha %} 16 |
17 | 18 | 19 | 27 | 28 | 29 | 30 | 31 |
20 | {% for post_item in post_data.items %} 21 | 22 | {% endfor %} 23 | 24 | {{ captcha_form.recaptcha }} 25 | 26 |
32 |
33 | {% endif %} 34 | 35 |
36 | {% endblock %} 37 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/default_badges/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/default_badges/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/exporter/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/backups/README: -------------------------------------------------------------------------------- 1 | you can change the location of this folder using the admin panel -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.utils.translation import ugettext as _ 3 | 4 | FORMAT_CHOICES = ( 5 | ('tgz', _('tar.gz')), 6 | ('zip', _('zip')) 7 | ) 8 | 9 | class ExporterForm(forms.Form): 10 | file_format = forms.ChoiceField(widget=forms.Select, choices=FORMAT_CHOICES, initial='zip', 11 | label=_('File format'), help_text=_("File format of the compressed backup"), required=True) 12 | anon_data = forms.BooleanField(label=_('Anonymized data'), help_text=_('Don\'t export user data and make all content anonymous'), required=False) 13 | uplodaded_files = forms.BooleanField(label=_('Uploaded files'), help_text=_('Include uploaded files in the backup'), required=False, initial=True) 14 | import_skins_folder = forms.BooleanField(label=_('Skins folder'), help_text=_('Include skins folder in the backup'), required=False, initial=False) 15 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/mappings.py: -------------------------------------------------------------------------------- 1 | from django.http import HttpResponseRedirect, HttpResponse, Http404, HttpResponsePermanentRedirect 2 | from django.template.defaultfilters import slugify 3 | 4 | from forum.views import readers 5 | from forum.modules import decorate 6 | from forum.models import Question 7 | 8 | import settings, logging 9 | 10 | @decorate(readers.question, needs_origin=True) 11 | def match_question_slug(origin, request, id, slug='', answer=None): 12 | try: 13 | id = int(id) 14 | except: 15 | raise Http404() 16 | 17 | if settings.MERGE_MAPPINGS and (int(id) in settings.MERGE_MAPPINGS.get('merged_nodes', {})): 18 | try: 19 | question = Question.objects.get(id=id) 20 | 21 | if slug != slugify(question.title): 22 | return origin(request, settings.MERGE_MAPPINGS['merged_nodes'][int(id)], slug, answer) 23 | 24 | except: 25 | pass 26 | 27 | return origin(request, id, slug, answer) -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/settings.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from django.conf import settings as djsettings 4 | from forum.settings.base import Setting, SettingSet 5 | from django.utils.translation import ugettext_lazy as _ 6 | 7 | EXPORTER_SET = SettingSet('exporter', _('Exporter settings'), _("Data export settings"), 800) 8 | 9 | EXPORTER_BACKUP_STORAGE = Setting('EXPORTER_BACKUP_STORAGE', os.path.join(os.path.dirname(__file__), 'backups'), EXPORTER_SET, dict( 10 | label = _("Backups storage"), 11 | help_text = _("A folder to keep your backups organized."))) 12 | 13 | MERGE_MAPPINGS = Setting('MERGE_MAPPINGS', {}) -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/startup.py: -------------------------------------------------------------------------------- 1 | import views 2 | import mappings -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/templates/exporter.html: -------------------------------------------------------------------------------- 1 | {% extends basetemplate %} 2 | 3 | {% load i18n %} 4 | 5 | {% block subtitle %} 6 | {% trans "XML data exporter" %} 7 | {% endblock %} 8 | {% block description %} 9 | {% trans "Export database to XML format" %} 10 | {% endblock %} 11 | 12 | {% block admincontent %} 13 |

14 | {% trans "Available backups" %} 15 |

16 |
    17 | {% for b in available %} 18 |
  • 19 | {{ b.date }} by {{ b.author }} 20 |
  • 21 | {% endfor %} 22 |
23 | 24 |

25 | {% trans "Start new backup" %} 26 |

27 |
28 | 29 | {{ form.as_table }} 30 |
31 | 32 |
33 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/templates/importer.html: -------------------------------------------------------------------------------- 1 | {% extends basetemplate %} 2 | 3 | {% load i18n %} 4 | 5 | {% block subtitle %} 6 | {% trans "XML data importer" %} 7 | {% endblock %} 8 | {% block description %} 9 | {% trans "Import data from dump file" %} 10 | {% endblock %} 11 | 12 | {% block admincontent %} 13 | 14 | {% endblock %} -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/tmp/README: -------------------------------------------------------------------------------- 1 | keep this folder writable -------------------------------------------------------------------------------- /qa-engine/forum_modules/exporter/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import * 2 | from django.views.generic.simple import direct_to_template 3 | from django.utils.translation import ugettext as _ 4 | 5 | from views import state, running, download 6 | 7 | urlpatterns = patterns('', 8 | url(r'^%s%s%s$' % (_('admin/'), _('exporter/'), _('state/')), state, name='exporter_state'), 9 | url(r'^%s(?P\w+)/%s$' % (_('admin/'), _('running/')), running, name='exporter_running'), 10 | url(r'^%s%s%s$' % (_('admin/'), _('exporter/'), _('download/')), download, name='exporter_download'), 11 | ) 12 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/facebookauth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/facebookauth/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/facebookauth/settings.py: -------------------------------------------------------------------------------- 1 | from forum.settings import EXT_KEYS_SET 2 | from forum.settings.base import Setting 3 | 4 | FB_API_KEY = Setting('FB_API_KEY', '', EXT_KEYS_SET, dict( 5 | label = "Facebook API key", 6 | help_text = """ 7 | Get this key at the Facebook developers network to enable 8 | authentication in your site through facebook. 9 | """, 10 | required=False)) 11 | 12 | FB_APP_SECRET = Setting('FB_APP_SECRET', '', EXT_KEYS_SET, dict( 13 | label = "Facebook APP secret", 14 | help_text = """ 15 | This your facebook app secret that you'll get in the same place as the API key. 16 | """, 17 | required=False)) 18 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/facebookauth/templates/xd_receiver.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/facebookauth/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import * 2 | from django.views.generic.simple import direct_to_template 3 | 4 | from views import user_is_registered 5 | 6 | urlpatterns = patterns('', 7 | url(r'^xd_receiver.htm$', direct_to_template, {'template': 'modules/facebookauth/xd_receiver.html'}, name='xd_receiver'), 8 | url(r'^facebook/user_is_registered/', user_is_registered, name="facebook_user_is_registered"), 9 | ) -------------------------------------------------------------------------------- /qa-engine/forum_modules/facebookauth/views.py: -------------------------------------------------------------------------------- 1 | from forum.models import AuthKeyUserAssociation 2 | from django.http import HttpResponse 3 | 4 | def user_is_registered(request): 5 | try: 6 | fb_uid = request.POST['fb_uid'] 7 | #print fb_uid 8 | AuthKeyUserAssociation.objects.get(key=fb_uid) 9 | return HttpResponse('yes') 10 | except: 11 | return HttpResponse('no') -------------------------------------------------------------------------------- /qa-engine/forum_modules/localauth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/localauth/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/localauth/authentication.py: -------------------------------------------------------------------------------- 1 | from forum.authentication.base import AuthenticationConsumer, ConsumerTemplateContext, InvalidAuthentication 2 | from forms import ClassicLoginForm 3 | 4 | class LocalAuthConsumer(AuthenticationConsumer): 5 | def process_authentication_request(self, request): 6 | form_auth = ClassicLoginForm(request.POST) 7 | 8 | if form_auth.is_valid(): 9 | return form_auth.get_user() 10 | else: 11 | raise InvalidAuthentication(" ".join(form_auth.errors.values()[0])) 12 | 13 | class LocalAuthContext(ConsumerTemplateContext): 14 | mode = 'STACK_ITEM' 15 | weight = 1000 16 | human_name = 'Local authentication' 17 | stack_item_template = 'modules/localauth/loginform.html' 18 | show_to_logged_in_user = False 19 | 20 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/localauth/templates/loginform.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 |
4 |

{% trans 'Enter your local user name and password' %}
({% trans 'or select your external provider above' %})

5 | 6 | 7 | 10 | 13 | 14 | 15 | 18 | 21 | 22 | 23 | 26 | 29 | 30 |
8 | 9 | 11 | 12 |
16 | 17 | 19 | 20 |
24 | 25 | 27 | {% trans 'Create account' %} | {% trans 'Forgot your password?' %} 28 |
31 |
32 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/localauth/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import * 2 | from django.views.generic.simple import direct_to_template 3 | from django.utils.translation import ugettext as _ 4 | import views as app 5 | 6 | urlpatterns = patterns('', 7 | url(r'^%s%s%s$' % (_('account/'), _('local/'), _('register/')), app.register, name='auth_local_register'), 8 | ) -------------------------------------------------------------------------------- /qa-engine/forum_modules/localauth/views.py: -------------------------------------------------------------------------------- 1 | from forum.models import User 2 | from django.shortcuts import render_to_response 3 | from django.template import RequestContext 4 | from django.utils.translation import ugettext as _ 5 | 6 | from forms import ClassicRegisterForm 7 | from forum.views.auth import login_and_forward 8 | from forum.actions import UserJoinsAction 9 | 10 | def register(request): 11 | if request.method == 'POST': 12 | form = ClassicRegisterForm(request.POST) 13 | 14 | if form.is_valid(): 15 | username = form.cleaned_data['username'] 16 | password = form.cleaned_data['password1'] 17 | email = form.cleaned_data['email'] 18 | 19 | user_ = User(username=username, email=email) 20 | user_.set_password(password) 21 | 22 | if User.objects.all().count() == 0: 23 | user_.is_superuser = True 24 | user_.is_staff = True 25 | 26 | user_.save() 27 | UserJoinsAction(user=user_, ip=request.META['REMOTE_ADDR']).save() 28 | 29 | return login_and_forward(request, user_, None, _("A welcome email has been sent to your email address. ")) 30 | else: 31 | form = ClassicRegisterForm(initial={'next':'/'}) 32 | 33 | return render_to_response('auth/complete.html', { 34 | 'form1': form 35 | }, context_instance=RequestContext(request)) 36 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/oauthauth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/oauthauth/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/oauthauth/authentication.py: -------------------------------------------------------------------------------- 1 | from consumer import OAuthAbstractAuthConsumer 2 | from forum.authentication.base import ConsumerTemplateContext 3 | 4 | try: 5 | import json as simplejson 6 | except ImportError: 7 | from django.utils import simplejson 8 | 9 | from lib import oauth 10 | import settings 11 | 12 | class TwitterAuthConsumer(OAuthAbstractAuthConsumer): 13 | def __init__(self): 14 | OAuthAbstractAuthConsumer.__init__(self, 15 | str(settings.TWITTER_CONSUMER_KEY), 16 | str(settings.TWITTER_CONSUMER_SECRET), 17 | "twitter.com", 18 | "https://twitter.com/oauth/request_token", 19 | "https://twitter.com/oauth/access_token", 20 | "https://twitter.com/oauth/authorize", 21 | ) 22 | 23 | def get_user_data(self, key): 24 | json = self.fetch_data(key, "https://twitter.com/account/verify_credentials.json") 25 | 26 | if 'screen_name' in json: 27 | creds = simplejson.loads(json) 28 | 29 | return { 30 | 'username': creds['screen_name'] 31 | } 32 | 33 | 34 | return {} 35 | 36 | class TwitterAuthContext(ConsumerTemplateContext): 37 | mode = 'BIGICON' 38 | type = 'DIRECT' 39 | weight = 150 40 | human_name = 'Twitter' 41 | icon = '/media/images/openid/twitter.png' -------------------------------------------------------------------------------- /qa-engine/forum_modules/oauthauth/lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/oauthauth/lib/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/oauthauth/settings.py: -------------------------------------------------------------------------------- 1 | from forum.settings import EXT_KEYS_SET 2 | from forum.settings.base import Setting 3 | 4 | TWITTER_CONSUMER_KEY = Setting('TWITTER_CONSUMER_KEY', '', EXT_KEYS_SET, dict( 5 | label = "Twitter consumer key", 6 | help_text = """ 7 | Get this key at the Twitter apps to enable 8 | authentication in your site through Twitter. 9 | """, 10 | required=False)) 11 | 12 | TWITTER_CONSUMER_SECRET = Setting('TWITTER_CONSUMER_SECRET', '', EXT_KEYS_SET, dict( 13 | label = "Twitter consumer secret", 14 | help_text = """ 15 | This your Twitter consumer secret that you'll get in the same place as the consumer key. 16 | """, 17 | required=False)) 18 | 19 | 20 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/openidauth/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import openid 3 | CAN_USE = True 4 | except: 5 | CAN_USE = False -------------------------------------------------------------------------------- /qa-engine/forum_modules/openidauth/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class OpenIdNonce(models.Model): 4 | server_url = models.URLField() 5 | timestamp = models.IntegerField() 6 | salt = models.CharField( max_length=50 ) 7 | 8 | def __unicode__(self): 9 | return "Nonce: %s" % self.nonce 10 | 11 | class Meta: 12 | app_label = 'forum' 13 | 14 | class OpenIdAssociation(models.Model): 15 | server_url = models.TextField(max_length=2047) 16 | handle = models.CharField(max_length=255) 17 | secret = models.TextField(max_length=255) # Stored base64 encoded 18 | issued = models.IntegerField() 19 | lifetime = models.IntegerField() 20 | assoc_type = models.TextField(max_length=64) 21 | 22 | def __unicode__(self): 23 | return "Association: %s, %s" % (self.server_url, self.handle) 24 | 25 | class Meta: 26 | app_label = 'forum' 27 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/openidauth/settings.py: -------------------------------------------------------------------------------- 1 | OPENID_SREG = { 2 | "required": "nickname, email", 3 | "optional": "postcode, country", 4 | "policy_url": "" 5 | } 6 | OPENID_AX = [ 7 | {"type_uri": "http://axschema.org/contact/email", "count": 1, "required": True, "alias": "email"}, 8 | {"type_uri": "fullname", "count":1 , "required": False, "alias": "fullname"} 9 | ] -------------------------------------------------------------------------------- /qa-engine/forum_modules/openidauth/templates/openidurl.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% load extra_tags %} 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 14 | 17 | 18 |

{% trans 'Enter your OpenId Url' %}

11 | 13 | 15 | 16 |
19 |
20 | 21 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/pgfulltext/__init__.py: -------------------------------------------------------------------------------- 1 | NAME = 'Postgresql Full Text Search' 2 | DESCRIPTION = "Enables PostgreSql full text search functionality." 3 | 4 | try: 5 | import psycopg2 6 | from django.conf import settings 7 | CAN_USE = settings.DATABASE_ENGINE in ('postgresql_psycopg2', 'postgresql', ) 8 | except: 9 | CAN_USE = False 10 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/pgfulltext/settings.py: -------------------------------------------------------------------------------- 1 | from forum.settings.base import Setting 2 | 3 | PG_FTSTRIGGERS_VERSION = Setting('PG_FTSTRIGGERS_VERSION', 0) -------------------------------------------------------------------------------- /qa-engine/forum_modules/pgfulltext/startup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from forum.models import KeyValue 3 | from django.db import connection, transaction 4 | import settings 5 | 6 | VERSION = 11 7 | 8 | if int(settings.PG_FTSTRIGGERS_VERSION) < VERSION: 9 | f = open(os.path.join(os.path.dirname(__file__), 'pg_fts_install.sql'), 'r') 10 | 11 | try: 12 | cursor = connection.cursor() 13 | cursor.execute(f.read()) 14 | transaction.commit_unless_managed() 15 | 16 | settings.PG_FTSTRIGGERS_VERSION.set_value(VERSION) 17 | 18 | except Exception, e: 19 | #import sys, traceback 20 | #traceback.print_exc(file=sys.stdout) 21 | pass 22 | finally: 23 | cursor.close() 24 | 25 | f.close() 26 | 27 | import handlers 28 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/project_badges/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/project_badges/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/project_badges/badges.py: -------------------------------------------------------------------------------- 1 | from django.utils.translation import ugettext as _ 2 | from forum.badges.base import AbstractBadge 3 | from forum.models import Badge, Tag 4 | from forum.actions import VoteUpAction 5 | import settings 6 | 7 | class BugBuster(AbstractBadge): 8 | type = Badge.SILVER 9 | name = _("Bug Buster") 10 | description = _('Got %s upvotes in a question tagged with "bug"') % settings.BUG_BUSTER_VOTES_UP 11 | listen_to = (VoteUpAction, ) 12 | 13 | def award_to(self, action): 14 | if action.node.node_type == "question" and action.node.score == settings.BUG_BUSTER_VOTES_UP: 15 | try: 16 | bug = Tag.objects.get(name="bug") 17 | if bug in action.node.tags.all(): 18 | return action.node.author 19 | except: 20 | pass 21 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/project_badges/settings.py: -------------------------------------------------------------------------------- 1 | from forum.settings import BADGES_SET 2 | from forum.settings.base import Setting 3 | 4 | BUG_BUSTER_VOTES_UP = Setting('BUG_BUSTER_VOTES_UP', 3, BADGES_SET, dict( 5 | label = "Bug Buster Votes Up", 6 | help_text = """ 7 | Number of votes up required for the author of a question tagged as bug to be awarded the Bug Buster badge. 8 | """)) -------------------------------------------------------------------------------- /qa-engine/forum_modules/recaptcha/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/recaptcha/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/recaptcha/formfield.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from lib import captcha 3 | from django.utils.safestring import mark_safe 4 | from django.utils.encoding import force_unicode, smart_unicode 5 | from django.utils.translation import ugettext_lazy as _ 6 | import settings 7 | 8 | class ReCaptchaField(forms.Field): 9 | def __init__(self, *args, **kwargs): 10 | super(ReCaptchaField, self).__init__(widget=ReCaptchaWidget) 11 | 12 | def clean(self, values): 13 | super(ReCaptchaField, self).clean(values[1]) 14 | recaptcha_challenge_value = smart_unicode(values[0]) 15 | recaptcha_response_value = smart_unicode(values[1]) 16 | check_captcha = captcha.submit(recaptcha_challenge_value, 17 | recaptcha_response_value, settings.RECAPTCHA_PRIV_KEY, {}) 18 | 19 | if not check_captcha.is_valid: 20 | raise forms.util.ValidationError(_('Invalid captcha')) 21 | 22 | return values[0] 23 | 24 | 25 | class ReCaptchaWidget(forms.Widget): 26 | def render(self, name, value, attrs=None): 27 | return mark_safe(force_unicode(captcha.displayhtml(settings.RECAPTCHA_PUB_KEY))) 28 | 29 | def value_from_datadict(self, data, files, name): 30 | return (data.get('recaptcha_challenge_field', None), data.get('recaptcha_response_field', None)) 31 | 32 | 33 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/recaptcha/handlers.py: -------------------------------------------------------------------------------- 1 | from formfield import ReCaptchaField 2 | 3 | def create_anti_spam_field(): 4 | return ('recaptcha', ReCaptchaField()) -------------------------------------------------------------------------------- /qa-engine/forum_modules/recaptcha/lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/recaptcha/lib/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/recaptcha/settings.py: -------------------------------------------------------------------------------- 1 | from forum.settings import EXT_KEYS_SET 2 | from forum.settings.base import Setting 3 | 4 | RECAPTCHA_PUB_KEY = Setting('RECAPTCHA_PUB_KEY', '', EXT_KEYS_SET, dict( 5 | label = "Recaptch public key", 6 | help_text = """ 7 | Get this key at reCaptcha to enable 8 | recaptcha anti spam through. 9 | """, 10 | required=False)) 11 | 12 | RECAPTCHA_PRIV_KEY = Setting('RECAPTCHA_PRIV_KEY', '', EXT_KEYS_SET, dict( 13 | label = "Recaptch private key", 14 | help_text = """ 15 | This is the private key you'll get in the same place as the recaptcha public key. 16 | """, 17 | required=False)) 18 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/robotstxt/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/robotstxt/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/robotstxt/settings.py: -------------------------------------------------------------------------------- 1 | from forum.settings.base import Setting, SettingSet 2 | from django.forms.widgets import Textarea 3 | from django.core.urlresolvers import reverse 4 | from forum.settings import APP_URL 5 | 6 | ROBOTS_SET = SettingSet('robots', 'Robots txt', "Set up the robots.txt file.", 3000) 7 | 8 | ROBOTS_FILE = Setting('ROBOTS_FILE', 9 | """Sitemap: %s/sitemap.xml 10 | 11 | User-Agent: * 12 | Disallow: /accounts/ 13 | Disallow: /users/ 14 | Disallow: /revisions/ 15 | Disallow: /search 16 | Disallow: /matching_tags 17 | Disallow: /*sort= 18 | """ % APP_URL, ROBOTS_SET, dict( 19 | label = "Robots.txt file", 20 | help_text = """ 21 | The robots.txt file search engine spiders will see. 22 | """, 23 | widget=Textarea(attrs={'rows': '20'}))) -------------------------------------------------------------------------------- /qa-engine/forum_modules/robotstxt/templates/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: /accounts/ 3 | Disallow: /users/ 4 | Disallow: /revisions/ 5 | Disallow: /search 6 | Disallow: /matching_tags 7 | Disallow: /*sort= -------------------------------------------------------------------------------- /qa-engine/forum_modules/robotstxt/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import * 2 | from django.http import HttpResponse 3 | import settings 4 | 5 | urlpatterns = patterns('', 6 | (r'^robots.txt$', lambda r: HttpResponse(settings.ROBOTS_FILE.value)), 7 | ) 8 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/sphinxfulltext/README.txt: -------------------------------------------------------------------------------- 1 | Full text search (using sphinx search) 2 | 3 | Currently full text search works only with sphinx search engine 4 | And builtin PostgreSQL (postgres only >= 8.3???) 5 | 6 | 5.1 Instructions for Sphinx search setup 7 | Sphinx at this time supports only MySQL and PostgreSQL databases 8 | to enable this, install sphinx search engine and djangosphinx 9 | 10 | configure sphinx, sample configuration can be found in 11 | sphinx/sphinx.conf file usually goes somewhere in /etc tree 12 | 13 | build osqa index first time manually 14 | 15 | % indexer --config /path/to/sphinx.conf --index osqa 16 | 17 | setup cron job to rebuild index periodically with command 18 | your crontab entry may be something like 19 | 20 | 0 9,15,21 * * * /usr/local/bin/indexer --config /etc/sphinx/sphinx.conf --all --rotate >/dev/null 2>&1 21 | adjust it as necessary this one will reindex three times a day at 9am 3pm and 9pm 22 | 23 | if your forum grows very big ( good luck with that :) you'll 24 | need to two search indices one diff index and one main 25 | please refer to online sphinx search documentation for the information 26 | on the subject http://sphinxsearch.com/docs/ 27 | 28 | in settings.py look for INSTALLED_APPS 29 | and uncomment #'djangosphinx', -------------------------------------------------------------------------------- /qa-engine/forum_modules/sphinxfulltext/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import djangosphinx 3 | CAN_USE = True 4 | except: 5 | CAN_USE = False -------------------------------------------------------------------------------- /qa-engine/forum_modules/sphinxfulltext/dependencies.py: -------------------------------------------------------------------------------- 1 | DJANGO_APPS = ('djangosphinx', ) 2 | 3 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/sphinxfulltext/handlers.py: -------------------------------------------------------------------------------- 1 | from forum.models import Question 2 | 3 | def question_search(keywords): 4 | return Question.search.query(keywords) -------------------------------------------------------------------------------- /qa-engine/forum_modules/sphinxfulltext/models.py: -------------------------------------------------------------------------------- 1 | from forum.models import Question 2 | from django.conf import settings 3 | from djangosphinx.manager import SphinxSearch 4 | 5 | from djangosphinx.models import SphinxSearch 6 | 7 | Question.add_to_class('search', SphinxSearch( 8 | index=' '.join(settings.SPHINX_SEARCH_INDICES), 9 | mode='SPH_MATCH_ALL', 10 | ) 11 | ) 12 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/sphinxfulltext/settings.py: -------------------------------------------------------------------------------- 1 | SPHINX_API_VERSION = 0x113 #refer to djangosphinx documentation 2 | SPHINX_SEARCH_INDICES=('osqa',) #a tuple of index names remember about a comma after the 3 | #last item, especially if you have just one :) 4 | SPHINX_SERVER='localhost' 5 | SPHINX_PORT=3312 6 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/sximporter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/forum_modules/sximporter/__init__.py -------------------------------------------------------------------------------- /qa-engine/forum_modules/sximporter/templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "osqaadmin/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load user_tags %} 5 | 6 | {% block subtitle %} 7 | {% trans "SX Importer" %} 8 | {% endblock %} 9 | {% block description %} 10 | {% trans "Welcome to Stack Exchange dump importer." %} 11 | {% endblock %} 12 | 13 | {% block admincontent %} 14 | Zip-file containing "users.xml", "posts.xml", "comments.xml", "votes.xml" and "badges.xml" 15 |
16 |
17 | {% trans "Your user id in stack exchange" %} 18 |
19 | 20 | 21 | {% trans "Merge users with same user name and email" %}
22 | 23 | 24 |
25 | 26 | {% if imported %} 27 |

Imported:

28 |
    29 | {% for item in imported %} 30 |
  • {{ item }}
  • 31 | {% endfor %} 32 |
33 | {% endif %} 34 | {% endblock %} 35 | -------------------------------------------------------------------------------- /qa-engine/forum_modules/sximporter/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import * 2 | from django.views.generic.simple import direct_to_template 3 | from django.utils.translation import ugettext as _ 4 | 5 | from views import sximporter 6 | 7 | urlpatterns = patterns('', 8 | url(r'^%s%s$' % (_('admin/'), _('sximporter/')), sximporter, name='sximporter'), 9 | ) -------------------------------------------------------------------------------- /qa-engine/locale/bg/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/locale/bg/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /qa-engine/locale/de/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/locale/de/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /qa-engine/locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /qa-engine/locale/es/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/locale/es/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /qa-engine/locale/fr/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/locale/fr/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /qa-engine/locale/l/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/locale/l/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /qa-engine/locale/phrases.py: -------------------------------------------------------------------------------- 1 | _("Test Phrase 1") 2 | _("Test Phrase 2") 3 | _("Test Phrase 3") 4 | _("Test Phrase n") -------------------------------------------------------------------------------- /qa-engine/locale/pt/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/locale/pt/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /qa-engine/locale/zh_CN/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CLLKazan/iCQA/6136509080addb3783f5c8269e488fdb328ca2f2/qa-engine/locale/zh_CN/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /qa-engine/log/README.TXT: -------------------------------------------------------------------------------- 1 | this file is just a placeholder so the empty directory is not ignored by version control -------------------------------------------------------------------------------- /qa-engine/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from django.core.management import execute_manager 3 | try: 4 | import settings # Assumed to be in the same directory. 5 | except ImportError, e: 6 | import traceback 7 | traceback.print_exc() 8 | import sys 9 | sys.stderr.write("Error: Can't find the file 'forms.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file forms.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) 10 | sys.exit(1) 11 | 12 | if __name__ == "__main__": 13 | execute_manager(settings) 14 | -------------------------------------------------------------------------------- /qa-engine/osqa.wsgi.dist: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | sys.path.append('/path/to_dir_above') 4 | sys.path.append('/path/to_dir_above/osqa') 5 | # The first part of this module name should be identical to the directory name 6 | # of the OSQA source. For instance, if the full path to OSQA is 7 | # /home/osqa/osqa-server, then the DJANGO_SETTINGS_MODULE should have a value 8 | # of 'osqa-server.settings'. 9 | os.environ['DJANGO_SETTINGS_MODULE'] = 'osqa.settings' 10 | import django.core.handlers.wsgi 11 | application = django.core.handlers.wsgi.WSGIHandler() 12 | -------------------------------------------------------------------------------- /qa-engine/rmpyc: -------------------------------------------------------------------------------- 1 | rm `find . -name '*.pyc'` 2 | -------------------------------------------------------------------------------- /qa-engine/tmp/README: -------------------------------------------------------------------------------- 1 | Just an empty placeholder. -------------------------------------------------------------------------------- /qa-engine/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import * 2 | from django.utils.translation import ugettext as _ 3 | from django.conf import settings 4 | 5 | urlpatterns = patterns('', 6 | (r'', include('forum.urls')), 7 | ) 8 | 9 | if 'rosetta' in settings.INSTALLED_APPS: 10 | urlpatterns += patterns('', 11 | url(r'^rosetta/', include('rosetta.urls')), 12 | ) 13 | 14 | handler404 = 'forum.views.meta.page' 15 | handler500 = 'forum.views.meta.error_handler' 16 | 17 | 18 | --------------------------------------------------------------------------------