diff --git a/app/assets/stylesheets/pages/_files.scss b/app/assets/stylesheets/pages/_files.scss index c449812..3941b5c 100644 --- a/app/assets/stylesheets/pages/_files.scss +++ b/app/assets/stylesheets/pages/_files.scss @@ -44,3 +44,47 @@ margin-top: em(20); } } + +/* + Movies List +*/ + +#movies { + + .filters { + @include span-columns(12); + margin-bottom: em(20); + } +} + +table.movie { + + .controls { + @include span-columns(12); + margin: em(20) 0; + } +} + +.movie-full { + + .title { + display: none; + } + + #player { + display: block; + position: relative; + width: 100%; + height: 0px; + padding-bottom: 56%; + padding-top: 50px; + margin-bottom: em(20); + + object { + position: absolute; + width: 100%; + height: 100%; + top: 0; + } + } +} \ No newline at end of file diff --git a/app/views/movies/_form.html.erb b/app/views/movies/_form.html.erb index 3856711..c165a14 100644 --- a/app/views/movies/_form.html.erb +++ b/app/views/movies/_form.html.erb @@ -1,49 +1,50 @@ -
- <%= form_for @movie, :html => { :multipart => true } do |f| %> - <%= f.error_messages %> +<%= form_for @movie, html: { multipart: true, class: 'square' } do |f| %> + <%= render 'shared/errors', messages: @movie.errors.full_messages %> - <% if @movie.file %> - <%= link_to "Go to file", edit_data_file_path(@movie.file) %> - <% end %> - -

- <%= f.label :name %>
- <%= f.text_field :name, {:value => @movie.file.to_s} %> -

-

- <%= f.label :category_id %>
- <%= f.select :category_id, Category.ordered.collect{|c| ["#{c.domains[c.domain]} - #{c}", c.id]} %> -

-

- <%= f.label :content %>
- <%= f.text_field :content %> -

-

- <%= f.label :format %>
- <%= f.text_field :format %> -

-

- <%= f.label :length, "Length in seconds" %>
- <%= f.text_field :length %> -

-

- <%= link_to_function 'Author', "findUser('movie[user_name]')" %>
- <%= f.text_field :user_name, {:value => @movie.get_user} %> -

-

- <%= f.label :file %>
- <%= f.select :file_id, DataFile.movies.collect{|d| ["#{d.name}", d.id]}, {:include_blank => true} %> -

-

- <%= f.label :preview_id %>
- <%= f.select :preview_id, @movie.all_files.collect{|d| ["#{d.name}", d.id]}, {:include_blank => true} %> -

-

- <%= f.label :picture %>
- <%= f.file_field :picture %> -

-

- <%= f.submit 'Save' %> -

+ <% if @movie.file %> + <%= link_to "View File", edit_data_file_path(@movie.file), class: 'button tiny' %> <% end %> -
+ +
+ <%= f.label :name %> + <%= f.text_field :name, { value: @movie.file.to_s } %> +
+
+ <%= f.label :category_id %> + <%= f.select :category_id, Category.ordered.collect { |c| ["#{c.domains[c.domain]} - #{c}", c.id] } %> +
+
+ <%= f.label :content %> + <%= f.text_field :content %> +
+
+ <%= f.label :format %> + <%= f.text_field :format %> +
+
+ <%= f.label :length, "Length in seconds" %> + <%= f.text_field :length %> +
+
+ <%= f.label :user_name, "Author" %> + <%= f.text_field :user_name, { value: @movie.get_user } %> +
+
+ <%= f.label :file %> +
+ <%= f.select :file_id, DataFile.movies.collect { |d| ["#{d.name}", d.id] }, { include_blank: true } %> +
+
+
+ <%= f.label :preview_id %> + <%= f.select :preview_id, @movie.all_files.collect { |d| ["#{d.name}", d.id] }, { include_blank: true } %> +
+
+ <%= f.label :picture %> + <%= f.file_field :picture %> +
+ +
+ <%= f.submit 'Save' %> +
+<% end %> diff --git a/app/views/movies/_movie.html.erb b/app/views/movies/_movie.html.erb index 15020a2..9972900 100644 --- a/app/views/movies/_movie.html.erb +++ b/app/views/movies/_movie.html.erb @@ -1,44 +1,34 @@ -
- - - +
-
 
- <% if movie.picture %> - <%= image_tag movie.picture.url, :class => "centered" %> - <% end %> -
+ + - - -
+ <% if movie.picture %> + <%= image_tag movie.picture.url, :class => "centered" %> + <% end %> + -

