Commit d417f40832e81249e6364f7ae0c83d6f351d6a3e

Authored by Fernando Brito
1 parent b782a340
Exists in master and in 2 other branches v2, wikilibras

Ribbon

app/assets/javascripts/v_libras/videos/index.js
... ... @@ -10,7 +10,6 @@ $(function() {
10 10  
11 11 // bind to a channel event
12 12 channel.bind('update', function(data) {
13   - alert("channel updated");
14 13 location.reload();
15 14 });
16 15 });
17 16 \ No newline at end of file
... ...
app/assets/stylesheets/application.css.scss
... ... @@ -15,3 +15,64 @@
15 15 *= require 'v_libras/videos'
16 16 *= require_self
17 17 */
  18 +
  19 +
  20 +.ribbon-wrapper-green {
  21 + margin: 10px auto;
  22 + width: 203px;
  23 + height: 144px;
  24 + overflow: hidden;
  25 + top: -3px;
  26 + right: -3px;
  27 +
  28 + padding-top: 3px;
  29 +}
  30 +
  31 +.ribbon-content img {
  32 + border-radius: 3px;
  33 + -webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
  34 + -moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
  35 + box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
  36 +}
  37 +
  38 +.ribbon-green {
  39 + font: bold 15px Sans-Serif;
  40 + color: #333;
  41 + text-align: center;
  42 + text-shadow: rgba(255,255,255,0.5) 0px 1px 0px;
  43 + -webkit-transform: rotate(45deg);
  44 + -moz-transform: rotate(45deg);
  45 + -ms-transform: rotate(45deg);
  46 + -o-transform: rotate(45deg);
  47 + position: relative;
  48 + padding: 5px 0;
  49 + left: 118px;
  50 + bottom: 124px;
  51 + width: 110px;
  52 + background-color: #BFDC7A;
  53 + background-image: -webkit-gradient(linear, left top, left bottom, from(#BFDC7A), to(#8EBF45));
  54 + background-image: -webkit-linear-gradient(top, #BFDC7A, #8EBF45);
  55 + background-image: -moz-linear-gradient(top, #BFDC7A, #8EBF45);
  56 + background-image: -ms-linear-gradient(top, #BFDC7A, #8EBF45);
  57 + background-image: -o-linear-gradient(top, #BFDC7A, #8EBF45);
  58 + color: #6a6340;
  59 + -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
  60 + -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
  61 + box-shadow: 0px 0px 3px rgba(0,0,0,0.3);
  62 +}
  63 +
  64 +.ribbon-green:before, .ribbon-green:after {
  65 + content: "";
  66 + border-top: 3px solid #6e8900;
  67 + border-left: 3px solid transparent;
  68 + border-right: 3px solid transparent;
  69 + position:absolute;
  70 + bottom: -3px;
  71 +}
  72 +
  73 +.ribbon-green:before {
  74 + left: 0;
  75 +}
  76 +.ribbon-green:after {
  77 + right: 0;
  78 +}
18 79 \ No newline at end of file
... ...
app/assets/stylesheets/bootstrap.css.less
1 1 @import "twitter/bootstrap/bootstrap";
2 2 @import "twitter/bootstrap/responsive";
  3 +@import "twitter/bootstrap/sprites";
3 4  
4   -@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
5   -@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
  5 +@iconSpritePath: url("twitter/bootstrap/glyphicons-halflings.png");
  6 +@iconWhiteSpritePath: url("twitter/bootstrap/glyphicons-halflings-white.png");
6 7  
7 8 @navbarBackground: #DDD;
8 9 @navbarBackgroundHighlight: #DDD;
... ...
app/controllers/v_libras/requests_controller.rb
... ... @@ -2,6 +2,8 @@ class VLibras::RequestsController < ApplicationController
2 2 protect_from_forgery with: :null_session, :only => [ :callback ]
3 3 before_filter :check_vlibras_api_status, :only => [ :rapid, :create ]
4 4  
  5 + before_filter :authenticate_user!
  6 +
5 7 def rapid
6 8 @request = VLibras::Request.new
7 9 end
... ...
app/controllers/v_libras/videos_controller.rb
... ... @@ -2,6 +2,7 @@ class VLibras::VideosController < InheritedResources::Base
2 2 actions :destroy
3 3  
4 4 before_filter :check_vlibras_api_status, :only => [ :index ]
  5 + before_filter :authenticate_user!
5 6  
6 7 def index
7 8 @videos = current_user.videos
... ...
app/views/v_libras/videos/index.haml
... ... @@ -7,10 +7,17 @@
7 7 .row.text-center
8 8 - @videos.each do |video|
9 9 .span4
10   - = link_to image_tag("avatar.png"), video.url
  10 + .ribbon-wrapper-green
  11 + .ribbon-content
  12 + = link_to image_tag("avatar.png"), video.url
  13 + .ribbon-green Novo
  14 +
11 15 %p
12   - = link_to t('videos.show'), video_path(video), class: "btn btn-success"
13   - = link_to t('videos.delete'), v_libras_video_path(video), method: :delete,
  16 + = link_to video_path(video), class: "btn btn-success" do
  17 + = content_tag(:span, '', :class => 'icon-download icon-white')
  18 + Baixar
  19 +
  20 + = link_to content_tag(:span, '', :class => 'icon-trash icon-white'), v_libras_video_path(video), method: :delete,
14 21 class: "btn btn-danger", data: { confirm: t('shared.confirm_delete') }
15 22  
16 23 .breadcrumb.requests
... ...