Commit bd898707 by Kálmán Viktor

Merge branch 'feature-group-rename' into 'master'

Group rename without js

See merge request !287
parents acfa3715 bb4dfc17
......@@ -188,11 +188,15 @@ html {
display: none;
.vm-details-home-name {
#group-details-rename-form {
display: inline-block;
.vm-details-home-name, #group-details-rename-form .input-group {
max-width: 401px;
#node-details-rename-name, #group-details-rename-name {
#node-details-rename-name {
max-width: 160px;
$(function() {
/* rename */
$("#group-details-h1-name, .group-details-rename-button").click(function() {
$("#group-details-rename").css('display', 'inline');
$("#group-details-h1-name span").hide();
$("#group-details-rename-form").show().css('display', 'inline-block');
/* rename ajax */
$('#group-details-rename-submit').click(function() {
if(!$("#group-details-rename-name")[0].checkValidity()) {
return true;
var name = $('#group-details-rename-name').val();
method: 'POST',
url: location.href,
data: {'new_name': name},
headers: {"X-CSRFToken": getCookie('csrftoken')},
success: function(data, textStatus, xhr) {
// addMessage(data['message'], "success");
$("#group-details-h1-name span").text(data.new_name).show();
error: function(xhr, textStatus, error) {
addMessage("Error during renaming!", "danger");
addMessage("Error during renaming.", "danger");
return false;
$(".group-details-help-button").click(function() {
......@@ -9,43 +9,33 @@
<div class="body-content">
<div class="page-header">
<div class="pull-right" style="padding-top: 15px;">
<a title="{% trans "Rename" %}" href="#" class="btn btn-default btn-xs group-details-rename-button">
<a title="{% trans "Rename" %}" class="btn btn-default btn-xs group-details-rename-button">
<i class="fa fa-pencil"></i>
<a title="{% trans "Delete" %}" data-group-pk="{{ }}" class="btn btn-default btn-xs real-link group-delete" href="{% url "dashboard.views.delete-group" %}">
<i class="fa fa-trash-o"></i>
<a title="{% trans "Help" %}" href="#" class="btn btn-default btn-xs group-details-help-button">
<i class="fa fa-question"></i>
<div id="group-details-rename">
<form action="" method="POST" id="group-details-rename-form">
{% csrf_token %}
<input id="group-details-rename-name" class="form-control" name="new_name" type="text" value="{{ }}"/>
<button type="submit" id="group-details-rename-submit" class="btn">{% trans "Rename" %}</button>
<form action="" method="POST" id="group-details-rename-form" class="js-hidden">
{% csrf_token %}
<div class="input-group">
<input id="group-details-rename-name" class="form-control" name="new_name"
type="text" value="{{ }}" required />
<span class="input-group-btn">
<button type="submit" id="group-details-rename-submit" class="btn">
{% trans "Rename" %}
<div id="group-details-h1-name">
{{ }}
<span class="no-js-hidden">{{ }}</span>
{% if group.groupprofile.org_id %}
{% endif %}
<div class="group-details-help js-hidden">
<ul style="list-style: none;">
<strong>{% trans "Rename" %}:</strong>
{% trans "Change the name of the group." %}
<strong>{% trans "Delete" %}:</strong>
{% trans "Delete group." %}
</div><!-- .page-header -->
<div class="row">
<div class="col-md-12" id="group-detail-pane">
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment