123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518 |
- {% extends "repo_master.html" %}
- {% block title %}{{ select.capitalize() }} - {{
- repo.namespace + '/' if repo.namespace }}{{ repo.name }}{% endblock %}
- {% set tag = "home" %}
- {% block header %}
- <link type="text/css" rel="stylesheet" nonce="{{ g.nonce }}" href="{{
- url_for('static', filename='vendor/selectize/selectize.bootstrap3.css') }}?version={{ g.version}}"/>
- {% endblock %}
- {% block repo %}
- <div class="container p-t-3">
- <div class="row">
- <div class="col">
- <nav>
- <div class="nav nav-tabs nav-sidetabs flex-column" id="nav-tab" role="tablist">
- <h5 class="pl-2 font-weight-bold text-muted">Project Settings</h5>
- <a class="nav-item nav-link active" id="projectdetails" data-toggle="tab"
- href="#projectdetails-tab" role="tab" aria-controls="projectdetails" aria-selected="true">Project Details</a>
- <a class="nav-item nav-link" id="gitbranch" data-toggle="tab"
- href="#gitbranch-tab" role="tab" aria-controls="gitbranch">Git Branches</a>
- {% if config.get('WEBHOOK', False) %}
- <a class="nav-item nav-link" id="privatewebhookkey" data-toggle="tab"
- href="#privatewebhookkey-tab" role="tab" aria-controls="privatewebhookkey">Private Web Hook Key</a>
- {% endif %}
- <a class="nav-item nav-link" id="apikeys" data-toggle="tab"
- href="#apikeys-tab" role="tab" aria-controls="apikeys">API Keys</a>
- <a class="nav-item nav-link" id="projectoptions" data-toggle="tab"
- href="#projectoptions-tab" role="tab" aria-controls="projectoptions">Project Options</a>
- <a class="nav-item nav-link" id="publicnotifications" data-toggle="tab"
- href="#publicnotifications-tab" role="tab" aria-controls="publicnotifications">Public Notifications</a>
- {% if config.get('ENABLE_USER_MNGT', True) %}
- <a class="nav-item nav-link" id="usersgroups" data-toggle="tab"
- href="#usersgroups-tab" role="tab" aria-controls="usersgroups">Users & Groups</a>
- {% endif %}
- {% if config.get('DEPLOY_KEY', True) %}
- <a class="nav-item nav-link" id="deploykey" data-toggle="tab"
- href="#deploykey-tab" role="tab" aria-controls="deploykey">Deploy Keys</a>
- {% endif %}
- {% if plugins %}
- <a class="nav-item nav-link" id="hooks" data-toggle="tab"
- href="#hooks-tab" role="tab" aria-controls="hooks">Hooks</a>
- {% endif %}
- {% if g.issues_enabled %}
- <a class="nav-item nav-link" id="priorities" data-toggle="tab"
- href="#priorities-tab" role="tab" aria-controls="priorities">Priorities</a>
- <a class="nav-item nav-link" id="roadmap" data-toggle="tab"
- href="#roadmap-tab" role="tab" aria-controls="roadmap">Roadmap</a>
- <a class="nav-item nav-link" id="closestatus" data-toggle="tab"
- href="#closestatus-tab" role="tab" aria-controls="closestatus">Close Status</a>
- <a class="nav-item nav-link" id="customfields" data-toggle="tab"
- href="#customfields-tab" role="tab" aria-controls="customfields">Custom Issue Fields</a>
- <a class="nav-item nav-link" id="reports" data-toggle="tab"
- href="#reports-tab" role="tab" aria-controls="reports">Reports</a>
- <a class="nav-item nav-link" id="boards" data-toggle="tab"
- href="#boards-tab" role="tab" aria-controls="boards">Boards</a>
- {% endif %}
- {% if g.issues_enabled or repo.settings.get('pull_requests', True) %}
- <a class="nav-item nav-link" id="projecttags" data-toggle="tab"
- href="#projecttags-tab" role="tab" aria-controls="projecttags">Tags</a>
- <a class="nav-item nav-link" id="quickreplies" data-toggle="tab"
- href="#quickreplies-tab" role="tab" aria-controls="quickreplies">Quick Replies</a>
- {% endif %}
- {% if not config.get('DISABLE_MIRROR_IN', False)
- and (repo.user.user == g.fas_user.username or pagure_admin)
- and repo.mirrored_from %}
- <a class="nav-item nav-link" id="mirrorlog" data-toggle="tab"
- href="#mirrorlog-tab" role="tab" aria-controls="mirrorlog">Mirror log</a>
- {% endif %}
- <a class="nav-item nav-link" id="regen" data-toggle="tab"
- href="#regen-tab" role="tab" aria-controls="regen">Regenerate Repos</a>
- {% if repo.user.user == g.fas_user.username or pagure_admin %}
- <a class="nav-item nav-link" id="blockusers" data-toggle="tab"
- href="#blockusers-tab" role="tab" aria-controls="blockusers">Block Users</a>
- {% endif %}
- {% if config.get('ENABLE_GIVE_PROJECTS', True)
- and (repo.user.user == g.fas_user.username or pagure_admin)
- and not repo.is_fork %}
- <a class="nav-item nav-link" id="giveproject" data-toggle="tab"
- href="#giveproject-tab" role="tab" aria-controls="giveproject">Give Project</a>
- {% endif %}
- {% if (not repo.is_fork and config.get('ENABLE_DEL_PROJECTS', True))
- or
- (repo.is_fork and config.get('ENABLE_DEL_FORKS',
- config.get('ENABLE_DEL_PROJECTS', True))) %}
- <a class="nav-item nav-link" id="deleteproject" data-toggle="tab"
- href="#deleteproject-tab" role="tab" aria-controls="deleteproject">Delete Project</a>
- {% endif %}
- {% for blueprint in g.main_app.blueprints %}
- {% if blueprint | hasattr('settings') %}
- <a class="nav-item nav-link thirdparty_settings"
- id="{{ blueprint.name }}" data-name="{{ blueprint.name }}"
- data-url="{{ url_for(
- '%s.settings' % blueprint.name,
- repo=repo.name, namespace=repo.namespace) }}"
- href="#{{ blueprint.name }}-tab">{{ blueprint.name }}</a>
- {% endif %}
- {% endfor %}
- </div>
- </nav>
- </div>
- <div class="col-9">
- <div class="tab-content mt-4" id="nav-tabContent">
- <div class="tab-pane fade active show" id="projectdetails-tab" role="tabpanel" aria-labelledby="projectdetails-tab">
- <h3 class="font-weight-bold mb-3">
- Project Details
- </h3>
- <div class="row">
- <div class="col">
- <form action="{{ url_for('ui_ns.update_project',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}" method="post">
- <fieldset class="form-group">
- <label for="description">Description</label>
- <input class="form-control" name="description" value="{{
- repo.description if repo.description }}" required/>
- <small class="text-muted">Short description of the project</small>
- </fieldset>
- <fieldset class="form-group">
- <label for="url">Project's url</label>
- <input class="form-control" name="url" value="{{ repo.url if repo.url else '' }}" />
- <small class="text-muted">Website URL of the project</small>
- </fieldset>
- <fieldset class="form-group">
- <label for="avatar">Avatar email</label>
- <input class="form-control" name="avatar_email" value="{{ repo.avatar_email if repo.avatar_email else '' }}" />
- <small class="text-muted">Email address linked to avatar to display for the project</small>
- </fieldset>
- <fieldset class="form-group">
- <label for="tags">Project tags</label>
- <input class="form-control" name="tags" value="{{ repo.tags_text |join(', ') if repo.tags else '' }}" />
- <small class="text-muted">
- Tags for project itself, as a comma-separated list. Tags
- for issues are managed further down on this page.
- </small>
- </fieldset>
- {% if config.get('PRIVATE_PROJECTS', False) and repo.private %}
- <fieldset class="form-group">
- <label class="c-input c-checkbox">Private</label>
- <input type="checkbox" value="private" name="private" checked="" />
- <span class="c-indicator"></span>
- </fieldset>
- {% endif %}
- {% if repo.mirrored_from %}
- <fieldset class="form-group">
- <label for="tags">Mirrored from</label>
- <input class="form-control" name="mirrored_from" value="{{ repo.mirrored_from }}" />
- <small class="text-muted">
- The (public) url from which this repository is mirrored.
- </small>
- </fieldset>
- {% endif %}
- <button class="btn btn-primary" type="submit" title="Update description">
- Update
- </button>
- {{ form.csrf_token }}
- </form>
- </div>
- </div>
- </div>
- <div class="tab-pane fade" id="gitbranch-tab" role="tabpanel" aria-labelledby="gitbranch-tab">
- {% include 'settings_git_branches.html' %}
- </div>
- {% if config.get('WEBHOOK', False) %}
- <div class="tab-pane fade" id="privatewebhookkey-tab" role="tabpanel" aria-labelledby="privatewebhookkey-tab">
- <h3 class="font-weight-bold mb-3">
- Private web-hook key
- </h3>
- <div class="row">
- <div class="col">
- <p>
- Each message sent to the web-hook are signed via hmac and SHA1 using
- this private key.
- </p>
- <p>
- This key is private to your project, make sure to store in a safe place
- and do not share it.
- </p>
- <div class="form-group">
- <div class="input-group">
- <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-key"></span></span></div>
- <input class="form-control" type="text" value="{{ repo.hook_token }}" readonly>
- </div>
- </div>
- <form action="{{ url_for('ui_ns.new_repo_hook_token',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- <button class="btn btn-primary" type="submit" id="generate_new_hook_token"
- title="Generate a new hook token">
- <span class="fa fa-refresh"></span> Re-generate
- </button>
- {{ form.csrf_token }}
- </form>
- </div>
- </div>
- </div>
- {% endif %}
- <div class="tab-pane fade" id="apikeys-tab" role="tabpanel" aria-labelledby="apikeys-tab">
- {% include 'settings_api_keys.html' %}
- </div>
- <div class="tab-pane fade" id="projectoptions-tab" role="tabpanel" aria-labelledby="projectoptions-tab">
- {% include 'settings_options.html' %}
- </div>
- <div class="tab-pane fade" id="publicnotifications-tab" role="tabpanel" aria-labelledby="publicnotifications-tab">
- <h3 class="font-weight-bold mb-3">
- Public Notifications
- </h3>
- <div class="row">
- <div class="col">
- <p>
- The email addresses entered below will receive all the notifications
- related to {% if g.issues_enabled %}
- (public) issues and {% endif %}pull-requests, this includes
- notifications about {% if g.issues_enabled %}
- new issue or {% endif %} new pull-request, new comment
- and status change.
- </p>
- <p>
- To enter multiple addresses, separate them with a comma.
- </p>
- <form action="{{ url_for(
- 'ui_ns.update_public_notifications',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- {{ tag_form.csrf_token }}
- <div class="card-body">
- {% if g.issues_enabled %}
- <div class="row">
- <div class="col-sm-12">
- <strong>Issues notifications</strong>
- </div>
- </div>
- <div id="issue-notifications">
- <div class="row p-t-1">
- <div class="col-sm-9 p-r-0">
- <input type="text" name="issue_notifs"
- value="{{ repo.notifications['issues'] | join(', ') }}" class="form-control"/>
- </div>
- </div>
- </div>
- {% endif %}
- <div class="row">
- <div class="col-sm-12 p-t-1">
- <strong>Pull-requests notifications</strong>
- </div>
- </div>
- <div id="pr-notifications">
- <div class="row p-t-1">
- <div class="col-sm-9 p-r-0">
- <input type="text" name="pr_notifs"
- value="{{ repo.notifications['requests'] | join(', ') }}" class="form-control"/>
- </div>
- </div>
- </div>
- <div class="row p-t-1">
- <div class="col-sm-12">
- <button class="btn btn-primary" type="submit"
- title="Update notifications">
- Update
- </button>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- {% if config.get('ENABLE_USER_MNGT', True) %}
- <div class="tab-pane fade" id="usersgroups-tab" role="tabpanel" aria-labelledby="usersgroups-tab">
- <h3 class="font-weight-bold mb-3">
- Users & Groups
- </h3>
- <div class="row">
- <div class="col">
- <p>Below is the list of users having commit rights to this repo.</p>
- <p>
- <a href="{{ url_for(
- 'ui_ns.add_user',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- class="btn btn-primary">
- add user
- </a>
- <a href="{{ url_for(
- 'ui_ns.add_group_project',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- class="btn btn-primary">
- add group
- </a>
- </p>
- <ul class="list-group">
- <li class="list-group-item">
- <a href="{{ url_for('ui_ns.view_user', username=repo.user.user) }}">
- <span class="fa fa-user"></span>
- {{ repo.user.user }}
- </a>
- (main admin)
- </li>
- {% for access in access_users %}
- {% for user in access_users[access] %}
- <li class="list-group-item">
- <a href="{{ url_for('ui_ns.view_user', username=user.user) }}">
- <span class="fa fa-user"></span>
- {{ user.user }}
- </a>
- ({{access}})
- <form class="pull-right" method="POST"
- action="{{ url_for(
- 'ui_ns.remove_user',
- repo=repo.name,
- username=username,
- namespace=repo.namespace,
- userid=user.id) }}">
- <button title="Remove user"
- class="btn btn-danger btn-sm remove_user_btn">
- <i class="fa fa-trash"></i>
- </button>
- {{ form.csrf_token }}
- </form>
- <a href="{{ url_for(
- 'ui_ns.add_user',
- repo=repo.name,
- username=username,
- namespace=repo.namespace)
- }}?user={{ user.user }}">
- <button title="Update User Access" class="btn btn-default btn-sm pull-right">
- <i class="fa fa-pencil"></i>
- </button>
- </a>
- </li>
- {% endfor %}
- {% endfor %}
- {% for access in access_groups %}
- {% for group in access_groups[access] %}
- <li class="list-group-item">
- <a href="{{ url_for('ui_ns.view_group', group=group.group_name) }}">
- <span class="fa fa-users"></span>
- {{ group.group_name }}
- </a>
- ({{access}})
- <form class="pull-right" method="POST"
- action="{{ url_for(
- 'ui_ns.remove_group_project',
- repo=repo.name,
- username=username,
- namespace=repo.namespace,
- groupid=group.id) }}">
- <button
- title="Remove group" class="btn btn-danger btn-sm pull-right remove_group_btn">
- <i class="fa fa-trash"></i>
- </button>
- {{ form.csrf_token }}
- </form>
- <a href="{{ url_for(
- 'ui_ns.add_group_project',
- repo=repo.name,
- username=username,
- namespace=repo.namespace)
- }}?group={{ group.group_name }}">
- <button class="btn btn-default btn-sm pull-right" title="Update Group Access" >
- <i class="fa fa-pencil"></i>
- </button>
- </a>
- </li>
- {% endfor %}
- {% endfor %}
- </ul>
- </div>
- </div>
- </div>
- {% endif %}
- {% if config.get('DEPLOY_KEY', True) %}
- <div class="tab-pane fade" id="deploykey-tab" role="tabpanel" aria-labelledby="deploykey-tab">
- <h3 class="font-weight-bold mb-3">
- Deploy Keys
- <a href="{{ url_for(
- 'ui_ns.add_deploykey',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- class="btn btn-outline-primary btn-sm float-right">
- add deploy key
- </a>
- </h3>
- <div class="row">
- <div class="col">
- <p>Below are this projects' deploy keys.</p>
- {% for deploykey in repo.deploykeys %}
- <div class="form-group">
- <div class="input-group">
- <div class="input-group-prepend">
- <span class="input-group-text"><span class="fa fa-key"></span></span>
- </div>
- {% if deploykey.pushaccess %}
- <div class="input-group-prepend">
- <span class="input-group-text">Push Access</span>
- </div>
- {% endif %}
- <input class="form-control bg-white font-monospace" readonly
- type="text" value="{{ deploykey.ssh_short_key }}"/>
- <form class="pull-xs-right" method="POST"
- action="{{ url_for(
- 'ui_ns.remove_deploykey',
- repo=repo.name,
- username=username,
- namespace=repo.namespace,
- keyid=deploykey.id) }}">
- <button
- title="Remove deploy key" class="btn btn-outline-danger remove_deploy_key_btn">
- <i class="fa fa-trash"></i>
- </button>
- {{ form.csrf_token }}
- </form>
- </div>
- </div>
- {% endfor %}
- </div>
- </div>
- </div>
- {% endif %}
- {% if plugins %}
- <div class="tab-pane fade" id="hooks-tab" role="tabpanel" aria-labelledby="hooks-tab">
- <h3 class="font-weight-bold mb-3">
- Hooks
- </h3>
- <div class="row">
- <div class="col">
- <div id="accordions" role="tablist" aria-multiselectable="true">
- {% for plugin in plugins %}
- {% if not g.issues_enabled and plugin in ['Pagure tickets'] %}
- {% else %}
- <div class="panel panel-default" >
- <div class="panel-heading" role="tab" id="pluginheading{{ loop.index }}">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#accordions"
- href="#plugincollapse{{ loop.index }}" aria-expanded="true"
- aria-controls="plugincollapse{{ loop.index }}">
- <span id="dropdowncaret" class="fa fa-caret-right">
- </span> {{ plugin }}
- </a>
- </h4>
- </div>
- <div id="plugincollapse{{ loop.index }}" data-plugin="{{ plugin }}"
- class="panel-collapse collapse" role="tabpanel"
- aria-labelledby="pluginheading{{ loop.index }}">
- <span class="oi oi-spin pull-left" data-glyph="loop-circular">
- </span>
- </div>
- </div>
- {% endif %}
- {% endfor %}
- </div>
- </div>
- </div>
- </div>
- {% endif %}
- {% if g.issues_enabled %}
- <div class="tab-pane fade" id="priorities-tab" role="tabpanel" aria-labelledby="priorities-tab">
- <h3 class="font-weight-bold mb-3">
- Priorities
- </h3>
- <div class="row">
- <div class="col">
- <p>
- Below are the priorities you may assign to a ticket, allowing you
- to sort them with it. The Weight determines the ordering. Higher
- priority should correspond to lower weight.
- <span class="italic">
- To remove an entry, simply clean the Weight and Title
- </span>
- </p>
- <form action="{{ url_for(
- 'ui_ns.update_priorities',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- {{ tag_form.csrf_token }}
- <div class="row">
- <div class="col-sm-2">
- <strong>Weight</strong>
- </div>
- <div class="col-sm-10">
- <strong>Title</strong>
- </div>
- </div>
- <div class="form-group settings-field-rows" id="priorities-list">
- {% for priority in ((repo.priorities or [""]) | sort) %}
- <div class="row {{'hidden blank-field' if priority == ''}}">
- <div class="col-sm-2" >
- <input type="text" name="priority_weigth"
- value="{{ priority }}" size="3" class="form-control"/>
- </div>
- <div class="col-sm-9">
- <input type="text" name="priority_title"
- value="{{ repo.priorities[priority] }}" class="form-control"/>
- </div>
- <div class="col-sm-1">
- <a class="btn btn-outline-danger remove-settings-field-row pointer"><i class="fa fa-trash"></i></a>
- </div>
- </div>
- {% endfor %}
- </div>
- <a class="btn btn-outline-primary pt-2 btn-sm btn-block add-settings-field-row pointer" data-target="#priorities-list">
- <i class="fa fa-plus"></i> Add new priority
- </a>
- {% if not repo.priorities %}
- <a class="btn btn-outline-secondary btn-sm btn-block pointer" id="default_priorities">
- Populate with defaults
- </a>
- {% endif %}
- <div class="row p-t-1">
- </div>
- <div class="row p-t-1">
- <div class="col-sm-12">
- <button class="btn btn-primary float-right mt-3" type="submit"
- title="Update the priorities">
- Update
- </button>
- </div>
- </div>
- </form>
- </div>
- </div>
- {% if repo.priorities %}
- <h3 class="font-weight-bold mb-3">
- Default Priority
- </h3>
- <div class="row">
- <div class="col">
- <p>
- The default priority will be set to all issues created after
- it has been set.
- </p>
- <form action="{{ url_for(
- 'ui_ns.default_priority',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- {{ tag_form.csrf_token }}
- <div class="card-body">
- <div class="row">
- <div class="col-sm-12">
- <strong>Default priority</strong>
- </div>
- </div>
- <div id="default_priority">
- {{ priority_form.priority(class_="c-select") }}
- </div>
- <div class="row p-t-1">
- <div class="col-sm-12">
- <button class="btn btn-primary" type="submit"
- title="Update the default priority">
- Update
- </button>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- {% endif %}
- </div>
- <div class="tab-pane fade" id="roadmap-tab" role="tabpanel" aria-labelledby="roadmap-tab">
- {% include 'settings_milestones.html' %}
- </div>
- <div class="tab-pane fade" id="closestatus-tab" role="tabpanel" aria-labelledby="closestatus-tab">
- <h3 class="font-weight-bold mb-3">
- Close Status
- </h3>
- <div class="row">
- <div class="col">
- <p>
- Here is the list of all the status that can be used when closing
- an issue.
- </p>
- <form action="{{ url_for(
- 'ui_ns.update_close_status',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- {{ tag_form.csrf_token }}
- <div class="row">
- <div class="col-sm-12">
- <strong>Status</strong>
- </div>
- </div>
- <div class="form-group settings-field-rows" id="status-list">
- <div class="row hidden blank-field">
- <div class="col-sm-11" >
- <input type="text" name="close_status"
- value="" class="form-control"/>
- </div>
- <div class="col-sm-1">
- <a class="btn btn-outline-danger remove-settings-field-row pointer"><i class="fa fa-trash"></i></a>
- </div>
- </div>
- {% for status in repo.close_status | sort %}
- <div class="row {{'hidden blank-field' if status == ''}}">
- <div class="col-sm-11" >
- <input type="text" name="close_status"
- value="{{ status }}" class="form-control"/>
- </div>
- <div class="col-sm-1">
- <a class="btn btn-outline-danger remove-settings-field-row pointer"><i class="fa fa-trash"></i></a>
- </div>
- </div>
- {% endfor %}
- </div>
- <a class="btn btn-outline-primary pt-2 btn-sm btn-block add-settings-field-row pointer" data-target="#status-list">
- <i class="fa fa-plus"></i> Add new close status
- </a>
- {% if not repo.close_status %}
- <a class="btn btn-outline-secondary btn-sm btn-block pointer" id="default_statuses">
- Populate with defaults
- </a>
- {% endif %}
- <div class="row p-t-1">
- </div>
- <div class="row p-t-1">
- <div class="col-sm-12">
- <button class="btn btn-primary float-right mt-3" type="submit"
- title="Update the statuses">
- Update
- </button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- <div class="tab-pane fade" id="customfields-tab" role="tabpanel" aria-labelledby="customfields-tab">
- <h3 class="font-weight-bold mb-3">
- Custom Issue Fields
- </h3>
- <div class="row">
- <div class="col">
- <p>
- Set some custom fields for your issues. <i>Field Values</i> are currently
- only used for Lists, and it accepts a comma separated list of items
- for the drop down list.
- </p>
- <form action="{{ url_for(
- 'ui_ns.update_custom_keys',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- {{ tag_form.csrf_token }}
- <div class="row">
- <div class="col-sm-2">
- <strong>Fields</strong>
- </div>
- <div class="col-sm-2">
- <strong>Field Type</strong>
- </div>
- <div class="col-sm-6">
- <strong>Field Values</strong> <i>(Lists only)</i>
- </div>
- <div class="col-sm-1">
- <strong>Notify</strong>
- </div>
- </div>
- <div class="form-group settings-field-rows" id="customfields-list">
- <div class="row hidden blank-field">
- <div class="col-sm-2 pr-0">
- <input type="text" name="custom_keys"
- value="" class="form-control"/>
- </div>
- <div class="col-sm-2 pr-0">
- <select name="custom_keys_type" class="form-control custom-keys">
- <option value="text">Text</option>
- <option value="boolean">Boolean</option>
- <option value="link">Link</option>
- <option value="list">List</option>
- <option value="date">Date</option>
- </select>
- </div>
- <div class="col-sm-6 pr-0">
- <input title="Comma separated list items" type="text" name="custom_keys_data" value="" class="form-control custom-keys-list hidden" id="custom_keys_list"/>
- </div>
- <div class="col-sm-1 pr-0">
- <input type="checkbox" name="custom_keys_notify" title="Trigger email notification when updated" class="form-control"/>
- </div>
- <div class="col-sm-1">
- <a class="btn btn-outline-danger remove-settings-field-row pointer"><i class="fa fa-trash"></i></a>
- </div>
- </div>
- {% for field in repo.issue_keys | sort %}
- <div class="row">
- <div class="col-sm-2 pr-0">
- <input type="text" name="custom_keys"
- value="{{ field.name }}" class="form-control"/>
- </div>
- <div class="col-sm-2 pr-0">
- <select name="custom_keys_type" class="form-control custom-keys">
- <option value="text" {%
- if field.key_type == 'text' %} selected {%
- endif %}>Text</option>
- <option value="boolean" {%
- if field.key_type == 'boolean' %} selected {%
- endif %}>Boolean</option>
- <option value="link" {%
- if field.key_type == 'link' %} selected {%
- endif %}>Link</option>
- <option value="list" {%
- if field.key_type == 'list' %} selected {%
- endif %}>List</option>
- <option value="date" {%
- if field.key_type == 'date' %} selected {%
- endif %}>Date</option>
- </select>
- </div>
- <div class="col-sm-6 pr-0">
- {% if field.key_type == 'list' %}
- <input title="Comma separated list items" type="text" name="custom_keys_data" id="custom_keys_list"
- value={% if field.data is none %}""{% else %}"{{ field.data | join(', ') }}"{% endif %} class="form-control custom-keys-list"/>
- {% else %}
- <input title="Comma separated list items" type="text" name="custom_keys_data" id="custom_keys_list"
- value="{{ field.data or '' }}" class="form-control custom-keys-list hidden"/>
- {% endif %}
- </div>
- <div class="col-sm-1 pr-0">
- <input type="checkbox" name="custom_keys_notify-{{ loop.index }}" title="Trigger email notification when updated"
- {% if field.key_notify == True %}
- checked="y"
- {% endif %}
- class="form-control"/>
- </div>
- <div class="col-sm-1">
- <a class="btn btn-outline-danger remove-settings-field-row pointer"><i class="fa fa-trash"></i></a>
- </div>
- </div>
- {% endfor %}
- </div>
- <a class="btn btn-outline-primary pt-2 btn-sm btn-block add-settings-field-row pointer" data-target="#customfields-list">
- <i class="fa fa-plus"></i> Add new custom field
- </a>
- <button class="btn btn-primary mt-3 float-right" type="submit"
- title="Update the custom fields">
- Update
- </button>
- </form>
- </div>
- </div>
- </div>
- <div class="tab-pane fade" id="reports-tab" role="tabpanel" aria-labelledby="reports-tab">
- <h3 class="font-weight-bold mb-3">
- Reports
- </h3>
- <div class="row">
- <div class="col">
- <p>
- Here is the list of reports saved for this project.
- </p>
- <ul class="list-group">
- {% for report in repo.reports %}
- <li class="list-group-item clearfix">
- <a href="{{ url_for(
- 'ui_ns.view_report',
- repo=repo.name,
- username=username,
- namespace=repo.namespace,
- report=report) }}">
- {{ report }}
- </a>
- <div class="float-right">
- <form class="icon del_icon float-right" method="POST"
- action="{{ url_for(
- 'ui_ns.delete_report',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}">
- <input type="hidden" value="{{ report }}" name="report" />
- {{ tag_form.csrf_token }}
- <button
- title="Delete report" class="btn btn-danger btn-sm delete_report_btn">
- <i class="fa fa-trash"></i>
- </button>
- </form>
- </div>
- </li>
- {% endfor %}
- </ul>
- </div>
- </div>
- </div>
- <div class="tab-pane fade" id="boards-tab" role="tabpanel" aria-labelledby="boards-tab">
- {% include 'settings_boards.html' %}
- </div>
- {% endif %}
- {% if g.issues_enabled or repo.settings.get('pull_requests', True) %}
- <div class="tab-pane fade" id="projecttags-tab" role="tabpanel" aria-labelledby="projecttags-tab">
- <h3 class="font-weight-bold mb-3">
- Tags
- </h3>
- <div class="row">
- <div class="col">
- <p>
- Here is the list of tags associated with this project (Issues and Pull Requests).
- </p>
- <ul class="list-group">
- {% for tag in tags %}
- <li class="list-group-item clearfix">
- {% if g.issues_enabled %}
- <a href="{{ url_for(
- 'ui_ns.view_issues',
- repo=repo.name,
- username=username,
- namespace=repo.namespace,
- tags=tag.tag) }}">{% endif %}
- <span class="fa fa-tag"></span> {{ tag.tag }}
- {% if g.issues_enabled %}</a>{% endif %}
- <span class="badge badge-info" data-bg-color="{{tag.tag_color}}">{{tag.tag}}</span>
- <span class="text-muted">{{ tag.tag_description or '' }}</span>
- <div class="float-right">
- <form class="icon del_icon float-right" method="POST"
- action="{{ url_for(
- 'ui_ns.remove_tag',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}">
- <input type="hidden" value="{{ tag.tag }}" name="tag" />
- {{ tag_form.csrf_token }}
- <button title="Remove tag" data-tag-name="{{ tag.tag }}"
- class="btn btn-danger btn-sm remove_tag_btn">
- <i class="fa fa-trash"></i>
- </button>
- </form>
- <a href="{{ url_for(
- 'ui_ns.edit_tag',
- repo=repo.name,
- username=username,
- namespace=repo.namespace,
- tag=tag.tag) }}">
- <button class="btn btn-default btn-sm" title="Edit tag">
- <i class="fa fa-pencil"></i>
- </button>
- </a>
- </div>
- </li>
- {% endfor %}
- </ul>
- <form action="{{ url_for(
- 'ui_ns.update_tags',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- {{ tag_form.csrf_token }}
- <div class="card-body">
- <!-- The "Add New Tag" rows/elements will fill in here -->
- <div id="tagcolor">
- </div>
- <div class="row p-t-1">
- <div class="col-sm-12">
- <a class="btn btn-outline-primary btn-sm btn-block pointer" id="new_tag">
- Add New Tag
- </a>
- </div>
- </div>
- <div class="row p-t-1">
- <div class="col-sm-12">
- <button class="btn btn-primary float-right mt-3" type="submit"
- title="Update the tags">
- Update
- </button>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- <div class="tab-pane fade" id="quickreplies-tab" role="tabpanel" aria-labelledby="quickreplies-tab">
- <h3 class="font-weight-bold mb-3">
- Quick Replies
- </h3>
- <div class="row">
- <div class="col">
- <p>Quick replies will be offered in a new comment form on Issue or
- Pull Request page. This allows you to reply to common problems with a
- click of a button.</p>
- <p>The reply can use the same Markdown formatting as regular
- comments. The list you will choose the reply from will only show the
- first 50 characters. Please make sure the important message is at the
- beginning.</p>
- <p>The replies will be presented in the same order they are written
- here.</p>
- <form action="{{ url_for(
- 'ui_ns.update_quick_replies',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post">
- {{ tag_form.csrf_token }}
- <div class="card-body">
- <div id="quick_reply_list">
- {% for quick_reply in repo.quick_replies or [""] %}
- <div class="row p-t-1">
- <div class="col-sm-12 p-r-0">
- <textarea class="form-control" name="quick_reply">{{quick_reply}}</textarea>
- </div>
- </div>
- {% endfor %}
- </div>
- <div class="row p-t-1">
- <div class="col-sm-6">
- <a class="btn btn-secondary btn-sm btn-block extend-form" data-target="#quick_reply_list">
- Add new quick reply
- </a>
- </div>
- </div>
- <div class="row p-t-1">
- <div class="col-sm-12">
- <button class="btn btn-primary" type="submit"
- title="Update quick replies">
- Update
- </button>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- {% endif %}
- {% if not config.get('DISABLE_MIRROR_IN', False)
- and (repo.user.user == g.fas_user.username or pagure_admin)
- and repo.mirrored_from %}
- <div class="tab-pane fade" id="mirrorlog-tab" role="tabpanel" aria-labelledby="mirrorlog-tab">
- {% include 'settings_mirrorlog.html' %}
- </div>
- {% endif %}
- <div class="tab-pane fade" id="regen-tab" role="tabpanel" aria-labelledby="regen-tab">
- <h3 class="font-weight-bold mb-3">
- Regenerate Repos
- </h3>
- <div class="row">
- <div class="col">
- {% if g.issues_enabled %}
- <form action="{{ url_for(
- 'ui_ns.regenerate_git',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}" method="post"
- class="icon">
- <input name="regenerate" value="tickets" type="hidden"/>
- <button class="btn btn-primary" type="submit"
- title="Regenerate tickets git repo">
- <span class="fa fa-refresh"></span> Regenerate the git repo for issues
- </button>
- {{ form.csrf_token }}
- </form>
- {% endif %}
- <form class="m-t-2 icon" action="{{ url_for(
- 'ui_ns.regenerate_git',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}" method="post">
- <input name="regenerate" value="requests" type="hidden"/>
- <button class="btn btn-primary" type="submit"
- title="Regenerate requests git repo">
- <span class="fa fa-refresh"></span> Regenerate the git repo for requests
- </button>
- {{ form.csrf_token }}
- </form>
- </div>
- </div>
- </div>
- <div class="tab-pane fade" id="blockusers-tab" role="tabpanel" aria-labelledby="blockusers-tab">
- {% include 'settings_block_users.html' %}
- </div>
- {% if config.get('ENABLE_GIVE_PROJECTS', True)
- and (repo.user.user == g.fas_user.username or pagure_admin)
- and not repo.is_fork %}
- <div class="tab-pane fade" id="giveproject-tab" role="tabpanel" aria-labelledby="giveproject-tab">
- <h3 class="font-weight-bold mb-3">
- Give Project
- </h3>
- <div class="row">
- <div class="col">
- <form action="{{ url_for(
- 'ui_ns.give_project',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- {{ tag_form.csrf_token }}
- <input class="form-control" name="user" id="user"
- placeholder="Start typing to search users" value=""/>
- <button class="btn btn-danger give_project_btn" type="submit"
- title="Give the project to someone">
- <i class="fa fa-share-square-o"></i> Give the {{repo.name}} project
- </button>
- </form>
- </div>
- </div>
- </div>
- {% endif %}
- {% if (not repo.is_fork and config.get('ENABLE_DEL_PROJECTS', True))
- or
- (repo.is_fork and config.get('ENABLE_DEL_FORKS',
- config.get('ENABLE_DEL_PROJECTS', True))) %}
- <div class="tab-pane fade" id="deleteproject-tab" role="tabpanel" aria-labelledby="deleteproject-tab">
- <h3 class="font-weight-bold mb-3">
- Delete Project
- </h3>
- <div class="row">
- <div class="col">
- {% if repo.read_only %}
- <button class="btn btn-danger disabled"
- title="Action disabled while project's ACLs are being refreshed">
- <i class="fa fa-trash"></i>
- Delete the {{ repo.fullname }} project
- </button>
- {% else %}
- <form action="{{ url_for(
- 'ui_ns.delete_repo',
- repo=repo.name,
- username=username,
- namespace=repo.namespace) }}"
- method="post" class="icon">
- <button class="btn btn-danger delete_project_btn" type="submit"
- title="Delete the project/fork">
- <i class="fa fa-trash"></i>
- Delete the {{ repo.fullname }} project
- </button>
- </form>
- {% endif %}
- </div>
- </div>
- </div>
- {%endif %}
- </div>
- </div>
- </div>
- </div>
- {% endblock %}
- {% block jscripts %}
- {{ super() }}
- <script type="text/javascript" nonce="{{ g.nonce }}" src="{{
- url_for('static', filename='vendor/selectize/selectize.min.js') }}?version={{ g.version}}"></script>
- <script type="text/javascript" nonce="{{ g.nonce }}" src="{{
- url_for('static', filename='tags.js') }}?version={{ g.version}}"></script>
- <script type="text/javascript" nonce="{{ g.nonce }}">
- function updateform() {
- $('.custom-keys').change(function() {
- field_type = $(this).val();
- if(field_type == "list") {
- $(this).parent().parent().find('.custom-keys-list').removeClass("hidden");
- } else {
- $(this).parent().parent().find('.custom-keys-list').addClass("hidden");
- }
- });
- };
- $(document).ready(function() {
- updateform();
- $('#generate_new_hook_token').click(function() {
- return confirm('Are you sure to generate a new token for '
- + 'this project/fork? \nThis will break all web hook in place and '
- + 'cannot be un-done.');
- });
- $('.remove_user_btn').click(function(){
- return confirm('You sure you want to remove this user from this project?');
- });
- $('.remove_group_btn').click(function(){
- return confirm('You sure you want to remove this group from this project?');
- });
- $('.remove_deploy_key_btn').click(function(){
- return confirm('You sure you want to remove this deploy key from this project?');
- });
- $('.delete_report_btn').click(function(){
- return confirm('Do you really want to remove the report: {{ report }}?');
- });
- $('.remove_tag_btn').click(function(){
- var _tag = $(this).attr('data-tag-name');
- return confirm('Do you really want to remove the tag: ' + _tag + '?');
- });
- $('.give_project_btn').click(function(){
- return confirm('Are you sure to give {{ repo.fullname }}? \nThis is final and cannot be un-done.');
- });
- $('.delete_project_btn').click(function(){
- return confirm('Are you sure to delete {{ repo.fullname }}? \nThis is final and cannot be un-done.');
- });
- $('.revoke_token_btn').click(function(){
- return confirm('Are you sure to revoke this token ?'
- + '\nThis will break all application using it and '
- + 'cannot be un-done.');
- });
- $('.renew_token_btn').click(function(){
- return confirm('Are you sure to renew this token ?'
- + '\nIt will have the same ACL but will be a different key.');
- });
- });
- </script>
- <script type="text/javascript" nonce="{{ g.nonce }}">
- function show_acls(acls) {
- var _txt = '<div title="ACLs details" id="show_meeting">'
- + '<ul>';
- for (i = 0; i < acls.length; i++) {
- _txt += '<li>' + acls[i] + '</li>';
- }
- _txt += '</ul>' + '</div>';
- var _elt = $(_txt);
- var _height = $(window).height() * 0.8;
- _elt.dialog({
- height: 250,
- width: 250,
- modal: true,
- cache: false,
- });
- }
- $('#accordions').on('shown.bs.collapse', function (e) {
- var _plugin = $(e.target).attr('data-plugin');
- $(e.target).siblings().find("#dropdowncaret").attr('data-glyph', "caret-bottom");
- if (!_plugin) {
- return false;
- }
- var _url = "{{ url_for(
- 'ui_ns.view_plugin',
- repo=repo.name,
- username=username,
- namespace=repo.namespace,
- plugin='') }}";
- _url += _plugin + '/0';
- console.log(_url);
- $.ajax({
- url: _url ,
- type: 'GET',
- dataType: 'html',
- success: function(res) {
- $("#"+e.target.id).html(res);
- },
- });
- return false;
- })
- $("form").submit(function(){
- $(this).find(".blank-field").remove();
- });
- $('#accordions').on('hide.bs.collapse', function (e) {
- $(e.target).siblings().find("#dropdowncaret").attr('data-glyph', "caret-right");
- })
- $('.add-settings-field-row').click(function(e) {
- let target = $(this).attr("data-target");
- let row = $(target + ".settings-field-rows .blank-field").clone();
- row.removeClass("hidden");
- row.removeClass("blank-field");
- $('.remove-settings-field-row', row).click(function(e) {
- $(this).parent().parent().remove();
- });
- $(target + ".settings-field-rows").append(row);
- updateform();
- console.log(row);
- });
- $('.remove-settings-field-row').click(function(e) {
- $(this).parent().parent().remove();
- });
- $('.thirdparty_settings').click(function() {
- $('.tab-pane fade active show').removeClass("active").removeClass("show");
- let name = $(this).attr("data-name");
- let target = $(this).attr("data-url");
- let _el = $('#' + name + '-tab');
- if (_el.length == 0) {
- $.ajax({
- url: target ,
- type: 'GET',
- dataType: 'html',
- success: function(res) {
- let _txt = '<div class="tab-pane fade active show" '
- + 'id="' + name + '-tab" role="tabpanel" role="tabpanel"'
- + 'aria-labelledby="' + name + '-tab">'
- + res
- + '</div>';
- $("#nav-tabContent").append(_txt);
- },
- });
- } else {
- _el.show();
- }
- return false;
- });
- {% if not repo.priorities %}
- $('#default_priorities').click(function(e) {
- let row = $('#priorities-list .blank-field');
- var def_priorities = ['High', 'Normal', 'Low'];
- for (var cnt = 0; cnt < def_priorities.length; cnt++) {
- let f = row.clone();
- f.removeClass("hidden");
- f.removeClass("blank-field");
- f.find("[name=priority_weigth]").val(cnt+1);
- f.find("[name=priority_title]").val(def_priorities[cnt]);
- $('.remove-settings-field-row', f).click(function(e) {
- $(this).parent().parent().remove();
- });
- $('#priorities-list').append(f);
- }
- $(e.target).hide();
- console.log($('#priorities'));
- });
- {% endif %}
- {% if not repo.close_status %}
- $('#default_statuses').click(function(e) {
- let row = $('#status-list .blank-field');
- var def_status = ['Fixed', 'Invalid', 'Duplicate', 'Insufficient Data'];
- for (var cnt = 0; cnt < def_status.length; cnt++) {
- let f = row.clone();
- f.removeClass("hidden");
- f.removeClass("blank-field");
- f.find("[name=close_status]").val(def_status[cnt]);
- $('.remove-settings-field-row', f).click(function(e) {
- $(this).parent().parent().remove();
- });
- $('#status-list').append(f);
- }
- $(e.target).hide();
- });
- $('#default_close_status').click(function(e) {
- let form = $('#close_sstatus>div:last-child');
- form.find('input[type=text], textarea').val('');
- $('#close_sstatus').html('');
- var def_closestatus = ['Fixed', 'Invalid', 'Duplicate', 'Insufficient Data'];
- for (var cnt = 0; cnt < def_closestatus.length; cnt++) {
- let f = form.clone();
- f.find("[name=close_status]").val(def_closestatus[cnt]);
- $('#close_sstatus').append(f);
- }
- console.log($('#close_sstatus'));
- });
- {% endif %}
- var first_new_tag = 1;
- $('#new_tag').click(function(e) {
- console.log('new tag');
- console.log($('#tagcolor'));
- if (first_new_tag == 1){
- // Only display the Tag row the first time Add New Tag is clicked
- $('#tagcolor').append(
- '<div class="row">\
- <div class="col-sm-4">\
- <strong>New Tag</strong>\
- </div>\
- <div class="col-sm-5">\
- <strong>Description</strong>\
- </div>\
- <div class="col-sm-3">\
- <strong>Tag Color</strong>\
- </div>\
- </div>');
- first_new_tag = 0;
- }
- $('#tagcolor').append(
- '<div class="row p-t-1"> \
- <div class="col-sm-4 p-r-0">\
- <input type="text" name="tag"\
- value="" size="3" class="form-control"/>\
- </div>\
- <div class="col-sm-5 p-r-0">\
- <input type="text" name="tag_description" placeholder="(optional)"\
- value="" size="15" class="form-control"/>\
- </div>\
- <div class="col-sm-2 p-r-0">\
- <input type="color" name="tag_color" class="form-control c-select" \
- onchange="clickColor(0, -1, -1, 5)" /> \
- </div>\
- <div class="col-sm-1 p-r-0">\
- <span class="oi del_tag_tbn" data-glyph="circle-x"></span>\
- </div>\
- </div>'
- );
- set_up_del_tag_tbn();
- });
- function set_up_del_tag_tbn() {
- $('.del_tag_tbn').click(function(e) {
- $(this).parent().parent().remove();
- });
- }
- $('.extend-form').click(function(e) {
- const tgt = $(this).attr('data-target');
- let form = $(tgt + ' > div:last-child').clone();
- form.find('input[type=text], textarea').val('');
- if (tgt == '#milestones'){
- var _b = $(form.find('.milestone_order_up'));
- const idx = parseInt(_b.attr('data-stone'));
- form.removeClass('milestone_inactive');
- form.attr('id', 'milestone_' + (idx + 1 ));
- _b.attr('data-stone', (idx + 1))
- var _b2 = $(form.find('.milestone_order_bottom'));
- _b2.attr('data-stone', (idx + 1))
- var _idx = form.find('input[name=milestones]');
- $(_idx).attr('value', (idx + 1 ));
- var _n = form.find('input[name=milestone_' + idx + '_name]');
- $(_n).attr('name', 'milestone_' + (idx + 1 ) + '_name');
- var _d = form.find('input[name=milestone_' + idx + '_date]');
- $(_d).attr('name', 'milestone_' + (idx + 1 ) + '_date');
- var _a = form.find('input[name=milestone_' + idx + '_active]');
- $(_a).attr('name', 'milestone_' + (idx + 1 ) + '_active');
- $(_a).prop('checked', true);
- } else if (tgt == '#milestones_show'){
- var _el = $('.milestone_inactive')
- if (_el.css('display') == 'none'){
- _el.css('display', 'flex');
- } else {
- _el.hide();
- }
- }
- $(tgt).append(form);
- });
- $('.milestone_order_up').click(function(e) {
- const idx = parseInt($(this).attr('data-stone'));
- let field = $('#milestone_' + idx);
- if (field.prev('.milestone').length > 0){
- field.prev('.milestone').before(field.detach());
- }
- });
- $('.milestone_order_bottom').click(function(e) {
- const idx = parseInt($(this).attr('data-stone'));
- let field = $('#milestone_' + idx);
- if (field.next('.milestone').length > 0){
- field.next('.milestone').after(field.detach());
- }
- });
- $('#show_old_keys').click(function(e) {
- var _el = $('.expired_api_keys')
- if (_el.css('display') == 'none'){
- _el.css('display', 'flex');
- $('#show_old_keys').text('Hide old API keys');
- } else {
- $('#show_old_keys').text('Show old API keys');
- _el.hide();
- }
- });
- {% if config.get('ENABLE_GIVE_PROJECTS', True)
- and repo.user.user == g.fas_user.username
- and not repo.is_fork %}
- $('#user').selectize({
- valueField: 'user',
- labelField: 'user',
- searchField: 'user',
- maxItems: 1,
- create: false,
- load: function(query, callback) {
- if (!query.length) return callback();
- $.getJSON(
- "{{ url_for('api_ns.api_users') }}", {
- pattern: query.term
- },
- function( data ) {
- callback( data.users.map(function(x) { return { user: x }; }) );
- }
- );
- }
- });
- {% endif %}
- $('.ajaxed').click(function(e) {
- _form = $(this).closest('form')
- $.ajax({
- url: _form.prop('action') ,
- type: 'POST',
- data: _form.serialize(),
- dataType: 'json',
- success: function(res) {
- console.log(res);
- if ( res.message ) {
- var _html = '<div class="container pt-2">'
- + ' <div class="alert alert-info border border-secondary bg-white alert-dismissible" role="alert">'
- + ' <button type="button" class="close" data-dismiss="alert" aria-label="Close">'
- + ' <span aria-hidden="true">×</span>'
- + ' <span class="sr-only">Close</span>'
- + ' </button>'
- + ' <div class="text-info font-weight-bold">'
- + ' <i class="fa fa-fw fa-info-circle"></i>' + res.message
- + ' </div>'
- + ' </div>'
- + '</div>';
- $('.bodycontent').prepend(_html)
- }
- },
- error: function(res) {
- console.log(res);
- alert('Request failed');
- }
- });
- return false;
- });
- </script>
- <script type="text/javascript" nonce="{{ g.nonce }}">
- $(document).ready(function() {
- $('#nav-tab a.nav-link').on('shown.bs.tab', function (e) {
- window.location.hash = e.target.hash;
- window.scrollTo(0,0);
- });
- if (!window.location.hash){
- window.location.hash = "#projectdetails-tab"
- }
- window.onhashchange = function () {
- $(window.location.hash.slice(0,-4)).tab('show');
- }
- const _anchor = window.location.hash.slice(0,-4);
- console.log(_anchor);
- $(_anchor).tab('show');
- window.scrollTo(0,0);
- });
- </script>
- {% endblock %}
|