diff --git a/Gemfile b/Gemfile index 4873ae0..dbf24ea 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,14 @@ gem 'bson_ext' gem 'mongoid_slug', github: 'digitalplaywright/mongoid-slug' gem 'carrierwave' gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid' +gem 'mongoid-grid_fs', github: 'ahoward/mongoid-grid_fs' +gem 'anjlab-bootstrap-rails', :require => 'bootstrap-rails', + :github => 'anjlab/bootstrap-rails', + :branch => '3.0.0' + +gem "font-awesome-rails", github: "bokmann/font-awesome-rails" +gem 'rmagick' # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index cd0ee63..88d7ae7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,27 @@ +GIT + remote: git://github.com/ahoward/mongoid-grid_fs.git + revision: 059012a2c2a9e0a5d6e67137752c3e918689c88a + specs: + mongoid-grid_fs (1.9.0) + mime-types (~> 1.19) + mongoid (>= 3.0, < 5.0) + +GIT + remote: git://github.com/anjlab/bootstrap-rails.git + revision: addb7143365f97f938e3bdbb2ccfc52591230eda + branch: 3.0.0 + specs: + anjlab-bootstrap-rails (3.0.0.rc2) + railties (>= 3.0) + sass (>= 3.2) + +GIT + remote: git://github.com/bokmann/font-awesome-rails.git + revision: 24ad375ed3db511c84310085889b2cbf0f650420 + specs: + font-awesome-rails (4.0.3.0) + railties (>= 3.2, < 5.0) + GIT remote: git://github.com/digitalplaywright/mongoid-slug.git revision: fb929a5d5b2a580fed367c6cd25772ce9e92e80a @@ -108,6 +132,7 @@ GEM rake (10.1.1) rdoc (3.12.2) json (~> 1.4) + rmagick (2.13.2) sass (3.2.13) sass-rails (4.0.1) railties (>= 4.0.0, < 5.0) @@ -144,16 +169,20 @@ PLATFORMS ruby DEPENDENCIES + anjlab-bootstrap-rails! bson_ext carrierwave carrierwave-mongoid coffee-rails (~> 4.0.0) + font-awesome-rails! jbuilder (~> 1.2) jquery-rails mongoid! + mongoid-grid_fs! mongoid_slug! puma rails (= 4.0.2) + rmagick sass-rails (~> 4.0.0) sdoc turbolinks diff --git a/app/assets/images/orbit-logo.png b/app/assets/images/orbit-logo.png new file mode 100644 index 0000000..5083d81 Binary files /dev/null and b/app/assets/images/orbit-logo.png differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d6925fa..3885622 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,5 +12,6 @@ // //= require jquery //= require jquery_ujs +//= require twitter/bootstrap //= require turbolinks //= require_tree . diff --git a/app/assets/javascripts/extensions.js.coffee b/app/assets/javascripts/extensions.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/extensions.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3192ec8..f2ea9a9 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -9,5 +9,7 @@ * compiled file, but it's generally better to create a new file per style scope. * *= require_self + *= require twitter/bootstrap + *= require sticky-footer-navbar *= require_tree . */ diff --git a/app/assets/stylesheets/extensions.css.scss b/app/assets/stylesheets/extensions.css.scss new file mode 100644 index 0000000..996db48 --- /dev/null +++ b/app/assets/stylesheets/extensions.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the extensions controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/sticky-footer-navbar.css b/app/assets/stylesheets/sticky-footer-navbar.css new file mode 100644 index 0000000..6978a99 --- /dev/null +++ b/app/assets/stylesheets/sticky-footer-navbar.css @@ -0,0 +1,46 @@ +/* Sticky footer styles +-------------------------------------------------- */ + +html, +body { + height: 100%; + /* The html and body elements cannot have any padding or margin. */ +} + +/* Wrapper for page content to push down footer */ +#wrap { + min-height: 100%; + height: auto !important; + height: 100%; + /* Negative indent footer by its height */ + margin: 0 auto -60px; + /* Pad bottom by footer height */ + padding: 0 0 60px; +} + +/* Set the fixed height of the footer here */ +#footer { + height: 60px; + background-color: #f5f5f5; +} + + +/* Custom page CSS +-------------------------------------------------- */ +/* Not required for template or sticky footer method. */ + +#wrap > .container { + padding: 60px 15px 0; +} +.container .credit { + margin: 20px 0; +} + +#footer > .container { + padding-left: 15px; + padding-right: 15px; +} + +code { + font-size: 80%; +} \ No newline at end of file diff --git a/app/controllers/api/v1/extensions_controller.rb b/app/controllers/api/v1/extensions_controller.rb new file mode 100644 index 0000000..736e434 --- /dev/null +++ b/app/controllers/api/v1/extensions_controller.rb @@ -0,0 +1,15 @@ +module Api + module V1 + class ExtensionsController < ApplicationController + respond_to :json + + def index + respond_with Extension.all + end + + def show + respond_with Extension.find(params[:id]) + end + end + end +end diff --git a/app/controllers/api/v1/templates_controller.rb b/app/controllers/api/v1/templates_controller.rb index a4875de..4c72edd 100644 --- a/app/controllers/api/v1/templates_controller.rb +++ b/app/controllers/api/v1/templates_controller.rb @@ -1,74 +1,15 @@ -class TemplatesController < ApplicationController - before_action :set_template, only: [:show, :edit, :update, :destroy] +module Api + module V1 + class TemplatesController < ApplicationController + respond_to :json - # GET /templates - # GET /templates.json - def index - @templates = Template.all - end + def index + respond_with Template.all + end - # GET /templates/1 - # GET /templates/1.json - def show - end - - # GET /templates/new - def new - @template = Template.new - end - - # GET /templates/1/edit - def edit - end - - # POST /templates - # POST /templates.json - def create - @template = Template.new(template_params) - - respond_to do |format| - if @template.save - format.html { redirect_to @template, notice: 'Template was successfully created.' } - format.json { render action: 'show', status: :created, location: @template } - else - format.html { render action: 'new' } - format.json { render json: @template.errors, status: :unprocessable_entity } + def show + respond_with Template.find(params[:id]) end end end - - # PATCH/PUT /templates/1 - # PATCH/PUT /templates/1.json - def update - respond_to do |format| - if @template.update(template_params) - format.html { redirect_to @template, notice: 'Template was successfully updated.' } - format.json { head :no_content } - else - format.html { render action: 'edit' } - format.json { render json: @template.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /templates/1 - # DELETE /templates/1.json - def destroy - @template.destroy - respond_to do |format| - format.html { redirect_to templates_url } - format.json { head :no_content } - end - end - - private - # Use callbacks to share common setup or constraints between actions. - def set_template - @template = Template.find(params[:id]) - end - - # Never trust parameters from the scary internet, only allow the white list through. - def template_params - params.require(:template).permit(:title, :author) - end end diff --git a/app/controllers/extensions_controller.rb b/app/controllers/extensions_controller.rb new file mode 100644 index 0000000..d51d301 --- /dev/null +++ b/app/controllers/extensions_controller.rb @@ -0,0 +1,74 @@ +class ExtensionsController < ApplicationController + before_action :set_extension, only: [:show, :edit, :update, :destroy] + + # GET /extensions + # GET /extensions.json + def index + @extensions = Extension.all + end + + # GET /extensions/1 + # GET /extensions/1.json + def show + end + + # GET /extensions/new + def new + @extension = Extension.new + end + + # GET /extensions/1/edit + def edit + end + + # POST /extensions + # POST /extensions.json + def create + @extension = Extension.new(extension_params) + + respond_to do |format| + if @extension.save + format.html { redirect_to @extension, notice: 'Extension was successfully created.' } + format.json { render action: 'show', status: :created, location: @extension } + else + format.html { render action: 'new' } + format.json { render json: @extension.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /extensions/1 + # PATCH/PUT /extensions/1.json + def update + respond_to do |format| + if @extension.update(extension_params) + format.html { redirect_to @extension, notice: 'Extension was successfully updated.' } + format.json { head :no_content } + else + format.html { render action: 'edit' } + format.json { render json: @extension.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /extensions/1 + # DELETE /extensions/1.json + def destroy + @extension.destroy + respond_to do |format| + format.html { redirect_to extensions_url } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_extension + @extension = Extension.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def extension_params + params.require(:extension).permit(:title, :author, :preview, :preview_cache, :extension, :extension_cache) + end +end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 95f2992..9cf010c 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,4 +1,6 @@ class HomeController < ApplicationController def index + @templates = Template.desc(:created_at).limit(3) + @extensions = Extension.desc(:created_at).limit(3) end end diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index a4875de..3093a6c 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -69,6 +69,6 @@ class TemplatesController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def template_params - params.require(:template).permit(:title, :author) + params.require(:template).permit(:title, :author,:preview, :preview_cache, :template, :template_cache) end end diff --git a/app/helpers/extensions_helper.rb b/app/helpers/extensions_helper.rb new file mode 100644 index 0000000..383b12c --- /dev/null +++ b/app/helpers/extensions_helper.rb @@ -0,0 +1,2 @@ +module ExtensionsHelper +end diff --git a/app/models/extension.rb b/app/models/extension.rb new file mode 100644 index 0000000..0fd5dd6 --- /dev/null +++ b/app/models/extension.rb @@ -0,0 +1,15 @@ +class Extension + include Mongoid::Document + include Mongoid::Timestamps + include Mongoid::Slug + + field :title, type: String + field :author, type: String + field :preview, type: String + field :extension, type: String + field :description, type: String + slug :title, history: true + + mount_uploader :preview, ImageUploader + mount_uploader :extension, ProductUploader +end diff --git a/app/models/template.rb b/app/models/template.rb index 7ff7020..d1c993e 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -1,11 +1,14 @@ class Template include Mongoid::Document include Mongoid::Timestamps + include Mongoid::Slug field :title, type: String field :author, type: String + field :preview, type: String + field :template, type: String + slug :title, history: true mount_uploader :preview, ImageUploader mount_uploader :template, ProductUploader - end diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb index e8e12b7..b21ba97 100644 --- a/app/uploaders/image_uploader.rb +++ b/app/uploaders/image_uploader.rb @@ -3,7 +3,7 @@ class ImageUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: - # include CarrierWave::RMagick + include CarrierWave::RMagick # include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: @@ -32,9 +32,9 @@ class ImageUploader < CarrierWave::Uploader::Base # end # Create different versions of your uploaded files: - # version :thumb do - # process :scale => [50, 50] - # end + version :thumb do + process :resize_to_fit => [300, 300] + end # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: diff --git a/app/views/extensions/_form.html.erb b/app/views/extensions/_form.html.erb new file mode 100644 index 0000000..1d0b1ef --- /dev/null +++ b/app/views/extensions/_form.html.erb @@ -0,0 +1,37 @@ +<%= form_for(@extension) do |f| %> + <% if @extension.errors.any? %> +
+

