From fd656a83e942c24771697f07c9c3716db26caae4 Mon Sep 17 00:00:00 2001 From: Swapnil Gupta <500swapnil@github.com> Date: Thu, 23 Feb 2017 00:49:25 +0530 Subject: [PATCH 1/8] Rich editor added --- app/views/editor/questionRich.html.erb | 305 +++++++++++++++++++++++++ 1 file changed, 305 insertions(+) create mode 100644 app/views/editor/questionRich.html.erb diff --git a/app/views/editor/questionRich.html.erb b/app/views/editor/questionRich.html.erb new file mode 100644 index 0000000000..2d15c56469 --- /dev/null +++ b/app/views/editor/questionRich.html.erb @@ -0,0 +1,305 @@ +
+ + + + + + +
+ +
+ +

Share

+ + +
+ +
+
+
+ +
+
+ + +
+
+
+ +
+ + +
+ +
+ + +
+ +
+
+ +
+ + + +
+ +
+

1

+
+ +
+ +
+ +
+ + + + +
+ +
+

2

+
+ +
+
+ Drag an image here to upload. +
+
+ + + +

+

Select an optional main image for your post.

+ +
+
+ +
+ + + + +
+ +
+

3

+
+ +
+ +
+ +
+ + + + +
+ +
+

4

+
+ +
+ +
+ +
+ + + + + + + +
+ + + +
+ <%= javascript_include_tag "post" %> + <%= javascript_include_tag "dragdrop" %> + + <% if params[:template] == "question" %> +

Ask a question

+ + + <% else %> +

What's a
research note?

+

What's a research note? Learn more »

+ + + <% end %> +
+ +
+ <% + if @node && params[:action] != "create" + url = { :controller => "notes", :action => "update", :id => params[:id] } + else + url = { :controller => "notes", :action => "create", :id => params[:id] } + end + %> + + <%= form_for @revision, :as => :drupal_node_revision, :url => url, :html => {:class => "form well"} do |f| %> + + <% if f.error_messages != "" %>
<%= f.error_messages :header_message => "Your note couldn't be saved." %>
<% end %> + + <%= render :partial => "editor/main_image" %> + +
+ + <% if params[:template] == "question" %> +

Ask a question of the community

+ <% else %> +

Share your work

+ <% end %> + +
+ Ask a question as specifically as possible<% else %>Title your post descriptively<% end %>" value="<%= if @node then @node.title else params[:title] end %>"/> +
+ + + + + + <%= render :partial => 'editor/editor' %> + +
+ + value="<%= params[:tags] || @node.tagnames.join(',') %><%= ','+@node.power_tag('question') if @node && @node.power_tag('question') != '' %>"<% else %>placeholder="balloon-mapping,gulf-coast"<% end %> data-provide="typeahead" /> +
+ + + +

Consider adding a lead image to illustrate your post! (see above right)

+
+ + <% if current_user.first_time_poster %> +

Hi! Just letting you know ahead of time that everyone's first posts to this website are moderated due to issues we've had with spam. Thanks for your patience!

+ <% end %> + + Publish + Preview + + + + + + + +
+ +
+
+

By publishing, you agree to open source your work so that others may use it.

+
+
+ + <% end %> +
\ No newline at end of file From 1a8d869222384f819f265e70b0c857a1cbddd14d Mon Sep 17 00:00:00 2001 From: Swapnil Gupta <500swapnil@github.com> Date: Tue, 28 Feb 2017 17:49:09 +0530 Subject: [PATCH 2/8] Starting from rich.html --- app/views/editor/questionRich.html.erb | 181 ++++++++----------------- 1 file changed, 58 insertions(+), 123 deletions(-) diff --git a/app/views/editor/questionRich.html.erb b/app/views/editor/questionRich.html.erb index 2d15c56469..7018ef0493 100644 --- a/app/views/editor/questionRich.html.erb +++ b/app/views/editor/questionRich.html.erb @@ -1,13 +1,9 @@ -
+ + + + - - + @@ -102,7 +98,7 @@
- +
@@ -126,10 +122,13 @@ @@ -182,124 +183,58 @@ - <%= javascript_include_tag "post" %> - <%= javascript_include_tag "dragdrop" %> - - <% if params[:template] == "question" %> -

Ask a question

- - - <% else %> -

What's a
research note?

-

What's a research note? Learn more »

- - - <% end %> - - -
- <% - if @node && params[:action] != "create" - url = { :controller => "notes", :action => "update", :id => params[:id] } - else - url = { :controller => "notes", :action => "create", :id => params[:id] } - end - %> - <%= form_for @revision, :as => :drupal_node_revision, :url => url, :html => {:class => "form well"} do |f| %> - <% if f.error_messages != "" %>
<%= f.error_messages :header_message => "Your note couldn't be saved." %>
<% end %> + From 266ab7fc26e2641b26d06d7d6b697ea4b35404ca Mon Sep 17 00:00:00 2001 From: Swapnil Gupta <500swapnil@github.com> Date: Sat, 4 Mar 2017 03:11:59 +0530 Subject: [PATCH 3/8] Simplified Interface --- app/views/editor/questionRich.html.erb | 86 ++++---------------------- 1 file changed, 12 insertions(+), 74 deletions(-) diff --git a/app/views/editor/questionRich.html.erb b/app/views/editor/questionRich.html.erb index 7018ef0493..68c48769d7 100644 --- a/app/views/editor/questionRich.html.erb +++ b/app/views/editor/questionRich.html.erb @@ -11,94 +11,32 @@
-

Share

- - -
- -
-
-
- -
-
- - -
-
-
- -
- - +

Ask a question

- -
- - -
- -
-
- -
- - +
-
- -
+

1

- +

Title

- -
- -
+ +
+
- - -
- -
-

2

-
- -
-
- Drag an image here to upload. -
-
- - - -

-

Select an optional main image for your post.

- -
-
- -
- +
-

3

+

2

-
- +
+
@@ -109,7 +47,7 @@
-

4

+

3

From 6c497ef41bf49ed896b80c48c7225dc521310a09 Mon Sep 17 00:00:00 2001 From: Swapnil Gupta <500swapnil@github.com> Date: Sat, 4 Mar 2017 03:23:07 +0530 Subject: [PATCH 4/8] publish and preview buttons added --- app/views/editor/questionRich.html.erb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/views/editor/questionRich.html.erb b/app/views/editor/questionRich.html.erb index 68c48769d7..11b42ac93e 100644 --- a/app/views/editor/questionRich.html.erb +++ b/app/views/editor/questionRich.html.erb @@ -53,10 +53,23 @@
-
+ +
+ +
+

4

+
+ +
+ + Publish + Preview +
+
+
-

1

Title

@@ -27,12 +26,10 @@
- -
+
-

2

@@ -47,11 +44,10 @@
-

3

- +
@@ -60,13 +56,12 @@
-

4

- Publish - Preview + Publish   + Help
@@ -107,34 +102,6 @@
- - -
-