Merge branch 'master' into improve_monitoring_page

This commit is contained in:
Alexander Machehin 2015-03-18 16:30:31 +05:00
commit eac252829f
8 changed files with 20 additions and 18 deletions

View File

@ -23,3 +23,4 @@ A ruby translation project managed on [Locale](http://www.localeapp.com/) that's
- The maintainer will then pull translations from the Locale project and push to Github.
Happy translating!
test 1

View File

@ -57,7 +57,7 @@ CommentsController = (Comment, Preview, confirmMessage, $scope, compileHTML, $ro
promise = Preview.get_preview(vm.project, body)
promise.success( (response) ->
vm.preview_body = response
vm.preview_body = response.html
Preview.old_text = body
).error( (response) ->
vm.preview_body = 'Error :('

View File

@ -46,7 +46,7 @@ IssueController = (dataservice, $http, Issue, $rootScope, Preview, Label, confir
promise = Preview.get_preview(vm.project, body)
promise.success( (response) ->
vm.preview_body = response
vm.preview_body = response.html
Preview.old_text = body
).error( (response) ->
vm.preview_body = 'Error :('

View File

@ -4,14 +4,8 @@ previewService = ($http) ->
old_text: old_text
get_preview: (name_with_owner, text, old_text) ->
return null if text is old_text
path = Routes.project_md_preview_path(
{
name_with_owner: name_with_owner,
text: text
}
)
$http.post(path)
path = Routes.project_md_preview_path(name_with_owner)
$http.post(path, {text: text})
}
angular

View File

@ -166,7 +166,10 @@ class Projects::ProjectsController < Projects::BaseController
end
def preview
render inline: view_context.markdown(params[:text]), layout: false
respond_to do |format|
format.json {}
format.html {render inline: view_context.markdown(params[:text]), layout: false}
end
end
def refs_list

View File

@ -3,4 +3,4 @@
- flash.each do |type, message|
.alert.text-center class = alert_class(type)
button.close[ type = 'button' data-dismiss = 'alert' aria-hidden = true ] &times;
= message
== message

View File

@ -0,0 +1 @@
json.html markdown(params[:text])

View File

@ -4,8 +4,11 @@
.row
- if current_user
.col-md-2
.dropdown
button.btn.btn-default.dropdown-toggle type="button" id="dropdownVisibility" aria-expanded="true"
.btn-group ng-cloak = true
button.btn.btn-default.dropdown-toggle[ type="button"
id="dropdownVisibility"
aria-expanded="false"
data-toggle="dropdown" ]
span> ng-show="visibility == 'all'"
= t('.visibilities.all')
span> ng-show="visibility == 'open'"
@ -16,16 +19,16 @@
= t('.visibilities.hidden')
span.caret
ul.dropdown-menu role="menu" aria-labelledby="dropdownVisibility"
ul.dropdown-menu role="menu"
li role="presentation"
a.btn-link role="menuitem" tabindex="-1" ng-click="visibility = 'all'"
a.btn-link.pointer role="menuitem" tabindex="-1" ng-click="visibility = 'all'"
= t('.visibilities.all')
li role="presentation"
a.btn-link role="menuitem" tabindex="-1" ng-click="visibility = 'open'"
a.btn-link.pointer role="menuitem" tabindex="-1" ng-click="visibility = 'open'"
i.fa.fa-unlock-alt.text-success>
= t('.visibilities.open')
li role="presentation"
a.btn-link role="menuitem" tabindex="-1" ng-click="visibility = 'hidden'"
a.btn-link.pointer role="menuitem" tabindex="-1" ng-click="visibility = 'hidden'"
i.fa.fa-lock.text-danger>
= t('.visibilities.hidden')