-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from eduNEXT/and/create_edit_view
And/create edit view
- Loading branch information
Showing
6 changed files
with
171 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,63 @@ | ||
|
||
<div class="rocketc_block"> | ||
<div class="editor-with-buttons" style="display: none;"> | ||
<div class="wrapper-comp-settings is-active editor-with-buttons"> | ||
<ul class="list-input settings-list"> | ||
|
||
<li class="field comp-setting-entry metadata_entry "> | ||
<div class="wrapper-comp-setting"> | ||
<label class="label setting-label">Group Name</label> | ||
<input type="text" id="group-name" required></input> | ||
</div> | ||
</li> | ||
|
||
<li class="field comp-setting-entry metadata_entry "> | ||
<div class="wrapper-comp-setting"> | ||
<label class="label setting-label">Description</label> | ||
<input type="text" id="group-description"></input> | ||
</div> | ||
</li> | ||
|
||
<li class="field comp-setting-entry metadata_entry "> | ||
<div class="wrapper-comp-setting"> | ||
<label class="label setting-label">Topic</label> | ||
<input type="text" id="group-topic"></input> | ||
</div> | ||
</li> | ||
|
||
<li class="field comp-setting-entry metadata_entry "> | ||
<div class="wrapper-comp-setting"> | ||
<p id="message"></p> | ||
</div> | ||
</li> | ||
|
||
|
||
</ul> | ||
</div> | ||
|
||
<div class="xblock-actions" style="background-color: #E5E5E5;"> | ||
<ul> | ||
<li class="action-item"> | ||
<a href="#" class="button action-primary" id="button-create">Create Group</a> | ||
</li> | ||
|
||
<li class="action-item"> | ||
<a href="#" class="button cancel-button">Exit</a> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div> | ||
<label for="name">Channel:</label> | ||
<input type="text" id="name" placeholder="{{default_channel}}" /> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="button"> | ||
<button id="button" type="submit">Save</button> | ||
</div> | ||
<div class="xblock-actions" id="options" style="cursor: pointer;"> | ||
<ul> | ||
<li class="action-item"> | ||
<a class="button action-primary" id="select-default" >DEFAULT CHANNEL</a> | ||
</li> | ||
|
||
</div> | ||
<li class="action-item"> | ||
<a class="button" id="select-create">CREATE GROUP</a> | ||
</li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Javascript for StudioView. */ | ||
function StudioViewEdit(runtime, element) { | ||
"use strict"; | ||
|
||
/*eslint no-undef: "error"*/ | ||
StudioEditableXBlockMixin(runtime, element); | ||
|
||
function responseCreate(data){ | ||
if (data["success"]) { | ||
$("#message").text("Group Created"). | ||
css("color", "green"); | ||
}else{ | ||
$("#message").text(data["error"]). | ||
css("color", "red"); | ||
} | ||
|
||
} | ||
|
||
var createGroup = runtime.handlerUrl(element, "create_group"); | ||
|
||
$("#button-create").click(function(eventObject) { | ||
var groupName = $("#group-name").val(); | ||
var description = $("#group-description").val(); | ||
var topic = $("#group-topic").val(); | ||
var data = {groupName, description, topic}; | ||
$.ajax({ | ||
type: "POST", | ||
url: createGroup, | ||
data: JSON.stringify(data), | ||
success: responseCreate | ||
}); | ||
}); | ||
|
||
$(".action-modes").append($("#options")); | ||
|
||
$("#select-default").on("click",function(){ | ||
$(".editor-with-buttons").css("display", "block"); | ||
$(".rocketc_block .editor-with-buttons").css("display", "none"); | ||
$("#select-create").attr("class", "button"); | ||
$("#select-default").attr("class", "button action-primary"); | ||
}); | ||
|
||
$("#select-create").on("click",function(){ | ||
$(".editor-with-buttons").css("display", "none"); | ||
$(".rocketc_block .editor-with-buttons").css("display", "block"); | ||
$("#select-create").attr("class", "button action-primary"); | ||
$("#select-default").attr("class", "button"); | ||
}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 0.2.3 | ||
current_version = 0.2.4 | ||
commit = True | ||
tag = True | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters