class Bid(admin.ModelAdmin):
change_form_template = "admin/my_admin_bid.html"
def response_change(self, request, obj):
if "_make_paid" in request.POST:
obj.state = 'PAID'
obj.save()
obj.payment.create(bid=obj, amount=amount)
self.message_user(request, "This loan mark as PAID")
return HttpResponseRedirect(".")
return super().response_change(request, obj)
import React, { useEffect, useState } from 'react';
import Cardstyle from "../../components/movie/cardstyle";
import { getCategories, getCollections, singleCategory } from "../../actions/category";
import Link from "next/link";
const Collect = ({ router }) => {
const [ categories, setCategories ] = useState([])
const [ values, setValues ] = useState({
error: '',
success: '',
loaded: false
})
useEffect(() => {
initCategories()
}, [])
const initCategories = () => {
return getCategories().then(data => {
if (data.error) {
setValues({ ...values, error: data.error })
} else {
setCategories(data)
}
})
}
const getCollect = (slug, limit) => {
getCollections(slug, limit).then(data => {
if (data.error) {
console.log(data.error)
} else {
console.log(data.movies)
return showMoviesOfCollections(data.movies)
}
})
}
const showMoviesOfCollections = (movies) => {
return movies.map((movie, i) => {
return (
<div key={ i } className="col-6 col-sm-6 col-md-4 col-xl-2 mt-5 mb-5 mb-xl-0">
<Cardstyle movie={ movie }/>
</div>
)
})
}
const viewCollection = () => {
return categories.map((cat, i) => {
return (
<div key={ i } className="bg-gray-1100 dark">
{ getCollect(cat.slug, 6) }
</div>
)
})
}
return (
<>
{ viewCollection() }
</>
);
}
export default Collect;
module Api
module V1
class PagesController < ApplicationController
def show
@page = Page.find_by(some_id_number: params[:some_id_number])
render json: { status: 'SUCCESS', message: 'loaded', somenumber: @page.some_id_number, pid: @page.id }, status: :ok
end
end
end
end
<div id="playera"></div>
<div id="player">
<%= javascript_tag do %>
// Объявляю переменную, которая принимает содержимое ДИВа, куда я генерирую ссылку на видео
var content=document.getElementById("linkurl").innerHTML
new Playerjs({
"id":"playera",
// Теперь как мне вывести значение переменной CONTENT? Если пишу CONTENT, то в HTML и отображается content, а мне нужно именно значение, которое присвоил.
"file": "content"
});
<% end %>
</div>
location /mp4 {
hls;
hls_fragment 5s;
hls_buffers 10 10m;
hls_mp4_buffer_size 1m;
hls_mp4_max_buffer_size 5m;
root /var/video/;
}
clip: {
sources: [
{ type: "application/x-mpegurl", src: "http://site.ru/mp4/test.mp4.m3u8" },
{ type: "video/mp4", src: "http://site.ru/mp4/test.mp4" }
]
}