<%= pluralize(@extension.errors.count, "error") %> prohibited this extension from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :title %>
+ <%= f.text_field :title %> +
+
+ <%= f.label :author %>
+ <%= f.text_field :author %> +
+ + + <%= f.file_field :preview %> + <%= f.hidden_field :preview_cache %> +

+ +

+ + <%= f.file_field :extension %> + <%= f.hidden_field :extension_cache %> +

+ +
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/extensions/edit.html.erb b/app/views/extensions/edit.html.erb new file mode 100644 index 0000000..732896b --- /dev/null +++ b/app/views/extensions/edit.html.erb @@ -0,0 +1,6 @@ +

Editing extension

+ +<%= render 'form' %> + +<%= link_to 'Show', @extension %> | +<%= link_to 'Back', extensions_path %> diff --git a/app/views/extensions/index.html.erb b/app/views/extensions/index.html.erb new file mode 100644 index 0000000..5894490 --- /dev/null +++ b/app/views/extensions/index.html.erb @@ -0,0 +1,10 @@ +
+ <% @extensions.each do |extension| %> +
+

<%=link_to extension.title, extension %>

+

Author: <%= extension.author %>

+

<%=image_tag extension.preview.thumb.url%>

+

<%=link_to 'Download', extension.extension.url, :class=> 'btn btn-success'%>

+

<%= link_to 'View details »'.html_safe ,extension, :class=>"btn btn-primary"%>

+
+ <%end%> \ No newline at end of file diff --git a/app/views/extensions/index.json.jbuilder b/app/views/extensions/index.json.jbuilder new file mode 100644 index 0000000..e60106f --- /dev/null +++ b/app/views/extensions/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@extensions) do |extension| + json.extract! extension, :id, :title, :author + json.url extension_url(extension, format: :json) +end diff --git a/app/views/extensions/new.html.erb b/app/views/extensions/new.html.erb new file mode 100644 index 0000000..be0a4b9 --- /dev/null +++ b/app/views/extensions/new.html.erb @@ -0,0 +1,5 @@ +

New extension

+ +<%= render 'form' %> + +<%= link_to 'Back', extensions_path %> diff --git a/app/views/extensions/show.html.erb b/app/views/extensions/show.html.erb new file mode 100644 index 0000000..5eb2902 --- /dev/null +++ b/app/views/extensions/show.html.erb @@ -0,0 +1,14 @@ +

<%= notice %>

+ +

+ Title: + <%= @extension.title %> +

+ +

+ Author: + <%= @extension.author %> +

+ +<%= link_to 'Edit', edit_extension_path(@extension) %> | +<%= link_to 'Back', extensions_path %> diff --git a/app/views/extensions/show.json.jbuilder b/app/views/extensions/show.json.jbuilder new file mode 100644 index 0000000..b6032ff --- /dev/null +++ b/app/views/extensions/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @extension, :id, :title, :author, :created_at, :updated_at diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 2085730..c49580a 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,2 +1,25 @@ -

