From 49815250471af4f86d0b46f321909fd2387bca02 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 14 Jan 2014 12:48:57 -0500 Subject: [PATCH] REFACTOR: Fixes poor class hierarchy for listing topics - Upgrades Ember to latest - Fixes a bunch of bugs with page titles and missing "active" states --- .../admin/templates/commits.js.handlebars | 4 +- .../admin/templates/customize.js.handlebars | 14 +- .../admin/templates/dashboard.js.handlebars | 12 +- .../admin/templates/email.js.handlebars | 2 +- .../admin/templates/email_index.js.handlebars | 2 +- .../admin/templates/flags.js.handlebars | 2 +- .../admin/templates/groups.js.handlebars | 6 +- .../admin/templates/logs.js.handlebars | 2 +- ...customization_change_details.js.handlebars | 2 +- .../logs/details_modal.js.handlebars | 2 +- .../logs/screened_emails.js.handlebars | 2 +- .../screened_emails_list_item.js.handlebars | 4 +- .../logs/screened_ip_addresses.js.handlebars | 2 +- ...eened_ip_addresses_list_item.js.handlebars | 8 +- .../logs/screened_urls.js.handlebars | 2 +- .../screened_urls_list_item.js.handlebars | 4 +- ...e_customization_change_modal.js.handlebars | 10 +- .../logs/staff_action_logs.js.handlebars | 4 +- .../staff_action_logs_list_item.js.handlebars | 2 +- .../admin/templates/reports.js.handlebars | 6 +- .../per_day_counts_report.js.handlebars | 4 +- .../summed_counts_report.js.handlebars | 12 +- .../reports/trust_levels_report.js.handlebars | 2 +- .../templates/site_content_edit.js.handlebars | 2 +- .../site_contents_empty.js.handlebars | 2 +- .../templates/site_settings.js.handlebars | 2 +- .../site_settings_category.js.handlebars | 2 +- .../admin/templates/user.js.handlebars | 6 +- .../admin/templates/users_list.js.handlebars | 4 +- .../components/bread_crumbs_component.js | 6 +- .../components/categorydrop_component.js | 6 + .../keyboard_shortcuts_component.js | 2 +- .../navigation_item_component.js} | 19 +- .../components/toggle_summary_component.js | 8 +- .../components/topic_map_component.js | 5 +- .../controllers/composer_controller.js | 2 +- ....js => discovery_categories_controller.js} | 6 +- ...troller.js => discovery_top_controller.js} | 10 +- ...ller.js => discovery_topics_controller.js} | 78 +- .../controllers/edit_category_controller.js | 2 +- .../controllers/invite_controller.js | 2 +- .../controllers/invite_private_controller.js | 2 +- .../controllers/list_controller.js.erb | 138 - .../navigation_default_controller.js | 40 + .../discourse/helpers/application_helpers.js | 4 +- .../initializers/1_init_message_bus.js | 4 + app/assets/javascripts/discourse/lib/url.js | 4 +- .../javascripts/discourse/lib/utilities.js | 1 + .../models/{nav_item.js.erb => nav_item.js} | 41 +- .../discourse/models/post_stream.js | 2 +- .../models/{top_list.js.erb => top_list.js} | 4 +- .../discourse/models/topic_list.js | 17 +- .../discourse/models/topic_tracking_state.js | 2 +- .../discourse/routes/application_routes.js | 16 +- .../routes/discovery_categories_route.js | 45 + .../discourse/routes/discovery_route.js | 25 + .../routes/discovery_route_builders.js | 119 + .../discourse/routes/discovery_top_route.js | 40 + .../discourse/routes/filtered_list_route.js | 62 - .../discourse/routes/list_categories_route.js | 50 - .../discourse/routes/list_category_route.js | 74 - .../discourse/routes/list_top_route.js | 42 - .../components/basic-topic-list.js.handlebars | 4 +- .../components/bread-crumbs.js.handlebars | 2 +- .../components/category-drop.js.handlebars | 15 +- .../screened-ip-address-form.handlebars | 2 +- .../components/sortable-heading.js.handlebars | 2 +- .../topic-list-loading.js.handlebars | 3 - .../components/topic-map.js.handlebars | 10 +- .../topic-participant.js.handlebars | 4 +- .../templates/composer.js.handlebars | 4 +- .../composer/education.js.handlebars | 2 +- .../templates/discovery.js.handlebars | 22 + .../categories.js.handlebars | 8 +- .../templates/discovery/top.js.handlebars | 48 + .../templates/discovery/topics.js.handlebars | 70 + .../templates/embedded_post.js.handlebars | 2 +- .../templates/featured_topics.js.handlebars | 2 +- .../discourse/templates/header.js.handlebars | 4 +- .../discourse/templates/list.js.handlebars | 38 - .../templates/list/top.js.handlebars | 50 - .../list/topic_list_item.js.handlebars | 17 +- .../templates/list/topics.js.handlebars | 85 - .../components/basic-topic-list.js.handlebars | 4 +- .../mobile/list/categories.js.handlebars | 2 +- .../mobile/list/topic_list_item.js.handlebars | 13 +- .../mobile/list/topics.js.handlebars | 9 +- .../mobile/modal/login.js.handlebars | 4 +- .../modal/archetype_options.js.handlebars | 2 +- .../templates/modal/auto_close.js.handlebars | 2 +- .../modal/avatar_selector.js.handlebars | 4 +- .../modal/create_account.js.handlebars | 4 +- .../modal/edit_category.js.handlebars | 24 +- .../templates/modal/flag.js.handlebars | 8 +- .../modal/forgot_password.js.handlebars | 2 +- .../templates/modal/history.js.handlebars | 14 +- .../templates/modal/invite.js.handlebars | 4 +- .../modal/invite_private.js.handlebars | 2 +- .../templates/modal/login.js.handlebars | 4 +- .../templates/modal/merge_topic.js.handlebars | 4 +- .../modal/not_activated.js.handlebars | 2 +- .../templates/modal/split_topic.js.handlebars | 4 +- .../modal/upload_selector.js.handlebars | 2 +- .../navigation/categories.js.handlebars | 12 + .../navigation/category.js.handlebars | 15 + .../navigation/default.js.handlebars | 11 + .../templates/popup_input_tip.js.handlebars | 2 +- .../discourse/templates/post.js.handlebars | 14 +- .../templates/poster_expansion.handlebars | 6 +- .../templates/reply_history.js.handlebars | 1 - .../templates/share_link.js.handlebars | 6 +- .../site_map/_admin_link.js.handlebars | 2 +- .../_all_categories_link.js.handlebars | 2 +- .../site_map/_category.js.handlebars | 2 +- .../site_map/_faq_link.js.handlebars | 2 +- .../_flagged_posts_links.js.handlebars | 2 +- .../_latest_topics_link.js.handlebars | 2 +- .../_mobile_toggle_link.js.handlebars | 2 +- .../discourse/templates/static.js.handlebars | 2 +- .../discourse/templates/topic.js.handlebars | 14 +- .../templates/topic_admin_menu.js.handlebars | 2 +- .../templates/user/about.js.handlebars | 2 +- .../templates/user/email.js.handlebars | 4 +- .../templates/user/invited.js.handlebars | 6 +- .../templates/user/preferences.js.handlebars | 2 +- .../templates/user/stream.js.handlebars | 2 +- .../templates/user/user.js.handlebars | 14 +- .../templates/user/username.js.handlebars | 4 +- .../discourse/views/discovery_topics_view.js | 45 + ...s_view.js => discovery_categories_view.js} | 2 +- ...list_top_view.js => discovery_top_view.js} | 6 +- .../discourse/views/list/list_topics_view.js | 63 - .../stylesheets/desktop/topic-list.scss | 14 +- app/assets/stylesheets/mobile/topic-list.scss | 14 +- app/jobs/scheduled/periodical_updates.rb | 3 - app/models/hot_topic.rb | 147 - app/models/topic.rb | 1 - app/models/topic_list.rb | 8 - app/serializers/site_serializer.rb | 21 +- app/serializers/topic_list_item_serializer.rb | 26 - app/serializers/topic_list_serializer.rb | 11 +- config/locales/client.cs.yml | 5 - config/locales/client.da.yml | 5 - config/locales/client.de.yml | 5 - config/locales/client.en.yml | 7 +- config/locales/client.fr.yml | 5 - config/locales/client.it.yml | 5 - config/locales/client.ja.yml | 5 - config/locales/client.ko.yml | 5 - config/locales/client.nb_NO.yml | 5 - config/locales/client.nl.yml | 5 - config/locales/client.pseudo.yml | 4 - config/locales/client.pt_BR.yml | 5 - config/locales/client.ru.yml | 4 - config/locales/client.sv.yml | 5 - config/locales/client.zh_CN.yml | 5 - config/locales/client.zh_TW.yml | 5 - db/migrate/20140116170655_drop_hot_topics.rb | 5 + dbs/.gitignore | 0 dbs/sql/empty.sql.gz | Bin 27383 -> 0 bytes lib/discourse.rb | 8 +- lib/tasks/integration.rake | 5 +- lib/topic_query.rb | 6 - lib/topic_query_sql.rb | 17 - spec/jobs/periodical_updates_spec.rb | 4 - spec/models/hot_topic_spec.rb | 34 - test/javascripts/fixtures/current_user.js | 1 + .../fixtures/discovery_fixtures.js | 4 + test/javascripts/fixtures/list_fixtures.js | 4 - test/javascripts/fixtures/site_fixtures.js | 2 +- test/javascripts/fixtures/static_fixtures.js | 6 +- test/javascripts/fixtures/topic_fixtures.js | 2 +- test/javascripts/fixtures/user_fixtures.js | 18 +- ...topics_test.js => discover_topics_test.js} | 2 +- test/javascripts/lib/url_test.js | 6 +- test/javascripts/test_helper.js | 1 + .../assets/javascripts/development/ember.js | 5380 +++++++++++----- vendor/assets/javascripts/production/ember.js | 5421 ++++++++++++----- 178 files changed, 8441 insertions(+), 4573 deletions(-) rename app/assets/javascripts/discourse/{views/nav_item_view.js => components/navigation_item_component.js} (75%) rename app/assets/javascripts/discourse/controllers/{list_categories_controller.js => discovery_categories_controller.js} (86%) rename app/assets/javascripts/discourse/controllers/{list_top_controller.js => discovery_top_controller.js} (87%) rename app/assets/javascripts/discourse/controllers/{list_topics_controller.js => discovery_topics_controller.js} (51%) delete mode 100644 app/assets/javascripts/discourse/controllers/list_controller.js.erb create mode 100644 app/assets/javascripts/discourse/controllers/navigation_default_controller.js rename app/assets/javascripts/discourse/models/{nav_item.js.erb => nav_item.js} (64%) rename app/assets/javascripts/discourse/models/{top_list.js.erb => top_list.js} (89%) create mode 100644 app/assets/javascripts/discourse/routes/discovery_categories_route.js create mode 100644 app/assets/javascripts/discourse/routes/discovery_route.js create mode 100644 app/assets/javascripts/discourse/routes/discovery_route_builders.js create mode 100644 app/assets/javascripts/discourse/routes/discovery_top_route.js delete mode 100644 app/assets/javascripts/discourse/routes/filtered_list_route.js delete mode 100644 app/assets/javascripts/discourse/routes/list_categories_route.js delete mode 100644 app/assets/javascripts/discourse/routes/list_category_route.js delete mode 100644 app/assets/javascripts/discourse/routes/list_top_route.js delete mode 100644 app/assets/javascripts/discourse/templates/components/topic-list-loading.js.handlebars create mode 100644 app/assets/javascripts/discourse/templates/discovery.js.handlebars rename app/assets/javascripts/discourse/templates/{list => discovery}/categories.js.handlebars (93%) create mode 100644 app/assets/javascripts/discourse/templates/discovery/top.js.handlebars create mode 100644 app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars delete mode 100644 app/assets/javascripts/discourse/templates/list.js.handlebars delete mode 100644 app/assets/javascripts/discourse/templates/list/top.js.handlebars delete mode 100644 app/assets/javascripts/discourse/templates/list/topics.js.handlebars create mode 100644 app/assets/javascripts/discourse/templates/navigation/categories.js.handlebars create mode 100644 app/assets/javascripts/discourse/templates/navigation/category.js.handlebars create mode 100644 app/assets/javascripts/discourse/templates/navigation/default.js.handlebars delete mode 100644 app/assets/javascripts/discourse/templates/reply_history.js.handlebars create mode 100644 app/assets/javascripts/discourse/views/discovery_topics_view.js rename app/assets/javascripts/discourse/views/list/{list_categories_view.js => discovery_categories_view.js} (93%) rename app/assets/javascripts/discourse/views/list/{list_top_view.js => discovery_top_view.js} (68%) delete mode 100644 app/assets/javascripts/discourse/views/list/list_topics_view.js delete mode 100644 app/models/hot_topic.rb create mode 100644 db/migrate/20140116170655_drop_hot_topics.rb delete mode 100644 dbs/.gitignore delete mode 100644 dbs/sql/empty.sql.gz delete mode 100644 spec/models/hot_topic_spec.rb create mode 100644 test/javascripts/fixtures/current_user.js create mode 100644 test/javascripts/fixtures/discovery_fixtures.js delete mode 100644 test/javascripts/fixtures/list_fixtures.js rename test/javascripts/integration/{list_topics_test.js => discover_topics_test.js} (95%) diff --git a/app/assets/javascripts/admin/templates/commits.js.handlebars b/app/assets/javascripts/admin/templates/commits.js.handlebars index 214aa6ef86b..383b52c0c74 100644 --- a/app/assets/javascripts/admin/templates/commits.js.handlebars +++ b/app/assets/javascripts/admin/templates/commits.js.handlebars @@ -9,10 +9,10 @@ {{#each controller}}
  • - +
    - {{ commit.message }}
    + {{ commit.message }}
    {{i18n admin.commits.by}} {{ commit.author.name }} - {{{ timeAgo }}}
  • diff --git a/app/assets/javascripts/admin/templates/customize.js.handlebars b/app/assets/javascripts/admin/templates/customize.js.handlebars index d934eda9f96..b4150ca1116 100644 --- a/app/assets/javascripts/admin/templates/customize.js.handlebars +++ b/app/assets/javascripts/admin/templates/customize.js.handlebars @@ -2,7 +2,7 @@

    {{i18n admin.customize.long_title}}

    @@ -17,16 +17,16 @@
    @@ -51,14 +51,14 @@ {{i18n admin.customize.override_default}} {{view Ember.Checkbox checkedBinding="selectedItem.override_default_style"}} {{i18n admin.customize.enabled}} {{view Ember.Checkbox checkedBinding="selectedItem.enabled"}} {{#unless selectedItem.changed}} - {{i18n admin.customize.preview}} + {{i18n admin.customize.preview}} | {{i18n admin.customize.undo_preview}}
    {{/unless}}
    - + {{selectedItem.savingStatus}} {{i18n admin.customize.delete}}
    diff --git a/app/assets/javascripts/admin/templates/dashboard.js.handlebars b/app/assets/javascripts/admin/templates/dashboard.js.handlebars index 4c73c9e3dcf..b42f0e4a02d 100644 --- a/app/assets/javascripts/admin/templates/dashboard.js.handlebars +++ b/app/assets/javascripts/admin/templates/dashboard.js.handlebars @@ -3,9 +3,9 @@
    -

    +

    {{i18n admin.dashboard.problems_found}} -

      +
        {{#each problem in problems}}
      • {{{problem}}}
      • {{/each}} @@ -34,7 +34,7 @@ {{/if}} {{#if Discourse.SiteSettings.version_checks}} -
        +
        @@ -48,7 +48,7 @@ {{#unless loading}} - + {{#if versionCheck.noCheckPerformed}} @@ -83,7 +83,7 @@ {{#if versionCheck.upToDate }} {{else}} - + {{#if versionCheck.behindByOneVersion}} ☺ {{else}} @@ -291,4 +291,4 @@
        {{i18n admin.dashboard.last_updated}} {{updatedTimestamp}}
        -
        \ No newline at end of file +
        diff --git a/app/assets/javascripts/admin/templates/email.js.handlebars b/app/assets/javascripts/admin/templates/email.js.handlebars index 86d516342a3..fbabe8bf1ae 100644 --- a/app/assets/javascripts/admin/templates/email.js.handlebars +++ b/app/assets/javascripts/admin/templates/email.js.handlebars @@ -10,4 +10,4 @@
        {{outlet}} -
        \ No newline at end of file + diff --git a/app/assets/javascripts/admin/templates/email_index.js.handlebars b/app/assets/javascripts/admin/templates/email_index.js.handlebars index c5e0812c228..2c7a498fc20 100644 --- a/app/assets/javascripts/admin/templates/email_index.js.handlebars +++ b/app/assets/javascripts/admin/templates/email_index.js.handlebars @@ -17,7 +17,7 @@ {{textField value=testEmailAddress placeholderKey="admin.email.test_email_address"}}
        - + {{#if sentTestEmail}}{{i18n admin.email.sent_test}}{{/if}}
        diff --git a/app/assets/javascripts/admin/templates/flags.js.handlebars b/app/assets/javascripts/admin/templates/flags.js.handlebars index 389456d23f6..798d5fae00e 100644 --- a/app/assets/javascripts/admin/templates/flags.js.handlebars +++ b/app/assets/javascripts/admin/templates/flags.js.handlebars @@ -24,7 +24,7 @@
        {{#each flaggedPost in content}} - + diff --git a/app/assets/javascripts/admin/templates/groups.js.handlebars b/app/assets/javascripts/admin/templates/groups.js.handlebars index 01857562f0d..ed19235f4b1 100644 --- a/app/assets/javascripts/admin/templates/groups.js.handlebars +++ b/app/assets/javascripts/admin/templates/groups.js.handlebars @@ -4,12 +4,12 @@
        - +
        @@ -37,7 +37,7 @@
        - + {{#unless automatic}} {{i18n admin.customize.delete}} {{/unless}} diff --git a/app/assets/javascripts/admin/templates/logs.js.handlebars b/app/assets/javascripts/admin/templates/logs.js.handlebars index b7661d84b05..95a75385190 100644 --- a/app/assets/javascripts/admin/templates/logs.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs.js.handlebars @@ -11,4 +11,4 @@
        {{outlet}} -
        \ No newline at end of file +
        diff --git a/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.js.handlebars b/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.js.handlebars index 0b5fac939e4..f3f5acf1967 100644 --- a/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.js.handlebars @@ -19,4 +19,4 @@
        {{i18n admin.customize.override_default}}: {{override_default_style}} -
        \ No newline at end of file + diff --git a/app/assets/javascripts/admin/templates/logs/details_modal.js.handlebars b/app/assets/javascripts/admin/templates/logs/details_modal.js.handlebars index 73c62624ff2..3bc547a3234 100644 --- a/app/assets/javascripts/admin/templates/logs/details_modal.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/details_modal.js.handlebars @@ -3,4 +3,4 @@ \ No newline at end of file + diff --git a/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars index 842d36d6f60..8ebe3cc0239 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/screened_emails.js.handlebars @@ -22,4 +22,4 @@ {{else}} {{i18n search.no_results}} {{/if}} -{{/if}} \ No newline at end of file +{{/if}} diff --git a/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars index 32c332c86c7..367a2090fa1 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.js.handlebars @@ -1,9 +1,9 @@
        {{actionName}}
        {{match_count}}
        {{unboundAgeWithTooltip last_match_at}}
        {{unboundAgeWithTooltip created_at}}
        {{ip_address}}
        -
        \ No newline at end of file +
        diff --git a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses.js.handlebars index 920306ae7e6..3c34f8d4ffb 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses.js.handlebars @@ -25,4 +25,4 @@ {{else}} {{i18n search.no_results}} {{/if}} -{{/if}} \ No newline at end of file +{{/if}} diff --git a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.js.handlebars index c10f4a9a8ea..54fdc7bca35 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.js.handlebars @@ -6,7 +6,7 @@ {{/if}}
        - + {{actionName}}
        {{match_count}}
        @@ -21,13 +21,13 @@ {{#if isBlocked}} - + {{else}} - + {{/if}} {{else}} {{i18n cancel}} {{/unless}} -
        \ No newline at end of file +
        diff --git a/app/assets/javascripts/admin/templates/logs/screened_urls.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_urls.js.handlebars index 7465cfeaafd..09893ba7041 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_urls.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/screened_urls.js.handlebars @@ -21,4 +21,4 @@ {{else}} {{i18n search.no_results}} {{/if}} -{{/if}} \ No newline at end of file +{{/if}} diff --git a/app/assets/javascripts/admin/templates/logs/screened_urls_list_item.js.handlebars b/app/assets/javascripts/admin/templates/logs/screened_urls_list_item.js.handlebars index 69cb12c4d2d..659ceccd7e1 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_urls_list_item.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/screened_urls_list_item.js.handlebars @@ -1,8 +1,8 @@
        -
        {{domain}}
        +
        {{domain}}
        {{actionName}}
        {{match_count}}
        {{unboundAgeWithTooltip last_match_at}}
        {{unboundAgeWithTooltip created_at}}
        -
        \ No newline at end of file +
        diff --git a/app/assets/javascripts/admin/templates/logs/site_customization_change_modal.js.handlebars b/app/assets/javascripts/admin/templates/logs/site_customization_change_modal.js.handlebars index 5d0e96ab3ab..d67216212d4 100644 --- a/app/assets/javascripts/admin/templates/logs/site_customization_change_modal.js.handlebars +++ b/app/assets/javascripts/admin/templates/logs/site_customization_change_modal.js.handlebars @@ -1,14 +1,14 @@
        {{i18n admin.dashboard.version}}{{ versionCheck.installed_version }}{{ versionCheck.installed_version }} 
        {{#if flaggedPost.user}}{{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="small"}}{{/link-to}}{{/if}}
        @@ -34,4 +34,4 @@ {{else}} {{i18n loading}} -{{/if}} \ No newline at end of file +{{/if}} diff --git a/app/assets/javascripts/admin/templates/reports/per_day_counts_report.js.handlebars b/app/assets/javascripts/admin/templates/reports/per_day_counts_report.js.handlebars index 305d1656db1..abd92d27f5a 100644 --- a/app/assets/javascripts/admin/templates/reports/per_day_counts_report.js.handlebars +++ b/app/assets/javascripts/admin/templates/reports/per_day_counts_report.js.handlebars @@ -1,7 +1,7 @@ - + - \ No newline at end of file + diff --git a/app/assets/javascripts/admin/templates/reports/summed_counts_report.js.handlebars b/app/assets/javascripts/admin/templates/reports/summed_counts_report.js.handlebars index 32ba5f062e8..b96b3f9b302 100644 --- a/app/assets/javascripts/admin/templates/reports/summed_counts_report.js.handlebars +++ b/app/assets/javascripts/admin/templates/reports/summed_counts_report.js.handlebars @@ -1,13 +1,13 @@ - - - + + + - \ No newline at end of file + diff --git a/app/assets/javascripts/admin/templates/reports/trust_levels_report.js.handlebars b/app/assets/javascripts/admin/templates/reports/trust_levels_report.js.handlebars index a16c7883d04..ca98def40d2 100644 --- a/app/assets/javascripts/admin/templates/reports/trust_levels_report.js.handlebars +++ b/app/assets/javascripts/admin/templates/reports/trust_levels_report.js.handlebars @@ -5,4 +5,4 @@ - \ No newline at end of file + diff --git a/app/assets/javascripts/admin/templates/site_content_edit.js.handlebars b/app/assets/javascripts/admin/templates/site_content_edit.js.handlebars index 5d3cdae712e..cd35dd0c559 100644 --- a/app/assets/javascripts/admin/templates/site_content_edit.js.handlebars +++ b/app/assets/javascripts/admin/templates/site_content_edit.js.handlebars @@ -15,7 +15,7 @@ {{/if}}
        -
        -
        +
        {{i18n admin.user.suspended}}
        {{isSuspended}}
        @@ -235,7 +235,7 @@
        {{/if}} -
        +
        {{i18n admin.user.blocked}}
        {{blocked}}
        @@ -313,7 +313,7 @@

        - diff --git a/app/assets/javascripts/admin/templates/users_list.js.handlebars b/app/assets/javascripts/admin/templates/users_list.js.handlebars index 3f528b412e0..bc052f19431 100644 --- a/app/assets/javascripts/admin/templates/users_list.js.handlebars +++ b/app/assets/javascripts/admin/templates/users_list.js.handlebars @@ -54,7 +54,7 @@ {{#each model}} -
        + {{#if controller.showApproval}} {{#groupedEach topic in topics}} - + - + {{#if topic.bumped}} {{#each model.categories}} - + - - - + {{/if}} -{{#unless controller.category}} +{{#unless controller.hideCategory}} @@ -61,7 +50,7 @@ {{/if}} - + {{#if bumped}}
        {{title}}{{title}} {{todayCount}} {{yesterdayCount}} {{sevenDaysAgoCount}} {{thirtyDaysAgoCount}}
        {{#if icon}} - + {{/if}} - {{title}} + {{title}} {{todayCount}}{{yesterdayCount}} {{lastSevenDaysCount}} {{lastThirtyDaysCount}} {{yesterdayCount}} {{lastSevenDaysCount}} {{lastThirtyDaysCount}} {{total}}
        {{#link-to 'adminUsersList.regular'}}{{valueAtTrustLevel data 2}}{{/link-to}} {{#link-to 'adminUsersList.leaders'}}{{valueAtTrustLevel data 3}}{{/link-to}} {{#link-to 'adminUsersList.elders'}}{{valueAtTrustLevel data 4}}{{/link-to}}
        {{#if can_approve}} @@ -94,4 +94,4 @@

        {{i18n search.no_results}}

        {{/if}} {{/if}} - \ No newline at end of file + diff --git a/app/assets/javascripts/discourse/components/bread_crumbs_component.js b/app/assets/javascripts/discourse/components/bread_crumbs_component.js index 2affd1acd95..fe44de26aca 100644 --- a/app/assets/javascripts/discourse/components/bread_crumbs_component.js +++ b/app/assets/javascripts/discourse/components/bread_crumbs_component.js @@ -29,9 +29,11 @@ Discourse.BreadCrumbsComponent = Ember.Component.extend({ }.property('category', 'parentCategory'), childCategories: function() { - var self = this; + var firstCategory = this.get('firstCategory'); + if (!firstCategory) { return; } + return this.get('categories').filter(function (c) { - return c.get('parentCategory') === self.get('firstCategory'); + return c.get('parentCategory') === firstCategory; }); }.property('firstCategory') diff --git a/app/assets/javascripts/discourse/components/categorydrop_component.js b/app/assets/javascripts/discourse/components/categorydrop_component.js index 5401794c029..5aa2e354b4e 100644 --- a/app/assets/javascripts/discourse/components/categorydrop_component.js +++ b/app/assets/javascripts/discourse/components/categorydrop_component.js @@ -56,6 +56,10 @@ Discourse.CategoryDropComponent = Ember.Component.extend({ var self = this, $dropdown = this.$()[0]; + this.$('a[data-drop-close]').on('click.category-drop', function() { + self.close(); + }); + $('html').on('click.category-drop', function(e) { var $target = $(e.target), closest = $target.closest($dropdown); @@ -71,11 +75,13 @@ Discourse.CategoryDropComponent = Ember.Component.extend({ close: function() { $('html').off('click.category-drop'); + this.$('a[data-drop-close]').off('click.category-drop'); this.set('expanded', false); }, willDestroyElement: function() { $('html').off('click.category-drop'); + this.$('a[data-drop-close]').off('click.category-drop'); } }); diff --git a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js index f900082d354..9a56ee3ce11 100644 --- a/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js +++ b/app/assets/javascripts/discourse/components/keyboard_shortcuts_component.js @@ -141,7 +141,7 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({ }, _changeSection: function(num) { - var $sections = $('#category-filter').find('li'), + var $sections = $('#navigation-bar').find('li'), index = $sections.index('.active'); $sections.eq(index + num).find('a').click(); diff --git a/app/assets/javascripts/discourse/views/nav_item_view.js b/app/assets/javascripts/discourse/components/navigation_item_component.js similarity index 75% rename from app/assets/javascripts/discourse/views/nav_item_view.js rename to app/assets/javascripts/discourse/components/navigation_item_component.js index 7403ac7270f..61bd338eac0 100644 --- a/app/assets/javascripts/discourse/views/nav_item_view.js +++ b/app/assets/javascripts/discourse/components/navigation_item_component.js @@ -1,19 +1,17 @@ /** This view handles rendering of a navigation item - @class NavItemView - @extends Discourse.View + @class NavigationItemComponent + @extends Ember.Component @namespace Discourse @module Discourse **/ -Discourse.NavItemView = Discourse.View.extend({ +Discourse.NavigationItemComponent = Ember.Component.extend({ tagName: 'li', classNameBindings: ['active', 'content.hasIcon:has-icon'], attributeBindings: ['title'], - hidden: Em.computed.not('content.visible'), shouldRerender: Discourse.View.renderIfChanged('content.count'), - active: Discourse.computed.propertyEqual('content.filterMode', 'controller.filterMode'), title: function() { var categoryName = this.get('content.categoryName'), @@ -27,13 +25,15 @@ Discourse.NavItemView = Discourse.View.extend({ return I18n.t("filters." + name + ".help", extra); }.property("content.name"), + active: function() { + return this.get('content.filterMode') === this.get('filterMode') || + (this.get('filterMode') === 'top' && this.get('content.filterMode').indexOf('top') >= 0); + }.property('content.filterMode', 'filterMode'), name: function() { var categoryName = this.get('content.categoryName'), name = this.get('content.name'), - extra = { - count: this.get('content.count') || 0 - }; + extra = { count: this.get('content.count') || 0 }; if (categoryName) { name = 'category'; @@ -51,7 +51,4 @@ Discourse.NavItemView = Discourse.View.extend({ buffer.push(this.get('name')); buffer.push(""); } - }); - - diff --git a/app/assets/javascripts/discourse/components/toggle_summary_component.js b/app/assets/javascripts/discourse/components/toggle_summary_component.js index 66f3d8c697d..b9b45f80037 100644 --- a/app/assets/javascripts/discourse/components/toggle_summary_component.js +++ b/app/assets/javascripts/discourse/components/toggle_summary_component.js @@ -6,12 +6,18 @@ @namespace Discourse @module Discourse **/ -Discourse.ToggleSummaryComponent = Ember.Component.extend({ +Discourse.ToggleSummaryComponent = Ember.View.extend({ templateName: 'components/toggle-summary', tagName: 'section', classNames: ['information'], postStream: Em.computed.alias('topic.postStream'), + init: function() { + this._super(); + this.set('context', this); + this.set('controller', this); + }, + actions: { toggleSummary: function() { this.get('postStream').toggleSummary(); diff --git a/app/assets/javascripts/discourse/components/topic_map_component.js b/app/assets/javascripts/discourse/components/topic_map_component.js index e139d9078b8..5cc9b7e259a 100644 --- a/app/assets/javascripts/discourse/components/topic_map_component.js +++ b/app/assets/javascripts/discourse/components/topic_map_component.js @@ -9,7 +9,7 @@ var LINKS_SHOWN = 5; -Discourse.TopicMapComponent = Ember.Component.extend({ +Discourse.TopicMapComponent = Ember.View.extend({ mapCollapsed: true, templateName: 'components/topic-map', details: Em.computed.alias('topic.details'), @@ -18,6 +18,9 @@ Discourse.TopicMapComponent = Ember.Component.extend({ init: function() { this._super(); + this.set('context', this); + this.set('controller', this); + // If the topic has a summary, expand the map by default this.set('mapCollapsed', Discourse.Mobile.mobileView || (!this.get('topic.has_summary'))); }, diff --git a/app/assets/javascripts/discourse/controllers/composer_controller.js b/app/assets/javascripts/discourse/controllers/composer_controller.js index ea8715ee2e4..2ecbe46b255 100644 --- a/app/assets/javascripts/discourse/controllers/composer_controller.js +++ b/app/assets/javascripts/discourse/controllers/composer_controller.js @@ -283,7 +283,7 @@ Discourse.ComposerController = Discourse.Controller.extend({ } else { opts.tested = true; if (!opts.ignoreIfChanged) { - this.cancelComposer().then(function() { self.open(opts); }).fail(function() { return promise.reject(); }); + this.cancelComposer().then(function() { self.open(opts); }).catch(function() { return promise.reject(); }); } return promise; } diff --git a/app/assets/javascripts/discourse/controllers/list_categories_controller.js b/app/assets/javascripts/discourse/controllers/discovery_categories_controller.js similarity index 86% rename from app/assets/javascripts/discourse/controllers/list_categories_controller.js rename to app/assets/javascripts/discourse/controllers/discovery_categories_controller.js index 4e10b6f5af8..34cd727b095 100644 --- a/app/assets/javascripts/discourse/controllers/list_categories_controller.js +++ b/app/assets/javascripts/discourse/controllers/discovery_categories_controller.js @@ -1,12 +1,12 @@ /** This controller supports actions when listing categories - @class ListCategoriesController + @class DiscoveryCategoriesController @extends Discourse.ObjectController @namespace Discourse @module Discourse **/ -Discourse.ListCategoriesController = Discourse.ObjectController.extend({ +Discourse.DiscoveryCategoriesController = Discourse.ObjectController.extend({ needs: ['modal'], actions: { @@ -33,5 +33,3 @@ Discourse.ListCategoriesController = Discourse.ObjectController.extend({ }.property('categories.@each.featuredTopics.length') }); - - diff --git a/app/assets/javascripts/discourse/controllers/list_top_controller.js b/app/assets/javascripts/discourse/controllers/discovery_top_controller.js similarity index 87% rename from app/assets/javascripts/discourse/controllers/list_top_controller.js rename to app/assets/javascripts/discourse/controllers/discovery_top_controller.js index f71e0bfdad7..5699591484b 100644 --- a/app/assets/javascripts/discourse/controllers/list_top_controller.js +++ b/app/assets/javascripts/discourse/controllers/discovery_top_controller.js @@ -1,12 +1,13 @@ /** - Controller of the top page + The controller for discoverying "Top" topics - @class ListTopController - @extends Discourse.ObjectController + @class DiscoveryTopController + @extends Discourse.Controller @namespace Discourse @module Discourse **/ -Discourse.ListTopController = Discourse.ObjectController.extend({ +Discourse.DiscoveryTopController = Discourse.ObjectController.extend({ + category:null, redirectedToTopPageReason: function() { // no need for a reason if the default homepage is "top" @@ -36,5 +37,4 @@ Discourse.ListTopController = Discourse.ObjectController.extend({ showMoreWeeklyUrl: function() { return this.showMoreUrl("weekly"); }.property("category.url"), showMoreMonthlyUrl: function() { return this.showMoreUrl("monthly"); }.property("category.url"), showMoreYearlyUrl: function() { return this.showMoreUrl("yearly"); }.property("category.url"), - }); diff --git a/app/assets/javascripts/discourse/controllers/list_topics_controller.js b/app/assets/javascripts/discourse/controllers/discovery_topics_controller.js similarity index 51% rename from app/assets/javascripts/discourse/controllers/list_topics_controller.js rename to app/assets/javascripts/discourse/controllers/discovery_topics_controller.js index 8f5d9b96a57..32e4e27e1e8 100644 --- a/app/assets/javascripts/discourse/controllers/list_topics_controller.js +++ b/app/assets/javascripts/discourse/controllers/discovery_topics_controller.js @@ -1,40 +1,12 @@ /** - This controller supports actions when listing topics or categories + The controller for displaying a list of topics. - @class ListTopicsController - @extends Discourse.ObjectController + @class DiscoveryTopicsController + @extends Discourse.Controller @namespace Discourse @module Discourse **/ -Discourse.ListTopicsController = Discourse.ObjectController.extend({ - needs: ['list', 'composer', 'modal'], - rankDetailsVisible: false, - - // If we're changing our channel - previousChannel: null, - - latest: Ember.computed.equal('filter', 'latest'), - - topicListReloading: function() { - return (!this.get('controllers.list.loading')) && (!this.get('loaded')); - }.property('loaded', 'controllers.list.loading'), - - categories: function() { - return Discourse.Category.list(); - }.property(), - - draftLoaded: function() { - var draft = this.get('content.draft'); - if (draft) { - return this.get('controllers.composer').open({ - draft: draft, - draftKey: this.get('content.draft_key'), - draftSequence: this.get('content.draft_sequence'), - ignoreIfChanged: true - }); - } - }.observes('content.draft'), - +Discourse.DiscoveryTopicsController = Discourse.ObjectController.extend({ actions: { // Star a topic toggleStar: function(topic) { @@ -46,14 +18,6 @@ Discourse.ListTopicsController = Discourse.ObjectController.extend({ topic.clearPin(); }, - toggleRankDetails: function() { - this.toggleProperty('rankDetailsVisible'); - }, - - createTopic: function() { - this.get('controllers.list').send('createTopic'); - }, - // Show newly inserted topics showInserted: function() { var tracker = Discourse.TopicTrackingState.current(); @@ -62,17 +26,36 @@ Discourse.ListTopicsController = Discourse.ObjectController.extend({ this.get('content').loadBefore(tracker.get('newIncoming')); tracker.resetTracking(); return false; + }, + + refresh: function() { + var filter = this.get('model.filter'), + self = this; + + this.send('loading'); + Discourse.TopicList.find(filter).then(function(list) { + self.set('model', list); + self.send('loadingComplete'); + }); } }, - allLoaded: function() { - return !this.get('loading') && !this.get('more_topics_url'); - }.property('loading', 'more_topics_url'), + topicTrackingState: function() { + return Discourse.TopicTrackingState.current(); + }.property(), - canCreateTopic: Em.computed.alias('controllers.list.canCreateTopic'), + hasTopics: Em.computed.gt('topics.length', 0), + showTable: Em.computed.or('hasTopics', 'topicTrackingState.hasIncoming'), + latest: Ember.computed.equal('filter', 'latest'), + allLoaded: Em.computed.empty('more_topics_url'), + + updateTitle: function(){ + Discourse.notifyTitle(this.get('topicTrackingState.incomingCount')); + }.observes('topicTrackingState.incomingCount'), footerMessage: function() { - if (!this.get('allLoaded')) return; + if (!this.get('allLoaded')) { return; } + var category = this.get('category'); if( category ) { return I18n.t('topics.bottom.category', {category: category.get('name')}); @@ -90,7 +73,7 @@ Discourse.ListTopicsController = Discourse.ObjectController.extend({ } }.property('allLoaded', 'topics.length'), - loadMore: function() { + loadMoreTopics: function() { var topicList = this.get('model'); return topicList.loadMore().then(function(moreUrl) { if (!Em.isEmpty(moreUrl)) { @@ -98,7 +81,4 @@ Discourse.ListTopicsController = Discourse.ObjectController.extend({ } }); } - }); - - diff --git a/app/assets/javascripts/discourse/controllers/edit_category_controller.js b/app/assets/javascripts/discourse/controllers/edit_category_controller.js index 90501549415..25107c0b9b1 100644 --- a/app/assets/javascripts/discourse/controllers/edit_category_controller.js +++ b/app/assets/javascripts/discourse/controllers/edit_category_controller.js @@ -155,7 +155,7 @@ Discourse.EditCategoryController = Discourse.ObjectController.extend(Discourse.M model.setProperties({slug: result.category.slug, id: result.category.id }); Discourse.URL.redirectTo("/category/" + Discourse.Category.slugFor(model)); - }).fail(function(error) { + }).catch(function(error) { if (error && error.responseText) { self.flash($.parseJSON(error.responseText).errors[0]); } else { diff --git a/app/assets/javascripts/discourse/controllers/invite_controller.js b/app/assets/javascripts/discourse/controllers/invite_controller.js index 4a8134d081b..fb60d25d9bb 100644 --- a/app/assets/javascripts/discourse/controllers/invite_controller.js +++ b/app/assets/javascripts/discourse/controllers/invite_controller.js @@ -92,7 +92,7 @@ Discourse.InviteController = Discourse.ObjectController.extend(Discourse.ModalFu this.setProperties({ saving: true, error: false }); this.get('model').createInvite(this.get('email')).then(function() { self.setProperties({ saving: false, finished: true }); - }).fail(function() { + }).catch(function() { self.setProperties({ saving: false, error: true }); }); return false; diff --git a/app/assets/javascripts/discourse/controllers/invite_private_controller.js b/app/assets/javascripts/discourse/controllers/invite_private_controller.js index 620e8a72414..9ca61a42094 100644 --- a/app/assets/javascripts/discourse/controllers/invite_private_controller.js +++ b/app/assets/javascripts/discourse/controllers/invite_private_controller.js @@ -39,7 +39,7 @@ Discourse.InvitePrivateController = Discourse.ObjectController.extend(Discourse. if(result && result.user) { self.get('model.details.allowed_users').pushObject(result.user); } - }).fail(function() { + }).catch(function() { self.setProperties({error: true, saving: false}); }); return false; diff --git a/app/assets/javascripts/discourse/controllers/list_controller.js.erb b/app/assets/javascripts/discourse/controllers/list_controller.js.erb deleted file mode 100644 index 9361cb74a8a..00000000000 --- a/app/assets/javascripts/discourse/controllers/list_controller.js.erb +++ /dev/null @@ -1,138 +0,0 @@ -/** - This controller supports actions when listing topics or categories - - @class ListController - @extends Discourse.Controller - @namespace Discourse - @module Discourse -**/ -Discourse.ListController = Discourse.Controller.extend({ - categoryBinding: "topicList.category", - canCreateCategory: false, - canCreateTopic: false, - needs: ["composer", "modal", "listTopics"], - - availableNavItems: function() { - var category = this.get("category"); - - return Discourse.SiteSettings.top_menu.split("|").map(function(i) { - return Discourse.NavItem.fromText(i, { - loggedOn: !!Discourse.User.current(), - category: category - }); - }).filter(function(i) { - return i !== null && !(category && i.get("name").indexOf("categor") === 0); - }); - }.property("category"), - - /** - Refresh our current topic list - @method refresh - **/ - refresh: function() { - var listTopicsController = this.get('controllers.listTopics'); - listTopicsController.set('model.loaded', false); - this.load(this.get('filterMode')).then(function (topicList) { - listTopicsController.set('model', topicList); - }); - }, - - /** - Load a list based on a filter - - @method load - @param {String} filterMode the filter we want to load - @param {Object} params for additional filtering - @returns {Ember.Deferred} the promise that will resolve to the list of items. - **/ - load: function(filterMode, params) { - var self = this; - this.set('loading', true); - - var trackingState = Discourse.TopicTrackingState.current(); - - if (filterMode === 'categories') { - return Discourse.CategoryList.list(filterMode).then(function(items) { - self.setProperties({ - loading: false, - filterMode: filterMode, - categoryMode: true, - draft: items.draft, - draft_key: items.draft_key, - draft_sequence: items.draft_sequence - }); - if(trackingState) { - trackingState.sync(items, filterMode); - trackingState.trackIncoming(filterMode); - } - return items; - }); - } - - var current = (this.get('availableNavItems').filter(function(f) { return f.name === filterMode; }))[0]; - if (!current) { - current = Discourse.NavItem.create({ name: filterMode }); - } - - params = params || {}; - return Discourse.TopicList.list(current, params).then(function(items) { - self.setProperties({ - loading: false, - filterMode: filterMode, - draft: items.draft, - draft_key: items.draft_key, - draft_sequence: items.draft_sequence, - noSubcategories: params.no_subcategories - }); - if(trackingState) { - trackingState.sync(items, filterMode); - trackingState.trackIncoming(filterMode); - } - return items; - }); - }, - - // Put in the appropriate page title based on our view - updateTitle: function() { - if (this.get('filterMode') === 'categories') { - Discourse.set('title', I18n.t('categories_list')); - } else { - if (this.present('category')) { - Discourse.set('title', this.get('category.name').capitalize() + " " + I18n.t('topic.list')); - } else { - Discourse.set('title', I18n.t('topic.list')); - } - } - }.observes('filterMode', 'category'), - - // Create topic button - actions: { - createTopic: function() { - this.get('controllers.composer').open({ - categoryId: this.get('category.id'), - action: Discourse.Composer.CREATE_TOPIC, - draft: this.get('draft'), - draftKey: this.get('draft_key'), - draftSequence: this.get('draft_sequence') - }); - } - }, - - canEditCategory: function() { - if( this.present('category') ) { - var u = Discourse.User.current(); - return u && u.staff; - } else { - return false; - } - }.property('category'), - - categories: function() { - return Discourse.Category.list(); - }.property() - -}); - -Discourse.ListController.reopenClass({ - FILTERS: <%= Discourse.filters.map(&:to_s) %> -}); diff --git a/app/assets/javascripts/discourse/controllers/navigation_default_controller.js b/app/assets/javascripts/discourse/controllers/navigation_default_controller.js new file mode 100644 index 00000000000..8fa71600ad6 --- /dev/null +++ b/app/assets/javascripts/discourse/controllers/navigation_default_controller.js @@ -0,0 +1,40 @@ +/** + Handles the controller for the default navigation within discovery. + + @class NavigationDefaultController + @extends Discourse.Controller + @namespace Discourse + @module Discourse +**/ +Discourse.NavigationDefaultController = Discourse.Controller.extend({ + needs: ['composer', 'discoveryTopics'], + + actions: { + createTopic: function() { + var topicsController = this.get('controllers.discoveryTopics'); + this.get('controllers.composer').open({ + categoryId: this.get('category.id'), + action: Discourse.Composer.CREATE_TOPIC, + draft: topicsController.get('draft'), + draftKey: topicsController.get('draft_key'), + draftSequence: topicsController.get('draft_sequence') + }); + } + }, + + categories: function() { + return Discourse.Category.list(); + }.property(), + + navItems: function() { + return Discourse.NavItem.buildList(); + }.property() +}); + +Discourse.NavigationCategoryController = Discourse.NavigationDefaultController.extend({ + navItems: function() { + return Discourse.NavItem.buildList(this.get('category'), { noSubcategories: this.get('noSubcategories') }); + }.property('category', 'noSubcategories') +}); + +Discourse.NavigationCategoriesController = Discourse.NavigationDefaultController.extend({}); diff --git a/app/assets/javascripts/discourse/helpers/application_helpers.js b/app/assets/javascripts/discourse/helpers/application_helpers.js index e0516efad52..da487600cbc 100644 --- a/app/assets/javascripts/discourse/helpers/application_helpers.js +++ b/app/assets/javascripts/discourse/helpers/application_helpers.js @@ -93,9 +93,9 @@ Handlebars.registerHelper('titledLinkTo', function(name, object) { options.hash.title = I18n.t(options.hash.titleKey); } if (arguments.length === 3) { - return Ember.Handlebars.helpers.linkTo.call(this, name, object, options); + return Ember.Handlebars.helpers['link-to'].call(this, name, object, options); } else { - return Ember.Handlebars.helpers.linkTo.call(this, name, options); + return Ember.Handlebars.helpers['link-to'].call(this, name, options); } }); diff --git a/app/assets/javascripts/discourse/initializers/1_init_message_bus.js b/app/assets/javascripts/discourse/initializers/1_init_message_bus.js index e15d45a38d1..b4c0fd56341 100644 --- a/app/assets/javascripts/discourse/initializers/1_init_message_bus.js +++ b/app/assets/javascripts/discourse/initializers/1_init_message_bus.js @@ -2,6 +2,10 @@ Initialize the message bus to receive messages. **/ Discourse.addInitializer(function() { + + // We don't use the message bus in testing + if (Discourse.testing) { return; } + Discourse.MessageBus.alwaysLongPoll = Discourse.Environment === "development"; Discourse.MessageBus.start(); Discourse.MessageBus.subscribe("/global/asset-version", function(version){ diff --git a/app/assets/javascripts/discourse/lib/url.js b/app/assets/javascripts/discourse/lib/url.js index e9a91f9fd2f..10bb4931fb1 100644 --- a/app/assets/javascripts/discourse/lib/url.js +++ b/app/assets/javascripts/discourse/lib/url.js @@ -188,11 +188,11 @@ Discourse.URL = Em.Object.createWithMixins({ @param {String} path the path we're navigating to **/ navigatedToHome: function(oldPath, path) { - var defaultFilter = "/" + Discourse.ListController.FILTERS[0]; + var defaultFilter = "/" + Discourse.Site.currentProp('filters')[0]; if (path === "/" && (oldPath === "/" || oldPath === defaultFilter)) { // Refresh our list - this.controllerFor('list').refresh(); + this.controllerFor('discoveryTopics').send('refresh'); return true; } diff --git a/app/assets/javascripts/discourse/lib/utilities.js b/app/assets/javascripts/discourse/lib/utilities.js index f6df27c4704..01831c1c01c 100644 --- a/app/assets/javascripts/discourse/lib/utilities.js +++ b/app/assets/javascripts/discourse/lib/utilities.js @@ -180,6 +180,7 @@ Discourse.Utilities = { @returns true whenever the upload is valid **/ validateUploadedFile: function(file, type) { + // check that the uploaded file is authorized if (!Discourse.Utilities.isAuthorizedUpload(file)) { var extensions = Discourse.Utilities.authorizedExtensions(); diff --git a/app/assets/javascripts/discourse/models/nav_item.js.erb b/app/assets/javascripts/discourse/models/nav_item.js similarity index 64% rename from app/assets/javascripts/discourse/models/nav_item.js.erb rename to app/assets/javascripts/discourse/models/nav_item.js index 09721d6e733..33986b1228b 100644 --- a/app/assets/javascripts/discourse/models/nav_item.js.erb +++ b/app/assets/javascripts/discourse/models/nav_item.js @@ -44,7 +44,9 @@ Discourse.NavItem = Discourse.Model.extend({ if(category){ mode += "category/"; - mode += Discourse.Category.slugFor(this.get('category')) + "/l/"; + mode += Discourse.Category.slugFor(this.get('category')); + if (this.get('noSubcategories')) { mode += '/none'; } + mode += "/l/"; } return mode + name.replace(' ', '-'); } @@ -55,36 +57,37 @@ Discourse.NavItem = Discourse.Model.extend({ if (state) { return state.lookupCount(this.get('name'), this.get('category')); } - }.property('topicTrackingState.messageCount'), - - excludeCategory: function() { - if (parseInt(this.get('filters.length'), 10) > 0) { - return this.get('filters')[0].substring(1); - } - }.property('filters.length') - + }.property('topicTrackingState.messageCount') }); Discourse.NavItem.reopenClass({ - NAMES: <%= Discourse.top_menu_items.map(&:to_s) %>, - ANONYMOUS_NAMES: <%= Discourse.anonymous_top_menu_items.map(&:to_s) %>, // create a nav item from the text, will return null if there is not valid nav item for this particular text fromText: function(text, opts) { var split = text.split(","), name = split[0], - testName = name.split("/")[0]; + testName = name.split("/")[0], + anonymous = !Discourse.User.current(); - if (!opts.loggedOn && !Discourse.NavItem.ANONYMOUS_NAMES.contains(testName)) return null; + if (anonymous && !Discourse.Site.currentProp('anonymous_top_menu_items').contains(testName)) return null; if (!Discourse.Category.list() && testName === "categories") return null; - if (!Discourse.NavItem.NAMES.contains(testName)) return null; + if (!Discourse.Site.currentProp('top_menu_items').contains(testName)) return null; - return Discourse.NavItem.create({ - name: name, - hasIcon: name === "unread" || name === "starred", - filters: split.splice(1), - category: opts.category, + var args = { name: name, hasIcon: name === "unread" || name === "starred" }; + if (opts.category) { args.category = opts.category; } + if (opts.noSubcategories) { args.noSubcategories = true; } + return Discourse.NavItem.create(args); + }, + + buildList: function(category, args) { + args = args || {}; + if (category) { args.category = category } + + return Discourse.SiteSettings.top_menu.split("|").map(function(i) { + return Discourse.NavItem.fromText(i, args); + }).filter(function(i) { + return i !== null && !(category && i.get("name").indexOf("categor") === 0); }); } diff --git a/app/assets/javascripts/discourse/models/post_stream.js b/app/assets/javascripts/discourse/models/post_stream.js index 3a15800df05..880ad530780 100644 --- a/app/assets/javascripts/discourse/models/post_stream.js +++ b/app/assets/javascripts/discourse/models/post_stream.js @@ -251,7 +251,7 @@ Discourse.PostStream = Em.Object.extend({ self.setProperties({ loadingFilter: false, loaded: true }); Discourse.URL.set('queryParams', self.get('streamFilters')); - }).fail(function(result) { + }).catch(function(result) { self.errorLoading(result); }); }, diff --git a/app/assets/javascripts/discourse/models/top_list.js.erb b/app/assets/javascripts/discourse/models/top_list.js similarity index 89% rename from app/assets/javascripts/discourse/models/top_list.js.erb rename to app/assets/javascripts/discourse/models/top_list.js index d595ea67eb0..e5ea4d1cf08 100644 --- a/app/assets/javascripts/discourse/models/top_list.js.erb +++ b/app/assets/javascripts/discourse/models/top_list.js @@ -10,8 +10,6 @@ Discourse.TopList = Discourse.Model.extend({}); Discourse.TopList.reopenClass({ - PERIODS: <%= TopTopic.periods.map(&:to_s) %>, - find: function(period, category) { return PreloadStore.getAndRemove("top_lists", function() { var url = ""; @@ -22,7 +20,7 @@ Discourse.TopList.reopenClass({ }).then(function (result) { var topList = Discourse.TopList.create({}); - _.each(Discourse.TopList.PERIODS, function(period) { + Discourse.Site.currentProp('periods').forEach(function(period) { // if there is a list for that period if (result[period]) { // instanciate a new topic list with no sorting diff --git a/app/assets/javascripts/discourse/models/topic_list.js b/app/assets/javascripts/discourse/models/topic_list.js index 9c762f2640d..34e65c8c171 100644 --- a/app/assets/javascripts/discourse/models/topic_list.js +++ b/app/assets/javascripts/discourse/models/topic_list.js @@ -191,7 +191,6 @@ Discourse.TopicList.reopenClass({ draft_key: result.topic_list.draft_key, draft_sequence: result.topic_list.draft_sequence, draft: result.topic_list.draft, - canViewRankDetails: result.topic_list.can_view_rank_details, loaded: true }); @@ -210,9 +209,8 @@ Discourse.TopicList.reopenClass({ @param {Object} Any additional params @returns {Promise} a promise that resolves to the list of topics **/ - list: function(menuItem, params) { - var filter = menuItem.get('name'), - session = Discourse.Session.current(), + list: function(filter, params) { + var session = Discourse.Session.current(), list = session.get('topicList'); if (list && (list.get('filter') === filter) && window.location.pathname.indexOf('more') > 0) { @@ -221,7 +219,16 @@ Discourse.TopicList.reopenClass({ } session.setProperties({topicList: null, topicListScrollPos: null}); - var findParams = {exclude_category: menuItem.get('excludeCategory')}; + var findParams = {}; + Discourse.SiteSettings.top_menu.split('|').forEach(function (i) { + if (i.indexOf(filter) === 0) { + var exclude = i.split("-"); + if (exclude && exclude.length === 2) { + findParams.exclude_category = exclude[1]; + } + } + }); + return Discourse.TopicList.find(filter, _.extend(findParams, params || {})); }, diff --git a/app/assets/javascripts/discourse/models/topic_tracking_state.js b/app/assets/javascripts/discourse/models/topic_tracking_state.js index 20b82cf6e0a..51700570d28 100644 --- a/app/assets/javascripts/discourse/models/topic_tracking_state.js +++ b/app/assets/javascripts/discourse/models/topic_tracking_state.js @@ -166,7 +166,7 @@ Discourse.TopicTrackingState = Discourse.Model.extend({ }, lookupCount: function(name, category){ - var categoryName = Em.get(category, "name"); + var categoryName = category ? Em.get(category, "name") : null; if(name === "new") { return this.countNew(categoryName); } else if(name === "unread") { diff --git a/app/assets/javascripts/discourse/routes/application_routes.js b/app/assets/javascripts/discourse/routes/application_routes.js index 7f6c99a763d..4905598d59a 100644 --- a/app/assets/javascripts/discourse/routes/application_routes.js +++ b/app/assets/javascripts/discourse/routes/application_routes.js @@ -18,12 +18,10 @@ Discourse.Route.buildRoutes(function() { router.route(page, { path: '/' + page }); }); - this.resource("list", { path: "/" }, function() { + this.resource('discovery', { path: '/' }, function() { + router = this; - - // categories - this.route('categories'); - + // top this.route('top'); this.route('topCategory', { path: '/category/:slug/l/top' }); @@ -31,7 +29,7 @@ Discourse.Route.buildRoutes(function() { this.route('topCategory', { path: '/category/:parentSlug/:slug/l/top' }); // top by periods - _.each(Discourse.TopList.PERIODS, function(period) { + Discourse.Site.currentProp('periods').forEach(function(period) { var top = 'top' + period.capitalize(); router.route(top, { path: '/top/' + period }); router.route(top, { path: '/top/' + period + '/more' }); @@ -43,8 +41,7 @@ Discourse.Route.buildRoutes(function() { router.route(top + 'Category', { path: '/category/:parentSlug/:slug/l/top/' + period + '/more' }); }); - // filters - _.each(Discourse.ListController.FILTERS, function(filter) { + Discourse.Site.currentProp('filters').forEach(function(filter) { router.route(filter, { path: '/' + filter }); router.route(filter, { path: '/' + filter + '/more' }); router.route(filter + 'Category', { path: '/category/:slug/l/' + filter }); @@ -55,13 +52,14 @@ Discourse.Route.buildRoutes(function() { router.route(filter + 'Category', { path: '/category/:parentSlug/:slug/l/' + filter + '/more' }); }); + this.route('categories'); + // default filter for a category this.route('category', { path: '/category/:slug' }); this.route('category', { path: '/category/:slug/more' }); this.route('categoryNone', { path: '/category/:slug/none' }); this.route('categoryNone', { path: '/category/:slug/none/more' }); this.route('category', { path: '/category/:parentSlug/:slug' }); - this.route('category', { path: '/category/:parentSlug/:slug/more' }); // homepage var homepage = Discourse.User.current() ? Discourse.User.currentProp('homepage') : Discourse.Utilities.defaultHomepage(); diff --git a/app/assets/javascripts/discourse/routes/discovery_categories_route.js b/app/assets/javascripts/discourse/routes/discovery_categories_route.js new file mode 100644 index 00000000000..b4c6f32c1cd --- /dev/null +++ b/app/assets/javascripts/discourse/routes/discovery_categories_route.js @@ -0,0 +1,45 @@ +/** + The route for handling the "Categories" view + + @class DiscoveryCategoriesRoute + @extends Discourse.Route + @namespace Discourse + @module Discourse +**/ +Discourse.DiscoveryCategoriesRoute = Discourse.Route.extend({ + renderTemplate: function() { + this.render('navigation/categories', { outlet: 'navigation-bar' }); + this.render('discovery/categories', { outlet: 'list-container' }); + }, + + beforeModel: function() { + this.controllerFor('navigationCategories').set('filterMode', 'categories'); + }, + + model: function() { + return Discourse.CategoryList.list('categories').then(function(list) { + var tracking = Discourse.TopicTrackingState.current(); + if (tracking) { + tracking.sync(list, 'categories'); + tracking.trackIncoming('categories'); + } + return list; + }); + }, + + setupController: function(controller, model) { + controller.set('model', model); + Discourse.set('title', I18n.t('filters.categories.title')); + this.controllerFor('navigationCategories').set('canCreateCategory', model.get('can_create_category')); + }, + + actions: { + createCategory: function() { + Discourse.Route.showModal(this, 'editCategory', Discourse.Category.create({ + color: 'AB9364', text_color: 'FFFFFF', hotness: 5, group_permissions: [{group_name: 'everyone', permission_type: 1}], + available_groups: Discourse.Site.current().group_names + })); + this.controllerFor('editCategory').set('selectedTab', 'general'); + } + }, +}); diff --git a/app/assets/javascripts/discourse/routes/discovery_route.js b/app/assets/javascripts/discourse/routes/discovery_route.js new file mode 100644 index 00000000000..f7093391abc --- /dev/null +++ b/app/assets/javascripts/discourse/routes/discovery_route.js @@ -0,0 +1,25 @@ +/** + The parent route for all discovery routes. Handles the logic for showing + the loading spinners. + + @class DiscoveryRoute + @extends Discourse.Route + @namespace Discourse + @module Discourse +**/ +Discourse.DiscoveryRoute = Discourse.Route.extend({ + actions: { + loading: function() { + this.controllerFor('discovery').set('loading', true); + }, + + loadingComplete: function() { + this.controllerFor('discovery').set('loading', false); + }, + + didTransition: function() { + this.send('loadingComplete'); + } + } +}); + diff --git a/app/assets/javascripts/discourse/routes/discovery_route_builders.js b/app/assets/javascripts/discourse/routes/discovery_route_builders.js new file mode 100644 index 00000000000..0dd511ee9cc --- /dev/null +++ b/app/assets/javascripts/discourse/routes/discovery_route_builders.js @@ -0,0 +1,119 @@ +/** + A builder to create routes for topic discovery. + + @function buildTopicRoute + @param {String} filter to create route for +**/ +function buildTopicRoute(filter) { + return Discourse.Route.extend({ + renderTemplate: function() { + this.render('navigation/default', { outlet: 'navigation-bar' }); + this.render('discovery/topics', { controller: 'discoveryTopics', outlet: 'list-container' }); + }, + + beforeModel: function() { + this.controllerFor('navigationDefault').set('filterMode', filter); + }, + + model: function() { + return Discourse.TopicList.list(filter).then(function(list) { + var tracking = Discourse.TopicTrackingState.current(); + if (tracking) { + tracking.sync(list, filter); + tracking.trackIncoming(filter); + } + return list; + }); + }, + + setupController: function(controller, model) { + var filterText = I18n.t('filters.' + filter + '.title', {count: 0}); + Discourse.set('title', I18n.t('filters.with_topics', {filter: filterText})); + this.controllerFor('discoveryTopics').set('model', model); + this.controllerFor('navigationDefault').set('canCreateTopic', model.get('can_create_topic')); + } + }); +} + +/** + A builder to create routes for topic discovery within a category. + + @function buildTopicRoute + @param {String} filter to create route for + @param {Object} params with additional options +**/ +function buildCategoryRoute(filter, params) { + return Discourse.Route.extend({ + renderTemplate: function() { + this.render('navigation/category', { outlet: 'navigation-bar' }); + this.render('discovery/topics', { controller: 'discoveryTopics', outlet: 'list-container' }); + }, + + model: function(params) { + return Discourse.Category.findBySlug(params.slug, params.parentSlug); + }, + + afterModel: function(model) { + var self = this, + noSubcategories = params && !!params.no_subcategories, + filterMode = "category/" + Discourse.Category.slugFor(model) + (noSubcategories ? "/none" : "") + "/l/" + filter, + listFilter = "category/" + Discourse.Category.slugFor(model) + "/l/" + filter; + + this.controllerFor('search').set('searchContext', model); + + var opts = { category: model, filterMode: filterMode }; + opts.noSubcategories = params && params.no_subcategories; + opts.canEditCategory = Discourse.User.current('staff'); + this.controllerFor('navigationCategory').setProperties(opts); + + return Discourse.TopicList.list(listFilter, params).then(function(list) { + var tracking = Discourse.TopicTrackingState.current(); + if (tracking) { + tracking.sync(list, listFilter); + tracking.trackIncoming(listFilter); + } + + // If all the categories are the same, we can hide them + var diffCat = list.get('topics').find(function (t) { + return t.get('category') !== model; + }); + if (!diffCat) { list.set('hideCategory', true); } + self.set('topics', list); + }); + }, + + setupController: function(controller, model) { + var topics = this.get('topics'); + + var filterText = I18n.t('filters.' + filter + '.title', {count: 0}); + Discourse.set('title', I18n.t('filters.with_category', {filter: filterText, category: model.get('name').capitalize()})); + this.controllerFor('discoveryTopics').set('model', topics); + this.controllerFor('navigationCategory').set('canCreateTopic', topics.get('can_create_topic')); + this.set('topics', null); + }, + + deactivate: function() { + this._super(); + this.controllerFor('search').set('searchContext', null); + } + }); +} + +// Finally, build all the routes with the helpers we created +Discourse.addInitializer(function() { + Discourse.DiscoveryController = Em.Controller.extend({}); + Discourse.DiscoveryCategoryRoute = buildCategoryRoute('latest'); + Discourse.DiscoveryCategoryNoneRoute = buildCategoryRoute('latest', {no_subcategories: true}); + + Discourse.Site.currentProp('filters').forEach(function(filter) { + Discourse["Discovery" + filter.capitalize() + "Route"] = buildTopicRoute(filter); + Discourse["Discovery" + filter.capitalize() + "CategoryRoute"] = buildCategoryRoute(filter); + Discourse["Discovery" + filter.capitalize() + "CategoryNoneRoute"] = buildCategoryRoute(filter, {no_subcategories: true}); + }); + + Discourse.Site.currentProp('periods').forEach(function(period) { + Discourse["DiscoveryTop" + period.capitalize() + "Route"] = buildTopicRoute('top/' + period); + Discourse["DiscoveryTop" + period.capitalize() + "CategoryRoute"] = buildCategoryRoute('top/' + period); + Discourse["DiscoveryTop" + period.capitalize() + "CategoryNoneRoute"] = buildCategoryRoute('top/' + period, {no_subcategories: true}); + }); +}, true); diff --git a/app/assets/javascripts/discourse/routes/discovery_top_route.js b/app/assets/javascripts/discourse/routes/discovery_top_route.js new file mode 100644 index 00000000000..e07777c59fc --- /dev/null +++ b/app/assets/javascripts/discourse/routes/discovery_top_route.js @@ -0,0 +1,40 @@ +/** + Handles the routes related to "Top" + + @class DiscoveryTopRoute + @extends Discourse.Route + @namespace Discourse + @module Discourse +**/ +Discourse.DiscoveryTopRoute = Discourse.Route.extend({ + model: function(params) { + return Discourse.Category.findBySlug(params.slug, params.parentSlug); + }, + + beforeModel: function() { + this.controllerFor('navigationCategory').set('filterMode', 'top'); + }, + + afterModel: function(model) { + var self = this; + return Discourse.TopList.find(null, model).then(function(list) { + self.set('topics', list); + }); + }, + + renderTemplate: function() { + this.render('navigation/category', { outlet: 'navigation-bar' }); + this.render('discovery/top', { outlet: 'list-container' }); + }, + + setupController: function(controller, model) { + this.controllerFor('discoveryTop').set('model', this.get('topics')); + this.controllerFor('discoveryTop').set('category', model); + this.controllerFor('navigationCategory').set('category', model); + Discourse.set('title', I18n.t('filters.top.title')); + this.set('topics', null); + } +}); + +Discourse.DiscoveryTopCategoryRoute = Discourse.DiscoveryTopRoute.extend({}); +Discourse.DiscoveryTopCategoryNoneRoute = Discourse.DiscoveryTopRoute.extend({}); diff --git a/app/assets/javascripts/discourse/routes/filtered_list_route.js b/app/assets/javascripts/discourse/routes/filtered_list_route.js deleted file mode 100644 index a1d0ec94f3d..00000000000 --- a/app/assets/javascripts/discourse/routes/filtered_list_route.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - A class used to handle filtering routes such as latest, hot, read, etc. - - @class FilteredListRoute - @extends Discourse.Route - @namespace Discourse - @module Discourse -**/ -Discourse.FilteredListRoute = Discourse.Route.extend({ - - redirect: function() { Discourse.redirectIfLoginRequired(this); }, - - renderTemplate: function() { - this.render('listTopics', { into: 'list', outlet: 'listView', controller: 'listTopics' }); - }, - - setupController: function() { - var listController = this.controllerFor('list'), - listTopicsController = this.controllerFor('listTopics'); - - listController.set('filterMode', this.filter); - - var listContent = listTopicsController.get('model'); - if (listContent) { - listContent.set('loaded', false); - } - - listController.set('category', null); - listController.load(this.filter).then(function(topicList) { - listController.set('canCreateTopic', topicList.get('can_create_topic')); - listTopicsController.set('model', topicList); - Discourse.FilteredListRoute.scrollToLastPosition(); - }); - }, - - deactivate: function() { - this._super(); - - this.controllerFor('list').setProperties({ - canCreateTopic: false, - filterMode: '' - }); - }, -}); - -Discourse.FilteredListRoute.reopenClass({ - scrollToLastPosition: function() { - var scrollPos = Discourse.Session.currentProp('topicListScrollPosition'); - if (scrollPos) { - Em.run.next(function() { $('html, body').scrollTop(scrollPos); }); - Discourse.Session.currentProp('topicListScrollPosition', null); - } - } -}); - -_.each(Discourse.ListController.FILTERS, function(filter) { - Discourse["List" + filter.capitalize() + "Route"] = Discourse.FilteredListRoute.extend({ filter: filter }); -}); - -_.each(Discourse.TopList.PERIODS, function(period) { - Discourse["ListTop" + period.capitalize() + "Route"] = Discourse.FilteredListRoute.extend({ filter: "top/" + period }); -}); diff --git a/app/assets/javascripts/discourse/routes/list_categories_route.js b/app/assets/javascripts/discourse/routes/list_categories_route.js deleted file mode 100644 index 8d3c2f3bc20..00000000000 --- a/app/assets/javascripts/discourse/routes/list_categories_route.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - The route for listing categories. - - @class ListCategoriesRoute - @extends Discourse.Route - @namespace Discourse - @module Discourse -**/ -Discourse.ListCategoriesRoute = Discourse.Route.extend({ - - model: function() { - this.controllerFor('listTop').set('content', null); - this.controllerFor('listTopics').set('content', null); - return this.controllerFor('list').load('categories'); - }, - - activate: function() { - this._super(); - this.controllerFor('list').setProperties({ filterMode: 'categories', category: null }); - }, - - redirect: function() { Discourse.redirectIfLoginRequired(this); }, - - afterModel: function(categoryList) { - this.controllerFor('list').setProperties({ - canCreateCategory: categoryList.get('can_create_category'), - canCreateTopic: categoryList.get('can_create_topic') - }); - }, - - renderTemplate: function() { - this.render('listCategories', { into: 'list', outlet: 'listView' }); - }, - - deactivate: function() { - this._super(); - this.controllerFor('list').set('canCreateCategory', false); - }, - - actions: { - createCategory: function() { - Discourse.Route.showModal(this, 'editCategory', Discourse.Category.create({ - color: 'AB9364', text_color: 'FFFFFF', hotness: 5, group_permissions: [{group_name: 'everyone', permission_type: 1}], - available_groups: Discourse.Site.current().group_names - })); - this.controllerFor('editCategory').set('selectedTab', 'general'); - } - }, - -}); diff --git a/app/assets/javascripts/discourse/routes/list_category_route.js b/app/assets/javascripts/discourse/routes/list_category_route.js deleted file mode 100644 index 093378bb412..00000000000 --- a/app/assets/javascripts/discourse/routes/list_category_route.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - This route is used when listing a particular category's topics - - @class ListCategoryRoute - @extends Discourse.Route - @namespace Discourse - @module Discourse -**/ -Discourse.ListCategoryRoute = Discourse.FilteredListRoute.extend({ - - model: function(params) { - this.controllerFor('listTop').set('content', null); - this.controllerFor('listCategories').set('content', null); - return Discourse.Category.findBySlug(params.slug, params.parentSlug); - }, - - activate: function() { - this._super(); - // Add a search context - this.controllerFor('search').set('searchContext', this.modelFor(this.get('routeName')).get('searchContext')); - }, - - setupController: function(controller, category) { - var listTopicsController = this.controllerFor('listTopics'); - if (listTopicsController) { - var listContent = listTopicsController.get('content'); - if (listContent) { - listContent.set('loaded', false); - } - } - - var listController = this.controllerFor('list'), - categorySlug = Discourse.Category.slugFor(category), - self = this, - filter = this.get('filter') || "latest", - url = "category/" + categorySlug + "/l/" + filter, - params = {}; - - if (this.get('noSubcategories')) { - params.no_subcategories = true; - } - - listController.setProperties({ filterMode: url, category: null }); - listController.load(url, params).then(function(topicList) { - listController.setProperties({ - canCreateTopic: topicList.get('can_create_topic'), - category: category - }); - self.controllerFor('listTopics').setProperties({ - content: topicList, - category: category - }); - Discourse.FilteredListRoute.scrollToLastPosition(); - }); - }, - - deactivate: function() { - this._super(); - // Clear the search context - this.controllerFor('search').set('searchContext', null); - } -}); - -Discourse.ListCategoryNoneRoute = Discourse.ListCategoryRoute.extend({ noSubcategories: true }); - -_.each(Discourse.ListController.FILTERS, function(filter) { - Discourse["List" + filter.capitalize() + "CategoryRoute"] = Discourse.ListCategoryRoute.extend({ filter: filter }); - Discourse["List" + filter.capitalize() + "CategoryNoneRoute"] = Discourse.ListCategoryRoute.extend({ filter: filter, noSubcategories: true }); -}); - -_.each(Discourse.TopList.PERIODS, function(period) { - Discourse["ListTop" + period.capitalize() + "CategoryRoute"] = Discourse.ListCategoryRoute.extend({ filter: "top/" + period }); - Discourse["ListTop" + period.capitalize() + "CategoryNoneRoute"] = Discourse.ListCategoryRoute.extend({ filter: "top/" + period, noSubcategories: true }); -}); diff --git a/app/assets/javascripts/discourse/routes/list_top_route.js b/app/assets/javascripts/discourse/routes/list_top_route.js deleted file mode 100644 index 7b14f4a70e4..00000000000 --- a/app/assets/javascripts/discourse/routes/list_top_route.js +++ /dev/null @@ -1,42 +0,0 @@ -Discourse.ListTopRoute = Discourse.Route.extend({ - - model: function(params) { - this.controllerFor('listCategories').set('content', null); - this.controllerFor('listTopics').set('content', null); - this.controllerFor('list').set('loading', true); - - var category = Discourse.Category.findBySlug(params.slug, params.parentSlug); - if (category) { this.set('category', category); } - - return Discourse.TopList.find(this.period, category); - }, - - activate: function() { - this._super(); - this.controllerFor('list').setProperties({ filterMode: 'top', category: null }); - }, - - redirect: function() { Discourse.redirectIfLoginRequired(this); }, - - setupController: function(controller, model) { - var category = this.get('category'), - categorySlug = Discourse.Category.slugFor(category), - url = category === undefined ? 'top' : 'category/' + categorySlug + '/l/top'; - - this.controllerFor('listTop').setProperties({ content: model, category: category }); - this.controllerFor('list').setProperties({ loading: false, filterMode: url }); - - if (category !== undefined) { - this.controllerFor('list').set('category', category); - } - - Discourse.set('title', I18n.t('filters.top.title')); - }, - - renderTemplate: function() { - this.render('listTop', { into: 'list', outlet: 'listView' }); - } - -}); - -Discourse.ListTopCategoryRoute = Discourse.ListTopRoute.extend({}); diff --git a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars index 3be634a0147..e3fbf1793eb 100644 --- a/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/basic-topic-list.js.handlebars @@ -23,7 +23,7 @@
        {{number topic.views numberKey="views_long"}}{{number topic.views numberKey="views_long"}} {{unboundAge topic.created_at}} diff --git a/app/assets/javascripts/discourse/templates/components/bread-crumbs.js.handlebars b/app/assets/javascripts/discourse/templates/components/bread-crumbs.js.handlebars index 3608f605a9d..ed285277f6c 100644 --- a/app/assets/javascripts/discourse/templates/components/bread-crumbs.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/bread-crumbs.js.handlebars @@ -8,4 +8,4 @@ {{/if}} -
        \ No newline at end of file +
        diff --git a/app/assets/javascripts/discourse/templates/components/category-drop.js.handlebars b/app/assets/javascripts/discourse/templates/components/category-drop.js.handlebars index 6fba55b3f21..f934c3b8c11 100644 --- a/app/assets/javascripts/discourse/templates/components/category-drop.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/category-drop.js.handlebars @@ -1,20 +1,19 @@ {{#if category}} - {{category.name}} + {{category.name}} {{else}} {{#if noSubcategories}} - {{i18n categories.no_subcategory}} + {{i18n categories.no_subcategory}} {{else}} - {{allCategoriesLabel}} + {{allCategoriesLabel}} {{/if}} - {{/if}} {{#if categories}} - -
        - + +
        + {{#if subCategory}} - + {{/if}} {{#each categories}}
        {{categoryLink this allowUncategorized=true}}
        {{/each}}
        diff --git a/app/assets/javascripts/discourse/templates/components/screened-ip-address-form.handlebars b/app/assets/javascripts/discourse/templates/components/screened-ip-address-form.handlebars index 04ee5701372..883c21b13f0 100644 --- a/app/assets/javascripts/discourse/templates/components/screened-ip-address-form.handlebars +++ b/app/assets/javascripts/discourse/templates/components/screened-ip-address-form.handlebars @@ -1,4 +1,4 @@ {{i18n admin.logs.screened_ips.form.label}} {{textField value=ip_address disabled=formSubmitted class="ip-address-input" placeholderKey="admin.logs.screened_ips.form.ip_address" autocorrect="off" autocapitalize="off"}} {{combobox content=actionNames value=actionName}} - + diff --git a/app/assets/javascripts/discourse/templates/components/sortable-heading.js.handlebars b/app/assets/javascripts/discourse/templates/components/sortable-heading.js.handlebars index 773a9c5ded2..36824ad2b1a 100644 --- a/app/assets/javascripts/discourse/templates/components/sortable-heading.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/sortable-heading.js.handlebars @@ -1,2 +1,2 @@ {{yield}} - + diff --git a/app/assets/javascripts/discourse/templates/components/topic-list-loading.js.handlebars b/app/assets/javascripts/discourse/templates/components/topic-list-loading.js.handlebars deleted file mode 100644 index 5883b28e7a3..00000000000 --- a/app/assets/javascripts/discourse/templates/components/topic-list-loading.js.handlebars +++ /dev/null @@ -1,3 +0,0 @@ -
        -
        {{i18n loading}}
        -
        diff --git a/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars b/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars index b9dec175766..bfe9f23839d 100644 --- a/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/topic-map.js.handlebars @@ -1,20 +1,20 @@ -
        +
        diff --git a/app/assets/javascripts/discourse/templates/components/topic-participant.js.handlebars b/app/assets/javascripts/discourse/templates/components/topic-participant.js.handlebars index 85bac6b05bf..bcaf945256e 100644 --- a/app/assets/javascripts/discourse/templates/components/topic-participant.js.handlebars +++ b/app/assets/javascripts/discourse/templates/components/topic-participant.js.handlebars @@ -1,4 +1,4 @@ - + {{unbound participant.post_count}} {{avatar participant imageSize="medium"}} - \ No newline at end of file + diff --git a/app/assets/javascripts/discourse/templates/composer.js.handlebars b/app/assets/javascripts/discourse/templates/composer.js.handlebars index bc0eb344f88..2ab00eecaaf 100644 --- a/app/assets/javascripts/discourse/templates/composer.js.handlebars +++ b/app/assets/javascripts/discourse/templates/composer.js.handlebars @@ -67,7 +67,7 @@ {{popupInputTip validation=view.replyValidation shownAt=view.showReplyTip}}
        -
        +
        {{#if currentUser}} {{{model.toggleText}}} @@ -82,7 +82,7 @@ {{#if currentUser}}
        - + {{i18n cancel}}
        {{/if}} diff --git a/app/assets/javascripts/discourse/templates/composer/education.js.handlebars b/app/assets/javascripts/discourse/templates/composer/education.js.handlebars index 7849851df4d..a4f045a133c 100644 --- a/app/assets/javascripts/discourse/templates/composer/education.js.handlebars +++ b/app/assets/javascripts/discourse/templates/composer/education.js.handlebars @@ -1,2 +1,2 @@ -{{{body}}} \ No newline at end of file +{{{body}}} diff --git a/app/assets/javascripts/discourse/templates/discovery.js.handlebars b/app/assets/javascripts/discourse/templates/discovery.js.handlebars new file mode 100644 index 00000000000..842e07f19a3 --- /dev/null +++ b/app/assets/javascripts/discourse/templates/discovery.js.handlebars @@ -0,0 +1,22 @@ +{{customHTML "top"}} + +
        +
        + {{outlet navigation-bar}} +
        +
        + +
        +
        {{i18n loading}}
        +
        + +
        +
        +
        +
        + {{outlet list-container}} +
        +
        +
        +
        + diff --git a/app/assets/javascripts/discourse/templates/list/categories.js.handlebars b/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars similarity index 93% rename from app/assets/javascripts/discourse/templates/list/categories.js.handlebars rename to app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars index 199788d9c88..81dd3c4d6be 100644 --- a/app/assets/javascripts/discourse/templates/list/categories.js.handlebars +++ b/app/assets/javascripts/discourse/templates/discovery/categories.js.handlebars @@ -13,7 +13,7 @@
        @@ -47,7 +47,7 @@
        {{/if}}
        + {{#each featuredTopics}} {{/each}} + {{#each topicCountStats}} @@ -84,7 +84,7 @@ {{/each}}
        + {{#each postCountStats}} diff --git a/app/assets/javascripts/discourse/templates/discovery/top.js.handlebars b/app/assets/javascripts/discourse/templates/discovery/top.js.handlebars new file mode 100644 index 00000000000..9bfea84d4f8 --- /dev/null +++ b/app/assets/javascripts/discourse/templates/discovery/top.js.handlebars @@ -0,0 +1,48 @@ +
        + {{#if redirectedToTopPageReason}} +
        + {{redirectedToTopPageReason}} +
        + {{/if}} + {{#if content.yearly}} +
        +

        {{i18n filters.top.this_year}}

        + {{basic-topic-list topicList=content.yearly}} + {{#if content.yearly.topics.length}}{{i18n show_more}}{{/if}} +
        + {{/if}} + {{#if content.monthly}} +
        +

        {{i18n filters.top.this_month}}

        + {{basic-topic-list topicList=content.monthly}} + {{#if content.monthly.topics.length}}{{i18n show_more}}{{/if}} +
        + {{/if}} + {{#if content.weekly}} +
        +

        {{i18n filters.top.this_week}}

        + {{basic-topic-list topicList=content.weekly}} + {{#if content.weekly.topics.length}}{{i18n show_more}}{{/if}} +
        + {{/if}} + {{#if content.daily}} +
        +

        {{i18n filters.top.today}}

        + {{basic-topic-list topicList=content.daily}} + {{#if content.daily.topics.length}}{{i18n show_more}}{{/if}} +
        + {{/if}} +
        +

        + {{#if hasDisplayedAllTopLists}} + {{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}}. + {{else}} + {{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}} + {{#unless content.yearly}}{{i18n filters.top.this_year}}{{/unless}} + {{#unless content.monthly}}{{i18n filters.top.this_month}}{{/unless}} + {{#unless content.weekly}}{{i18n filters.top.this_week}}{{/unless}} + {{#unless content.daily}}{{i18n filters.top.today}}{{/unless}} + {{/if}} +

        +
        +
        diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars b/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars new file mode 100644 index 00000000000..a556052c7d5 --- /dev/null +++ b/app/assets/javascripts/discourse/templates/discovery/topics.js.handlebars @@ -0,0 +1,70 @@ +
        + {{#if showTable}} +
        + + + {{#if currentUser}} + + {{/if}} + {{#sortable-heading sortBy="default" sortOrder=sortOrder}} + {{i18n topic.title}} + {{/sortable-heading}} + {{#unless category}} + {{#sortable-heading sortBy="category" sortOrder=sortOrder}} + {{i18n category_title}} + {{/sortable-heading}} + {{/unless}} + {{#sortable-heading sortBy="posters" sortOrder=sortOrder}} + {{i18n users}} + {{/sortable-heading}} + {{#sortable-heading sortBy="posts" number=true sortOrder=sortOrder}} + {{i18n posts}} + {{/sortable-heading}} + {{#sortable-heading sortBy="likes" number=true sortOrder=sortOrder}} + {{i18n likes}} + {{/sortable-heading}} + {{#sortable-heading sortBy="views" number=true sortOrder=sortOrder}} + {{i18n views}} + {{/sortable-heading}} + {{#sortable-heading sortBy="activity" number=true colspan="2" sortOrder=sortOrder}} + {{i18n activity}} + {{/sortable-heading}} + + + + {{#if topicTrackingState.hasIncoming}} + + + + + + {{/if}} + + {{collection contentBinding="topics" tagName="tbody" itemViewClass="Discourse.TopicListItemView"}} +
         
        +
        + {{countI18n new_topics_inserted count=topicTrackingState.incomingCount}} + {{i18n show_new_topics}} +
        +
        + {{/if}} + + +
        + {{#if loadingMore}} +
        {{i18n topic.loading_more}}
        + {{/if}} + +

        + {{footerMessage}} + {{#if allLoaded}} + {{#if latest}} + {{#if canCreateTopic}} + {{i18n topic.suggest_create_topic}} + {{/if}} + {{else}} + {{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} + {{/if}} + {{/if}} +

        +
        diff --git a/app/assets/javascripts/discourse/templates/embedded_post.js.handlebars b/app/assets/javascripts/discourse/templates/embedded_post.js.handlebars index e5bcfbf13f4..cc07cc78c3a 100644 --- a/app/assets/javascripts/discourse/templates/embedded_post.js.handlebars +++ b/app/assets/javascripts/discourse/templates/embedded_post.js.handlebars @@ -4,7 +4,7 @@ -
        {{{breakUp username name}}}
        +
        {{{breakUp username name}}}
        diff --git a/app/assets/javascripts/discourse/templates/featured_topics.js.handlebars b/app/assets/javascripts/discourse/templates/featured_topics.js.handlebars index 0290ef5b952..2b4a48f81bd 100644 --- a/app/assets/javascripts/discourse/templates/featured_topics.js.handlebars +++ b/app/assets/javascripts/discourse/templates/featured_topics.js.handlebars @@ -22,7 +22,7 @@ {{/if}} {{#each topics}} -
        - + {{categoryLink category}} {{number views numberKey="views_long"}}{{number views numberKey="views_long"}} diff --git a/app/assets/javascripts/discourse/templates/list/topics.js.handlebars b/app/assets/javascripts/discourse/templates/list/topics.js.handlebars deleted file mode 100644 index 01dbdd47fe6..00000000000 --- a/app/assets/javascripts/discourse/templates/list/topics.js.handlebars +++ /dev/null @@ -1,85 +0,0 @@ -{{topic-list-loading loading=topicListReloading}} - -{{#unless loading}} - {{#if loaded}} -
        - {{#if view.showTable}} - - {{#if canViewRankDetails}} - - {{/if}} - - - - - {{#if currentUser}} - - {{/if}} - {{#sortable-heading sortBy="default" sortOrder=sortOrder}} - {{i18n topic.title}} - {{/sortable-heading}} - {{#unless category}} - {{#sortable-heading sortBy="category" sortOrder=sortOrder}} - {{i18n category_title}} - {{/sortable-heading}} - {{/unless}} - {{#sortable-heading sortBy="posters" sortOrder=sortOrder}} - {{i18n users}} - {{/sortable-heading}} - {{#sortable-heading sortBy="posts" number=true sortOrder=sortOrder}} - {{i18n posts}} - {{/sortable-heading}} - {{#sortable-heading sortBy="likes" number=true sortOrder=sortOrder}} - {{i18n likes}} - {{/sortable-heading}} - {{#sortable-heading sortBy="views" number=true sortOrder=sortOrder}} - {{i18n views}} - {{/sortable-heading}} - {{#sortable-heading sortBy="activity" number=true colspan="2" sortOrder=sortOrder}} - {{i18n activity}} - {{/sortable-heading}} - - - - {{#if view.topicTrackingState.hasIncoming}} - - - - - - {{/if}} - - {{collection contentBinding="topics" tagName="tbody" itemViewClass="Discourse.TopicListItemView"}} - -
         
        -
        - {{countI18n new_topics_inserted countBinding="view.topicTrackingState.incomingCount"}} - {{i18n show_new_topics}} -
        -
        - {{/if}} -
        - -
        - {{#if loadingMore}} -
        {{i18n topic.loading_more}}
        - {{/if}} - -

        - {{footerMessage}} - {{#if allLoaded}} - {{#if latest}} - {{#if canCreateTopic}} - {{i18n topic.suggest_create_topic}} - {{/if}} - {{else}} - {{#link-to "list.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'list.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} - {{/if}} - {{/if}} -

        -
        - {{/if}} -{{/unless}} diff --git a/app/assets/javascripts/discourse/templates/mobile/components/basic-topic-list.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/components/basic-topic-list.js.handlebars index a7ab59e4639..0e0f26db88e 100644 --- a/app/assets/javascripts/discourse/templates/mobile/components/basic-topic-list.js.handlebars +++ b/app/assets/javascripts/discourse/templates/mobile/components/basic-topic-list.js.handlebars @@ -2,7 +2,7 @@ {{#if topics}} {{#groupedEach topic in topics}} - + \ No newline at end of file + diff --git a/app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars index f921669a6c2..070f9c25bd7 100644 --- a/app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars +++ b/app/assets/javascripts/discourse/templates/mobile/list/topics.js.handlebars @@ -2,13 +2,6 @@ {{#if loaded}}
        {{#if view.showTable}} - {{#if canViewRankDetails}} - - {{/if}} -
        {{/if}} -
        +
        {{number views numberKey="views_long"}} diff --git a/app/assets/javascripts/discourse/templates/mobile/list/categories.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/list/categories.js.handlebars index b58458b3644..ddc4a4dbe15 100644 --- a/app/assets/javascripts/discourse/templates/mobile/list/categories.js.handlebars +++ b/app/assets/javascripts/discourse/templates/mobile/list/categories.js.handlebars @@ -1 +1 @@ -{{each categories itemViewClass="Discourse.FeaturedTopicsView"}} \ No newline at end of file +{{each categories itemViewClass="Discourse.FeaturedTopicsView"}} diff --git a/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.js.handlebars index bbd18a921a3..fb6ad47102b 100644 --- a/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.js.handlebars +++ b/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.js.handlebars @@ -1,16 +1,5 @@
        -
        {{#if view.topicTrackingState.hasIncoming}} @@ -43,7 +36,7 @@ {{i18n topic.suggest_create_topic}} {{/if}} {{else}} - {{#link-to 'list.categories'}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'list.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} + {{#link-to 'discovery.categories'}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{/if}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/mobile/modal/login.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/modal/login.js.handlebars index 8b7bf12ebf7..a97ec8a352d 100644 --- a/app/assets/javascripts/discourse/templates/mobile/modal/login.js.handlebars +++ b/app/assets/javascripts/discourse/templates/mobile/modal/login.js.handlebars @@ -41,7 +41,7 @@ {{/if}} {{authMessage}} -
        {{alert}}
        +
        {{alert}}
        \ No newline at end of file + diff --git a/app/assets/javascripts/discourse/templates/modal/auto_close.js.handlebars b/app/assets/javascripts/discourse/templates/modal/auto_close.js.handlebars index afd3f4392ea..15ac4ffcddd 100644 --- a/app/assets/javascripts/discourse/templates/modal/auto_close.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/auto_close.js.handlebars @@ -3,7 +3,7 @@ {{auto-close-form autoCloseTime=auto_close_time autoCloseValid=auto_close_valid}} diff --git a/app/assets/javascripts/discourse/templates/modal/avatar_selector.js.handlebars b/app/assets/javascripts/discourse/templates/modal/avatar_selector.js.handlebars index 7585b163050..1b7e54cc4a1 100644 --- a/app/assets/javascripts/discourse/templates/modal/avatar_selector.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/avatar_selector.js.handlebars @@ -14,7 +14,7 @@ {{i18n user.change_avatar.uploaded_avatar_empty}} {{/if}} - @@ -29,6 +29,6 @@ diff --git a/app/assets/javascripts/discourse/templates/modal/create_account.js.handlebars b/app/assets/javascripts/discourse/templates/modal/create_account.js.handlebars index e3977d27544..fa44cceaf8f 100644 --- a/app/assets/javascripts/discourse/templates/modal/create_account.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/create_account.js.handlebars @@ -67,11 +67,11 @@ -{{/unless}} \ No newline at end of file +{{/unless}} diff --git a/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars b/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars index 6057ca5700b..8a63285afda 100644 --- a/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars @@ -1,20 +1,20 @@ -
        +
        diff --git a/app/assets/javascripts/discourse/templates/modal/invite_private.js.handlebars b/app/assets/javascripts/discourse/templates/modal/invite_private.js.handlebars index 4fab3aa1836..46fdc24792b 100644 --- a/app/assets/javascripts/discourse/templates/modal/invite_private.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/invite_private.js.handlebars @@ -17,7 +17,7 @@ {{#if finished}} {{else}} - + {{/if}}
        diff --git a/app/assets/javascripts/discourse/templates/modal/login.js.handlebars b/app/assets/javascripts/discourse/templates/modal/login.js.handlebars index 85ef001a807..3f987c6fa21 100644 --- a/app/assets/javascripts/discourse/templates/modal/login.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/login.js.handlebars @@ -38,12 +38,12 @@ {{/if}} {{authMessage}} -
        {{alert}}
        +
        {{alert}}
        \ No newline at end of file + + diff --git a/app/assets/javascripts/discourse/templates/modal/not_activated.js.handlebars b/app/assets/javascripts/discourse/templates/modal/not_activated.js.handlebars index c536081ae5b..182dc57787d 100644 --- a/app/assets/javascripts/discourse/templates/modal/not_activated.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/not_activated.js.handlebars @@ -8,4 +8,4 @@ \ No newline at end of file + diff --git a/app/assets/javascripts/discourse/templates/modal/split_topic.js.handlebars b/app/assets/javascripts/discourse/templates/modal/split_topic.js.handlebars index d37cc5e6cc7..4bad9d2bd19 100644 --- a/app/assets/javascripts/discourse/templates/modal/split_topic.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/split_topic.js.handlebars @@ -18,5 +18,5 @@ \ No newline at end of file + + diff --git a/app/assets/javascripts/discourse/templates/modal/upload_selector.js.handlebars b/app/assets/javascripts/discourse/templates/modal/upload_selector.js.handlebars index 854acf20d48..91ea5227e8c 100644 --- a/app/assets/javascripts/discourse/templates/modal/upload_selector.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/upload_selector.js.handlebars @@ -30,7 +30,7 @@ -
        +
        {{#if showUserReplyTab}} @@ -20,9 +20,9 @@
        {{#if user}} @@ -60,4 +60,4 @@ {{i18n user.invited.none}} {{/if}} - \ No newline at end of file + diff --git a/app/assets/javascripts/discourse/templates/user/preferences.js.handlebars b/app/assets/javascripts/discourse/templates/user/preferences.js.handlebars index 68cc0fd14c7..903003ed1b3 100644 --- a/app/assets/javascripts/discourse/templates/user/preferences.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/preferences.js.handlebars @@ -155,7 +155,7 @@
        - + {{#if saved}}{{i18n saved}}{{/if}}
        diff --git a/app/assets/javascripts/discourse/templates/user/stream.js.handlebars b/app/assets/javascripts/discourse/templates/user/stream.js.handlebars index 953895c2aa5..4f3972ef299 100644 --- a/app/assets/javascripts/discourse/templates/user/stream.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/stream.js.handlebars @@ -1,5 +1,5 @@ {{#groupedEach model.content}} -
        - {{#linkTo 'user' user}}{{avatar user imageSize="tiny"}}{{/linkTo}} - {{#linkTo 'user' user}}{{user.username}}{{/linkTo}} + {{#link-to 'user' user}}{{avatar user imageSize="tiny"}}{{/link-to}} + {{#link-to 'user' user}}{{user.username}}{{/link-to}} {{unboundDate redeemed_at}} {{unboundDate user.last_seen_at}}