diff --git a/app/assets/javascripts/discourse/templates/mobile/.gitkeep b/app/assets/javascripts/discourse/templates/mobile/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/assets/javascripts/discourse/templates/mobile/topic.js.handlebars b/app/assets/javascripts/discourse/templates/mobile/topic.js.handlebars deleted file mode 100644 index f2a45cebe11..00000000000 --- a/app/assets/javascripts/discourse/templates/mobile/topic.js.handlebars +++ /dev/null @@ -1,9 +0,0 @@ -{{#if postStream.loaded}} -
- Mobile Topic Page Loaded! -
-{{else}} -
-
{{i18n loading}}
-
-{{/if}} \ No newline at end of file diff --git a/app/assets/stylesheets/application.css.erb b/app/assets/stylesheets/application.css.erb index 78d8f11823b..8e7e930220c 100644 --- a/app/assets/stylesheets/application.css.erb +++ b/app/assets/stylesheets/application.css.erb @@ -1,17 +1,4 @@ // Manifest // -//= require ./vendor/normalize -//= require ./vendor/bootstrap -//= require ./foundation/base -//= require ./vendor/font_awesome/font-awesome -//= require ./vendor/chosen -//= require_tree ./components +//= require common //= require_tree ./application -//= require ./foundation/helpers -<% - # TODO this is very tricky, we want to add a dependency here on files that may not yet exist - # otherwise in dev we are often stuck nuking the tmp/cache directory - DiscoursePluginRegistry.stylesheets.each do |css| - require_asset(css) - end -%> diff --git a/app/assets/stylesheets/common.css.erb b/app/assets/stylesheets/common.css.erb new file mode 100644 index 00000000000..50f5249ee1e --- /dev/null +++ b/app/assets/stylesheets/common.css.erb @@ -0,0 +1,16 @@ +// Manifest +// +//= require ./vendor/normalize +//= require ./vendor/bootstrap +//= require ./foundation/base +//= require ./vendor/font_awesome/font-awesome +//= require ./vendor/chosen +//= require_tree ./components +//= require ./foundation/helpers +<% + # TODO this is very tricky, we want to add a dependency here on files that may not yet exist + # otherwise in dev we are often stuck nuking the tmp/cache directory + DiscoursePluginRegistry.stylesheets.each do |css| + require_asset(css) + end +%> diff --git a/app/assets/stylesheets/mobile.css.erb b/app/assets/stylesheets/mobile.css.erb new file mode 100644 index 00000000000..54d3e8e87c6 --- /dev/null +++ b/app/assets/stylesheets/mobile.css.erb @@ -0,0 +1,9 @@ +// Manifest +// +//= require common +//= require_tree ./mobile +// +// For now, include all desktop css. But once we add files in ./mobile that override +// files in ./application, we'll need to only include the files we need: +// +//= require_tree ./application \ No newline at end of file diff --git a/app/assets/stylesheets/mobile/.gitkeep b/app/assets/stylesheets/mobile/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/views/common/_discourse_stylesheet.html.erb b/app/views/common/_discourse_stylesheet.html.erb index 3c8b93a4e48..1312283bbad 100644 --- a/app/views/common/_discourse_stylesheet.html.erb +++ b/app/views/common/_discourse_stylesheet.html.erb @@ -1,8 +1,13 @@ <%- unless SiteCustomization.override_default_style(session[:preview_style]) %> - <%=stylesheet_link_tag "application"%> + <% if mobile_view? %> + <%= stylesheet_link_tag "mobile" %> + <% else %> + <%= stylesheet_link_tag "application" %> + <% end %> <%- end %> <%- if staff? %> <%= stylesheet_link_tag "admin"%> <%-end%> + <%=SiteCustomization.custom_stylesheet(session[:preview_style])%>