% from helper.url import Url
% from helper.translator import Translator
% _ = Translator.instance(language)

<div class="grid">
    <div class="unit w-4-5">
        <p>{{_('The database contains {} recipes.').format(num_recipes)}}</p>
        % if recipes:
            % include recipe_list recipes=recipes
        % else:
            <p>{{_('All recipes have at least one category.')}}</p>
        % end
    </div>

    <div class="unit w-1-5">
        % if randoms:
            <ul id="randoms">
            % for random in randoms:
                % url = Url.from_recipe(random)
                <li>
                    % if random.images:
                        % img_url = Url.from_img(random.images[0].path)
                        <div>
                            <a class="fancybox" href="{{img_url}}" data-fancybox-group="random-images" data-fancybox-title="{{random.title}}">
                                <img src="{{img_url}}" alt="{{random.images[0].path}}" />
                            </a>
                        </div>
                    % end
                    <div>
                        <a href="{{url}}">{{random.title}}</a>
                    </div>
                </li>
            % end
            </ul>
        %end
    </div>
</div>

% rebase html_body id='index', title=None, categories=categories, languages=languages, logout=logout
% from helper.url import Url
% from helper.translator import Translator
% _ = Translator.instance(language)

<div class="grid">
    <div class="unit w-4-5">
        <p>{{_('The database contains {} recipes.').format(num_recipes)}}</p>
        % if recipes:
            % include recipe_list recipes=recipes
        % else:
            <p>{{_('All recipes have at least one category.')}}</p>
        % end
    </div>

    <div class="unit w-1-5">
        % if randoms:
            <ul id="randoms">
            % for random in randoms:
                % url = Url.from_recipe(random)
                <li>
                    % if random.images:
                        % img_url = Url.from_img(random.images[0].path)
                        <div>
                            <a class="fancybox" href="{{img_url}}" data-fancybox-group="images" data-fancybox-title="{{random.title}}">
                                <img src="{{img_url}}" alt="{{random.images[0].path}}" />
                            </a>
                        </div>
                    % end
                    <div>
                        <a href="{{url}}">{{random.title}}</a>
                    </div>
                </li>
            % end
            </ul>
        %end
    </div>
</div>

% rebase html_body id='index', title=None, categories=categories, languages=languages, logout=logout
Include random pics in normal image gallery.
Include random pics in normal image gallery.
