#13 Add a customized index page to be displayed when the users are logged out
Merged 7 years ago by pingou. Opened 7 years ago by pingou.

file modified
+3
@@ -98,6 +98,9 @@ 

  # Install the custom template/theme

  mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pagure_dist_git/template/

  install -p -m 644 template/repo_info.html $RPM_BUILD_ROOT/%{_datadir}/pagure_dist_git/template/

+ install -p -m 644 template/index.html $RPM_BUILD_ROOT/%{_datadir}/pagure_dist_git/template/

+ 

+ # Install the customized static files or our own

  mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pagure_dist_git/static/

  install -p -m 644 static/pagure-logo.png $RPM_BUILD_ROOT/%{_datadir}/pagure_dist_git/static/

  

file added
+140
@@ -0,0 +1,140 @@ 

+ {% extends "master.html" %}

+ 

+ {% block title %}Home{% endblock %}

+ {% set tag = "home" %}i

+ 

+ {% from "_render_repo.html" import render_repos, render_user_repos%}

+ {% from "_browseheader.html" import browse_header %}

+ 

+ 

+ {% block header %}

+ <link href="{{ url_for('static', filename='vendor/selectize/selectize.bootstrap3.css') }}"

+   rel="stylesheet" />

+ {% endblock %}

+ 

+ {% block content %}

+ <div class="repo-header p-t-1">

+   <div class="container">

+     {{ browse_header(select=select) }}

+   </div>

+ </div>

+   <div class="container">

+     {% if not authenticated %}

+     <section class="container p-t-2">

+       <p>

+         Welcome to Fedora's repository for package maintenance. If you're

+         looking to download software to run, look at

+         <a href="https://getfedora.org/">https://getfedora.org/</a>, or a

+         <a href="https://mirrors.fedoraproject.org/">Fedora Mirror</a>.

+         You can however find source code for Fedora packages here.

+       </p>

+ 

+       <p>

+         If you are looking for RPM spec files, module and container definitions,

+         Fedora-specific patches, tests, and so on, you're in the right place.

+         You can browse <a href="/browse/projects/">packages</a> and

+         <a href="/users">packagers</a> — and you can fork, improve, and submit

+         pull requests.

+         </p>

+ 

+       <p>

+         If you are already a package maintainer, feel free to consult the

+         <a href="https://docs.pagure.org/pagure/usage.html">docs on using

+         pagure</a>. If you'd like to become a package maintainer, see

+         <a href="https://fedoraproject.org/wiki/Join_the_package_collection_maintainers">

+         this guide</a>.

+       </p>

+ 

+       <p>

+         Note that package issues are still tracked in

+         <a href="https://bugzilla.redhat.com/">Bugzilla</a>,

+         not with Pagure's issue feature.

+       </p>

+     </section>

+     {% endif %}

+ 

+     {{ render_repos(

+         repos, total_page, 'page', page,

+         'All Projects', repos_length, 'repos', username, sorting=sorting) }}

+   </div>

+ 

+ {% endblock %}

+ 

+ {% block jscripts %}

+     {{ super() }}

+ <script src="{{ url_for('static', filename='vendor/jdenticon/jdenticon.min.js') }}" type="text/javascript"></script>

+ <script src="{{ url_for('static', filename='vendor/selectize/selectize.min.js') }}" type="text/javascript"> </script>

+ <script src="{{ url_for('static', filename='vendor/jquery.dotdotdot/jquery.dotdotdot.min.js') }}" type="text/javascript"></script>

+ <script type="text/javascript">

+ $(document).ready(function() {

+ 

+   $('#headerSearch').on('keypress keydown keyup', function(e) {

+     if (e.which == 13) {

+         e.preventDefault();

+         return false;

+     }

+   });

+ 

+   $('#term').selectize({

+     valueField: 'fullname',

+     labelField: 'fullname',

+     searchField: 'fullname',

+     maxItems: 1,

+     create: false,

+     onType: function(value){

+       if (value == ""){

+         this.close();

+       }

+     },

+     onChange: function(value){

+       if (value != ""){

+         $('#headerSearch').submit();

+       }

+     },

+     load: function(query, callback) {

+       if (!query.length) return callback();

+       $.getJSON(

+         "{{ url_for('api_ns.api_projects') }}", {

+           pattern: "*"+query+"*",

+           short: "1",

+         },

+         function( data ) {

+           callback( data.projects );

+         }

+       );

+     },

+     render: {

+       option: function(item, escape) {

+         {% set reponame = 'item.fullname' %}

+         return '<div>'

+           +   '<div class="projecticon-search pull-xs-left">'

+           +     '<span class="oi" data-glyph="document"></span>'

+           +   '</div>'

+           +   '<div class="title">'

+           +     '<span class="name">'

+           +       '<strong>' + escape(item.fullname) + '</strong>'

+           +     '</span>'

+           +   '</div>'

+           +   '<div class="description">'

+           +     '<small>' + escape(item.description) + '</small>'

+           +   '</div>'

+           + '</div>';

+       }

+     },

+   });

+ 

+   $(".repo_desc").dotdotdot({

+     watch:"window"

+   });

+ 

+   {% if username %}

+     $(function(){

+         $('.show_parts input[type="checkbox"]').change(function(){

+             $('#' + $(this).attr('name')).toggle();

+         });

+     });

+   {% endif %}

+ });

+ </script>

+ 

+ {% endblock %}

rebased

7 years ago

Pull-Request has been merged by pingou

7 years ago
Metadata