Home#index

-

Find me in app/views/home/index.html.erb

+

Top Templates

+
+ <% @templates.each do |template| %> +
+

<%=link_to template.title, template %>

+

Author: <%= template.author %>

+

<%=image_tag template.preview.thumb.url%>

+

<%= link_to 'View details »'.html_safe ,template, :class=>"btn btn-primary"%>

+
+ <%end%> +
+ <%= link_to 'More »'.html_safe,templates_path, :class=>"btn btn-danger"%> + +

Top Modules

+
+ <% @extensions.each do |extension| %> +
+

<%=link_to extension.title, extension %>

+

Author: <%= extension.author %>

+

<%=image_tag extension.preview.thumb.url%>

+

<%= link_to 'View details »'.html_safe ,extension, :class=>"btn btn-primary"%>

+
+ <%end%> +
+ <%= link_to 'More »'.html_safe,extensions_path, :class=>"btn btn-danger"%> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ad8a4ae..f78ae93 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,14 +1,48 @@ - - - - Mtstore - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - + + + + + RulingOrbit - Template & Module Store + <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> + <%= javascript_include_tag "application", "data-turbolinks-track" => true %> + <%= csrf_meta_tags %> + + + +
+ + +
+ <%= yield %> +
+
+ diff --git a/app/views/templates/_form.html.erb b/app/views/templates/_form.html.erb index e2e0a6e..dddbbb9 100644 --- a/app/views/templates/_form.html.erb +++ b/app/views/templates/_form.html.erb @@ -24,11 +24,13 @@ <%= f.file_field :preview %> <%= f.hidden_field :preview_cache %>