- <%= namelink movie %> -

+
+

<%= namelink movie %>

+ <%= cascade movie, ["content", "format", ["Author", :user], "length_s", ["Views", "view_count"], ["Date", "file.created_at"]] %> - <%= cascade movie, ["content", "format", ["Author", :user], "length_s", ["Views", "view_count"], ["Date", "file.created_at"]] %> - - <% (params[:action] == "show" ? movie.all_files : [movie.file]).each do |file| %> -

- File: <%= link_to File.basename(file.name.to_s), file.url %> -

+ <% (params[:action] == "show" ? movie.all_files : [movie.file]).each do |file| %> + File: <%= link_to File.basename(file.name.to_s), file.url %>
  • - MD5: <%= file.md5_s %> -
  • -
  • - Size: <%= file.size_s %> MB -
  • -
- <% end %> + MD5: <%= file.md5_s %> + +
  • + Size: <%= file.size_s %> MB +
  • + + <% end %> - <% if cuser and movie.can_update? cuser %> -

    - <%= link_to 'Edit', edit_movie_path(movie) %> | - <%= link_to 'Make a Preview', :action => "preview", :id => movie %> | - <%= link_to 'Destroy', movie, :confirm => 'Are you sure?', :method => :delete %> -

    - <% end %> -
    -
    -
    -
    + <% if cuser and movie.can_update? cuser %> +
    + <%= link_to 'Edit', edit_movie_path(movie), class: 'button tiny' %> + <%= link_to 'Make a Preview', { action: "preview", id: movie }, class: 'button tiny' %> + <%= link_to 'Destroy', movie, confirm: 'Are you sure?', method: :delete, class: 'button tiny' %> +
    + <% end %> + + + diff --git a/app/views/movies/edit.html.erb b/app/views/movies/edit.html.erb index 46c0f64..d12cc0f 100644 --- a/app/views/movies/edit.html.erb +++ b/app/views/movies/edit.html.erb @@ -1,60 +1,65 @@ -

    Editing movie

    +

    Editing Movie

    -<%= render :partial => "form" %> +<%= render partial: 'form' %> -
    -

    - Make a preview -

    +
    +

    Make a Preview

    This will produce a MP4-version preview of the file. It will take usually 3-4 times the movie length. The program will run in the background and the preview file will automatically added to the movie.

    - <%= form_tag :action => "preview", :id => @movie.id do %> -

    - Resolution: <%= text_field_tag "x", "800", :size => 2 %> x <%= text_field_tag "y", "600", :size => 2 %> -

    - -

    - <%= submit_tag "Make a preview" %> -

    -<% end %> - -
    - -

    - Take a snapshot -

    - -<%= form_tag :action => "snapshot", :id => @movie.id do %> -

    - Secs: <%= text_field_tag "secs" %> -

    - -

    - <%= submit_tag "Take snapshot" %> -

    - <% end %> - -

    - Download (stream) -

    - - <%= form_tag :action => "download", :id => @movie.id do %> -

    - This will start downloading the video from an IP and Port. -

    -

    - IP: <%= text_field_tag "ip", "", :size => 12 %> : <%= text_field_tag "port", "", :size => 3 %> -

    - -

    - <%= submit_tag "Download" %> -

    - <% end %> + <%= form_tag({ action: "preview", id: @movie.id }, { class: 'square' }) do %> +
    + <%= label_tag "Resolution" %> +
    + <%= text_field_tag "x", "800", size: 2 %> x <%= text_field_tag "y", "600", size: 2 %> +
    - <%= link_to 'Show', @movie %> | - <%= link_to 'Back', movies_path %> +
    + <%= submit_tag "Make a Preview" %> +
    + <% end %> +
    + + +
    +

    Take a Snapshot

    + + <%= form_tag({ action: "snapshot", id: @movie.id }, { class: 'square' }) do %> +
    + <%= label_tag "Seconds" %> + <%= text_field_tag "secs" %> +
    + +
    + <%= submit_tag "Take Snapshot" %> +
    + <% end %> +
    + +
    +

    Download (Stream)

    + + <%= form_tag({ action: "download", id: @movie.id }, { class: 'square' }) do %> +

    This will start downloading the video from an IP and Port.

    + +
    + <%= label_tag "IP" %> + <%= text_field_tag "ip", "", size: 12 %> +
    + +
    + <%= label_tag "Port" %> + <%= text_field_tag "port", "", size: 3 %> +
    + +
    + <%= submit_tag "Download" %> +
    + <% end %> +
    + + \ No newline at end of file diff --git a/app/views/movies/index.html.erb b/app/views/movies/index.html.erb index 5f07624..a0efddc 100644 --- a/app/views/movies/index.html.erb +++ b/app/views/movies/index.html.erb @@ -1,48 +1,51 @@ -

    - ENSL Movie Archive -

    +
    +

    Movie Archive

    +

    We recommend <%= link_to "VLC Player", "http://www.videolan.org/vlc/" %> for movie playback.

    -

    - We recommend <%= link_to "VLC Player", "http://www.videolan.org/vlc/" %> for movie playback. -

    - -<%= form_tag movies_url(), :method => "get" do %> - Limit to: - <%= select_tag :filter, options_for_select({"5 stars" => 5, "4 stars" => 4, "3 stars" => 3, "2 stars" => 2, "1 stars" => 1}) %> - Order by: - <%= select_tag :order, options_for_select({"Ratings" => :ratings, "Date" => :date, "Author" => :author}) %> - <%= submit_tag "Filter" %> -<% end %> - -
    - -
    -
      - <% Category.domain(Category::DOMAIN_MOVIES).ordered.each do |cat| %> -
    • - <%= cat %> -
    • - <% end %> -
    - -
    - <% Category.domain(Category::DOMAIN_MOVIES).each do |cat| %> -
    -
    - <% @movies.each do |m| %> - <% next if m.category != cat %> - <%= render :partial => "movie", :object => m %> - <% end %> -
    +
    + <%= form_tag movies_url, method: "get" do %> +
    + <%= select_tag :filter, options_for_select({"5 stars" => 5, "4 stars" => 4, "3 stars" => 3, "2 stars" => 2, "1 stars" => 1}) %> +
    + +
    + <%= select_tag :order, options_for_select({"Ratings" => :ratings, "Date" => :date, "Author" => :author}) %> +
    + +
    + <%= submit_tag "Filter" %>
    <% end %>
    + +
    +
      + <% Category.domain(Category::DOMAIN_MOVIES).ordered.each do |cat| %> +
    • + <%= cat %> +
    • + <% end %> +
    + +
    + <% Category.domain(Category::DOMAIN_MOVIES).each do |cat| %> +
    + <% @movies.each do |m| %> + <% next if m.category != cat %> + <%= render partial: "movie", object: m %> + <% end %> +
    + <% end %> +
    +
    + + + + <% if cuser and DataFile.new(directory_id: Directory::MOVIES).can_create? cuser %> + <%= link_to "New Movie", { controller: "data_files", action: "new", id: Directory::MOVIES }, { class: 'button' } %> + <% end %>
    - - - -<% if cuser and DataFile.new(:directory_id => Directory::MOVIES).can_create? cuser %> - <%= link_to "New Movie", :controller => "data_files", :action => "new", :id => Directory::MOVIES %> -<% end %> diff --git a/app/views/movies/new.html.erb b/app/views/movies/new.html.erb index 1c77aaf..cf05ec9 100644 --- a/app/views/movies/new.html.erb +++ b/app/views/movies/new.html.erb @@ -1,5 +1,3 @@ -

    New movie

    +

    New Movie

    -<%= render :partial => "form" %> - -<%= link_to 'Back', movies_path %> \ No newline at end of file +<%= render partial: 'form' %> diff --git a/app/views/movies/show.html.erb b/app/views/movies/show.html.erb index 3771699..e549d67 100644 --- a/app/views/movies/show.html.erb +++ b/app/views/movies/show.html.erb @@ -1,32 +1,26 @@ -
    -

    - <%= namelink @movie %> -

    - <%= render :partial => "movie", :object => @movie %> +
    +

    + <%= namelink @movie %> +

    + + <%= render partial: "movie", object: @movie %> <% if @movie.preview %> -
    +
    <%= javascript_include_tag 'flowplayer' %> + - - -

    - This is a low quality version. Please download better version from above.
    - We recommend <%= link_to "VLC Player", "http://www.videolan.org/vlc/" %> for movie playback. -

    + + +

    This is a low quality version. Please download better version from above.

    <% end %>
    diff --git a/app/views/users/_movies.html.erb b/app/views/users/_movies.html.erb index b97b35d..bdcbd6f 100644 --- a/app/views/users/_movies.html.erb +++ b/app/views/users/_movies.html.erb @@ -1,7 +1,5 @@ -

    - Movies -

    +

    Movies

    - <%= render :partial => "movies/movie_user", :collection => @user.movies %> + <%= render partial: "movies/movie_user", collection: @user.movies %>
    \ No newline at end of file