+

- + <%= f.file_field :template %> <%= f.hidden_field :template_cache %>

+
<%= f.submit %>
diff --git a/app/views/templates/index.html.erb b/app/views/templates/index.html.erb index 5539104..4278696 100644 --- a/app/views/templates/index.html.erb +++ b/app/views/templates/index.html.erb @@ -1,29 +1,10 @@ -

Listing templates

- - - - - - - - - - - - - +
<% @templates.each do |template| %> -
- - - - - - - <% end %> - -
TitleAuthor
<%= template.title %><%= template.author %><%= link_to 'Show', template %><%= link_to 'Edit', edit_template_path(template) %><%= link_to 'Destroy', template, method: :delete, data: { confirm: 'Are you sure?' } %>
- -
- -<%= link_to 'New Template', new_template_path %> +
+

<%=link_to template.title, template %>

+

Author: <%= template.author %>

+

<%=image_tag template.preview.thumb.url%>

+

<%=link_to 'Download', template.template.url, :class=> 'btn btn-success'%>

+

<%= link_to 'View details »'.html_safe ,template, :class=>"btn btn-primary"%>

+
+ <%end%> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3efd98b..8340a42 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,11 +1,16 @@ +require 'api_constraints' + Mtstore::Application.routes.draw do namespace :api, defaults: {format: 'json'} do - namespace :v1 do + scope module: :v1, constraints: ApiConstraints.new(version: 1, default: :true) do resources :templates + resources :extensions end end resources :templates + resources :extensions + get "home/index" # The priority is based upon order of creation: first created -> highest priority. diff --git a/lib/api_constraints.rb b/lib/api_constraints.rb new file mode 100644 index 0000000..8663a7a --- /dev/null +++ b/lib/api_constraints.rb @@ -0,0 +1,10 @@ +class ApiConstraints + def initialize(options) + @version = options[:version] + @default = options[:default] + end + + def matches?(req) + @default || req.headers['Accept'].include?("application/vnd.example.v#{@version}") + end +end \ No newline at end of file diff --git a/public/uploads/extension/extension/52bbf74e727775758e030000/video.tar.gz b/public/uploads/extension/extension/52bbf74e727775758e030000/video.tar.gz new file mode 100644 index 0000000..9856262 Binary files /dev/null and b/public/uploads/extension/extension/52bbf74e727775758e030000/video.tar.gz differ diff --git a/public/uploads/extension/extension/52bbf9a3727775758e040000/location.zip b/public/uploads/extension/extension/52bbf9a3727775758e040000/location.zip new file mode 100644 index 0000000..076cb64 Binary files /dev/null and b/public/uploads/extension/extension/52bbf9a3727775758e040000/location.zip differ diff --git a/public/uploads/extension/preview/52bbf74e727775758e030000/Video.png b/public/uploads/extension/preview/52bbf74e727775758e030000/Video.png new file mode 100644 index 0000000..5e7ab2e Binary files /dev/null and b/public/uploads/extension/preview/52bbf74e727775758e030000/Video.png differ diff --git a/public/uploads/extension/preview/52bbf74e727775758e030000/thumb_Video.png b/public/uploads/extension/preview/52bbf74e727775758e030000/thumb_Video.png new file mode 100644 index 0000000..10c1133 Binary files /dev/null and b/public/uploads/extension/preview/52bbf74e727775758e030000/thumb_Video.png differ diff --git a/public/uploads/extension/preview/52bbf9a3727775758e040000/location.png b/public/uploads/extension/preview/52bbf9a3727775758e040000/location.png new file mode 100644 index 0000000..d0fb562 Binary files /dev/null and b/public/uploads/extension/preview/52bbf9a3727775758e040000/location.png differ diff --git a/public/uploads/extension/preview/52bbf9a3727775758e040000/thumb_location.png b/public/uploads/extension/preview/52bbf9a3727775758e040000/thumb_location.png new file mode 100644 index 0000000..0ffb361 Binary files /dev/null and b/public/uploads/extension/preview/52bbf9a3727775758e040000/thumb_location.png differ diff --git a/public/uploads/template/preview/52bab3967277757d45010000/canada.png b/public/uploads/template/preview/52bab3967277757d45010000/canada.png new file mode 100644 index 0000000..0b57acc Binary files /dev/null and b/public/uploads/template/preview/52bab3967277757d45010000/canada.png differ diff --git a/public/uploads/template/preview/52bbdd377277756cd5000000/Preview.png b/public/uploads/template/preview/52bbdd377277756cd5000000/Preview.png new file mode 100644 index 0000000..12b45fd Binary files /dev/null and b/public/uploads/template/preview/52bbdd377277756cd5000000/Preview.png differ diff --git a/public/uploads/template/preview/52bbdd377277756cd5000000/thumb_Preview.png b/public/uploads/template/preview/52bbdd377277756cd5000000/thumb_Preview.png new file mode 100644 index 0000000..51e9506 Binary files /dev/null and b/public/uploads/template/preview/52bbdd377277756cd5000000/thumb_Preview.png differ diff --git a/public/uploads/template/preview/52bbe6847277756faf000000/FGU.png b/public/uploads/template/preview/52bbe6847277756faf000000/FGU.png new file mode 100644 index 0000000..94b639b Binary files /dev/null and b/public/uploads/template/preview/52bbe6847277756faf000000/FGU.png differ diff --git a/public/uploads/template/preview/52bbe6847277756faf000000/thumb_FGU.png b/public/uploads/template/preview/52bbe6847277756faf000000/thumb_FGU.png new file mode 100644 index 0000000..c865fa9 Binary files /dev/null and b/public/uploads/template/preview/52bbe6847277756faf000000/thumb_FGU.png differ diff --git a/public/uploads/template/preview/52bbe954727775758e000000/OrbitFresh.png b/public/uploads/template/preview/52bbe954727775758e000000/OrbitFresh.png new file mode 100644 index 0000000..6bf70ab Binary files /dev/null and b/public/uploads/template/preview/52bbe954727775758e000000/OrbitFresh.png differ diff --git a/public/uploads/template/preview/52bbe954727775758e000000/thumb_OrbitFresh.png b/public/uploads/template/preview/52bbe954727775758e000000/thumb_OrbitFresh.png new file mode 100644 index 0000000..0b3f0d5 Binary files /dev/null and b/public/uploads/template/preview/52bbe954727775758e000000/thumb_OrbitFresh.png differ diff --git a/public/uploads/template/preview/52bbeb28727775758e010000/CPH.png b/public/uploads/template/preview/52bbeb28727775758e010000/CPH.png new file mode 100644 index 0000000..338688e Binary files /dev/null and b/public/uploads/template/preview/52bbeb28727775758e010000/CPH.png differ diff --git a/public/uploads/template/preview/52bbeb28727775758e010000/thumb_CPH.png b/public/uploads/template/preview/52bbeb28727775758e010000/thumb_CPH.png new file mode 100644 index 0000000..faceed8 Binary files /dev/null and b/public/uploads/template/preview/52bbeb28727775758e010000/thumb_CPH.png differ diff --git a/public/uploads/template/template/52bbdd377277756cd5000000/orbitdefault.zip b/public/uploads/template/template/52bbdd377277756cd5000000/orbitdefault.zip new file mode 100644 index 0000000..5511f1f Binary files /dev/null and b/public/uploads/template/template/52bbdd377277756cd5000000/orbitdefault.zip differ diff --git a/public/uploads/template/template/52bbe6847277756faf000000/fgu_production.zip b/public/uploads/template/template/52bbe6847277756faf000000/fgu_production.zip new file mode 100644 index 0000000..0ef0489 Binary files /dev/null and b/public/uploads/template/template/52bbe6847277756faf000000/fgu_production.zip differ diff --git a/public/uploads/template/template/52bbe954727775758e000000/orbitdefault.zip b/public/uploads/template/template/52bbe954727775758e000000/orbitdefault.zip new file mode 100644 index 0000000..5511f1f Binary files /dev/null and b/public/uploads/template/template/52bbe954727775758e000000/orbitdefault.zip differ diff --git a/public/uploads/template/template/52bbeb28727775758e010000/fgu_production.zip b/public/uploads/template/template/52bbeb28727775758e010000/fgu_production.zip new file mode 100644 index 0000000..0ef0489 Binary files /dev/null and b/public/uploads/template/template/52bbeb28727775758e010000/fgu_production.zip differ diff --git a/public/uploads/tmp/1388043068-25211-5455/Preview.png b/public/uploads/tmp/1388043068-25211-5455/Preview.png new file mode 100644 index 0000000..12b45fd Binary files /dev/null and b/public/uploads/tmp/1388043068-25211-5455/Preview.png differ diff --git a/public/uploads/tmp/1388043068-25211-5455/thumb_Preview.png b/public/uploads/tmp/1388043068-25211-5455/thumb_Preview.png new file mode 100644 index 0000000..12b45fd Binary files /dev/null and b/public/uploads/tmp/1388043068-25211-5455/thumb_Preview.png differ diff --git a/public/uploads/tmp/1388043503-27861-2522/Preview.png b/public/uploads/tmp/1388043503-27861-2522/Preview.png new file mode 100644 index 0000000..12b45fd Binary files /dev/null and b/public/uploads/tmp/1388043503-27861-2522/Preview.png differ diff --git a/public/uploads/tmp/1388043503-27861-2522/thumb_Preview.png b/public/uploads/tmp/1388043503-27861-2522/thumb_Preview.png new file mode 100644 index 0000000..12b45fd Binary files /dev/null and b/public/uploads/tmp/1388043503-27861-2522/thumb_Preview.png differ diff --git a/test/controllers/extensions_controller_test.rb b/test/controllers/extensions_controller_test.rb new file mode 100644 index 0000000..027042c --- /dev/null +++ b/test/controllers/extensions_controller_test.rb @@ -0,0 +1,49 @@ +require 'test_helper' + +class ExtensionsControllerTest < ActionController::TestCase + setup do + @extension = extensions(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:extensions) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create extension" do + assert_difference('Extension.count') do + post :create, extension: { author: @extension.author, title: @extension.title } + end + + assert_redirected_to extension_path(assigns(:extension)) + end + + test "should show extension" do + get :show, id: @extension + assert_response :success + end + + test "should get edit" do + get :edit, id: @extension + assert_response :success + end + + test "should update extension" do + patch :update, id: @extension, extension: { author: @extension.author, title: @extension.title } + assert_redirected_to extension_path(assigns(:extension)) + end + + test "should destroy extension" do + assert_difference('Extension.count', -1) do + delete :destroy, id: @extension + end + + assert_redirected_to extensions_path + end +end diff --git a/test/fixtures/extensions.yml b/test/fixtures/extensions.yml new file mode 100644 index 0000000..18ae164 --- /dev/null +++ b/test/fixtures/extensions.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + title: MyString + author: MyString + +two: + title: MyString + author: MyString diff --git a/test/helpers/extensions_helper_test.rb b/test/helpers/extensions_helper_test.rb new file mode 100644 index 0000000..48b16b3 --- /dev/null +++ b/test/helpers/extensions_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ExtensionsHelperTest < ActionView::TestCase +end diff --git a/test/models/extension_test.rb b/test/models/extension_test.rb new file mode 100644 index 0000000..a0f090d --- /dev/null +++ b/test/models/extension_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ExtensionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end